\n * \n * ```\n */\nvar Toolbar = /** @class */ (function (_super) {\n __extends(Toolbar, _super);\n /**\n * Initializes a new instance of the Toolbar class.\n *\n * @param {ToolbarModel} options - Specifies Toolbar model properties as options.\n * @param { string | HTMLElement} element - Specifies the element that is rendered as a Toolbar.\n */\n function Toolbar(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.resizeContext = _this.resize.bind(_this);\n /**\n * Contains the keyboard configuration of the Toolbar.\n */\n _this.keyConfigs = {\n moveLeft: 'leftarrow',\n moveRight: 'rightarrow',\n moveUp: 'uparrow',\n moveDown: 'downarrow',\n popupOpen: 'enter',\n popupClose: 'escape',\n tab: 'tab',\n home: 'home',\n end: 'end'\n };\n return _this;\n }\n /**\n * Removes the control from the DOM and also removes all its related events.\n *\n * @returns {void}.\n */\n Toolbar.prototype.destroy = function () {\n var _this = this;\n if (this.isReact) {\n this.clearTemplate();\n }\n var btnItems = this.element.querySelectorAll('.e-control.e-btn');\n [].slice.call(btnItems).forEach(function (el) {\n if (!isNOU(el) && !isNOU(el.ej2_instances) && !isNOU(el.ej2_instances[0]) && !(el.ej2_instances[0].isDestroyed)) {\n el.ej2_instances[0].destroy();\n }\n });\n _super.prototype.destroy.call(this);\n this.unwireEvents();\n this.tempId.forEach(function (ele) {\n if (!isNOU(_this.element.querySelector(ele))) {\n document.body.appendChild(_this.element.querySelector(ele)).style.display = 'none';\n }\n });\n while (this.element.lastElementChild) {\n this.element.removeChild(this.element.lastElementChild);\n }\n if (this.trgtEle) {\n this.element.appendChild(this.ctrlTem);\n }\n this.clearProperty();\n this.popObj = null;\n this.tbarAlign = null;\n this.remove(this.element, 'e-toolpop');\n if (this.cssClass) {\n removeClass([this.element], this.cssClass.split(' '));\n }\n this.element.removeAttribute('style');\n ['aria-disabled', 'aria-orientation', 'aria-haspopup', 'role'].forEach(function (attrb) {\n return _this.element.removeAttribute(attrb);\n });\n };\n /**\n * Initialize the event handler\n *\n * @private\n * @returns {void}\n */\n Toolbar.prototype.preRender = function () {\n var eventArgs = { enableCollision: this.enableCollision, scrollStep: this.scrollStep };\n this.trigger('beforeCreate', eventArgs);\n this.enableCollision = eventArgs.enableCollision;\n this.scrollStep = eventArgs.scrollStep;\n this.scrollModule = null;\n this.popObj = null;\n this.tempId = [];\n this.tbarItemsCol = this.items;\n this.isVertical = this.element.classList.contains(CLS_VERTICAL) ? true : false;\n this.isExtendedOpen = false;\n this.popupPriCount = 0;\n if (this.enableRtl) {\n this.add(this.element, CLS_RTL);\n }\n };\n Toolbar.prototype.wireEvents = function () {\n EventHandler.add(this.element, 'click', this.clickHandler, this);\n window.addEventListener('resize', this.resizeContext);\n if (this.allowKeyboard) {\n this.wireKeyboardEvent();\n }\n };\n Toolbar.prototype.wireKeyboardEvent = function () {\n this.keyModule = new KeyboardEvents(this.element, {\n keyAction: this.keyActionHandler.bind(this),\n keyConfigs: this.keyConfigs\n });\n EventHandler.add(this.element, 'keydown', this.docKeyDown, this);\n this.element.setAttribute('tabIndex', '0');\n };\n Toolbar.prototype.unwireKeyboardEvent = function () {\n if (this.keyModule) {\n EventHandler.remove(this.element, 'keydown', this.docKeyDown);\n this.keyModule.destroy();\n this.keyModule = null;\n }\n };\n Toolbar.prototype.docKeyDown = function (e) {\n if (e.target.tagName === 'INPUT') {\n return;\n }\n var popCheck = !isNOU(this.popObj) && isVisible(this.popObj.element) && this.overflowMode !== 'Extended';\n if (e.keyCode === 9 && e.target.classList.contains('e-hor-nav') === true && popCheck) {\n this.popObj.hide({ name: 'FadeOut', duration: 100 });\n }\n var keyCheck = (e.keyCode === 40 || e.keyCode === 38 || e.keyCode === 35 || e.keyCode === 36);\n if (keyCheck) {\n e.preventDefault();\n }\n };\n Toolbar.prototype.unwireEvents = function () {\n EventHandler.remove(this.element, 'click', this.clickHandler);\n this.destroyScroll();\n this.unwireKeyboardEvent();\n window.removeEventListener('resize', this.resizeContext);\n EventHandler.remove(document, 'scroll', this.docEvent);\n EventHandler.remove(document, 'click', this.docEvent);\n };\n Toolbar.prototype.clearProperty = function () {\n this.tbarEle = [];\n this.tbarAlgEle = { lefts: [], centers: [], rights: [] };\n };\n Toolbar.prototype.docEvent = function (e) {\n var popEle = closest(e.target, '.e-popup');\n if (this.popObj && isVisible(this.popObj.element) && !popEle && this.overflowMode === 'Popup') {\n this.popObj.hide({ name: 'FadeOut', duration: 100 });\n }\n };\n Toolbar.prototype.destroyScroll = function () {\n if (this.scrollModule) {\n if (this.tbarAlign) {\n this.add(this.scrollModule.element, CLS_TBARPOS);\n }\n this.scrollModule.destroy();\n this.scrollModule = null;\n }\n };\n Toolbar.prototype.destroyItems = function () {\n if (this.element) {\n [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM)).forEach(function (el) { detach(el); });\n }\n var tbarItems = this.element.querySelector('.' + CLS_ITEMS);\n if (this.tbarAlign) {\n [].slice.call(tbarItems.children).forEach(function (el) {\n detach(el);\n });\n this.tbarAlign = false;\n this.remove(tbarItems, CLS_TBARPOS);\n }\n this.clearProperty();\n };\n Toolbar.prototype.destroyMode = function () {\n if (this.scrollModule) {\n this.remove(this.scrollModule.element, CLS_RTL);\n this.destroyScroll();\n }\n this.remove(this.element, CLS_EXTENDEDPOPOPEN);\n this.remove(this.element, CLS_EXTEANDABLE_TOOLBAR);\n var tempEle = this.element.querySelector('.e-toolbar-multirow');\n if (tempEle) {\n this.remove(tempEle, CLS_MULTIROW);\n }\n if (this.popObj) {\n this.popupRefresh(this.popObj.element, true);\n }\n };\n Toolbar.prototype.add = function (ele, val) {\n ele.classList.add(val);\n };\n Toolbar.prototype.remove = function (ele, val) {\n ele.classList.remove(val);\n };\n Toolbar.prototype.elementFocus = function (ele) {\n var fChild = ele.firstElementChild;\n if (fChild) {\n fChild.focus();\n this.activeEleSwitch(ele);\n }\n else {\n ele.focus();\n }\n };\n Toolbar.prototype.clstElement = function (tbrNavChk, trgt) {\n var clst;\n if (tbrNavChk && this.popObj && isVisible(this.popObj.element)) {\n clst = this.popObj.element.querySelector('.' + CLS_ITEM);\n }\n else if (this.element === trgt || tbrNavChk) {\n clst = this.element.querySelector('.' + CLS_ITEM + ':not(.' + CLS_DISABLE + ' ):not(.' + CLS_SEPARATOR + ' ):not(.' + CLS_HIDDEN + ' )');\n }\n else {\n clst = closest(trgt, '.' + CLS_ITEM);\n }\n return clst;\n };\n Toolbar.prototype.keyHandling = function (clst, e, trgt, navChk, scrollChk) {\n var popObj = this.popObj;\n var rootEle = this.element;\n var popAnimate = { name: 'FadeOut', duration: 100 };\n var value = e.action === 'moveUp' ? 'previous' : 'next';\n var ele;\n var nodes;\n switch (e.action) {\n case 'moveRight':\n if (this.isVertical) {\n return;\n }\n if (rootEle === trgt) {\n this.elementFocus(clst);\n }\n else if (!navChk) {\n this.eleFocus(clst, 'next');\n }\n break;\n case 'moveLeft':\n if (this.isVertical) {\n return;\n }\n if (!navChk) {\n this.eleFocus(clst, 'previous');\n }\n break;\n case 'home':\n case 'end':\n if (clst) {\n var popupCheck = closest(clst, '.e-popup');\n if (popupCheck) {\n if (isVisible(this.popObj.element)) {\n nodes = [].slice.call(popupCheck.children);\n if (e.action === 'home') {\n ele = nodes[0];\n }\n else {\n ele = nodes[nodes.length - 1];\n }\n }\n }\n else {\n nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM);\n if (e.action === 'home') {\n ele = nodes[0];\n }\n else {\n ele = nodes[nodes.length - 1];\n }\n }\n if (ele) {\n this.elementFocus(ele);\n }\n }\n break;\n case 'moveUp':\n case 'moveDown':\n if (!this.isVertical) {\n if (popObj && closest(trgt, '.e-popup')) {\n var popEle = popObj.element;\n var popFrstEle = popEle.firstElementChild;\n if ((value === 'previous' && popFrstEle === clst) || (value === 'next' && popEle.lastElementChild === clst)) {\n return;\n }\n else {\n this.eleFocus(clst, value);\n }\n }\n else if (e.action === 'moveDown' && popObj && isVisible(popObj.element)) {\n this.elementFocus(clst);\n }\n }\n else {\n if (e.action === 'moveUp') {\n this.eleFocus(clst, 'previous');\n }\n else {\n this.eleFocus(clst, 'next');\n }\n }\n break;\n case 'tab':\n if (!scrollChk && !navChk) {\n var ele_1 = clst.firstElementChild;\n if (rootEle === trgt) {\n if (this.activeEle) {\n this.activeEle.focus();\n }\n else {\n this.activeEleRemove(ele_1);\n ele_1.focus();\n }\n this.element.removeAttribute('tabindex');\n }\n }\n break;\n case 'popupClose':\n if (popObj && this.overflowMode !== 'Extended') {\n popObj.hide(popAnimate);\n }\n break;\n case 'popupOpen':\n if (!navChk) {\n return;\n }\n if (popObj && !isVisible(popObj.element)) {\n popObj.element.style.top = rootEle.offsetHeight + 'px';\n popObj.show({ name: 'FadeIn', duration: 100 });\n }\n else {\n popObj.hide(popAnimate);\n }\n break;\n }\n };\n Toolbar.prototype.keyActionHandler = function (e) {\n var trgt = e.target;\n if (trgt.tagName === 'INPUT' || trgt.tagName === 'TEXTAREA' || this.element.classList.contains(CLS_DISABLE)) {\n return;\n }\n e.preventDefault();\n var tbrNavChk = trgt.classList.contains(CLS_TBARNAV);\n var tbarScrollChk = trgt.classList.contains(CLS_TBARSCRLNAV);\n var clst = this.clstElement(tbrNavChk, trgt);\n if (clst || tbarScrollChk) {\n this.keyHandling(clst, e, trgt, tbrNavChk, tbarScrollChk);\n }\n };\n /**\n * Specifies the value to disable/enable the Toolbar component.\n * When set to `true`, the component will be disabled.\n *\n * @param {boolean} value - Based on this Boolean value, Toolbar will be enabled (false) or disabled (true).\n * @returns {void}.\n */\n Toolbar.prototype.disable = function (value) {\n var rootEle = this.element;\n if (value) {\n rootEle.classList.add(CLS_DISABLE);\n }\n else {\n rootEle.classList.remove(CLS_DISABLE);\n }\n rootEle.setAttribute('tabindex', !value ? '0' : '-1');\n if (this.activeEle) {\n this.activeEle.setAttribute('tabindex', !value ? '0' : '-1');\n }\n if (this.scrollModule) {\n this.scrollModule.disable(value);\n }\n if (this.popObj) {\n if (isVisible(this.popObj.element) && this.overflowMode !== 'Extended') {\n this.popObj.hide();\n }\n rootEle.querySelector('#' + rootEle.id + '_nav').setAttribute('tabindex', !value ? '0' : '-1');\n }\n };\n Toolbar.prototype.eleContains = function (el) {\n return el.classList.contains(CLS_SEPARATOR) || el.classList.contains(CLS_DISABLE) || el.getAttribute('disabled') || el.classList.contains(CLS_HIDDEN) || !isVisible(el);\n };\n Toolbar.prototype.eleFocus = function (closest, pos) {\n var sib = Object(closest)[pos + 'ElementSibling'];\n if (sib) {\n var skipEle = this.eleContains(sib);\n if (skipEle) {\n this.eleFocus(sib, pos);\n return;\n }\n this.elementFocus(sib);\n }\n else if (this.tbarAlign) {\n var elem = Object(closest.parentElement)[pos + 'ElementSibling'];\n if (!isNOU(elem) && elem.children.length === 0) {\n elem = Object(elem)[pos + 'ElementSibling'];\n }\n if (!isNOU(elem) && elem.children.length > 0) {\n if (pos === 'next') {\n var el = elem.querySelector('.' + CLS_ITEM);\n if (this.eleContains(el)) {\n this.eleFocus(el, pos);\n }\n else {\n el.firstElementChild.focus();\n this.activeEleSwitch(el);\n }\n }\n else {\n var el = elem.lastElementChild;\n if (this.eleContains(el)) {\n this.eleFocus(el, pos);\n }\n else {\n this.elementFocus(el);\n }\n }\n }\n }\n };\n Toolbar.prototype.clickHandler = function (e) {\n var _this = this;\n var trgt = e.target;\n var ele = this.element;\n var isPopupElement = !isNOU(closest(trgt, '.' + CLS_POPUPCLASS));\n var clsList = trgt.classList;\n var popupNav = closest(trgt, ('.' + CLS_TBARNAV));\n if (!popupNav) {\n popupNav = trgt;\n }\n if (!ele.children[0].classList.contains('e-hscroll') && !ele.children[0].classList.contains('e-vscroll')\n && (clsList.contains(CLS_TBARNAV))) {\n clsList = trgt.querySelector('.e-icons').classList;\n }\n if (clsList.contains(CLS_POPUPICON) || clsList.contains(CLS_POPUPDOWN)) {\n this.popupClickHandler(ele, popupNav, CLS_RTL);\n }\n var itemObj;\n var clst = closest(e.target, '.' + CLS_ITEM);\n if ((isNOU(clst) || clst.classList.contains(CLS_DISABLE)) && !popupNav.classList.contains(CLS_TBARNAV)) {\n return;\n }\n if (clst) {\n var tempItem = this.items[this.tbarEle.indexOf(clst)];\n itemObj = tempItem;\n }\n var eventArgs = { originalEvent: e, item: itemObj };\n if (itemObj && !isNOU(itemObj.click)) {\n this.trigger('items[' + this.tbarEle.indexOf(clst) + '].click', eventArgs);\n }\n if (!eventArgs.cancel) {\n this.trigger('clicked', eventArgs, function (clickedArgs) {\n if (!isNOU(_this.popObj) && isPopupElement && !clickedArgs.cancel && _this.overflowMode === 'Popup' &&\n clickedArgs.item && clickedArgs.item.type !== 'Input') {\n _this.popObj.hide({ name: 'FadeOut', duration: 100 });\n }\n });\n }\n };\n Toolbar.prototype.popupClickHandler = function (ele, popupNav, CLS_RTL) {\n var popObj = this.popObj;\n if (isVisible(popObj.element)) {\n popupNav.classList.remove(CLS_TBARNAVACT);\n popObj.hide({ name: 'FadeOut', duration: 100 });\n }\n else {\n if (ele.classList.contains(CLS_RTL)) {\n popObj.enableRtl = true;\n popObj.position = { X: 'left', Y: 'top' };\n }\n if (popObj.offsetX === 0 && !ele.classList.contains(CLS_RTL)) {\n popObj.enableRtl = false;\n popObj.position = { X: 'right', Y: 'top' };\n }\n popObj.dataBind();\n popObj.refreshPosition();\n popObj.element.style.top = this.getElementOffsetY() + 'px';\n if (this.overflowMode === 'Extended') {\n popObj.element.style.minHeight = '0px';\n }\n popupNav.classList.add(CLS_TBARNAVACT);\n popObj.show({ name: 'FadeIn', duration: 100 });\n }\n };\n /**\n * To Initialize the control rendering\n *\n * @private\n * @returns {void}\n */\n Toolbar.prototype.render = function () {\n this.initialize();\n this.renderControl();\n this.wireEvents();\n this.renderComplete();\n };\n Toolbar.prototype.initialize = function () {\n var width = formatUnit(this.width);\n var height = formatUnit(this.height);\n if (Browser.info.name !== 'msie' || this.height !== 'auto' || this.overflowMode === 'MultiRow') {\n setStyle(this.element, { 'height': height });\n }\n setStyle(this.element, { 'width': width });\n var ariaAttr = {\n 'role': 'toolbar', 'aria-disabled': 'false', 'aria-haspopup': 'false',\n 'aria-orientation': !this.isVertical ? 'horizontal' : 'vertical'\n };\n attributes(this.element, ariaAttr);\n if (this.cssClass) {\n addClass([this.element], this.cssClass.split(' '));\n }\n };\n Toolbar.prototype.renderControl = function () {\n var ele = this.element;\n this.trgtEle = (ele.children.length > 0) ? ele.querySelector('div') : null;\n this.tbarAlgEle = { lefts: [], centers: [], rights: [] };\n this.renderItems();\n this.renderLayout();\n };\n Toolbar.prototype.renderLayout = function () {\n this.renderOverflowMode();\n if (this.tbarAlign) {\n this.itemPositioning();\n }\n if (this.popObj && this.popObj.element.childElementCount > 1 && this.checkPopupRefresh(this.element, this.popObj.element)) {\n this.popupRefresh(this.popObj.element, false);\n }\n this.separator();\n };\n Toolbar.prototype.itemsAlign = function (items, itemEleDom) {\n var innerItem;\n var innerPos;\n if (!this.tbarEle) {\n this.tbarEle = [];\n }\n for (var i = 0; i < items.length; i++) {\n innerItem = this.renderSubComponent(items[i], i);\n if (this.tbarEle.indexOf(innerItem) === -1) {\n this.tbarEle.push(innerItem);\n }\n if (!this.tbarAlign) {\n this.tbarItemAlign(items[i], itemEleDom, i);\n }\n innerPos = itemEleDom.querySelector('.e-toolbar-' + items[i].align.toLowerCase());\n if (innerPos) {\n if (!(items[i].showAlwaysInPopup && items[i].overflow !== 'Show')) {\n this.tbarAlgEle[(items[i].align + 's').toLowerCase()].push(innerItem);\n }\n innerPos.appendChild(innerItem);\n }\n else {\n itemEleDom.appendChild(innerItem);\n }\n }\n if (this.isReact) {\n var portals = 'portals';\n this.notify('render-react-toolbar-template', this[portals]);\n this.renderReactTemplates();\n }\n };\n /**\n * @hidden\n * @returns {void}\n */\n Toolbar.prototype.changeOrientation = function () {\n var ele = this.element;\n if (this.isVertical) {\n ele.classList.remove(CLS_VERTICAL);\n this.isVertical = false;\n if (this.height === 'auto' || this.height === '100%') {\n ele.style.height = this.height;\n }\n ele.setAttribute('aria-orientation', 'horizontal');\n }\n else {\n ele.classList.add(CLS_VERTICAL);\n this.isVertical = true;\n ele.setAttribute('aria-orientation', 'vertical');\n setStyle(this.element, { 'height': formatUnit(this.height), 'width': formatUnit(this.width) });\n }\n this.destroyMode();\n this.refreshOverflow();\n };\n Toolbar.prototype.initScroll = function (element, innerItems) {\n if (!this.scrollModule && this.checkOverflow(element, innerItems[0])) {\n if (this.tbarAlign) {\n this.element.querySelector('.' + CLS_ITEMS + ' .' + CLS_TBARCENTER).removeAttribute('style');\n }\n if (this.isVertical) {\n this.scrollModule = new VScroll({ scrollStep: this.scrollStep, enableRtl: this.enableRtl }, innerItems[0]);\n }\n else {\n this.scrollModule = new HScroll({ scrollStep: this.scrollStep, enableRtl: this.enableRtl }, innerItems[0]);\n }\n this.remove(this.scrollModule.element, CLS_TBARPOS);\n setStyle(this.element, { overflow: 'hidden' });\n }\n };\n Toolbar.prototype.itemWidthCal = function (items) {\n var _this = this;\n var width = 0;\n var style;\n [].slice.call(selectAll('.' + CLS_ITEM, items)).forEach(function (el) {\n if (isVisible(el)) {\n style = window.getComputedStyle(el);\n width += _this.isVertical ? el.offsetHeight : el.offsetWidth;\n width += parseFloat(_this.isVertical ? style.marginTop : style.marginRight);\n width += parseFloat(_this.isVertical ? style.marginBottom : style.marginLeft);\n }\n });\n return width;\n };\n Toolbar.prototype.getScrollCntEle = function (innerItem) {\n var trgClass = (this.isVertical) ? '.e-vscroll-content' : '.e-hscroll-content';\n return innerItem.querySelector(trgClass);\n };\n Toolbar.prototype.checkOverflow = function (element, innerItem) {\n if (isNOU(element) || isNOU(innerItem) || !isVisible(element)) {\n return false;\n }\n var eleWidth = this.isVertical ? element.offsetHeight : element.offsetWidth;\n var itemWidth = this.isVertical ? innerItem.offsetHeight : innerItem.offsetWidth;\n if (this.tbarAlign || this.scrollModule || (eleWidth === itemWidth)) {\n itemWidth = this.itemWidthCal(this.scrollModule ? this.getScrollCntEle(innerItem) : innerItem);\n }\n var popNav = element.querySelector('.' + CLS_TBARNAV);\n var scrollNav = element.querySelector('.' + CLS_TBARSCRLNAV);\n var navEleWidth = 0;\n if (popNav) {\n navEleWidth = this.isVertical ? popNav.offsetHeight : popNav.offsetWidth;\n }\n else if (scrollNav) {\n navEleWidth = this.isVertical ? (scrollNav.offsetHeight * (2)) : (scrollNav.offsetWidth * 2);\n }\n if (itemWidth > eleWidth - navEleWidth) {\n return true;\n }\n else {\n return false;\n }\n };\n /**\n * Refresh the whole Toolbar component without re-rendering.\n * - It is used to manually refresh the Toolbar overflow modes such as scrollable, popup, multi row, and extended.\n * - It will refresh the Toolbar component after loading items dynamically.\n *\n * @returns {void}.\n */\n Toolbar.prototype.refreshOverflow = function () {\n this.resize();\n };\n Toolbar.prototype.toolbarAlign = function (innerItems) {\n if (this.tbarAlign) {\n this.add(innerItems, CLS_TBARPOS);\n this.itemPositioning();\n }\n };\n Toolbar.prototype.renderOverflowMode = function () {\n var ele = this.element;\n var innerItems = ele.querySelector('.' + CLS_ITEMS);\n var priorityCheck = this.popupPriCount > 0;\n if (ele && ele.children.length > 0) {\n this.offsetWid = ele.offsetWidth;\n this.remove(this.element, 'e-toolpop');\n if (Browser.info.name === 'msie' && this.height === 'auto') {\n ele.style.height = '';\n }\n switch (this.overflowMode) {\n case 'Scrollable':\n if (isNOU(this.scrollModule)) {\n this.initScroll(ele, [].slice.call(ele.getElementsByClassName(CLS_ITEMS)));\n }\n break;\n case 'Popup':\n this.add(this.element, 'e-toolpop');\n if (this.tbarAlign) {\n this.removePositioning();\n }\n if (this.checkOverflow(ele, innerItems) || priorityCheck) {\n this.setOverflowAttributes(ele);\n }\n this.toolbarAlign(innerItems);\n break;\n case 'MultiRow':\n this.add(innerItems, CLS_MULTIROW);\n if (this.checkOverflow(ele, innerItems) && this.tbarAlign) {\n this.removePositioning();\n this.add(innerItems, CLS_MULTIROWPOS);\n }\n if (ele.style.overflow === 'hidden') {\n ele.style.overflow = '';\n }\n if (Browser.info.name === 'msie' || ele.style.height !== 'auto') {\n ele.style.height = 'auto';\n }\n break;\n case 'Extended':\n this.add(this.element, CLS_EXTEANDABLE_TOOLBAR);\n if (this.checkOverflow(ele, innerItems) || priorityCheck) {\n if (this.tbarAlign) {\n this.removePositioning();\n }\n this.setOverflowAttributes(ele);\n }\n this.toolbarAlign(innerItems);\n }\n }\n };\n Toolbar.prototype.setOverflowAttributes = function (ele) {\n this.createPopupEle(ele, [].slice.call(selectAll('.' + CLS_ITEMS + ' .' + CLS_ITEM, ele)));\n this.element.querySelector('.' + CLS_TBARNAV).setAttribute('tabIndex', '0');\n this.element.querySelector('.' + CLS_TBARNAV).setAttribute('role', 'list');\n };\n Toolbar.prototype.separator = function () {\n var element = this.element;\n var eleItem = [].slice.call(element.querySelectorAll('.' + CLS_SEPARATOR));\n var multiVar = element.querySelector('.' + CLS_MULTIROW_SEPARATOR);\n var extendVar = element.querySelector('.' + CLS_EXTENDABLE_SEPARATOR);\n var eleInlineItem = this.overflowMode === 'MultiRow' ? multiVar : extendVar;\n if (eleInlineItem !== null) {\n if (this.overflowMode === 'MultiRow') {\n eleInlineItem.classList.remove(CLS_MULTIROW_SEPARATOR);\n }\n else if (this.overflowMode === 'Extended') {\n eleInlineItem.classList.remove(CLS_EXTENDABLE_SEPARATOR);\n }\n }\n for (var i = 0; i <= eleItem.length - 1; i++) {\n if (eleItem[i].offsetLeft < 30 && eleItem[i].offsetLeft !== 0) {\n if (this.overflowMode === 'MultiRow') {\n eleItem[i].classList.add(CLS_MULTIROW_SEPARATOR);\n }\n else if (this.overflowMode === 'Extended') {\n eleItem[i].classList.add(CLS_EXTENDABLE_SEPARATOR);\n }\n }\n }\n };\n Toolbar.prototype.createPopupEle = function (ele, innerEle) {\n var innerNav = ele.querySelector('.' + CLS_TBARNAV);\n var vertical = this.isVertical;\n if (!innerNav) {\n this.createPopupIcon(ele);\n }\n innerNav = ele.querySelector('.' + CLS_TBARNAV);\n var innerNavDom = (vertical ? innerNav.offsetHeight : innerNav.offsetWidth);\n var eleWidth = ((vertical ? ele.offsetHeight : ele.offsetWidth) - (innerNavDom));\n this.element.classList.remove('e-rtl');\n setStyle(this.element, { direction: 'initial' });\n this.checkPriority(ele, innerEle, eleWidth, true);\n if (this.enableRtl) {\n this.element.classList.add('e-rtl');\n }\n this.element.style.removeProperty('direction');\n this.createPopup();\n };\n Toolbar.prototype.pushingPoppedEle = function (tbarObj, popupPri, ele, eleHeight, sepHeight) {\n var element = tbarObj.element;\n var poppedEle = [].slice.call(selectAll('.' + CLS_POPUP, element.querySelector('.' + CLS_ITEMS)));\n var nodes = selectAll('.' + CLS_TBAROVERFLOW, ele);\n var nodeIndex = 0;\n var nodePri = 0;\n poppedEle.forEach(function (el, index) {\n nodes = selectAll('.' + CLS_TBAROVERFLOW, ele);\n if (el.classList.contains(CLS_TBAROVERFLOW) && nodes.length > 0) {\n if (tbarObj.tbResize && nodes.length > index) {\n ele.insertBefore(el, nodes[index]);\n ++nodePri;\n }\n else {\n ele.insertBefore(el, ele.children[nodes.length]);\n ++nodePri;\n }\n }\n else if (el.classList.contains(CLS_TBAROVERFLOW)) {\n ele.insertBefore(el, ele.firstChild);\n ++nodePri;\n }\n else if (tbarObj.tbResize && el.classList.contains(CLS_POPOVERFLOW) && ele.children.length > 0 && nodes.length === 0) {\n ele.insertBefore(el, ele.firstChild);\n ++nodePri;\n }\n else if (el.classList.contains(CLS_POPOVERFLOW)) {\n popupPri.push(el);\n }\n else if (tbarObj.tbResize) {\n ele.insertBefore(el, ele.childNodes[nodeIndex + nodePri]);\n ++nodeIndex;\n }\n else {\n ele.appendChild(el);\n }\n if (el.classList.contains(CLS_SEPARATOR)) {\n setStyle(el, { display: '', height: sepHeight + 'px' });\n }\n else {\n setStyle(el, { display: '', height: eleHeight + 'px' });\n }\n });\n popupPri.forEach(function (el) {\n ele.appendChild(el);\n });\n var tbarEle = selectAll('.' + CLS_ITEM, element.querySelector('.' + CLS_ITEMS));\n for (var i = tbarEle.length - 1; i >= 0; i--) {\n var tbarElement = tbarEle[i];\n if (tbarElement.classList.contains(CLS_SEPARATOR) && this.overflowMode !== 'Extended') {\n setStyle(tbarElement, { display: 'none' });\n }\n else {\n break;\n }\n }\n };\n Toolbar.prototype.createPopup = function () {\n var element = this.element;\n var sepHeight;\n var sepItem;\n if (this.overflowMode === 'Extended') {\n sepItem = element.querySelector('.' + CLS_SEPARATOR + ':not(.' + CLS_POPUP + ')');\n sepHeight = (element.style.height === 'auto' || element.style.height === '') ? null : sepItem.offsetHeight;\n }\n var eleItem = element.querySelector('.' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + '):not(.' + CLS_POPUP + ')');\n var eleHeight = (element.style.height === 'auto' || element.style.height === '') ? null : (eleItem && eleItem.offsetHeight);\n var ele;\n var popupPri = [];\n if (select('#' + element.id + '_popup.' + CLS_POPUPCLASS, element)) {\n ele = select('#' + element.id + '_popup.' + CLS_POPUPCLASS, element);\n }\n else {\n var extendEle = this.createElement('div', {\n id: element.id + '_popup', className: CLS_POPUPCLASS + ' ' + CLS_EXTENDABLECLASS\n });\n var popupEle = this.createElement('div', { id: element.id + '_popup', className: CLS_POPUPCLASS });\n ele = this.overflowMode === 'Extended' ? extendEle : popupEle;\n }\n this.pushingPoppedEle(this, popupPri, ele, eleHeight, sepHeight);\n this.popupInit(element, ele);\n };\n Toolbar.prototype.getElementOffsetY = function () {\n return (this.overflowMode === 'Extended' && window.getComputedStyle(this.element).getPropertyValue('box-sizing') === 'border-box' ?\n this.element.clientHeight : this.element.offsetHeight);\n };\n Toolbar.prototype.popupInit = function (element, ele) {\n if (!this.popObj) {\n element.appendChild(ele);\n setStyle(this.element, { overflow: '' });\n var eleStyles = window.getComputedStyle(this.element);\n var popup = new Popup(null, {\n relateTo: this.element,\n offsetY: (this.isVertical) ? 0 : this.getElementOffsetY(),\n enableRtl: this.enableRtl,\n open: this.popupOpen.bind(this),\n close: this.popupClose.bind(this),\n collision: { Y: this.enableCollision ? 'flip' : 'none' },\n position: this.enableRtl ? { X: 'left', Y: 'top' } : { X: 'right', Y: 'top' }\n });\n popup.appendTo(ele);\n if (this.overflowMode === 'Extended') {\n popup.width = parseFloat(eleStyles.width) + ((parseFloat(eleStyles.borderRightWidth)) * 2);\n popup.offsetX = 0;\n }\n EventHandler.add(document, 'scroll', this.docEvent.bind(this));\n EventHandler.add(document, 'click ', this.docEvent.bind(this));\n popup.element.style.maxHeight = popup.element.offsetHeight + 'px';\n if (this.isVertical) {\n popup.element.style.visibility = 'hidden';\n }\n if (this.isExtendedOpen) {\n var popupNav = this.element.querySelector('.' + CLS_TBARNAV);\n popupNav.classList.add(CLS_TBARNAVACT);\n classList(popupNav.firstElementChild, [CLS_POPUPICON], [CLS_POPUPDOWN]);\n this.element.querySelector('.' + CLS_EXTENDABLECLASS).classList.add(CLS_POPUPOPEN);\n }\n else {\n popup.hide();\n }\n this.popObj = popup;\n this.element.setAttribute('aria-haspopup', 'true');\n }\n else {\n var popupEle = this.popObj.element;\n setStyle(popupEle, { maxHeight: '', display: 'block' });\n setStyle(popupEle, { maxHeight: popupEle.offsetHeight + 'px', display: '' });\n }\n };\n Toolbar.prototype.tbarPopupHandler = function (isOpen) {\n if (this.overflowMode === 'Extended') {\n isOpen ? this.add(this.element, CLS_EXTENDEDPOPOPEN) : this.remove(this.element, CLS_EXTENDEDPOPOPEN);\n }\n };\n Toolbar.prototype.popupOpen = function (e) {\n var popObj = this.popObj;\n if (!this.isVertical) {\n popObj.offsetY = this.getElementOffsetY();\n popObj.dataBind();\n }\n var popupEle = this.popObj.element;\n var toolEle = this.popObj.element.parentElement;\n var popupNav = toolEle.querySelector('.' + CLS_TBARNAV);\n setStyle(popObj.element, { height: 'auto', maxHeight: '' });\n popObj.element.style.maxHeight = popObj.element.offsetHeight + 'px';\n if (this.overflowMode === 'Extended') {\n popObj.element.style.minHeight = '';\n }\n var popupElePos = popupEle.offsetTop + popupEle.offsetHeight + calculatePosition(toolEle).top;\n var popIcon = popupNav.firstElementChild;\n popupNav.classList.add(CLS_TBARNAVACT);\n classList(popIcon, [CLS_POPUPICON], [CLS_POPUPDOWN]);\n this.tbarPopupHandler(true);\n var scrollVal = isNOU(window.scrollY) ? 0 : window.scrollY;\n if (!this.isVertical && ((window.innerHeight + scrollVal) < popupElePos) && (this.element.offsetTop < popupEle.offsetHeight)) {\n var overflowHeight = (popupEle.offsetHeight - ((popupElePos - window.innerHeight - scrollVal) + 5));\n popObj.height = overflowHeight + 'px';\n for (var i = 0; i <= popupEle.childElementCount; i++) {\n var ele = popupEle.children[i];\n if (ele.offsetTop + ele.offsetHeight > overflowHeight) {\n overflowHeight = ele.offsetTop;\n break;\n }\n }\n setStyle(popObj.element, { maxHeight: overflowHeight + 'px' });\n }\n else if (this.isVertical) {\n var tbEleData = this.element.getBoundingClientRect();\n setStyle(popObj.element, { maxHeight: (tbEleData.top + this.element.offsetHeight) + 'px', bottom: 0, visibility: '' });\n }\n if (popObj) {\n var popupOffset = popupEle.getBoundingClientRect();\n if (popupOffset.right > document.documentElement.clientWidth && popupOffset.width > toolEle.getBoundingClientRect().width) {\n popObj.collision = { Y: 'none' };\n popObj.dataBind();\n }\n popObj.refreshPosition();\n }\n };\n Toolbar.prototype.popupClose = function (e) {\n var element = this.element;\n var popupNav = element.querySelector('.' + CLS_TBARNAV);\n var popIcon = popupNav.firstElementChild;\n popupNav.classList.remove(CLS_TBARNAVACT);\n classList(popIcon, [CLS_POPUPDOWN], [CLS_POPUPICON]);\n this.tbarPopupHandler(false);\n };\n Toolbar.prototype.checkPriority = function (ele, inEle, eleWidth, pre) {\n var popPriority = this.popupPriCount > 0;\n var len = inEle.length;\n var eleWid = eleWidth;\n var eleOffset;\n var checkoffset;\n var sepCheck = 0;\n var itemCount = 0;\n var itemPopCount = 0;\n var checkClass = function (ele, val) {\n var rVal = false;\n val.forEach(function (cls) {\n if (ele.classList.contains(cls)) {\n rVal = true;\n }\n });\n return rVal;\n };\n for (var i = len - 1; i >= 0; i--) {\n var mrgn = void 0;\n var compuStyle = window.getComputedStyle(inEle[i]);\n if (this.isVertical) {\n mrgn = parseFloat((compuStyle).marginTop);\n mrgn += parseFloat((compuStyle).marginBottom);\n }\n else {\n mrgn = parseFloat((compuStyle).marginRight);\n mrgn += parseFloat((compuStyle).marginLeft);\n }\n var fstEleCheck = inEle[i] === this.tbarEle[0];\n if (fstEleCheck) {\n this.tbarEleMrgn = mrgn;\n }\n eleOffset = this.isVertical ? inEle[i].offsetHeight : inEle[i].offsetWidth;\n var eleWid_1 = fstEleCheck ? (eleOffset + mrgn) : eleOffset;\n if (checkClass(inEle[i], [CLS_POPPRI]) && popPriority) {\n inEle[i].classList.add(CLS_POPUP);\n if (this.isVertical) {\n setStyle(inEle[i], { display: 'none', minHeight: eleWid_1 + 'px' });\n }\n else {\n setStyle(inEle[i], { display: 'none', minWidth: eleWid_1 + 'px' });\n }\n itemPopCount++;\n }\n if (this.isVertical) {\n checkoffset = (inEle[i].offsetTop + inEle[i].offsetHeight + mrgn) > eleWidth;\n }\n else {\n checkoffset = (inEle[i].offsetLeft + inEle[i].offsetWidth + mrgn) > eleWidth;\n }\n if (checkoffset) {\n if (inEle[i].classList.contains(CLS_SEPARATOR)) {\n if (this.overflowMode === 'Extended') {\n if (itemCount === itemPopCount) {\n var sepEle = inEle[i];\n if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {\n inEle[i].classList.add(CLS_POPUP);\n itemPopCount++;\n }\n }\n itemCount++;\n }\n else if (this.overflowMode === 'Popup') {\n if (sepCheck > 0 && itemCount === itemPopCount) {\n var sepEle = inEle[i + itemCount + (sepCheck - 1)];\n if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {\n setStyle(sepEle, { display: 'none' });\n }\n }\n sepCheck++;\n itemCount = 0;\n itemPopCount = 0;\n }\n }\n else {\n itemCount++;\n }\n if (inEle[i].classList.contains(CLS_TBAROVERFLOW) && pre) {\n eleWidth -= ((this.isVertical ? inEle[i].offsetHeight : inEle[i].offsetWidth) + (mrgn));\n }\n else if (!checkClass(inEle[i], [CLS_SEPARATOR, CLS_TBARIGNORE])) {\n inEle[i].classList.add(CLS_POPUP);\n if (this.isVertical) {\n setStyle(inEle[i], { display: 'none', minHeight: eleWid_1 + 'px' });\n }\n else {\n setStyle(inEle[i], { display: 'none', minWidth: eleWid_1 + 'px' });\n }\n itemPopCount++;\n }\n else {\n eleWidth -= ((this.isVertical ? inEle[i].offsetHeight : inEle[i].offsetWidth) + (mrgn));\n }\n }\n }\n if (pre) {\n var popedEle = selectAll('.' + CLS_ITEM + ':not(.' + CLS_POPUP + ')', this.element);\n this.checkPriority(ele, popedEle, eleWid, false);\n }\n };\n Toolbar.prototype.createPopupIcon = function (element) {\n var id = element.id.concat('_nav');\n var className = 'e-' + element.id.concat('_nav ' + CLS_POPUPNAV);\n className = this.overflowMode === 'Extended' ? className + ' ' + CLS_EXTENDPOPUP : className;\n var nav = this.createElement('div', { id: id, className: className });\n if (Browser.info.name === 'msie' || Browser.info.name === 'edge') {\n nav.classList.add('e-ie-align');\n }\n var navItem = this.createElement('div', { className: CLS_POPUPDOWN + ' e-icons' });\n nav.appendChild(navItem);\n nav.setAttribute('tabindex', '0');\n nav.setAttribute('role', 'list');\n element.appendChild(nav);\n };\n Toolbar.prototype.tbarPriRef = function (inEle, indx, sepPri, el, des, elWid, wid, ig) {\n var ignoreCount = ig;\n var popEle = this.popObj.element;\n var query = '.' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + '):not(.' + CLS_TBAROVERFLOW + ')';\n var priEleCnt = selectAll('.' + CLS_POPUP + ':not(.' + CLS_TBAROVERFLOW + ')', popEle).length;\n var checkClass = function (ele, val) {\n return ele.classList.contains(val);\n };\n if (selectAll(query, inEle).length === 0) {\n var eleSep = inEle.children[indx - (indx - sepPri) - 1];\n var ignoreCheck = (!isNOU(eleSep) && checkClass(eleSep, CLS_TBARIGNORE));\n if ((!isNOU(eleSep) && checkClass(eleSep, CLS_SEPARATOR) && !isVisible(eleSep)) || ignoreCheck) {\n var sepDisplay = 'none';\n eleSep.style.display = 'inherit';\n var eleSepWidth = eleSep.offsetWidth + (parseFloat(window.getComputedStyle(eleSep).marginRight) * 2);\n var prevSep = eleSep.previousElementSibling;\n if ((elWid + eleSepWidth) < wid || des) {\n inEle.insertBefore(el, inEle.children[(indx + ignoreCount) - (indx - sepPri)]);\n if (!isNOU(prevSep)) {\n prevSep.style.display = '';\n }\n }\n else {\n if (prevSep.classList.contains(CLS_SEPARATOR)) {\n prevSep.style.display = sepDisplay;\n }\n }\n eleSep.style.display = '';\n }\n else {\n inEle.insertBefore(el, inEle.children[(indx + ignoreCount) - (indx - sepPri)]);\n }\n }\n else {\n inEle.insertBefore(el, inEle.children[(indx + ignoreCount) - priEleCnt]);\n }\n };\n Toolbar.prototype.popupRefresh = function (popupEle, destroy) {\n var _this = this;\n var ele = this.element;\n var isVer = this.isVertical;\n var innerEle = ele.querySelector('.' + CLS_ITEMS);\n var popNav = ele.querySelector('.' + CLS_TBARNAV);\n if (isNOU(popNav)) {\n return;\n }\n innerEle.removeAttribute('style');\n popupEle.style.display = 'block';\n var dimension;\n if (isVer) {\n dimension = ele.offsetHeight - (popNav.offsetHeight + innerEle.offsetHeight);\n }\n else {\n dimension = ele.offsetWidth - (popNav.offsetWidth + innerEle.offsetWidth);\n }\n var popupEleWidth = 0;\n [].slice.call(popupEle.children).forEach(function (el) {\n popupEleWidth += _this.popupEleWidth(el);\n setStyle(el, { 'position': '' });\n });\n if ((dimension + (isVer ? popNav.offsetHeight : popNav.offsetWidth)) > (popupEleWidth) && this.popupPriCount === 0) {\n destroy = true;\n }\n this.popupEleRefresh(dimension, popupEle, destroy);\n popupEle.style.display = '';\n if (popupEle.children.length === 0 && popNav && this.popObj) {\n detach(popNav);\n popNav = null;\n this.popObj.destroy();\n detach(this.popObj.element);\n this.popObj = null;\n ele.setAttribute('aria-haspopup', 'false');\n }\n };\n Toolbar.prototype.ignoreEleFetch = function (index, innerEle) {\n var ignoreEle = [].slice.call(innerEle.querySelectorAll('.' + CLS_TBARIGNORE));\n var ignoreInx = [];\n var count = 0;\n if (ignoreEle.length > 0) {\n ignoreEle.forEach(function (ele) {\n ignoreInx.push([].slice.call(innerEle.children).indexOf(ele));\n });\n }\n else {\n return 0;\n }\n ignoreInx.forEach(function (val) {\n if (val <= index) {\n count++;\n }\n });\n return count;\n };\n Toolbar.prototype.checkPopupRefresh = function (root, popEle) {\n popEle.style.display = 'block';\n var elWid = this.popupEleWidth(popEle.firstElementChild);\n popEle.firstElementChild.style.removeProperty('Position');\n var tbarWidth = root.offsetWidth - root.querySelector('.' + CLS_TBARNAV).offsetWidth;\n var tbarItemsWid = root.querySelector('.' + CLS_ITEMS).offsetWidth;\n popEle.style.removeProperty('display');\n if (tbarWidth > (elWid + tbarItemsWid)) {\n return true;\n }\n return false;\n };\n Toolbar.prototype.popupEleWidth = function (el) {\n el.style.position = 'absolute';\n var elWidth = this.isVertical ? el.offsetHeight : el.offsetWidth;\n var btnText = el.querySelector('.' + CLS_TBARBTNTEXT);\n if (el.classList.contains('e-tbtn-align') || el.classList.contains(CLS_TBARTEXT)) {\n var btn = el.children[0];\n if (!isNOU(btnText) && el.classList.contains(CLS_TBARTEXT)) {\n btnText.style.display = 'none';\n }\n else if (!isNOU(btnText) && el.classList.contains(CLS_POPUPTEXT)) {\n btnText.style.display = 'block';\n }\n btn.style.minWidth = '0%';\n elWidth = parseFloat(!this.isVertical ? el.style.minWidth : el.style.minHeight);\n btn.style.minWidth = '';\n btn.style.minHeight = '';\n if (!isNOU(btnText)) {\n btnText.style.display = '';\n }\n }\n return elWidth;\n };\n Toolbar.prototype.popupEleRefresh = function (width, popupEle, destroy) {\n var popPriority = this.popupPriCount > 0;\n var eleSplice = this.tbarEle;\n var priEleCnt;\n var index;\n var innerEle = this.element.querySelector('.' + CLS_ITEMS);\n var ignoreCount = 0;\n var _loop_1 = function (el) {\n if (el.classList.contains(CLS_POPPRI) && popPriority && !destroy) {\n return \"continue\";\n }\n var elWidth = this_1.popupEleWidth(el);\n if (el === this_1.tbarEle[0]) {\n elWidth += this_1.tbarEleMrgn;\n }\n el.style.position = '';\n if (elWidth < width || destroy) {\n setStyle(el, { minWidth: '', height: '', minHeight: '' });\n if (!el.classList.contains(CLS_POPOVERFLOW)) {\n el.classList.remove(CLS_POPUP);\n }\n index = this_1.tbarEle.indexOf(el);\n if (this_1.tbarAlign) {\n var pos = this_1.items[index].align;\n index = this_1.tbarAlgEle[(pos + 's').toLowerCase()].indexOf(el);\n eleSplice = this_1.tbarAlgEle[(pos + 's').toLowerCase()];\n innerEle = this_1.element.querySelector('.' + CLS_ITEMS + ' .' + 'e-toolbar-' + pos.toLowerCase());\n }\n var sepBeforePri_1 = 0;\n if (this_1.overflowMode !== 'Extended') {\n eleSplice.slice(0, index).forEach(function (el) {\n if (el.classList.contains(CLS_TBAROVERFLOW) || el.classList.contains(CLS_SEPARATOR)) {\n if (el.classList.contains(CLS_SEPARATOR)) {\n el.style.display = '';\n width -= el.offsetWidth;\n }\n sepBeforePri_1++;\n }\n });\n }\n ignoreCount = this_1.ignoreEleFetch(index, innerEle);\n if (el.classList.contains(CLS_TBAROVERFLOW)) {\n this_1.tbarPriRef(innerEle, index, sepBeforePri_1, el, destroy, elWidth, width, ignoreCount);\n width -= el.offsetWidth;\n }\n else if (index === 0) {\n innerEle.insertBefore(el, innerEle.firstChild);\n width -= el.offsetWidth;\n }\n else {\n priEleCnt = selectAll('.' + CLS_TBAROVERFLOW, this_1.popObj.element).length;\n innerEle.insertBefore(el, innerEle.children[(index + ignoreCount) - priEleCnt]);\n width -= el.offsetWidth;\n }\n el.style.height = '';\n }\n else {\n return \"break\";\n }\n };\n var this_1 = this;\n for (var _i = 0, _a = [].slice.call(popupEle.children); _i < _a.length; _i++) {\n var el = _a[_i];\n var state_1 = _loop_1(el);\n if (state_1 === \"break\")\n break;\n }\n var checkOverflow = this.checkOverflow(this.element, this.element.getElementsByClassName(CLS_ITEMS)[0]);\n if (checkOverflow && !destroy) {\n this.renderOverflowMode();\n }\n };\n Toolbar.prototype.removePositioning = function () {\n var item = this.element.querySelector('.' + CLS_ITEMS);\n if (isNOU(item) || !item.classList.contains(CLS_TBARPOS)) {\n return;\n }\n this.remove(item, CLS_TBARPOS);\n var innerItem = [].slice.call(item.childNodes);\n innerItem[1].removeAttribute('style');\n innerItem[2].removeAttribute('style');\n };\n Toolbar.prototype.refreshPositioning = function () {\n var item = this.element.querySelector('.' + CLS_ITEMS);\n this.add(item, CLS_TBARPOS);\n this.itemPositioning();\n };\n Toolbar.prototype.itemPositioning = function () {\n var item = this.element.querySelector('.' + CLS_ITEMS);\n var margin;\n if (isNOU(item) || !item.classList.contains(CLS_TBARPOS)) {\n return;\n }\n var popupNav = this.element.querySelector('.' + CLS_TBARNAV);\n var innerItem;\n if (this.scrollModule) {\n var trgClass = (this.isVertical) ? CLS_VSCROLLCNT : CLS_HSCROLLCNT;\n innerItem = [].slice.call(item.querySelector('.' + trgClass).children);\n }\n else {\n innerItem = [].slice.call(item.childNodes);\n }\n if (this.isVertical) {\n margin = innerItem[0].offsetHeight + innerItem[2].offsetHeight;\n }\n else {\n margin = innerItem[0].offsetWidth + innerItem[2].offsetWidth;\n }\n var tbarWid = this.isVertical ? this.element.offsetHeight : this.element.offsetWidth;\n if (popupNav) {\n tbarWid -= (this.isVertical ? popupNav.offsetHeight : popupNav.offsetWidth);\n var popWid = (this.isVertical ? popupNav.offsetHeight : popupNav.offsetWidth) + 'px';\n innerItem[2].removeAttribute('style');\n if (this.isVertical) {\n this.enableRtl ? innerItem[2].style.top = popWid : innerItem[2].style.bottom = popWid;\n }\n else {\n this.enableRtl ? innerItem[2].style.left = popWid : innerItem[2].style.right = popWid;\n }\n }\n if (tbarWid <= margin) {\n return;\n }\n var value = (((tbarWid - margin)) - (!this.isVertical ? innerItem[1].offsetWidth : innerItem[1].offsetHeight)) / 2;\n innerItem[1].removeAttribute('style');\n var mrgn = ((!this.isVertical ? innerItem[0].offsetWidth : innerItem[0].offsetHeight) + value) + 'px';\n if (this.isVertical) {\n this.enableRtl ? innerItem[1].style.marginBottom = mrgn : innerItem[1].style.marginTop = mrgn;\n }\n else {\n this.enableRtl ? innerItem[1].style.marginRight = mrgn : innerItem[1].style.marginLeft = mrgn;\n }\n };\n Toolbar.prototype.tbarItemAlign = function (item, itemEle, pos) {\n var _this = this;\n if (item.showAlwaysInPopup && item.overflow !== 'Show') {\n return;\n }\n var alignDiv = [];\n alignDiv.push(this.createElement('div', { className: CLS_TBARLEFT }));\n alignDiv.push(this.createElement('div', { className: CLS_TBARCENTER }));\n alignDiv.push(this.createElement('div', { className: CLS_TBARRIGHT }));\n if (pos === 0 && item.align !== 'Left') {\n alignDiv.forEach(function (ele) {\n itemEle.appendChild(ele);\n });\n this.tbarAlign = true;\n this.add(itemEle, CLS_TBARPOS);\n }\n else if (item.align !== 'Left') {\n var alignEle = itemEle.childNodes;\n var leftAlign_1 = alignDiv[0];\n [].slice.call(alignEle).forEach(function (el) {\n _this.tbarAlgEle.lefts.push(el);\n leftAlign_1.appendChild(el);\n });\n itemEle.appendChild(leftAlign_1);\n itemEle.appendChild(alignDiv[1]);\n itemEle.appendChild(alignDiv[2]);\n this.tbarAlign = true;\n this.add(itemEle, CLS_TBARPOS);\n }\n };\n Toolbar.prototype.ctrlTemplate = function () {\n var _this = this;\n this.ctrlTem = this.trgtEle.cloneNode(true);\n this.add(this.trgtEle, CLS_ITEMS);\n this.tbarEle = [];\n var innerEle = [].slice.call(this.trgtEle.children);\n innerEle.forEach(function (ele) {\n if (ele.tagName === 'DIV') {\n _this.tbarEle.push(ele);\n ele.setAttribute('aria-disabled', 'false');\n _this.add(ele, CLS_ITEM);\n }\n });\n };\n Toolbar.prototype.renderItems = function () {\n var ele = this.element;\n var items = this.items;\n if (this.trgtEle != null) {\n this.ctrlTemplate();\n }\n else if (ele && items.length > 0) {\n var itemEleDom = void 0;\n if (ele && ele.children.length > 0) {\n itemEleDom = ele.querySelector('.' + CLS_ITEMS);\n }\n if (!itemEleDom) {\n itemEleDom = this.createElement('div', { className: CLS_ITEMS });\n }\n this.itemsAlign(items, itemEleDom);\n ele.appendChild(itemEleDom);\n }\n };\n Toolbar.prototype.setAttr = function (attr, element) {\n var key = Object.keys(attr);\n var keyVal;\n for (var i = 0; i < key.length; i++) {\n keyVal = key[i];\n keyVal === 'class' ? this.add(element, attr[keyVal]) : element.setAttribute(keyVal, attr[keyVal]);\n }\n };\n /**\n * Enables or disables the specified Toolbar item.\n *\n * @param {number|HTMLElement|NodeList} items - DOM element or an array of items to be enabled or disabled.\n * @param {boolean} isEnable - Boolean value that determines whether the command should be enabled or disabled.\n * By default, `isEnable` is set to true.\n * @returns {void}.\n */\n Toolbar.prototype.enableItems = function (items, isEnable) {\n var elements = items;\n var len = elements.length;\n var ele;\n if (isNOU(isEnable)) {\n isEnable = true;\n }\n var enable = function (isEnable, ele) {\n if (isEnable) {\n ele.classList.remove(CLS_DISABLE);\n ele.setAttribute('aria-disabled', 'false');\n }\n else {\n ele.classList.add(CLS_DISABLE);\n ele.setAttribute('aria-disabled', 'true');\n }\n };\n if (!isNOU(len) && len >= 1) {\n for (var a = 0, element = [].slice.call(elements); a < len; a++) {\n var itemElement = element[a];\n if (typeof (itemElement) === 'number') {\n ele = this.getElementByIndex(itemElement);\n if (isNOU(ele)) {\n return;\n }\n else {\n elements[a] = ele;\n }\n }\n else {\n ele = itemElement;\n }\n enable(isEnable, ele);\n }\n isEnable ? removeClass(elements, CLS_DISABLE) : addClass(elements, CLS_DISABLE);\n }\n else {\n if (typeof (elements) === 'number') {\n ele = this.getElementByIndex(elements);\n if (isNOU(ele)) {\n return;\n }\n }\n else {\n ele = items;\n }\n enable(isEnable, ele);\n }\n };\n Toolbar.prototype.getElementByIndex = function (index) {\n if (this.tbarEle[index]) {\n return this.tbarEle[index];\n }\n return null;\n };\n /**\n * Adds new items to the Toolbar that accepts an array as Toolbar items.\n *\n * @param {ItemModel[]} items - DOM element or an array of items to be added to the Toolbar.\n * @param {number} index - Number value that determines where the command is to be added. By default, index is 0.\n * @returns {void}.\n */\n Toolbar.prototype.addItems = function (items, index) {\n var innerItems;\n this.extendedOpen();\n var itemsDiv = this.element.querySelector('.' + CLS_ITEMS);\n if (isNOU(itemsDiv)) {\n this.itemsRerender(items);\n return;\n }\n var innerEle;\n var itemAgn = 'Left';\n if (isNOU(index)) {\n index = 0;\n }\n items.forEach(function (e) {\n if (!isNOU(e.align) && e.align !== 'Left' && itemAgn === 'Left') {\n itemAgn = e.align;\n }\n });\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var item = items_1[_i];\n if (isNOU(item.type)) {\n item.type = 'Button';\n }\n innerItems = selectAll('.' + CLS_ITEM, this.element);\n item.align = itemAgn;\n innerEle = this.renderSubComponent(item, index);\n if (this.tbarEle.length >= index && innerItems.length >= 0) {\n if (isNOU(this.scrollModule)) {\n this.destroyMode();\n }\n var algIndex = item.align[0] === 'L' ? 0 : item.align[0] === 'C' ? 1 : 2;\n var ele = void 0;\n if (!this.tbarAlign && itemAgn !== 'Left') {\n this.tbarItemAlign(item, itemsDiv, 1);\n this.tbarAlign = true;\n ele = closest(innerItems[0], '.' + CLS_ITEMS).children[algIndex];\n ele.appendChild(innerEle);\n this.tbarAlgEle[(item.align + 's').toLowerCase()].push(innerEle);\n this.refreshPositioning();\n }\n else if (this.tbarAlign) {\n ele = closest(innerItems[0], '.' + CLS_ITEMS).children[algIndex];\n ele.insertBefore(innerEle, ele.children[index]);\n this.tbarAlgEle[(item.align + 's').toLowerCase()].splice(index, 0, innerEle);\n this.refreshPositioning();\n }\n else if (innerItems.length === 0) {\n innerItems = selectAll('.' + CLS_ITEMS, this.element);\n innerItems[0].appendChild(innerEle);\n }\n else {\n innerItems[0].parentNode.insertBefore(innerEle, innerItems[index]);\n }\n this.items.splice(index, 0, item);\n this.tbarEle.splice(index, 0, innerEle);\n index++;\n this.offsetWid = itemsDiv.offsetWidth;\n }\n }\n itemsDiv.style.width = '';\n this.renderOverflowMode();\n if (this.isReact) {\n this.renderReactTemplates();\n }\n };\n /**\n * Removes the items from the Toolbar. Acceptable arguments are index of item/HTMLElement/node list.\n *\n * @param {number|HTMLElement|NodeList|HTMLElement[]} args\n * Index or DOM element or an Array of item which is to be removed from the Toolbar.\n * @returns {void}.\n */\n Toolbar.prototype.removeItems = function (args) {\n var elements = args;\n var index;\n var innerItems = [].slice.call(selectAll('.' + CLS_ITEM, this.element));\n if (typeof (elements) === 'number') {\n index = parseInt(args.toString(), 10);\n this.removeItemByIndex(index, innerItems);\n }\n else {\n if (elements && elements.length > 1) {\n for (var _i = 0, _a = [].slice.call(elements); _i < _a.length; _i++) {\n var ele = _a[_i];\n index = this.tbarEle.indexOf(ele);\n this.removeItemByIndex(index, innerItems);\n innerItems = selectAll('.' + CLS_ITEM, this.element);\n }\n }\n else {\n var ele = (elements && elements.length && elements.length === 1) ? elements[0] : args;\n index = innerItems.indexOf(ele);\n this.removeItemByIndex(index, innerItems);\n }\n }\n this.resize();\n };\n Toolbar.prototype.removeItemByIndex = function (index, innerItems) {\n if (this.tbarEle[index] && innerItems[index]) {\n var eleIdx = this.tbarEle.indexOf(innerItems[index]);\n if (this.tbarAlign) {\n var indexAgn = this.tbarAlgEle[(this.items[eleIdx].align + 's').toLowerCase()].indexOf(this.tbarEle[eleIdx]);\n this.tbarAlgEle[(this.items[eleIdx].align + 's').toLowerCase()].splice(indexAgn, 1);\n }\n if (this.isReact) {\n this.clearTemplate();\n }\n var btnItem = innerItems[index].querySelector('.e-control.e-btn');\n if (!isNOU(btnItem) && !isNOU(btnItem.ej2_instances[0]) && !(btnItem.ej2_instances[0].isDestroyed)) {\n btnItem.ej2_instances[0].destroy();\n }\n detach(innerItems[index]);\n this.items.splice(eleIdx, 1);\n this.tbarEle.splice(eleIdx, 1);\n }\n };\n Toolbar.prototype.templateRender = function (templateProp, innerEle, item, index) {\n var itemType = item.type;\n var eleObj = templateProp;\n var isComponent;\n if (typeof (templateProp) === 'object') {\n isComponent = typeof (eleObj.appendTo) === 'function';\n }\n if (typeof (templateProp) === 'string' || !isComponent) {\n var templateFn = void 0;\n var val = templateProp;\n val = (typeof (templateProp) === 'string') ? templateProp.trim() : templateProp;\n try {\n if (typeof (templateProp) === 'object' && !isNOU(templateProp.tagName)) {\n innerEle.appendChild(templateProp);\n }\n else if (document.querySelectorAll(val).length) {\n var ele = document.querySelector(val);\n var tempStr = ele.outerHTML.trim();\n innerEle.appendChild(ele);\n ele.style.display = '';\n if (!isNOU(tempStr)) {\n this.tempId.push(val);\n }\n }\n }\n catch (e) {\n templateFn = templateCompiler(val);\n }\n var tempArray = void 0;\n if (!isNOU(templateFn)) {\n var toolbarTemplateID = this.element.id + index + '_template';\n tempArray = templateFn({}, this, 'template', toolbarTemplateID, this.isStringTemplate);\n }\n if (!isNOU(tempArray) && tempArray.length > 0) {\n [].slice.call(tempArray).forEach(function (ele) {\n if (!isNOU(ele.tagName)) {\n ele.style.display = '';\n }\n innerEle.appendChild(ele);\n });\n }\n }\n else if (itemType === 'Input') {\n var ele = this.createElement('input');\n item.id ? (ele.id = item.id) : (ele.id = getUniqueID('tbr-ipt'));\n innerEle.appendChild(ele);\n eleObj.appendTo(ele);\n }\n this.add(innerEle, CLS_TEMPLATE);\n this.tbarEle.push(innerEle);\n };\n Toolbar.prototype.buttonRendering = function (item, innerEle) {\n var dom = this.createElement('button', { className: CLS_TBARBTN });\n dom.setAttribute('type', 'button');\n var textStr = item.text;\n var iconCss;\n var iconPos;\n item.id ? (dom.id = item.id) : dom.id = getUniqueID('e-tbr-btn');\n var btnTxt = this.createElement('span', { className: 'e-tbar-btn-text' });\n if (textStr) {\n btnTxt.innerHTML = this.enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(textStr) : textStr;\n dom.appendChild(btnTxt);\n dom.classList.add('e-tbtn-txt');\n }\n else {\n this.add(innerEle, 'e-tbtn-align');\n }\n if (item.prefixIcon || item.suffixIcon) {\n if ((item.prefixIcon && item.suffixIcon) || item.prefixIcon) {\n iconCss = item.prefixIcon + ' e-icons';\n iconPos = 'Left';\n }\n else {\n iconCss = item.suffixIcon + ' e-icons';\n iconPos = 'Right';\n }\n }\n var btnObj = new Button({ iconCss: iconCss, iconPosition: iconPos });\n btnObj.createElement = this.createElement;\n btnObj.appendTo(dom);\n if (item.width) {\n setStyle(dom, { 'width': formatUnit(item.width) });\n }\n return dom;\n };\n Toolbar.prototype.renderSubComponent = function (item, index) {\n var dom;\n var innerEle = this.createElement('div', { className: CLS_ITEM });\n innerEle.setAttribute('aria-disabled', 'false');\n var tempDom = this.createElement('div', {\n innerHTML: this.enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(item.tooltipText) : item.tooltipText\n });\n if (!this.tbarEle) {\n this.tbarEle = [];\n }\n if (item.htmlAttributes) {\n this.setAttr(item.htmlAttributes, innerEle);\n }\n if (item.tooltipText) {\n innerEle.setAttribute('title', tempDom.textContent);\n }\n if (item.cssClass) {\n innerEle.className = innerEle.className + ' ' + item.cssClass;\n }\n if (item.template) {\n this.templateRender(item.template, innerEle, item, index);\n }\n else {\n switch (item.type) {\n case 'Button':\n dom = this.buttonRendering(item, innerEle);\n dom.setAttribute('tabindex', '-1');\n dom.setAttribute('aria-label', (item.text || item.tooltipText));\n innerEle.appendChild(dom);\n innerEle.addEventListener('click', this.itemClick.bind(this));\n break;\n case 'Separator':\n this.add(innerEle, CLS_SEPARATOR);\n break;\n }\n }\n if (item.showTextOn) {\n var sTxt = item.showTextOn;\n if (sTxt === 'Toolbar') {\n this.add(innerEle, CLS_POPUPTEXT);\n this.add(innerEle, 'e-tbtn-align');\n }\n else if (sTxt === 'Overflow') {\n this.add(innerEle, CLS_TBARTEXT);\n }\n }\n if (item.overflow) {\n var overflow = item.overflow;\n if (overflow === 'Show') {\n this.add(innerEle, CLS_TBAROVERFLOW);\n }\n else if (overflow === 'Hide') {\n if (!innerEle.classList.contains(CLS_SEPARATOR)) {\n this.add(innerEle, CLS_POPOVERFLOW);\n }\n }\n }\n if (item.overflow !== 'Show' && item.showAlwaysInPopup && !innerEle.classList.contains(CLS_SEPARATOR)) {\n this.add(innerEle, CLS_POPPRI);\n this.popupPriCount++;\n }\n if (item.disabled) {\n this.add(innerEle, CLS_DISABLE);\n }\n if (item.visible === false) {\n this.add(innerEle, CLS_HIDDEN);\n }\n return innerEle;\n };\n Toolbar.prototype.itemClick = function (e) {\n this.activeEleSwitch(e.currentTarget);\n };\n Toolbar.prototype.activeEleSwitch = function (ele) {\n this.activeEleRemove(ele.firstElementChild);\n this.activeEle.focus();\n };\n Toolbar.prototype.activeEleRemove = function (curEle) {\n if (!isNOU(this.activeEle)) {\n this.activeEle.setAttribute('tabindex', '-1');\n }\n this.activeEle = curEle;\n if (isNOU(this.trgtEle) && !curEle.parentElement.classList.contains(CLS_TEMPLATE)) {\n curEle.removeAttribute('tabindex');\n }\n else {\n this.activeEle.setAttribute('tabindex', '0');\n }\n };\n Toolbar.prototype.getPersistData = function () {\n return this.addOnPersist([]);\n };\n /**\n * Returns the current module name.\n *\n * @returns {string} - Returns the module name as string.\n * @private\n */\n Toolbar.prototype.getModuleName = function () {\n return 'toolbar';\n };\n Toolbar.prototype.itemsRerender = function (newProp) {\n this.items = this.tbarItemsCol;\n if (this.isReact) {\n this.clearTemplate();\n }\n this.destroyMode();\n this.destroyItems();\n this.items = newProp;\n this.tbarItemsCol = this.items;\n this.renderItems();\n this.renderOverflowMode();\n if (this.isReact) {\n this.renderReactTemplates();\n }\n };\n Toolbar.prototype.resize = function () {\n var ele = this.element;\n this.tbResize = true;\n if (this.tbarAlign) {\n this.itemPositioning();\n }\n if (this.popObj && this.overflowMode === 'Popup') {\n this.popObj.hide();\n }\n var checkOverflow = this.checkOverflow(ele, ele.getElementsByClassName(CLS_ITEMS)[0]);\n if (!checkOverflow) {\n this.destroyScroll();\n var multirowele = ele.querySelector('.' + CLS_ITEMS);\n if (!isNOU(multirowele)) {\n this.remove(multirowele, CLS_MULTIROWPOS);\n if (this.tbarAlign) {\n this.add(multirowele, CLS_TBARPOS);\n }\n }\n }\n if (checkOverflow && this.scrollModule && (this.offsetWid === ele.offsetWidth)) {\n return;\n }\n if (this.offsetWid > ele.offsetWidth || checkOverflow) {\n this.renderOverflowMode();\n }\n if (this.popObj) {\n if (this.overflowMode === 'Extended') {\n var eleStyles = window.getComputedStyle(this.element);\n this.popObj.width = parseFloat(eleStyles.width) + ((parseFloat(eleStyles.borderRightWidth)) * 2);\n }\n if (this.tbarAlign) {\n this.removePositioning();\n }\n this.popupRefresh(this.popObj.element, false);\n if (this.tbarAlign) {\n this.refreshPositioning();\n }\n }\n if (this.element.querySelector('.' + CLS_HSCROLLBAR)) {\n this.scrollStep = this.element.querySelector('.' + CLS_HSCROLLBAR).offsetWidth;\n }\n this.offsetWid = ele.offsetWidth;\n this.tbResize = false;\n this.separator();\n };\n Toolbar.prototype.extendedOpen = function () {\n var sib = this.element.querySelector('.' + CLS_EXTENDABLECLASS);\n if (this.overflowMode === 'Extended' && sib) {\n this.isExtendedOpen = sib.classList.contains(CLS_POPUPOPEN);\n }\n };\n /**\n * Gets called when the model property changes.The data that describes the old and new values of the property that changed.\n *\n * @param {ToolbarModel} newProp - It contains new value of the data.\n * @param {ToolbarModel} oldProp - It contains old value of the data.\n * @returns {void}\n * @private\n */\n Toolbar.prototype.onPropertyChanged = function (newProp, oldProp) {\n var tEle = this.element;\n var wid = tEle.offsetWidth;\n this.extendedOpen();\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'items':\n if (!(newProp.items instanceof Array && oldProp.items instanceof Array)) {\n var changedProb = Object.keys(newProp.items);\n for (var i = 0; i < changedProb.length; i++) {\n var index = parseInt(Object.keys(newProp.items)[i], 10);\n var property = Object.keys(newProp.items[index])[0];\n var newProperty = Object(newProp.items[index])[property];\n if (typeof newProperty !== 'function') {\n if (this.tbarAlign || property === 'align') {\n this.refresh();\n this.trigger('created');\n break;\n }\n var popupPriCheck = property === 'showAlwaysInPopup' && !newProperty;\n var booleanCheck = property === 'overflow' && this.popupPriCount !== 0;\n if ((popupPriCheck) || (this.items[index].showAlwaysInPopup) && booleanCheck) {\n --this.popupPriCount;\n }\n if (isNOU(this.scrollModule)) {\n this.destroyMode();\n }\n var itemCol = [].slice.call(selectAll('.' + CLS_ITEMS + ' .' + CLS_ITEM, tEle));\n if (this.isReact) {\n this.clearTemplate();\n }\n detach(itemCol[index]);\n this.tbarEle.splice(index, 1);\n this.addItems([this.items[index]], index);\n this.items.splice(index, 1);\n if (this.items[index].template) {\n this.tbarEle.splice(this.items.length, 1);\n }\n }\n }\n }\n else {\n this.itemsRerender(newProp.items);\n }\n break;\n case 'width':\n setStyle(tEle, { 'width': formatUnit(newProp.width) });\n this.renderOverflowMode();\n if (this.popObj && wid < tEle.offsetWidth) {\n this.popupRefresh(this.popObj.element, false);\n }\n break;\n case 'height':\n setStyle(this.element, { 'height': formatUnit(newProp.height) });\n break;\n case 'overflowMode':\n this.destroyMode();\n this.renderOverflowMode();\n if (this.enableRtl) {\n this.add(tEle, CLS_RTL);\n }\n this.refreshOverflow();\n break;\n case 'enableRtl':\n newProp.enableRtl ? this.add(tEle, CLS_RTL) : this.remove(tEle, CLS_RTL);\n if (!isNOU(this.scrollModule)) {\n newProp.enableRtl ? this.add(this.scrollModule.element, CLS_RTL) : this.remove(this.scrollModule.element, CLS_RTL);\n }\n if (!isNOU(this.popObj)) {\n newProp.enableRtl ? this.add(this.popObj.element, CLS_RTL) : this.remove(this.popObj.element, CLS_RTL);\n }\n if (this.tbarAlign) {\n this.itemPositioning();\n }\n break;\n case 'scrollStep':\n if (this.scrollModule) {\n this.scrollModule.scrollStep = this.scrollStep;\n }\n break;\n case 'enableCollision':\n if (this.popObj) {\n this.popObj.collision = { Y: this.enableCollision ? 'flip' : 'none' };\n }\n break;\n case 'cssClass':\n if (oldProp.cssClass) {\n removeClass([this.element], oldProp.cssClass.split(' '));\n }\n if (newProp.cssClass) {\n addClass([this.element], newProp.cssClass.split(' '));\n }\n break;\n case 'allowKeyboard':\n this.unwireKeyboardEvent();\n if (newProp.allowKeyboard) {\n this.wireKeyboardEvent();\n }\n break;\n }\n }\n };\n /**\n * Shows or hides the Toolbar item that is in the specified index.\n *\n * @param {number | HTMLElement} index - Index value of target item or DOM element of items to be hidden or shown.\n * @param {boolean} value - Based on this Boolean value, item will be hide (true) or show (false). By default, value is false.\n * @returns {void}.\n */\n Toolbar.prototype.hideItem = function (index, value) {\n var isElement = (typeof (index) === 'object') ? true : false;\n var eleIndex = index;\n var initIndex;\n var ele;\n var innerItems = [].slice.call(selectAll('.' + CLS_ITEM, this.element));\n if (isElement) {\n ele = index;\n }\n else if (this.tbarEle[eleIndex]) {\n var innerItems_1 = [].slice.call(selectAll('.' + CLS_ITEM, this.element));\n ele = innerItems_1[eleIndex];\n }\n if (ele) {\n value ? ele.classList.add(CLS_HIDDEN) : ele.classList.remove(CLS_HIDDEN);\n if (value && isNOU(this.element.getAttribute('tabindex')) && !ele.classList.contains(CLS_SEPARATOR)) {\n if (isNOU(ele.firstElementChild.getAttribute('tabindex'))) {\n ele.firstElementChild.setAttribute('tabindex', '-1');\n var innerItems_2 = [].slice.call(selectAll('.' + CLS_ITEM, this.element));\n if (isElement) {\n eleIndex = innerItems_2.indexOf(ele);\n }\n var nextEle = innerItems_2[++eleIndex];\n while (nextEle) {\n var skipEle = this.eleContains(nextEle);\n if (!skipEle) {\n nextEle.firstElementChild.removeAttribute('tabindex');\n break;\n }\n nextEle = innerItems_2[++eleIndex];\n }\n }\n }\n else if (isNOU(this.element.getAttribute('tabindex')) && !ele.classList.contains(CLS_SEPARATOR)) {\n initIndex = 0;\n var setFlag = false;\n var removeFlag = false;\n var initELe = innerItems[initIndex];\n while (initELe) {\n if (!initELe.classList.contains(CLS_SEPARATOR)) {\n if (isNOU(initELe.firstElementChild.getAttribute('tabindex'))) {\n initELe.firstElementChild.setAttribute('tabindex', '-1');\n setFlag = true;\n }\n else {\n if (setFlag && removeFlag) {\n break;\n }\n var skipEle = this.eleContains(initELe);\n if (!skipEle) {\n initELe.firstElementChild.removeAttribute('tabindex');\n removeFlag = true;\n }\n initELe = innerItems[++initIndex];\n }\n }\n else {\n initELe = innerItems[++initIndex];\n }\n }\n }\n this.refreshOverflow();\n }\n };\n __decorate([\n Collection([], Item)\n ], Toolbar.prototype, \"items\", void 0);\n __decorate([\n Property('auto')\n ], Toolbar.prototype, \"width\", void 0);\n __decorate([\n Property('auto')\n ], Toolbar.prototype, \"height\", void 0);\n __decorate([\n Property('')\n ], Toolbar.prototype, \"cssClass\", void 0);\n __decorate([\n Property('Scrollable')\n ], Toolbar.prototype, \"overflowMode\", void 0);\n __decorate([\n Property()\n ], Toolbar.prototype, \"scrollStep\", void 0);\n __decorate([\n Property(true)\n ], Toolbar.prototype, \"enableCollision\", void 0);\n __decorate([\n Property(true)\n ], Toolbar.prototype, \"enableHtmlSanitizer\", void 0);\n __decorate([\n Property(true)\n ], Toolbar.prototype, \"allowKeyboard\", void 0);\n __decorate([\n Event()\n ], Toolbar.prototype, \"clicked\", void 0);\n __decorate([\n Event()\n ], Toolbar.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], Toolbar.prototype, \"destroyed\", void 0);\n __decorate([\n Event()\n ], Toolbar.prototype, \"beforeCreate\", void 0);\n Toolbar = __decorate([\n NotifyPropertyChanges\n ], Toolbar);\n return Toolbar;\n}(Component));\nexport { Toolbar };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isNullOrUndefined, createElement, remove, closest, addClass, removeClass, extend } from '@syncfusion/ej2-base';\nimport { Toolbar } from '@syncfusion/ej2-navigations';\nimport { Calendar } from '@syncfusion/ej2-calendars';\nimport { Popup } from '@syncfusion/ej2-popups';\nimport * as events from '../base/constant';\nimport * as util from '../base/util';\nimport * as cls from '../base/css-constant';\n/**\n * Header module\n */\nvar HeaderRenderer = /** @class */ (function () {\n function HeaderRenderer(parent) {\n this.parent = parent;\n this.l10n = this.parent.localeObj;\n this.renderHeader();\n this.addEventListener();\n }\n HeaderRenderer.prototype.addEventListener = function () {\n this.parent.on(events.documentClick, this.closeHeaderPopup, this);\n };\n HeaderRenderer.prototype.removeEventListener = function () {\n this.parent.off(events.documentClick, this.closeHeaderPopup);\n };\n HeaderRenderer.prototype.closeHeaderPopup = function (e) {\n var closestEle = closest(e.event.target, '.e-date-range,.e-header-popup,.e-day,.e-selected');\n var closestPop = closest(e.event.target, '.e-hor-nav,.e-toolbar-pop');\n var contentWrap = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);\n if (this.parent.isAdaptive) {\n if (!isNullOrUndefined(closestPop) && (closestPop.classList.contains('e-toolbar-pop') ||\n closestPop.classList.contains('e-hor-nav')) && !(closestPop.classList.contains('e-hor-nav') &&\n this.element.querySelector('.e-toolbar-pop').classList.contains(cls.POPUP_OPEN))) {\n addClass([contentWrap], cls.SCROLL_HIDDEN);\n }\n else {\n removeClass([contentWrap], cls.SCROLL_HIDDEN);\n var popupEle = this.element.querySelector('.e-toolbar-pop');\n if (!isNullOrUndefined(popupEle)) {\n var popupObj = popupEle.ej2_instances[0];\n if (popupObj && !(!isNullOrUndefined(closestPop) && closestPop.classList.contains('e-hor-nav') &&\n popupEle.classList.contains(cls.POPUP_OPEN))) {\n popupObj.hide();\n }\n }\n }\n }\n if (!isNullOrUndefined(closestEle)) {\n return;\n }\n this.hideHeaderPopup();\n };\n HeaderRenderer.prototype.hideHeaderPopup = function () {\n if (this.headerPopup) {\n this.headerPopup.hide();\n }\n };\n HeaderRenderer.prototype.renderHeader = function () {\n this.element = createElement('div', { className: cls.TOOLBAR_CONTAINER });\n var toolbarEle = createElement('div', { className: cls.HEADER_TOOLBAR });\n this.element.appendChild(toolbarEle);\n this.parent.element.insertBefore(this.element, this.parent.element.firstElementChild);\n this.renderToolbar();\n };\n HeaderRenderer.prototype.renderToolbar = function () {\n var _this = this;\n var items = this.getItems();\n this.parent.trigger(events.actionBegin, { requestType: 'toolbarItemRendering', items: items }, function (args) {\n _this.toolbarObj = new Toolbar({\n items: args.items,\n overflowMode: 'Popup',\n clicked: _this.toolbarClickHandler.bind(_this),\n enableRtl: _this.parent.enableRtl,\n locale: _this.parent.locale\n });\n _this.toolbarObj.appendTo(_this.parent.element.querySelector('.' + cls.HEADER_TOOLBAR));\n var prevNavEle = _this.toolbarObj.element.querySelector('.e-prev');\n if (prevNavEle) {\n prevNavEle.firstElementChild.setAttribute('title', _this.l10n.getConstant('previous'));\n }\n var nextNavEle = _this.toolbarObj.element.querySelector('.e-next');\n if (nextNavEle) {\n nextNavEle.firstElementChild.setAttribute('title', _this.l10n.getConstant('next'));\n }\n _this.updateAddIcon();\n _this.updateActiveView();\n _this.parent.trigger(events.actionComplete, { requestType: 'toolBarItemRendered', items: _this.toolbarObj.items });\n });\n };\n HeaderRenderer.prototype.updateItems = function () {\n var _this = this;\n if (this.toolbarObj) {\n var items = this.getItems();\n this.parent.trigger(events.actionBegin, { requestType: 'toolbarItemRendering', items: items }, function (args) {\n _this.toolbarObj.items = args.items;\n _this.toolbarObj.dataBind();\n _this.parent.trigger(events.actionComplete, { requestType: 'toolBarItemRendered', items: _this.toolbarObj.items });\n });\n }\n };\n HeaderRenderer.prototype.getPopUpRelativeElement = function () {\n if (this.parent.isAdaptive) {\n return this.toolbarObj.element;\n }\n return this.element.querySelector('.e-date-range');\n };\n HeaderRenderer.prototype.setDayOfWeek = function (index) {\n if (this.headerCalendar) {\n this.headerCalendar.firstDayOfWeek = index;\n this.headerCalendar.dataBind();\n }\n };\n HeaderRenderer.prototype.setCalendarDate = function (date) {\n if (this.headerCalendar) {\n this.headerCalendar.value = date;\n this.headerCalendar.dataBind();\n }\n };\n HeaderRenderer.prototype.setCalendarMinMaxDate = function () {\n if (this.headerCalendar) {\n this.headerCalendar.min = this.parent.minDate;\n this.headerCalendar.max = this.parent.maxDate;\n this.headerCalendar.dataBind();\n }\n };\n HeaderRenderer.prototype.getCalendarView = function () {\n if (['Month', 'MonthAgenda', 'TimelineMonth'].indexOf(this.parent.currentView) > -1) {\n return 'Year';\n }\n else if (['Year', 'TimelineYear'].indexOf(this.parent.currentView) > -1) {\n return 'Decade';\n }\n else {\n return 'Month';\n }\n };\n HeaderRenderer.prototype.setCalendarView = function () {\n if (this.headerCalendar) {\n var calendarView = this.getCalendarView();\n this.headerCalendar.depth = calendarView;\n this.headerCalendar.start = calendarView;\n this.headerCalendar.refresh();\n }\n };\n HeaderRenderer.prototype.updateActiveView = function () {\n var selEle = [].slice.call(this.toolbarObj.element.querySelectorAll('.e-views'));\n removeClass(selEle, ['e-active-view']);\n if (selEle.length > 0 && selEle[this.parent.viewIndex]) {\n addClass([selEle[this.parent.viewIndex]], ['e-active-view']);\n }\n };\n HeaderRenderer.prototype.updateDateRange = function (text) {\n var selEle = this.toolbarObj.element.querySelector('.e-date-range');\n if (selEle) {\n selEle.setAttribute('aria-label', text);\n selEle.querySelector('.e-tbar-btn-text').innerHTML = text;\n this.refresh();\n }\n };\n HeaderRenderer.prototype.refresh = function () {\n if (this.toolbarObj) {\n this.toolbarObj.refreshOverflow();\n }\n };\n HeaderRenderer.prototype.updateAddIcon = function () {\n var addEle = this.toolbarObj.element.querySelector('.e-add');\n if (addEle) {\n if (!this.parent.eventSettings.allowAdding) {\n addClass([addEle], cls.HIDDEN_CLASS);\n }\n else {\n removeClass([addEle], cls.HIDDEN_CLASS);\n }\n }\n };\n HeaderRenderer.prototype.getDateRangeText = function () {\n var dateString = this.parent.globalize.formatDate(this.parent.selectedDate, {\n format: 'MMMM y', calendar: this.parent.getCalendarMode()\n });\n return util.capitalizeFirstWord(dateString, 'single');\n };\n HeaderRenderer.prototype.getItems = function () {\n var items = [];\n items.push({\n align: 'Left', prefixIcon: 'e-icon-prev', tooltipText: 'Previous', overflow: 'Show',\n cssClass: 'e-prev', htmlAttributes: { 'aria-label': 'previous period', 'role': 'navigation' }\n });\n items.push({\n align: 'Left', prefixIcon: 'e-icon-next', tooltipText: 'Next', overflow: 'Show',\n cssClass: 'e-next', htmlAttributes: { 'aria-label': 'next period', 'role': 'navigation' }\n });\n items.push({\n align: 'Left', text: this.getDateRangeText(), suffixIcon: 'e-icon-down-arrow', cssClass: 'e-date-range',\n overflow: 'Show',\n htmlAttributes: { 'aria-atomic': 'true', 'aria-live': 'assertive', 'aria-label': 'title', 'role': 'navigation' }\n });\n if (this.parent.isAdaptive || this.parent.enableAdaptiveUI) {\n items.push({\n align: 'Right', showAlwaysInPopup: (this.parent.isAdaptive || this.parent.enableAdaptiveUI), prefixIcon: 'e-icon-add',\n text: this.l10n.getConstant('newEvent'), cssClass: 'e-add', overflow: 'Show'\n });\n items.push({\n align: 'Right', showAlwaysInPopup: (this.parent.isAdaptive || this.parent.enableAdaptiveUI), prefixIcon: 'e-icon-today',\n text: this.l10n.getConstant('today'), cssClass: 'e-today', overflow: 'Show'\n });\n }\n else {\n items.push({\n align: 'Right', showAlwaysInPopup: (this.parent.isAdaptive || this.parent.enableAdaptiveUI), prefixIcon: 'e-icon-day',\n text: this.l10n.getConstant('today'), cssClass: 'e-today', overflow: 'Show'\n });\n if (this.parent.views.length > 1) {\n items.push({ align: 'Right', type: 'Separator', cssClass: 'e-schedule-seperator' });\n }\n }\n if (this.parent.views.length > 1) {\n for (var _i = 0, _a = this.parent.views; _i < _a.length; _i++) {\n var item = _a[_i];\n items.push(this.getItemObject(item));\n }\n }\n return items;\n };\n HeaderRenderer.prototype.getItemObject = function (item) {\n var viewName;\n var displayName;\n if (typeof (item) === 'string') {\n viewName = item.toLowerCase();\n displayName = null;\n }\n else {\n viewName = item.option.toLowerCase();\n displayName = item.displayName;\n }\n var view;\n var orientationClass;\n var isItemInsidePopup = this.parent.isAdaptive || this.parent.enableAdaptiveUI;\n switch (viewName) {\n case 'day':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-day',\n text: displayName || this.l10n.getConstant('day'), cssClass: 'e-views e-day'\n };\n break;\n case 'week':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-week',\n text: displayName || this.l10n.getConstant('week'), cssClass: 'e-views e-week'\n };\n break;\n case 'workweek':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-workweek',\n text: displayName || this.l10n.getConstant('workWeek'), cssClass: 'e-views e-work-week'\n };\n break;\n case 'month':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-month',\n text: displayName || this.l10n.getConstant('month'), cssClass: 'e-views e-month'\n };\n break;\n case 'year':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-year',\n text: displayName || this.l10n.getConstant('year'), cssClass: 'e-views e-year'\n };\n break;\n case 'agenda':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-agenda',\n text: displayName || this.l10n.getConstant('agenda'), cssClass: 'e-views e-agenda'\n };\n break;\n case 'monthagenda':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-month-agenda',\n text: displayName || this.l10n.getConstant('monthAgenda'), cssClass: 'e-views e-month-agenda'\n };\n break;\n case 'timelineday':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-timeline-day',\n text: displayName || this.l10n.getConstant('timelineDay'), cssClass: 'e-views e-timeline-day'\n };\n break;\n case 'timelineweek':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-timeline-week',\n text: displayName || this.l10n.getConstant('timelineWeek'), cssClass: 'e-views e-timeline-week'\n };\n break;\n case 'timelineworkweek':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-timeline-workweek',\n text: displayName || this.l10n.getConstant('timelineWorkWeek'), cssClass: 'e-views e-timeline-work-week'\n };\n break;\n case 'timelinemonth':\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-timeline-month',\n text: displayName || this.l10n.getConstant('timelineMonth'), cssClass: 'e-views e-timeline-month'\n };\n break;\n case 'timelineyear':\n orientationClass = (item.orientation === 'Vertical') ? 'vertical' : 'horizontal';\n view = {\n align: 'Right', showAlwaysInPopup: isItemInsidePopup, prefixIcon: 'e-icon-timeline-year-' + orientationClass,\n text: displayName || this.l10n.getConstant('timelineYear'), cssClass: 'e-views e-timeline-year'\n };\n break;\n }\n return view;\n };\n HeaderRenderer.prototype.renderHeaderPopup = function () {\n var headerPopupEle = createElement('div', { className: cls.HEADER_POPUP_CLASS });\n var headerCalendarEle = createElement('div', { className: cls.HEADER_CALENDAR_CLASS });\n headerPopupEle.appendChild(headerCalendarEle);\n this.element.appendChild(headerPopupEle);\n this.headerPopup = new Popup(headerPopupEle, {\n actionOnScroll: 'hide',\n targetType: 'relative',\n relateTo: this.getPopUpRelativeElement(),\n position: { X: 'left', Y: 'bottom' },\n enableRtl: this.parent.enableRtl\n });\n var calendarView = this.getCalendarView();\n this.headerCalendar = new Calendar({\n value: this.parent.selectedDate,\n min: this.parent.minDate,\n max: this.parent.maxDate,\n firstDayOfWeek: this.parent.activeViewOptions.firstDayOfWeek,\n enableRtl: this.parent.enableRtl,\n locale: this.parent.locale,\n depth: calendarView,\n start: calendarView,\n calendarMode: this.parent.calendarMode,\n change: this.calendarChange.bind(this)\n });\n this.setCalendarTimezone();\n this.headerCalendar.appendTo(headerCalendarEle);\n this.headerPopup.hide();\n };\n HeaderRenderer.prototype.calendarChange = function (args) {\n if (args.value.getTime() !== this.parent.selectedDate.getTime()) {\n var calendarDate = util.resetTime(new Date(args.value));\n this.parent.changeDate(calendarDate);\n }\n this.headerPopup.hide();\n };\n HeaderRenderer.prototype.setCalendarTimezone = function () {\n if (this.headerCalendar) {\n this.headerCalendar.timezone = this.parent.timezone || this.parent.tzModule.getLocalTimezoneName();\n }\n };\n HeaderRenderer.prototype.calculateViewIndex = function (args) {\n var target = closest(args.originalEvent.target, '.e-views');\n var views = [].slice.call(this.element.querySelectorAll('.e-views'));\n return views.indexOf(target);\n };\n HeaderRenderer.prototype.toolbarClickHandler = function (args) {\n if (!args.item) {\n return;\n }\n var strClass = args.item.cssClass.replace('e-views ', '');\n var data;\n var isSameTime;\n switch (strClass) {\n case 'e-date-range':\n if (!this.headerPopup) {\n this.renderHeaderPopup();\n }\n if (this.headerPopup.element.classList.contains(cls.POPUP_OPEN)) {\n this.headerPopup.hide();\n }\n else {\n this.headerPopup.show();\n }\n break;\n case 'e-day':\n this.parent.changeView('Day', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-week':\n this.parent.changeView('Week', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-work-week':\n this.parent.changeView('WorkWeek', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-month':\n this.parent.changeView('Month', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-year':\n this.parent.changeView('Year', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-agenda':\n this.parent.changeView('Agenda', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-month-agenda':\n this.parent.changeView('MonthAgenda', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-timeline-day':\n this.parent.changeView('TimelineDay', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-timeline-week':\n this.parent.changeView('TimelineWeek', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-timeline-work-week':\n this.parent.changeView('TimelineWorkWeek', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-timeline-month':\n this.parent.changeView('TimelineMonth', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-timeline-year':\n this.parent.changeView('TimelineYear', args.originalEvent, undefined, this.calculateViewIndex(args));\n break;\n case 'e-today':\n if (this.parent.currentView === 'Agenda' || !this.parent.isSelectedDate(util.resetTime(this.parent.getCurrentTime()))) {\n this.parent.changeDate(util.resetTime(this.parent.getCurrentTime()), args.originalEvent);\n }\n break;\n case 'e-prev':\n this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), args.originalEvent);\n break;\n case 'e-next':\n this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), args.originalEvent);\n break;\n case 'e-add':\n isSameTime = this.parent.activeCellsData.startTime.getTime() === this.parent.activeCellsData.endTime.getTime();\n if (this.parent.activeCellsData && !isSameTime) {\n data = this.parent.activeCellsData;\n }\n else {\n var interval = this.parent.activeViewOptions.timeScale.interval;\n var slotCount = this.parent.activeViewOptions.timeScale.slotCount;\n var msInterval = (interval * util.MS_PER_MINUTE) / slotCount;\n var startTime = new Date(this.parent.selectedDate.getTime());\n var currentTime = this.parent.getCurrentTime();\n startTime.setHours(currentTime.getHours(), (Math.round(startTime.getMinutes() / msInterval) * msInterval), 0);\n var endTime = new Date(new Date(startTime.getTime()).setMilliseconds(startTime.getMilliseconds() + msInterval));\n data = { startTime: startTime, endTime: endTime, isAllDay: false };\n }\n this.parent.eventWindow.openEditor(extend(data, { cancel: false, event: args.originalEvent }), 'Add');\n break;\n }\n if (isNullOrUndefined(this.toolbarObj)) {\n return;\n }\n var toolbarPopUp = this.toolbarObj.element.querySelector('.e-toolbar-pop');\n if (toolbarPopUp && args.item.type !== 'Input') {\n toolbarPopUp.ej2_instances[0].hide({ name: 'SlideUp', duration: 100 });\n }\n };\n HeaderRenderer.prototype.getHeaderElement = function () {\n return this.toolbarObj.element;\n };\n HeaderRenderer.prototype.updateHeaderItems = function (classType) {\n var prevNavEle = this.toolbarObj.element.querySelector('.e-prev');\n var nextNavEle = this.toolbarObj.element.querySelector('.e-next');\n var dateRangeEle = this.toolbarObj.element.querySelector('.e-date-range');\n if (prevNavEle) {\n if (classType === 'add') {\n addClass([prevNavEle], cls.HIDDEN_CLASS);\n }\n else {\n removeClass([prevNavEle], cls.HIDDEN_CLASS);\n }\n }\n if (nextNavEle) {\n if (classType === 'add') {\n addClass([nextNavEle], cls.HIDDEN_CLASS);\n }\n else {\n removeClass([nextNavEle], cls.HIDDEN_CLASS);\n }\n }\n if (dateRangeEle) {\n if (classType === 'add') {\n addClass([dateRangeEle], cls.TEXT_ELLIPSIS);\n }\n else {\n removeClass([dateRangeEle], cls.TEXT_ELLIPSIS);\n }\n }\n };\n HeaderRenderer.prototype.previousNextIconHandler = function () {\n var dates = (this.parent.currentView === 'Agenda' ?\n [this.parent.getCurrentViewDates()[0]] : this.parent.getCurrentViewDates());\n var prevNavEle = this.toolbarObj.element.querySelector('.' + cls.PREVIOUS_DATE_CLASS);\n var nextNavEle = this.toolbarObj.element.querySelector('.' + cls.NEXT_DATE_CLASS);\n var firstDate = new Date(dates[0].getTime());\n var lastDate = new Date(dates[dates.length - 1].getTime());\n if (this.parent.currentView === 'WorkWeek' || this.parent.currentView === 'TimelineWorkWeek') {\n firstDate = util.getWeekFirstDate(util.resetTime(this.parent.selectedDate), this.parent.firstDayOfWeek);\n lastDate = util.addDays(firstDate, 7 * this.parent.activeViewOptions.interval);\n }\n if (this.parent.currentView === 'Month') {\n firstDate = util.firstDateOfMonth(this.parent.selectedDate);\n var lastMonthFirstDate = util.addMonths(firstDate, this.parent.activeViewOptions.interval - 1);\n lastDate = util.lastDateOfMonth(lastMonthFirstDate);\n }\n if (!isNullOrUndefined(prevNavEle)) {\n this.toolbarObj.enableItems(prevNavEle, firstDate > this.parent.minDate);\n }\n if (!isNullOrUndefined(nextNavEle)) {\n this.toolbarObj.enableItems(nextNavEle, lastDate < this.parent.maxDate);\n }\n this.setCalendarMinMaxDate();\n };\n HeaderRenderer.prototype.getModuleName = function () {\n return 'headerbar';\n };\n HeaderRenderer.prototype.destroy = function () {\n if (this.headerPopup && !this.headerPopup.isDestroyed) {\n this.headerPopup.destroy();\n this.headerPopup = null;\n }\n if (this.headerCalendar && !this.headerCalendar.isDestroyed) {\n this.headerCalendar.destroy();\n this.headerCalendar = null;\n }\n if (this.toolbarObj && !this.toolbarObj.isDestroyed) {\n this.toolbarObj.destroy();\n this.removeEventListener();\n remove(this.element);\n this.toolbarObj = null;\n }\n this.element = null;\n this.parent = null;\n this.l10n = null;\n };\n return HeaderRenderer;\n}());\nexport { HeaderRenderer };\n","import { formatUnit } from '@syncfusion/ej2-base';\nimport { contentReady, uiUpdate, scrollUiUpdate } from '../base/constant';\n/**\n * `Scroll` module\n */\nvar Scroll = /** @class */ (function () {\n /**\n * Constructor for the scrolling.\n *\n * @param {Schedule} parent Accepts the Schedule instance\n */\n function Scroll(parent) {\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @returns {string} Returns the module name.\n * @private\n */\n Scroll.prototype.getModuleName = function () {\n return 'scroll';\n };\n /**\n * Internal method to set the element width\n *\n * @returns {void}\n * @private\n */\n Scroll.prototype.setWidth = function () {\n this.parent.element.style.width = formatUnit(this.parent.width);\n };\n /**\n * Internal method to set the element height\n *\n * @returns {void}\n * @private\n */\n Scroll.prototype.setHeight = function () {\n this.parent.element.style.height = formatUnit(this.parent.height);\n };\n /**\n * Internal method to bind events\n *\n * @returns {void}\n * @private\n */\n Scroll.prototype.addEventListener = function () {\n this.parent.on(contentReady, this.setDimensions, this);\n this.parent.on(uiUpdate, this.onPropertyChanged, this);\n };\n /**\n * Internal method to unbind events\n *\n * @returns {void}\n * @private\n */\n Scroll.prototype.removeEventListener = function () {\n this.parent.off(contentReady, this.setDimensions);\n this.parent.off(uiUpdate, this.onPropertyChanged);\n };\n /**\n * Internal method to set the dimensions\n *\n * @returns {void}\n * @private\n */\n Scroll.prototype.setDimensions = function () {\n this.setWidth();\n this.setHeight();\n var data = { cssProperties: this.parent.getCssProperties(), module: this.getModuleName() };\n this.parent.notify(scrollUiUpdate, data);\n };\n /**\n * Internal method to set the dimensions dynamically\n *\n * @returns {void}\n * @private\n */\n Scroll.prototype.onPropertyChanged = function () {\n this.setDimensions();\n };\n /**\n * Destroy the scroll module\n *\n * @returns {void}\n * @private\n */\n Scroll.prototype.destroy = function () {\n this.removeEventListener();\n };\n return Scroll;\n}());\nexport { Scroll };\n","import { addClass, removeClass, Touch, remove, EventHandler, Browser } from '@syncfusion/ej2-base';\nimport { closest, isNullOrUndefined } from '@syncfusion/ej2-base';\nimport * as events from '../base/constant';\nimport * as cls from '../base/css-constant';\nimport * as util from '../base/util';\n/**\n * `touch` module is used to handle touch interactions.\n */\nvar ScheduleTouch = /** @class */ (function () {\n function ScheduleTouch(parent) {\n this.parent = parent;\n this.element = this.parent.element.querySelector('.' + cls.TABLE_CONTAINER_CLASS);\n this.touchObj = new Touch(this.element, {\n scroll: this.scrollHandler.bind(this),\n swipe: this.swipeHandler.bind(this),\n tapHold: this.tapHoldHandler.bind(this),\n swipeSettings: { swipeThresholdDistance: 1 }\n });\n EventHandler.add(this.element, 'transitionend', this.onTransitionEnd, this);\n this.touchLeftDirection = this.parent.enableRtl ? 'Right' : 'Left';\n this.touchRightDirection = this.parent.enableRtl ? 'Left' : 'Right';\n }\n ScheduleTouch.prototype.scrollHandler = function (e) {\n if (this.parent.currentView === 'Agenda' || this.parent.uiStateValues.action ||\n (e.originalEvent && (e.originalEvent.target.classList.contains(cls.APPOINTMENT_CLASS) ||\n closest(e.originalEvent.target, '.' + cls.APPOINTMENT_CLASS)))) {\n return;\n }\n if (!this.timeStampStart) {\n this.timeStampStart = Date.now();\n }\n if (this.element.classList.contains(cls.TRANSLATE_CLASS)) {\n this.onTransitionEnd();\n }\n if (e.scrollDirection === 'Left' || e.scrollDirection === 'Right') {\n var args = { requestType: 'dateNavigate', cancel: false, event: e.originalEvent };\n this.parent.trigger(events.actionBegin, args);\n if (args.cancel) {\n return;\n }\n var scrollDiv = this.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);\n if (scrollDiv && scrollDiv.scrollWidth > scrollDiv.clientWidth) {\n return;\n }\n else {\n this.isScrollTriggered = true;\n e.originalEvent.preventDefault();\n e.originalEvent.stopPropagation();\n }\n }\n if (e.scrollDirection === this.touchLeftDirection) {\n if (!this.nextPanel) {\n this.renderPanel(cls.NEXT_PANEL_CLASS, 'next');\n this.nextPanel = {\n element: this.parent.activeView.getPanel(),\n selectedDate: new Date(this.parent.selectedDate.getTime())\n };\n this.setDimensions(this.nextPanel.element);\n }\n var x = this.parent.enableRtl ? e.distanceX : -e.distanceX;\n this.element.style.transform = 'translatex(' + (this.getTranslateX(this.element) + x) + 'px)';\n }\n else if (e.scrollDirection === this.touchRightDirection) {\n var prevWidth = 0;\n if (!this.previousPanel) {\n this.renderPanel(cls.PREVIOUS_PANEL_CLASS, 'previous');\n this.previousPanel = {\n element: this.parent.activeView.getPanel(),\n selectedDate: new Date(this.parent.selectedDate.getTime())\n };\n this.setDimensions(this.previousPanel.element);\n prevWidth = this.previousPanel.element.offsetWidth;\n }\n var x = this.parent.enableRtl ? prevWidth - e.distanceX : -prevWidth + e.distanceX;\n this.element.style.transform = 'translatex(' + (this.getTranslateX(this.element) + x) + 'px)';\n }\n };\n ScheduleTouch.prototype.swipeHandler = function (e) {\n if (!this.isScrollTriggered || this.parent.uiStateValues.action) {\n return;\n }\n this.isScrollTriggered = false;\n var swipeDate = e.swipeDirection === 'Left' ?\n this.parent.activeView.renderDates[0] : this.parent.activeView.renderDates.slice(-1)[0];\n if ((e.swipeDirection === 'Left' && swipeDate < this.parent.maxDate) ||\n (e.swipeDirection === 'Right' && swipeDate >= this.parent.minDate)) {\n var time = Date.now() - this.timeStampStart;\n var offsetDist = (e.distanceX * (Browser.isDevice ? 6 : 1.66));\n if (offsetDist > time || (e.distanceX > (this.parent.element.offsetWidth / 2))) {\n this.swapPanels(e.swipeDirection);\n if (offsetDist > time && (e.distanceX > (this.parent.element.offsetWidth / 2))) {\n this.element.style.transitionDuration = ((offsetDist / time) / 10) + 's';\n }\n this.confirmSwipe(e.swipeDirection);\n }\n else {\n this.cancelSwipe();\n }\n var args = { requestType: 'dateNavigate', cancel: false, event: e.originalEvent };\n this.parent.trigger(events.actionComplete, args);\n }\n else {\n this.cancelSwipe();\n }\n this.timeStampStart = null;\n };\n ScheduleTouch.prototype.tapHoldHandler = function (e) {\n var target = closest(e.originalEvent.target, '.' + cls.APPOINTMENT_CLASS);\n if (!isNullOrUndefined(target) && this.parent.isAdaptive) {\n this.parent.quickPopup.tapHoldEventPopup(e.originalEvent);\n return;\n }\n };\n ScheduleTouch.prototype.renderPanel = function (clsName, nextPrevType) {\n if (!this.currentPanel) {\n this.currentPanel = {\n element: this.parent.activeView.getPanel(),\n selectedDate: new Date(this.parent.selectedDate.getTime())\n };\n this.setDimensions(this.currentPanel.element);\n }\n else {\n this.parent.setProperties({ selectedDate: this.currentPanel.selectedDate }, true);\n }\n this.parent.setProperties({ selectedDate: this.parent.activeView.getNextPreviousDate(nextPrevType) }, true);\n if (this.parent.headerModule) {\n this.parent.headerModule.setCalendarDate(this.parent.selectedDate);\n }\n this.parent.activeView.getRenderDates();\n this.parent.activeView.renderLayout(clsName);\n };\n ScheduleTouch.prototype.swapPanels = function (direction) {\n if (direction === this.touchLeftDirection) {\n var temp = this.nextPanel;\n this.nextPanel = this.currentPanel;\n this.currentPanel = temp;\n }\n else {\n var temp = this.previousPanel;\n this.previousPanel = this.currentPanel;\n this.currentPanel = temp;\n }\n };\n ScheduleTouch.prototype.confirmSwipe = function (swipeDirection) {\n var _this = this;\n var previousDate = swipeDirection === this.touchLeftDirection ?\n this.nextPanel.selectedDate : this.previousPanel.selectedDate;\n var args = {\n action: 'date', cancel: false, previousDate: previousDate, currentDate: this.currentPanel.selectedDate\n };\n this.parent.trigger(events.navigating, args, function (navArgs) {\n if (navArgs.cancel) {\n _this.swapPanels(swipeDirection);\n _this.cancelSwipe();\n }\n else {\n _this.parent.activeView.setPanel(_this.currentPanel.element);\n _this.parent.setProperties({ selectedDate: _this.currentPanel.selectedDate }, true);\n var translateX = void 0;\n if (_this.parent.enableRtl) {\n translateX = swipeDirection === _this.touchLeftDirection ?\n (_this.previousPanel ? _this.previousPanel.element.offsetLeft : _this.currentPanel.element.offsetWidth) : 0;\n }\n else {\n translateX = swipeDirection === _this.touchLeftDirection ? -_this.currentPanel.element.offsetLeft : 0;\n }\n addClass([_this.element], cls.TRANSLATE_CLASS);\n _this.element.style.transform = 'translatex(' + translateX + 'px)';\n if (_this.parent.headerModule) {\n _this.parent.headerModule.updateDateRange(_this.parent.activeView.getDateRangeText());\n }\n _this.parent.renderTemplates();\n _this.parent.crudModule.refreshDataManager();\n }\n });\n };\n ScheduleTouch.prototype.cancelSwipe = function () {\n this.parent.activeView.setPanel(this.currentPanel.element);\n this.parent.setProperties({ selectedDate: this.currentPanel.selectedDate }, true);\n this.parent.activeView.getRenderDates();\n this.parent.activeView.generateColumnLevels();\n addClass([this.element], cls.TRANSLATE_CLASS);\n var prevWidth = this.previousPanel ? this.previousPanel.element.offsetWidth : 0;\n this.element.style.transform = 'translatex(' + (this.parent.enableRtl ? prevWidth : -this.currentPanel.element.offsetLeft) + 'px)';\n };\n ScheduleTouch.prototype.onTransitionEnd = function () {\n removeClass([this.element], cls.TRANSLATE_CLASS);\n this.element.style.transitionDuration = '';\n this.element.style.transform = '';\n if (this.previousPanel) {\n remove(this.previousPanel.element);\n this.previousPanel = null;\n removeClass([this.currentPanel.element], cls.PREVIOUS_PANEL_CLASS);\n addClass([this.currentPanel.element], cls.CURRENT_PANEL_CLASS);\n }\n if (this.nextPanel) {\n remove(this.nextPanel.element);\n this.nextPanel = null;\n removeClass([this.currentPanel.element], cls.NEXT_PANEL_CLASS);\n addClass([this.currentPanel.element], cls.CURRENT_PANEL_CLASS);\n }\n this.currentPanel = null;\n this.parent.activeView.getPanel().style.width = '';\n };\n ScheduleTouch.prototype.getTranslateX = function (element) {\n var style = window.getComputedStyle(element);\n return new WebKitCSSMatrix(style.webkitTransform).m41;\n };\n ScheduleTouch.prototype.setDimensions = function (element) {\n element.style.width = (this.parent.element.clientWidth) + 'px';\n };\n ScheduleTouch.prototype.resetValues = function () {\n this.currentPanel = null;\n this.previousPanel = null;\n this.nextPanel = null;\n this.timeStampStart = null;\n this.element.style.transform = '';\n util.removeChildren(this.element);\n removeClass([this.element], cls.TRANSLATE_CLASS);\n };\n ScheduleTouch.prototype.destroy = function () {\n if (this.touchObj) {\n this.touchObj.destroy();\n this.touchObj = null;\n }\n EventHandler.remove(this.element, 'transitionend', this.onTransitionEnd);\n this.resetValues();\n };\n return ScheduleTouch;\n}());\nexport { ScheduleTouch };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { KeyboardEvents, closest, EventHandler, extend } from '@syncfusion/ej2-base';\nimport { isNullOrUndefined, addClass, removeClass } from '@syncfusion/ej2-base';\nimport * as event from '../base/constant';\nimport * as util from '../base/util';\nimport * as cls from '../base/css-constant';\n/**\n * Keyboard interaction\n */\nvar KeyboardInteraction = /** @class */ (function () {\n function KeyboardInteraction(parent) {\n this.selectedCells = [];\n this.keyConfigs = {\n downArrow: 'downarrow',\n upArrow: 'uparrow',\n rightArrow: 'rightarrow',\n leftArrow: 'leftarrow',\n shiftDownArrow: 'shift+downarrow',\n shiftUpArrow: 'shift+uparrow',\n shiftRightArrow: 'shift+rightarrow',\n shiftLeftArrow: 'shift+leftarrow',\n ctrlLeftArrow: 'ctrl+leftarrow',\n ctrlRightArrow: 'ctrl+rightarrow',\n altOne: 'alt+1',\n altTwo: 'alt+2',\n altThree: 'alt+3',\n altFour: 'alt+4',\n altFive: 'alt+5',\n altSix: 'alt+6',\n altSeven: 'alt+7',\n altEight: 'alt+8',\n altNine: 'alt+9',\n enter: 'enter',\n escape: 'escape',\n delete: 'delete',\n home: 'home',\n pageUp: 'pageup',\n pageDown: 'pagedown',\n tab: 'tab',\n shiftTab: 'shift+tab',\n ctrlShiftUpArrow: 'ctrl+shift+uparrow',\n ctrlShiftDownArrow: 'ctrl+shift+downarrow',\n ctrlShiftLeftArrow: 'ctrl+shift+leftarrow',\n ctrlShiftRightArrow: 'ctrl+shift+rightarrow'\n };\n this.parent = parent;\n this.parent.element.tabIndex = this.parent.element.tabIndex === -1 ? 0 : this.parent.element.tabIndex;\n this.keyboardModule = new KeyboardEvents(this.parent.element, {\n keyAction: this.keyActionHandler.bind(this),\n keyConfigs: this.keyConfigs,\n eventName: 'keydown'\n });\n this.addEventListener();\n }\n KeyboardInteraction.prototype.keyActionHandler = function (e) {\n switch (e.action) {\n case 'downArrow':\n case 'shiftDownArrow':\n this.processDown(e, e.shiftKey);\n break;\n case 'upArrow':\n case 'shiftUpArrow':\n this.processUp(e, e.shiftKey);\n break;\n case 'leftArrow':\n case 'shiftLeftArrow':\n this.processLeft(e, e.shiftKey);\n break;\n case 'rightArrow':\n case 'shiftRightArrow':\n this.processRight(e, e.shiftKey);\n break;\n case 'ctrlLeftArrow':\n this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);\n if (this.parent.headerModule) {\n this.parent.headerModule.element.querySelector('.e-prev button').focus();\n }\n break;\n case 'ctrlRightArrow':\n this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);\n if (this.parent.headerModule) {\n this.parent.headerModule.element.querySelector('.e-next button').focus();\n }\n break;\n case 'altOne':\n case 'altTwo':\n case 'altThree':\n case 'altFour':\n case 'altFive':\n case 'altSix':\n case 'altSeven':\n case 'altEight':\n case 'altNine':\n this.processViewNavigation(e);\n break;\n case 'enter':\n this.processEnter(e);\n break;\n case 'home':\n this.focusFirstCell();\n break;\n case 'tab':\n case 'shiftTab':\n this.processTab(e, e.shiftKey);\n break;\n case 'delete':\n this.processDelete(e);\n break;\n case 'ctrlShiftUpArrow':\n case 'ctrlShiftDownArrow':\n case 'ctrlShiftLeftArrow':\n case 'ctrlShiftRightArrow':\n this.processCtrlShiftNavigationArrows(e);\n break;\n case 'escape':\n this.processEscape(e);\n }\n };\n KeyboardInteraction.prototype.addEventListener = function () {\n this.parent.on(event.cellMouseDown, this.onCellMouseDown, this);\n };\n KeyboardInteraction.prototype.removeEventListener = function () {\n this.parent.off(event.cellMouseDown, this.onCellMouseDown);\n };\n KeyboardInteraction.prototype.onCellMouseDown = function (e) {\n if (e.event.shiftKey) {\n return;\n }\n this.initialTarget = this.getClosestCell(e.event);\n if (this.parent.activeViewOptions.readonly || this.parent.currentView === 'MonthAgenda' || !this.initialTarget) {\n return;\n }\n if (e.event.target.classList.contains(cls.WORK_CELLS_CLASS) && e.event.which !== 3) {\n this.parent.removeSelectedClass();\n EventHandler.add(this.parent.getContentTable(), 'mousemove', this.onMouseSelection, this);\n EventHandler.add(this.parent.getContentTable(), 'mouseup', this.onMoveUp, this);\n }\n if (e.event.target.classList.contains(cls.ALLDAY_CELLS_CLASS) && e.event.which !== 3) {\n this.parent.removeSelectedClass();\n var allDayRow = this.parent.getAllDayRow();\n EventHandler.add(allDayRow, 'mousemove', this.onMouseSelection, this);\n EventHandler.add(allDayRow, 'mouseup', this.onMoveUp, this);\n }\n };\n KeyboardInteraction.prototype.onMouseSelection = function (e) {\n var appointments = [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS));\n addClass(appointments, 'e-allow-select');\n var selectionEdges = this.parent.boundaryValidation(e.pageY, e.pageX);\n if (selectionEdges.bottom || selectionEdges.top || selectionEdges.left || selectionEdges.right) {\n var parent_1 = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);\n var yInBounds = parent_1.offsetHeight <= parent_1.scrollHeight && parent_1.scrollTop >= 0 &&\n parent_1.scrollTop + parent_1.offsetHeight <= parent_1.scrollHeight;\n var xInBounds = parent_1.offsetWidth <= parent_1.scrollWidth && parent_1.scrollLeft >= 0 &&\n parent_1.scrollLeft + parent_1.offsetWidth <= parent_1.scrollWidth;\n if (yInBounds && (selectionEdges.top || selectionEdges.bottom)) {\n parent_1.scrollTop += selectionEdges.top ? -e.target.offsetHeight : e.target.offsetHeight;\n }\n if (xInBounds && (selectionEdges.left || selectionEdges.right)) {\n parent_1.scrollLeft += selectionEdges.left ? -e.target.offsetWidth : e.target.offsetWidth;\n }\n }\n var target = this.getClosestCell(e);\n if (target) {\n this.selectCells(true, target);\n }\n };\n KeyboardInteraction.prototype.getClosestCell = function (e) {\n return closest(e.target, '.' + cls.WORK_CELLS_CLASS + ',.' + cls.ALLDAY_CELLS_CLASS);\n };\n KeyboardInteraction.prototype.onMoveUp = function (e) {\n var _this = this;\n var appointments = [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS));\n removeClass(appointments, 'e-allow-select');\n if (e.target.classList.contains(cls.WORK_CELLS_CLASS)) {\n EventHandler.remove(this.parent.getContentTable(), 'mousemove', this.onMouseSelection);\n EventHandler.remove(this.parent.getContentTable(), 'mouseup', this.onMoveUp);\n }\n if (e.target.classList.contains(cls.ALLDAY_CELLS_CLASS)) {\n var allDayRow = this.parent.getAllDayRow();\n EventHandler.remove(allDayRow, 'mousemove', this.onMouseSelection);\n EventHandler.remove(allDayRow, 'mouseup', this.onMoveUp);\n }\n if (this.isPreventAction(e)) {\n return;\n }\n var queryStr = '.' + cls.WORK_CELLS_CLASS + ',.' + cls.ALLDAY_CELLS_CLASS + ',.' + cls.HEADER_CELLS_CLASS;\n var target = closest(e.target, queryStr);\n this.parent.activeCellsData = this.getSelectedElements(target);\n var cellData = {};\n if (this.parent.eventWindow) {\n this.parent.eventWindow.convertToEventData(this.parent.activeCellsData, cellData);\n }\n var selectedCells = this.parent.getSelectedElements();\n var args = {\n data: cellData, element: this.parent.activeCellsData.element, event: e,\n requestType: 'cellSelect', showQuickPopup: false\n };\n this.parent.trigger(event.select, args, function (selectArgs) {\n var isPopupShow = selectArgs.showQuickPopup || _this.parent.quickInfoOnSelectionEnd;\n if (isPopupShow && selectedCells.length > 1) {\n var cellArgs = extend(_this.parent.activeCellsData, { cancel: false, event: e, name: 'cellClick' });\n _this.parent.notify(event.cellClick, cellArgs);\n }\n });\n };\n KeyboardInteraction.prototype.processEnter = function (e) {\n if ((this.parent.activeViewOptions.readonly && !e.target.classList.contains(cls.APPOINTMENT_CLASS))\n || this.isPreventAction(e)) {\n return;\n }\n var target = e.target;\n if (closest(target, '.' + cls.POPUP_WRAPPER_CLASS)) {\n if (target.classList.contains(cls.QUICK_POPUP_EVENT_DETAILS_CLASS) ||\n target.classList.contains(cls.EVENT_CREATE_CLASS) ||\n target.classList.contains(cls.EDIT_EVENT_CLASS) ||\n target.classList.contains(cls.DELETE_EVENT_CLASS) ||\n target.classList.contains(cls.CLOSE_CLASS)) {\n target.click();\n e.preventDefault();\n }\n else if (target.classList.contains(cls.SUBJECT_CLASS)) {\n this.parent.element.querySelector('.' + cls.EVENT_CREATE_CLASS).click();\n e.preventDefault();\n }\n return;\n }\n if (target.classList.contains(cls.RESOURCE_CELLS_CLASS) && target.classList.contains(cls.RESOURCE_PARENT_CLASS)) {\n var resourceIcon = target.querySelector('.' + cls.RESOURCE_TREE_ICON_CLASS);\n if (resourceIcon) {\n resourceIcon.click();\n }\n return;\n }\n if (target.classList.contains(cls.WORK_CELLS_CLASS) || target.classList.contains(cls.ALLDAY_CELLS_CLASS)) {\n this.parent.activeCellsData = this.getSelectedElements(target);\n var args = extend(this.parent.activeCellsData, { cancel: false, event: e });\n if (this.parent.allowInline) {\n var inlineArgs = {\n element: args.element,\n groupIndex: args.groupIndex, type: 'Cell'\n };\n this.parent.notify(event.inlineClick, inlineArgs);\n }\n else {\n this.parent.notify(event.cellClick, args);\n }\n return;\n }\n if (target.classList.contains(cls.INLINE_SUBJECT_CLASS)) {\n this.parent.inlineModule.inlineCrudActions(target);\n return;\n }\n if (target.classList.contains(cls.APPOINTMENT_CLASS) || target.classList.contains(cls.MORE_EVENT_CLOSE_CLASS) ||\n target.classList.contains(cls.ALLDAY_APPOINTMENT_SECTION_CLASS) || target.classList.contains(cls.MORE_INDICATOR_CLASS)) {\n target.click();\n return;\n }\n if (target.classList.contains(cls.MORE_EVENT_HEADER_DATE_CLASS)) {\n this.parent.setProperties({ selectedDate: this.parent.getDateFromElement(target) }, true);\n this.parent.changeView(this.parent.getNavigateView(), e);\n this.processEscape(e);\n return;\n }\n };\n KeyboardInteraction.prototype.getSelectedElements = function (target) {\n var cellDetails;\n if (this.selectedCells.length > 1 && target.classList.contains(cls.SELECTED_CELL_CLASS)) {\n var start = this.parent.getCellDetails(this.selectedCells[0]);\n var end = this.parent.getCellDetails(this.selectedCells.slice(-1)[0]);\n start.endTime = end.endTime;\n start.element = target;\n cellDetails = start;\n }\n else {\n cellDetails = this.parent.getCellDetails(target);\n }\n return cellDetails;\n };\n KeyboardInteraction.prototype.getCells = function (isInverseTable, start, end) {\n var tableEle = this.parent.getContentTable();\n var cells = [].slice.call(tableEle.querySelectorAll('td'));\n var maxRow = tableEle.rows.length;\n var maxColumn = tableEle.rows[0].cells.length;\n if (start && start.classList.contains(cls.ALLDAY_CELLS_CLASS)) {\n var allDayRow = this.parent.getAllDayRow();\n cells = [].slice.call(allDayRow.cells);\n maxRow = 1;\n maxColumn = allDayRow.cells.length;\n }\n var startIndex = cells.indexOf(start);\n var endIndex = cells.indexOf(end);\n var inverseCells = [];\n if (isInverseTable) {\n for (var i = 0; i < maxColumn; i++) {\n for (var j = 0; j < maxRow; j++) {\n inverseCells.push(cells[maxColumn * j + i]);\n }\n }\n startIndex = inverseCells.indexOf(start);\n endIndex = inverseCells.indexOf(end);\n }\n if (startIndex > endIndex) {\n var temp = startIndex;\n startIndex = endIndex;\n endIndex = temp;\n }\n var sCells = isInverseTable ? inverseCells : cells;\n return sCells.slice(startIndex, endIndex + 1);\n };\n KeyboardInteraction.prototype.focusFirstCell = function () {\n if (this.parent.currentView === 'Agenda') {\n var focusCell = this.parent.getContentTable().querySelector('.' + cls.AGENDA_CELLS_CLASS);\n focusCell.setAttribute('tabindex', '0');\n focusCell.focus();\n return;\n }\n this.parent.eventBase.removeSelectedAppointmentClass();\n if (this.parent.activeView.isTimelineView()) {\n var cell = this.parent.element.querySelector('.' + cls.CONTENT_TABLE_CLASS +\n ' tr:not(.' + cls.HIDDEN_CLASS + ') .' + cls.WORK_CELLS_CLASS + ':not(.' + cls.RESOURCE_GROUP_CELLS_CLASS + ')');\n this.selectCells(false, cell);\n }\n else {\n this.selectCells(false, this.parent.getWorkCellElements()[0]);\n }\n };\n KeyboardInteraction.prototype.isInverseTableSelect = function () {\n return this.parent.activeView.isInverseTableSelect;\n };\n /**\n * Internal method to select cells\n *\n * @param {boolean} isMultiple Accepts to select multiple cells or not\n * @param {HTMLTableCellElement} targetCell Accepts the target cells\n * @returns {void}\n * @private\n */\n KeyboardInteraction.prototype.selectCells = function (isMultiple, targetCell) {\n var _this = this;\n this.parent.removeSelectedClass();\n var target = (targetCell instanceof Array) ? targetCell.slice(-1)[0] : targetCell;\n if (isMultiple) {\n var initialId_1;\n var views_1 = ['Day', 'Week', 'WorkWeek', 'Month', 'TimelineDay', 'TimelineWeek', 'TimelineWorkWeek', 'TimelineMonth'];\n var args = { element: targetCell, requestType: 'mousemove', allowMultipleRow: true };\n this.parent.inlineModule.removeInlineAppointmentElement();\n this.parent.trigger(event.select, args, function (selectArgs) {\n var allowMultipleRow = (!selectArgs.allowMultipleRow) || (!_this.parent.allowMultiRowSelection);\n if (allowMultipleRow && (views_1.indexOf(_this.parent.currentView) > -1)) {\n target = target.parentElement.children[_this.initialTarget.cellIndex];\n }\n var selectedCells = _this.getCells(_this.isInverseTableSelect(), _this.initialTarget, target);\n if (_this.parent.activeViewOptions.group.resources.length > 0) {\n initialId_1 = _this.initialTarget.getAttribute('data-group-index');\n var resourceSelectedCells = [];\n for (var _i = 0, selectedCells_1 = selectedCells; _i < selectedCells_1.length; _i++) {\n var cell = selectedCells_1[_i];\n if (cell.getAttribute('data-group-index') === initialId_1) {\n resourceSelectedCells.push(cell);\n }\n }\n selectedCells = resourceSelectedCells;\n }\n if (!_this.parent.allowMultiCellSelection) {\n selectedCells = [_this.initialTarget];\n }\n _this.selectedCells = selectedCells;\n if (selectedCells.length > 2 && !target.classList.contains(cls.ALLDAY_CELLS_CLASS)) {\n var allDayCells = _this.getAllDayCells(selectedCells);\n if (_this.parent.activeViewOptions.group.resources.length > 0) {\n var resourceAllDayCells = [];\n for (var _a = 0, allDayCells_1 = allDayCells; _a < allDayCells_1.length; _a++) {\n var cell = allDayCells_1[_a];\n if (cell.getAttribute('data-group-index') === initialId_1) {\n resourceAllDayCells.push(cell);\n }\n }\n allDayCells = resourceAllDayCells;\n }\n selectedCells = selectedCells.concat(allDayCells);\n }\n if ((target.getAttribute('data-group-index') !== initialId_1) && _this.parent.activeViewOptions.group.resources.length > 0) {\n target = _this.selectedCells[_this.selectedCells.length - 1];\n }\n _this.parent.addSelectedClass(selectedCells, target);\n });\n }\n else {\n this.initialTarget = target;\n this.selectedCells = [target];\n this.parent.addSelectedClass([target], target);\n }\n };\n KeyboardInteraction.prototype.selectAppointment = function (isReverse, target) {\n var appointments = this.getAppointmentElements();\n if (appointments.length < 0) {\n return;\n }\n this.parent.eventBase.removeSelectedAppointmentClass();\n var nextAppEle;\n if (target.classList.contains(cls.APPOINTMENT_CLASS)) {\n var targetIndex = appointments.indexOf(target);\n nextAppEle = appointments[(isReverse ? targetIndex - 1 : targetIndex + 1)];\n }\n else {\n nextAppEle = isReverse ? appointments[appointments.length - 1] : appointments[0];\n }\n if (nextAppEle) {\n this.parent.eventBase.addSelectedAppointments([nextAppEle]);\n nextAppEle.focus();\n addClass([nextAppEle], cls.AGENDA_SELECTED_CELL);\n }\n };\n KeyboardInteraction.prototype.selectAppointmentElementFromWorkCell = function (isReverse, target) {\n var _this = this;\n this.parent.eventBase.removeSelectedAppointmentClass();\n this.parent.removeSelectedClass();\n if (target.classList.contains(cls.WORK_CELLS_CLASS) || target.classList.contains(cls.ALLDAY_CELLS_CLASS)) {\n var appointmentElements_1 = this.getUniqueAppointmentElements();\n var filteredElements_1 = [];\n var selectedDate_1 = this.parent.getDateFromElement(target).getTime();\n var selectedSeriesEvents = this.parent.eventsProcessed.filter(function (eventObject) {\n return (!isReverse ? (eventObject[_this.parent.eventFields.startTime].getTime() >= selectedDate_1) :\n (eventObject[_this.parent.eventFields.startTime].getTime() <= selectedDate_1));\n });\n selectedSeriesEvents.filter(function (event) {\n appointmentElements_1.filter(function (element) {\n if (JSON.stringify(event.Guid) === JSON.stringify(element.getAttribute('data-guid'))) {\n filteredElements_1.push(element);\n }\n });\n });\n if (filteredElements_1.length > 0) {\n var selectedElement = isReverse ? filteredElements_1[filteredElements_1.length - 1] : filteredElements_1[0];\n var focusElements = this.getAppointmentElementsByGuid(selectedElement.getAttribute('data-guid'));\n this.parent.eventBase.addSelectedAppointments(focusElements);\n (focusElements[focusElements.length - 1]).focus();\n }\n }\n };\n KeyboardInteraction.prototype.getAllDayCells = function (cells) {\n var allDayRow = this.parent.getAllDayRow();\n if (!allDayRow) {\n return [];\n }\n var startCell = cells[0];\n var endCell = cells[cells.length - 1];\n var start = this.parent.getCellDetails(startCell);\n var end = this.parent.getCellDetails(endCell);\n if (end.endTime.getTime() - start.startTime.getTime() >= util.MS_PER_DAY) {\n var allDayCells = [].slice.call(allDayRow.cells);\n return allDayCells.slice(startCell.cellIndex, endCell.cellIndex + 1);\n }\n return [];\n };\n KeyboardInteraction.prototype.getAppointmentElements = function () {\n return [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS));\n };\n KeyboardInteraction.prototype.getAppointmentElementsByGuid = function (guid) {\n return [].slice.call(this.parent.element.querySelectorAll('div[data-guid=\"' + guid + '\"]'));\n };\n KeyboardInteraction.prototype.getUniqueAppointmentElements = function () {\n var appointments = this.getAppointmentElements();\n var appointmentElements = [];\n appointments.map(function (value) { return value.getAttribute('data-guid'); }).filter(function (value, index, self) {\n if (self.indexOf(value) === index) {\n appointmentElements.push(appointments[index]);\n }\n });\n return appointmentElements;\n };\n KeyboardInteraction.prototype.getWorkCellFromAppointmentElement = function (target) {\n var selectedObject = this.parent.eventBase.getEventByGuid(target.getAttribute('data-guid'));\n return this.parent.eventBase.selectWorkCellByTime([selectedObject]);\n };\n KeyboardInteraction.prototype.processViewNavigation = function (e) {\n var index = parseInt(e.key, 10) - 1;\n if (index < this.parent.views.length) {\n var view = this.parent.viewCollections[index].option;\n this.parent.changeView(view, e, undefined, index);\n if (this.parent.headerModule) {\n this.parent.headerModule.element.querySelector('.e-active-view button').focus();\n }\n }\n };\n KeyboardInteraction.prototype.processUp = function (e, isMultiple) {\n if ((isMultiple && (this.parent.activeView.isTimelineView() || this.parent.currentView === 'MonthAgenda'))) {\n return;\n }\n var target = (e.target);\n var selectedElements = this.parent.getSelectedElements();\n var selectedEventElements = this.parent.eventBase.getSelectedAppointments();\n var moreEventWrapper = this.parent.element.querySelector('.' + cls.MORE_POPUP_WRAPPER_CLASS);\n var quickPopupWrapper = this.getQuickPopupElement();\n if (selectedElements.length > 0 && !e.target.classList.contains(cls.WORK_CELLS_CLASS)) {\n target = selectedElements[selectedElements.length - 1];\n }\n if (selectedEventElements.length > 0 && !moreEventWrapper.classList.contains(cls.POPUP_OPEN) &&\n !quickPopupWrapper.classList.contains(cls.POPUP_OPEN) &&\n ['Day', 'Week', 'WorkWeek', 'Month'].indexOf(this.parent.currentView) !== -1) {\n target = this.getWorkCellFromAppointmentElement(selectedEventElements[selectedEventElements.length - 1]);\n this.parent.eventBase.removeSelectedAppointmentClass();\n }\n if (!target) {\n return;\n }\n if (target.classList.contains(cls.WORK_CELLS_CLASS) && !this.parent.element.querySelector('.' + cls.POPUP_OPEN)) {\n var tableRows = this.parent.getTableRows();\n var curRowIndex = tableRows.indexOf(target.parentElement);\n if (curRowIndex > 0 && curRowIndex < tableRows.length) {\n this.selectCells(isMultiple, (tableRows[curRowIndex - 1]).cells[target.cellIndex]);\n }\n }\n else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {\n this.selectAppointment(true, target);\n }\n };\n KeyboardInteraction.prototype.processDown = function (e, isMultiple) {\n if (isMultiple && (this.parent.activeView.isTimelineView() || this.parent.currentView === 'MonthAgenda')) {\n return;\n }\n var target = (e.target);\n var selectedCells = this.parent.getSelectedElements();\n var selectedElements = this.parent.eventBase.getSelectedAppointments();\n var moreEventWrapper = this.parent.element.querySelector('.' + cls.MORE_POPUP_WRAPPER_CLASS);\n var quickPopupWrapper = this.getQuickPopupElement();\n if (selectedCells.length > 0 && !e.target.classList.contains(cls.WORK_CELLS_CLASS)) {\n target = selectedCells[selectedCells.length - 1];\n }\n if (selectedElements.length > 0 && !moreEventWrapper.classList.contains(cls.POPUP_OPEN) &&\n !quickPopupWrapper.classList.contains(cls.POPUP_OPEN) &&\n ['Day', 'Week', 'WorkWeek', 'Month'].indexOf(this.parent.currentView) !== -1) {\n target = this.getWorkCellFromAppointmentElement(selectedElements[selectedElements.length - 1]);\n this.parent.eventBase.removeSelectedAppointmentClass();\n }\n var tableRows = this.parent.getTableRows();\n if (!target) {\n return;\n }\n if (target.classList.contains(cls.WORK_CELLS_CLASS) && !this.parent.element.querySelector('.' + cls.POPUP_OPEN)) {\n var curRowIndex = tableRows.indexOf(target.parentElement);\n if (curRowIndex >= 0 && curRowIndex < tableRows.length - 1) {\n this.selectCells(isMultiple, (tableRows[curRowIndex + 1]).cells[target.cellIndex]);\n }\n }\n else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {\n this.selectAppointment(false, target);\n }\n };\n KeyboardInteraction.prototype.processLeftRight = function (target) {\n var tableEle = this.parent.getContentTable();\n var curRowIndex = target.parentNode.sectionRowIndex;\n var key = {\n element: tableEle,\n rowIndex: curRowIndex,\n columnIndex: target.cellIndex,\n maxIndex: tableEle.rows[curRowIndex].cells.length\n };\n return key;\n };\n KeyboardInteraction.prototype.getQuickPopupElement = function () {\n return (this.parent.isAdaptive ? document.body : this.parent.element).querySelector('.' + cls.POPUP_WRAPPER_CLASS);\n };\n KeyboardInteraction.prototype.isCancelLeftRightAction = function (e, isMultiple) {\n if (this.parent.currentView === 'Agenda' || (isMultiple && this.parent.currentView === 'MonthAgenda')) {\n return true;\n }\n if (this.isPreventAction(e) && isMultiple) {\n return true;\n }\n var moreEventWrapper = this.parent.element.querySelector('.' + cls.MORE_POPUP_WRAPPER_CLASS);\n var quickPopupWrapper = this.getQuickPopupElement();\n if (moreEventWrapper.classList.contains(cls.POPUP_OPEN) || quickPopupWrapper.classList.contains(cls.POPUP_OPEN)) {\n return true;\n }\n return false;\n };\n KeyboardInteraction.prototype.processRight = function (e, isMultiple) {\n if (this.isCancelLeftRightAction(e, isMultiple)) {\n return;\n }\n var selectedCells = this.parent.getSelectedElements();\n var targetCell;\n var selectedAppointments = this.parent.eventBase.getSelectedAppointments();\n var target = (e.target);\n if (selectedCells.length > 0 && !target.classList.contains(cls.WORK_CELLS_CLASS) &&\n !target.classList.contains(cls.ALLDAY_CELLS_CLASS)) {\n target = selectedCells[selectedCells.length - 1];\n }\n if (selectedAppointments.length > 0) {\n target = this.getWorkCellFromAppointmentElement(selectedAppointments[selectedAppointments.length - 1]);\n this.parent.eventBase.removeSelectedAppointmentClass();\n if (!target) {\n return;\n }\n }\n if (target.classList.contains(cls.WORK_CELLS_CLASS) &&\n (e.target).classList.contains(cls.WORK_CELLS_CLASS)) {\n var key = this.processLeftRight(target);\n if (key.columnIndex >= 0 && key.columnIndex < key.maxIndex - 1) {\n targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex].cells[target.cellIndex + 1], 'right');\n if (!isNullOrUndefined(targetCell)) {\n this.selectCells(isMultiple, targetCell);\n }\n }\n else if (key.columnIndex === key.maxIndex - 1) {\n if (!this.isInverseTableSelect() && key.rowIndex < key.element.rows.length - 1) {\n targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex + 1].cells[0], 'right');\n if (!isNullOrUndefined(targetCell)) {\n this.selectCells(isMultiple, targetCell);\n }\n }\n else if (!isMultiple) {\n var rowIndex = this.isInverseTableSelect() ? key.rowIndex : 0;\n this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);\n var tableEle = this.parent.getContentTable();\n this.selectCells(false, tableEle.rows[rowIndex].cells[0]);\n }\n }\n }\n else if (target.classList.contains(cls.ALLDAY_CELLS_CLASS)) {\n var curColIndex = target.cellIndex;\n var allDayRow = this.parent.getAllDayRow();\n var maxColIndex = allDayRow.cells.length;\n if (curColIndex >= 0 && curColIndex < maxColIndex - 1) {\n this.selectCells(isMultiple, allDayRow.cells[curColIndex + 1]);\n }\n else if (curColIndex === maxColIndex - 1 && !isMultiple) {\n this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);\n var allDayRow_1 = this.parent.getAllDayRow();\n this.selectCells(false, allDayRow_1.cells[0]);\n }\n }\n };\n KeyboardInteraction.prototype.processLeft = function (e, isMultiple) {\n if (this.isCancelLeftRightAction(e, isMultiple)) {\n return;\n }\n var target = (e.target);\n var selectedCells = this.parent.getSelectedElements();\n var targetCell;\n if (selectedCells.length > 0 && !target.classList.contains(cls.WORK_CELLS_CLASS) &&\n !target.classList.contains(cls.ALLDAY_CELLS_CLASS)) {\n target = selectedCells[selectedCells.length - 1];\n }\n var selectedElements = this.parent.eventBase.getSelectedAppointments();\n if (selectedElements.length > 0) {\n target = this.getWorkCellFromAppointmentElement(selectedElements[selectedElements.length - 1]);\n this.parent.eventBase.removeSelectedAppointmentClass();\n if (!target) {\n return;\n }\n }\n if ((e.target).classList.contains(cls.WORK_CELLS_CLASS) &&\n target.classList.contains(cls.WORK_CELLS_CLASS)) {\n var key = this.processLeftRight(target);\n if (key.columnIndex > 0 && key.columnIndex < key.maxIndex) {\n targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex].cells[target.cellIndex - 1], 'left');\n if (!isNullOrUndefined(targetCell)) {\n this.selectCells(isMultiple, targetCell);\n }\n }\n else if (key.columnIndex === 0) {\n if (!this.isInverseTableSelect() && key.rowIndex > 0) {\n targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex - 1].cells[key.maxIndex - 1], 'left');\n if (!isNullOrUndefined(targetCell)) {\n this.selectCells(isMultiple, targetCell);\n }\n }\n else if (!isMultiple) {\n this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);\n var tableEle = this.parent.getContentTable();\n var rowIndex = this.isInverseTableSelect() ? key.rowIndex : tableEle.rows.length - 1;\n this.selectCells(false, tableEle.rows[rowIndex].cells[key.maxIndex - 1]);\n }\n }\n }\n else if (target.classList.contains(cls.ALLDAY_CELLS_CLASS)) {\n var curColIndex = target.cellIndex;\n var allDayRow = this.parent.getAllDayRow();\n var maxColIndex = allDayRow.cells.length;\n if (curColIndex > 0 && curColIndex < maxColIndex) {\n this.selectCells(isMultiple, allDayRow.cells[curColIndex - 1]);\n }\n else if (curColIndex === 0 && !isMultiple) {\n this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);\n var allDayRow_2 = this.parent.getAllDayRow();\n this.selectCells(false, allDayRow_2.cells[maxColIndex - 1]);\n }\n }\n };\n KeyboardInteraction.prototype.calculateNextPrevDate = function (currentCell, target, type) {\n var initialId = this.initialTarget.getAttribute('data-group-index');\n if (this.parent.activeViewOptions.group.resources.length > 0 && this.parent.currentView === 'Month') {\n if (currentCell && target && target.getAttribute('data-group-index') !== initialId) {\n var currentDate = this.parent.getDateFromElement(currentCell);\n var nextPrevDate = (type === 'right') ? new Date(currentDate.setDate(currentDate.getDate() + 1))\n : new Date(currentDate.setDate(currentDate.getDate() - 1));\n target = [].slice.call(this.parent.element.querySelectorAll('td[data-date=\"'\n + nextPrevDate.getTime().toString() + '\"]' + '[data-group-index=\"' + initialId + '\"]'))[0];\n }\n }\n return target;\n };\n KeyboardInteraction.prototype.getFocusableElements = function (container) {\n var queryString = 'a[href]:not([tabindex=\"-1\"]),input:not([disabled]):not([tabindex=\"-1\"]),' +\n 'textarea:not([disabled]):not([tabindex=\"-1\"]),button:not([disabled]):not([tabindex=\"-1\"]),' +\n 'select:not([disabled]):not([tabindex=\"-1\"]),[tabindex]:not([tabindex=\"-1\"]),[contentEditable=true]:not([tabindex=\"-1\"])';\n return [].slice.call(container.querySelectorAll(queryString));\n };\n KeyboardInteraction.prototype.processTabOnPopup = function (e, popupElement) {\n var _this = this;\n var focusableElements = this.getFocusableElements(popupElement);\n focusableElements = focusableElements.filter(function (element) {\n var footerEle = _this.parent.element.querySelector('.' + cls.POPUP_FOOTER_CLASS);\n if (footerEle && footerEle.offsetParent) {\n return !(element.classList.contains(cls.EDIT_CLASS) || element.classList.contains(cls.DELETE_CLASS));\n }\n else {\n return !(element.classList.contains(cls.EDIT_EVENT_CLASS) || element.classList.contains(cls.DELETE_EVENT_CLASS));\n }\n });\n var firstEle = focusableElements[0];\n var lastEle = focusableElements[focusableElements.length - 1];\n if (!isNullOrUndefined(lastEle) && document.activeElement === lastEle && !e.shiftKey) {\n e.preventDefault();\n firstEle.focus();\n }\n if (!isNullOrUndefined(firstEle) && document.activeElement === firstEle && e.shiftKey) {\n e.preventDefault();\n lastEle.focus();\n }\n };\n KeyboardInteraction.prototype.processTab = function (e, isReverse) {\n var target = e.target;\n var popupWrapper = closest(target, '.' + cls.POPUP_WRAPPER_CLASS + ',.' + cls.MORE_POPUP_WRAPPER_CLASS);\n if (popupWrapper && popupWrapper.classList.contains(cls.POPUP_OPEN)) {\n if (popupWrapper.classList.contains(cls.MORE_POPUP_WRAPPER_CLASS)) {\n this.parent.eventBase.removeSelectedAppointmentClass();\n }\n this.processTabOnPopup(e, popupWrapper);\n return;\n }\n if (target.classList.contains(cls.ROOT)) {\n this.parent.eventBase.removeSelectedAppointmentClass();\n return;\n }\n if (target.classList.contains(cls.RESOURCE_CELLS_CLASS) && this.parent.activeView.isTimelineView()\n && this.parent.activeViewOptions.group.resources.length > 0) {\n var index = parseInt(target.getAttribute('data-group-index'), 10);\n var appSelector = \".\" + cls.APPOINTMENT_CLASS + \"[data-group-index=\\\"\" + (isReverse ? index - 1 : index) + \"\\\"]\";\n var appElements = [].slice.call(this.parent.element.querySelectorAll(appSelector));\n if (appElements.length > 0) {\n this.parent.eventBase.removeSelectedAppointmentClass();\n var focusAppointment = isReverse ? appElements.slice(-1)[0] : appElements[0];\n this.parent.eventBase.addSelectedAppointments([focusAppointment]);\n focusAppointment.focus();\n e.preventDefault();\n }\n else if (index + 1 === this.parent.resourceBase.lastResourceLevel.length) {\n this.parent.element.focus();\n e.preventDefault();\n }\n else if (this.parent.virtualScrollModule) {\n var virtual = this.parent.element.querySelector('.' + cls.VIRTUAL_TRACK_CLASS);\n var averageRowHeight = Math.round(virtual.offsetHeight / this.parent.resourceBase.expandedResources.length);\n this.parent.element.querySelector('.e-content-wrap').scrollTop = ((isReverse ? index - 1 : index + 1) * averageRowHeight);\n this.parent.virtualScrollModule.virtualScrolling();\n }\n else {\n this.setScrollPosition(index);\n }\n return;\n }\n if (target.classList.contains(cls.APPOINTMENT_CLASS)) {\n var appElements = [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS));\n if (this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.group.resources.length > 0) {\n var index = parseInt(target.getAttribute('data-group-index'), 10);\n appElements = [].slice.call(this.parent.element.querySelectorAll(\".\" + cls.APPOINTMENT_CLASS + \"[data-group-index=\\\"\" + index + \"\\\"]\"));\n var resCellSelector = \".\" + cls.RESOURCE_CELLS_CLASS + \"[data-group-index=\\\"\" + (isReverse ? index : index + 1) + \"\\\"]\";\n var resourceCell = this.parent.element.querySelector(resCellSelector);\n if (resourceCell && (isReverse && target.getAttribute('data-guid') === appElements[0].getAttribute('data-guid') ||\n !isReverse && target.getAttribute('data-guid') === appElements.slice(-1)[0].getAttribute('data-guid'))) {\n this.parent.eventBase.removeSelectedAppointmentClass();\n if (this.parent.virtualScrollModule) {\n resourceCell.focus({ preventScroll: true });\n }\n else {\n resourceCell.focus();\n }\n if (this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.group.resources.length > 0 &&\n isNullOrUndefined(this.parent.virtualScrollModule)) {\n this.setScrollPosition(index);\n }\n e.preventDefault();\n return;\n }\n }\n var selectedAppointments = this.parent.eventBase.getSelectedAppointments();\n if (selectedAppointments.length > 0) {\n target = selectedAppointments[selectedAppointments.length - 1];\n }\n this.parent.eventBase.removeSelectedAppointmentClass();\n if (!isReverse && target.getAttribute('data-guid') === appElements[appElements.length - 1].getAttribute('data-guid') ||\n isReverse && target.getAttribute('data-guid') === appElements[0].getAttribute('data-guid')) {\n return;\n }\n if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {\n this.selectAppointment(isReverse, target);\n e.preventDefault();\n }\n return;\n }\n var selectedCells = this.parent.getSelectedElements();\n if (selectedCells.length > 0 && !target.classList.contains(cls.APPOINTMENT_CLASS)) {\n target = selectedCells[selectedCells.length - 1];\n this.selectAppointmentElementFromWorkCell(isReverse, target);\n e.preventDefault();\n return;\n }\n if (target && !target.classList.contains(cls.RESOURCE_CELLS_CLASS) && this.parent.activeView.isTimelineView()\n && this.parent.activeViewOptions.group.resources.length > 0) {\n this.processTabOnResourceCells(target, isReverse);\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n KeyboardInteraction.prototype.processDelete = function (e) {\n var activeEle = document.activeElement;\n if (this.parent.currentView === 'MonthAgenda') {\n var selectedEle = this.parent.eventBase.getSelectedEvents().element;\n activeEle = ((selectedEle && isNullOrUndefined(selectedEle.length)) ? selectedEle : selectedEle[0]);\n }\n if (activeEle && activeEle.classList.contains(cls.APPOINTMENT_CLASS)) {\n addClass([activeEle], cls.APPOINTMENT_BORDER);\n this.parent.activeEventData = this.parent.eventBase.getSelectedEvents();\n if (this.parent.activeViewOptions.readonly || activeEle.classList.contains(cls.READ_ONLY) ||\n !this.parent.eventSettings.allowDeleting) {\n return;\n }\n this.parent.quickPopup.deleteClick(e);\n }\n };\n KeyboardInteraction.prototype.processCtrlShiftNavigationArrows = function (e) {\n if (this.parent.activeViewOptions.group.resources.length > 0 && document.activeElement.classList.contains(cls.APPOINTMENT_CLASS)) {\n var groupIndex = parseInt(document.activeElement.getAttribute('data-group-index'), 10);\n var index = (e.action === 'ctrlShiftLeftArrow' || e.action === 'ctrlShiftUpArrow') ? groupIndex - 1 : groupIndex + 1;\n index = index < 0 ? 0 : index > this.parent.resourceBase.lastResourceLevel.length ?\n this.parent.resourceBase.lastResourceLevel.length : index;\n var eventEle = [];\n while (eventEle.length === 0 && index >= 0 && index <= this.parent.resourceBase.lastResourceLevel.length) {\n eventEle = [].slice.call(this.parent.element.querySelectorAll(\".\" + cls.APPOINTMENT_CLASS + \"[data-group-index=\\\"\" + index + \"\\\"]\"));\n index = (e.action === 'ctrlShiftLeftArrow' || e.action === 'ctrlShiftUpArrow') ? index - 1 : index + 1;\n }\n var nextAppEle = eventEle[0];\n if (nextAppEle) {\n this.parent.eventBase.removeSelectedAppointmentClass();\n this.parent.eventBase.addSelectedAppointments([nextAppEle]);\n nextAppEle.focus();\n }\n }\n else if (this.parent.activeViewOptions.group.resources.length > 0 &&\n !document.activeElement.classList.contains(cls.APPOINTMENT_CLASS)) {\n var index = this.parent.resourceBase.renderedResources[0].groupIndex;\n var appSelector = \".\" + cls.APPOINTMENT_CLASS + \"[data-group-index=\\\"\" + index + \"\\\"]\";\n var appElements = [].slice.call(this.parent.element.querySelectorAll(appSelector));\n if (appElements.length > 0) {\n this.parent.eventBase.removeSelectedAppointmentClass();\n var focusAppointment = appElements[0];\n this.parent.eventBase.addSelectedAppointments([focusAppointment]);\n focusAppointment.focus();\n e.preventDefault();\n }\n }\n };\n KeyboardInteraction.prototype.processEscape = function (event) {\n this.parent.quickPopup.onClosePopup(event);\n this.parent.quickPopup.morePopup.hide();\n if (this.parent.headerModule) {\n this.parent.headerModule.hideHeaderPopup();\n }\n if (this.parent.inlineModule) {\n this.parent.inlineModule.removeInlineAppointmentElement();\n }\n };\n KeyboardInteraction.prototype.isPreventAction = function (e) {\n var target = closest(e.target, '.' + cls.RESOURCE_GROUP_CELLS_CLASS);\n if (this.parent.activeView.isTimelineView() && !isNullOrUndefined(target)) {\n return true;\n }\n return false;\n };\n KeyboardInteraction.prototype.processTabOnResourceCells = function (target, isReverse) {\n var tabElements = [].slice.call(this.parent.element.querySelectorAll('[tabIndex=\"0\"]'));\n var currentTabIndex = tabElements.indexOf(target);\n var nextTabElement = !isReverse ? tabElements[currentTabIndex + 1] : tabElements[currentTabIndex - 1];\n if (nextTabElement && nextTabElement.classList.contains(cls.RESOURCE_CELLS_CLASS)) {\n var groupIndex = parseInt(nextTabElement.getAttribute('data-group-index'), 10);\n if (this.parent.virtualScrollModule) {\n var resColWrap_1 = this.parent.element.querySelector('.' + cls.RESOURCE_COLUMN_WRAP_CLASS);\n var resCells = [].slice.call(this.parent.element.querySelectorAll('.' + cls.RESOURCE_CELLS_CLASS));\n resCells.forEach(function (element) {\n if (element.getBoundingClientRect().top < resColWrap_1.getBoundingClientRect().top) {\n element.setAttribute('tabindex', '-1');\n }\n });\n }\n else {\n this.setScrollPosition(groupIndex);\n }\n }\n };\n KeyboardInteraction.prototype.setScrollPosition = function (index) {\n var workCell = this.parent.element.querySelector(\".\" + cls.WORK_CELLS_CLASS + \"[data-group-index=\\\"\" + index + \"\\\"]\");\n if (workCell) {\n this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS).scrollTop = workCell.offsetTop;\n }\n };\n /**\n * Get module name.\n *\n * @returns {string} Returns the module name.\n */\n KeyboardInteraction.prototype.getModuleName = function () {\n return 'keyboard';\n };\n /**\n * To destroy the keyboard module.\n *\n * @returns {void}\n * @private\n */\n KeyboardInteraction.prototype.destroy = function () {\n this.removeEventListener();\n this.keyboardModule.destroy();\n };\n return KeyboardInteraction;\n}());\nexport { KeyboardInteraction };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Query, DataManager } from '@syncfusion/ej2-data';\n/**\n * data module is used to generate query and data source.\n *\n * @private\n */\nvar Data = /** @class */ (function () {\n /**\n * Constructor for data module\n *\n * @param {Object | DataManager} dataSource Accepts the datasource as JSON objects or DataManager\n * @param {Query} query Accepts the query to process the data\n * @private\n */\n function Data(dataSource, query) {\n this.initDataManager(dataSource, query);\n }\n /**\n * The function used to initialize dataManager and query\n *\n * @param {Object | DataManager} dataSource Accepts the datasource as JSON objects or DataManager\n * @param {Query} query Accepts the query to process the data\n * @returns {void}\n * @private\n */\n Data.prototype.initDataManager = function (dataSource, query) {\n this.dataManager = dataSource instanceof DataManager ? dataSource : new DataManager(dataSource);\n this.query = query instanceof Query ? query : new Query();\n };\n /**\n * The function used to generate updated Query from schedule model\n *\n * @param {Date} startDate Accepts the start date\n * @param {Date} endDate Accepts the end date\n * @returns {void}\n * @private\n */\n Data.prototype.generateQuery = function (startDate, endDate) {\n var query = this.query.clone();\n if (startDate) {\n query.addParams('StartDate', startDate.toISOString());\n }\n if (endDate) {\n query.addParams('EndDate', endDate.toISOString());\n }\n return query;\n };\n /**\n * The function used to get dataSource by executing given Query\n *\n * @param {Query} query - A Query that specifies to generate dataSource\n * @returns {void}\n * @private\n */\n Data.prototype.getData = function (query) {\n return this.dataManager.executeQuery(query);\n };\n /**\n * To destroy the crud module.\n *\n * @returns {void}\n * @private\n */\n Data.prototype.destroy = function () {\n this.dataManager = null;\n this.query = null;\n };\n return Data;\n}());\nexport { Data };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { addClass, createElement, closest, remove, removeClass } from '@syncfusion/ej2-base';\nimport { VerticalEvent } from '../event-renderer/vertical-view';\nimport { MonthEvent } from '../event-renderer/month';\nimport { TimelineEvent } from '../event-renderer/timeline-view';\nimport * as cls from '../base/css-constant';\nimport * as events from '../base/constant';\nimport * as util from '../base/util';\n/**\n * Inline Edit interactions\n */\nvar InlineEdit = /** @class */ (function () {\n function InlineEdit(parent) {\n this.parent = parent;\n this.parent.on(events.inlineClick, this.inlineEdit, this);\n }\n InlineEdit.prototype.inlineEdit = function (args) {\n if (this.parent.quickPopup) {\n this.parent.quickPopup.quickPopupHide();\n }\n var moreWrapper = this.parent.element.querySelector('.e-more-popup-wrapper ');\n if (moreWrapper && moreWrapper.classList.contains(cls.POPUP_OPEN)) {\n this.parent.quickPopup.morePopup.hide();\n }\n if (args.type === 'Cell') {\n this.removeInlineAppointmentElement();\n this.cellEdit(args);\n }\n else {\n if (this.parent.element.querySelector('.' + cls.INLINE_SUBJECT_CLASS) !==\n args.element.querySelector('.' + cls.INLINE_SUBJECT_CLASS)) {\n this.removeInlineAppointmentElement();\n }\n this.eventEdit(args);\n }\n };\n InlineEdit.prototype.cellEdit = function (args) {\n var saveObj = this.generateEventData();\n var cellIndex = args.element.cellIndex;\n var count = this.getEventDaysCount(saveObj);\n if (count > 1) {\n count = Math.round(count);\n count--;\n cellIndex = cellIndex - count;\n }\n var start = util.resetTime(new Date('' + saveObj[this.parent.eventFields.startTime])).getTime();\n var end = util.resetTime(new Date('' + saveObj[this.parent.eventFields.endTime])).getTime();\n var resIndex = args.groupIndex || 0;\n if (this.parent.currentView === 'Day' || this.parent.currentView === 'Week' || this.parent.currentView === 'WorkWeek') {\n var dayIndex = saveObj[this.parent.eventFields.startTime].getDay();\n this.createVerticalViewInline(saveObj, dayIndex, resIndex, cellIndex);\n }\n else if (this.parent.currentView === 'Month') {\n this.createMonthViewInline(saveObj, resIndex, start, end);\n }\n else {\n this.createTimelineViewInline(saveObj, start, end, resIndex);\n }\n var inlineSubject = this.parent.element.querySelector('.' + cls.INLINE_SUBJECT_CLASS);\n if (inlineSubject) {\n inlineSubject.focus();\n }\n };\n InlineEdit.prototype.eventEdit = function (args) {\n var inlineSubject = args.element.querySelector('.' + cls.INLINE_SUBJECT_CLASS);\n var subject;\n if (inlineSubject) {\n subject = inlineSubject.value;\n }\n else {\n var subEle = args.element.querySelector('.' + cls.SUBJECT_CLASS);\n var timeEle = args.element.querySelector('.' + cls.APPOINTMENT_TIME);\n subject = subEle.innerText;\n inlineSubject = createElement('input', { className: cls.INLINE_SUBJECT_CLASS, attrs: { value: subject } });\n addClass([subEle], cls.DISABLE_CLASS);\n if (closest(args.element, '.' + cls.MORE_POPUP_WRAPPER_CLASS)) {\n args.element.insertBefore(inlineSubject, subEle);\n }\n else if (['Agenda', 'MonthAgenda'].indexOf(this.parent.currentView) > -1) {\n var subjectWrap = args.element.querySelector('.' + cls.SUBJECT_WRAP);\n subjectWrap.insertBefore(inlineSubject, subjectWrap.firstChild);\n }\n else {\n var elementSelector = ['TimelineDay', 'TimelineWeek', 'TimelineWorkWeek', 'TimelineMonth'].indexOf(this.parent.currentView) > -1 ?\n '.e-inner-wrap' : '.e-appointment-details';\n args.element.querySelector(elementSelector).insertBefore(inlineSubject, timeEle);\n }\n }\n inlineSubject.focus();\n inlineSubject.setSelectionRange(subject.length, subject.length);\n };\n InlineEdit.prototype.createVerticalViewInline = function (saveObj, dayIndex, resIndex, daysCount) {\n var _a;\n var count = this.getEventDaysCount(saveObj);\n var verticalEvent = new VerticalEvent(this.parent);\n verticalEvent.initializeValues();\n var index = verticalEvent.dateRender[resIndex].map(function (date) { return date.getDay(); }).indexOf(dayIndex);\n if (count >= 1) {\n verticalEvent.allDayElement = [].slice.call(this.parent.element.querySelectorAll('.' + cls.ALLDAY_CELLS_CLASS));\n (_a = verticalEvent.slots).push.apply(_a, this.parent.activeView.renderDates.map(function (date) { return +date; }));\n var allDayElements = [].slice.call(this.parent.element.querySelectorAll('.' + cls.ALLDAY_APPOINTMENT_CLASS));\n var allDayLevel = 0;\n if (allDayElements.length > 0) {\n allDayLevel = Math.floor(this.parent.element.querySelector('.' + cls.ALLDAY_ROW_CLASS).getBoundingClientRect().height /\n allDayElements[0].offsetHeight) - 1;\n }\n verticalEvent.allDayLevel = allDayLevel;\n verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline);\n }\n else {\n verticalEvent.renderNormalEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline);\n }\n };\n InlineEdit.prototype.createMonthViewInline = function (saveObj, index, start, end) {\n var count = this.getEventDaysCount(saveObj);\n var saveObject = this.parent.eventBase.cloneEventObject(saveObj, start, end, count, false, false);\n var monthEvent = new MonthEvent(this.parent);\n monthEvent.dateRender = this.parent.activeView.renderDates;\n monthEvent.inlineValue = this.parent.allowInline;\n var renderDates = this.parent.activeView.renderDates;\n var workDays = this.parent.activeViewOptions.workDays;\n var monthCellSelector = '.' + cls.WORK_CELLS_CLASS;\n if (this.parent.activeViewOptions.group.resources.length > 0) {\n monthCellSelector += '[data-group-index=\"' + index + '\"]';\n var resourceData = this.parent.resourceBase.lastResourceLevel[index];\n renderDates = resourceData.renderDates;\n workDays = resourceData.workDays;\n }\n monthEvent.workCells = [].slice.call(this.parent.element.querySelectorAll(monthCellSelector));\n monthEvent.cellWidth = monthEvent.workCells[0].offsetWidth;\n monthEvent.cellHeight = monthEvent.workCells[0].offsetHeight;\n monthEvent.eventHeight = util.getElementHeightFromClass(this.parent.monthModule.element, cls.APPOINTMENT_CLASS);\n monthEvent.getSlotDates(workDays);\n var filteredDates = monthEvent.getRenderedDates(renderDates);\n var spannedEvents = monthEvent.splitEvent(saveObject, filteredDates || renderDates);\n for (var _i = 0, spannedEvents_1 = spannedEvents; _i < spannedEvents_1.length; _i++) {\n var eventData = spannedEvents_1[_i];\n monthEvent.renderEvents(eventData, index);\n }\n var inlineSubject = this.parent.element.querySelector('.' + cls.INLINE_SUBJECT_CLASS);\n inlineSubject.focus();\n };\n InlineEdit.prototype.createTimelineViewInline = function (saveObj, start, end, resIndex) {\n var count = this.getEventDaysCount(saveObj);\n var saveObject = this.parent.eventBase.cloneEventObject(saveObj, start, end, count, false, false);\n var timelineView = new TimelineEvent(this.parent, this.parent.activeViewOptions.timeScale.enable ? 'hour' : 'day');\n timelineView.dateRender = this.parent.activeView.renderDates;\n timelineView.eventContainers = [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CONTAINER_CLASS));\n var workCell = this.parent.element.querySelector('.' + cls.WORK_CELLS_CLASS);\n timelineView.inlineValue = this.parent.allowInline;\n timelineView.cellWidth = workCell.offsetWidth;\n timelineView.cellHeight = workCell.offsetHeight;\n var dayLength = this.parent.element.querySelectorAll('.' + cls.CONTENT_TABLE_CLASS + ' tbody tr').length === 0 ?\n 0 : this.parent.element.querySelectorAll('.' + cls.CONTENT_TABLE_CLASS + ' tbody tr')[0].children.length;\n timelineView.slotsPerDay = dayLength / timelineView.dateRender.length;\n timelineView.eventHeight = util.getElementHeightFromClass(timelineView.element, cls.APPOINTMENT_CLASS);\n timelineView.renderEvents(saveObject, resIndex);\n };\n InlineEdit.prototype.getEventDaysCount = function (saveObj) {\n var startDate = saveObj[this.parent.eventFields.startTime];\n var endDate = saveObj[this.parent.eventFields.endTime];\n var daysCount = Math.abs(endDate.getTime() - startDate.getTime()) / util.MS_PER_DAY;\n return daysCount;\n };\n InlineEdit.prototype.generateEventData = function (target) {\n var inlineElement = this.parent.element.querySelector('.' + cls.INLINE_SUBJECT_CLASS);\n var subject = inlineElement ? inlineElement.value : target ? target.innerHTML : '';\n var saveObj = {};\n saveObj[this.parent.eventFields.id] = this.parent.eventBase.getEventMaxID();\n saveObj[this.parent.eventFields.subject] = subject;\n saveObj[this.parent.eventFields.startTime] = this.parent.activeCellsData.startTime;\n saveObj[this.parent.eventFields.endTime] = this.parent.activeCellsData.endTime;\n saveObj[this.parent.eventFields.isAllDay] = this.parent.activeCellsData.isAllDay;\n this.parent.eventWindow.setDefaultValueToObject(saveObj);\n if (this.parent.resourceBase) {\n this.parent.resourceBase.setResourceValues(saveObj, this.parent.activeCellsData.groupIndex);\n }\n return saveObj;\n };\n InlineEdit.prototype.documentClick = function () {\n var target = this.parent.element.querySelector('.' + cls.INLINE_SUBJECT_CLASS);\n if (target && target.value !== '') {\n this.inlineCrudActions(target);\n }\n };\n InlineEdit.prototype.inlineCrudActions = function (target) {\n if (closest(target, '.' + cls.INLINE_APPOINTMENT_CLASS)) {\n var saveObj = this.generateEventData(target);\n this.parent.addEvent(saveObj);\n }\n else {\n var eventTarget = closest(target, '.' + cls.APPOINTMENT_CLASS);\n var eventDetails = this.parent.getEventDetails(eventTarget);\n eventDetails[this.parent.eventFields.subject] = target.value;\n var currentAction = void 0;\n if (eventDetails[this.parent.eventFields.id] === eventDetails[this.parent.eventFields.recurrenceID]) {\n currentAction = 'EditOccurrence';\n eventDetails[this.parent.eventFields.id] = this.parent.eventBase.getEventMaxID();\n }\n this.parent.saveEvent(eventDetails, currentAction);\n }\n this.removeInlineAppointmentElement();\n };\n InlineEdit.prototype.createInlineAppointmentElement = function (inlineData) {\n var inlineAppointmentElement = createElement('div', {\n className: cls.APPOINTMENT_CLASS + ' ' + cls.INLINE_APPOINTMENT_CLASS\n });\n var inlineDetails = createElement('div', { className: cls.APPOINTMENT_DETAILS });\n inlineAppointmentElement.appendChild(inlineDetails);\n var inline = createElement('input', { className: cls.INLINE_SUBJECT_CLASS });\n inlineDetails.appendChild(inline);\n if (inlineData) {\n this.parent.eventBase.applyResourceColor(inlineAppointmentElement, inlineData, 'backgroundColor');\n }\n return inlineAppointmentElement;\n };\n InlineEdit.prototype.removeInlineAppointmentElement = function () {\n var inlineAppointment = [].slice.call(this.parent.element.querySelectorAll('.' + cls.INLINE_APPOINTMENT_CLASS));\n if (inlineAppointment.length > 0) {\n inlineAppointment.forEach(function (node) { return remove(node); });\n }\n var inlineSubject = this.parent.element.querySelector('.' + cls.INLINE_SUBJECT_CLASS);\n if (inlineSubject) {\n var appointmentSubject = closest(inlineSubject, '.' + cls.APPOINTMENT_CLASS);\n removeClass([appointmentSubject.querySelector('.' + cls.SUBJECT_CLASS)], cls.DISABLE_CLASS);\n remove(inlineSubject);\n }\n };\n InlineEdit.prototype.destroy = function () {\n this.parent.off(events.inlineClick, this.inlineEdit);\n };\n return InlineEdit;\n}());\nexport { InlineEdit };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, Property, Event, Collection, L10n, Complex, compile, createElement } from '@syncfusion/ej2-base';\nimport { addClass, removeClass, detach, attributes, prepend, setStyleAttribute } from '@syncfusion/ej2-base';\nimport { NotifyPropertyChanges, ChildProperty, isBlazor } from '@syncfusion/ej2-base';\nimport { isNullOrUndefined, formatUnit, append, EventHandler, Draggable, extend } from '@syncfusion/ej2-base';\nimport { SanitizeHtmlHelper, Browser } from '@syncfusion/ej2-base';\nimport { Button } from '@syncfusion/ej2-buttons';\nimport { Popup, PositionData, getZindexPartial } from '../popup/popup';\nimport { createResize, removeResize, setMinHeight, setMaxWidth, setMaxHeight } from '../common/resize';\nvar ButtonProps = /** @class */ (function (_super) {\n __extends(ButtonProps, _super);\n function ButtonProps() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(true)\n ], ButtonProps.prototype, \"isFlat\", void 0);\n __decorate([\n Property()\n ], ButtonProps.prototype, \"buttonModel\", void 0);\n __decorate([\n Property('Button')\n ], ButtonProps.prototype, \"type\", void 0);\n __decorate([\n Event()\n ], ButtonProps.prototype, \"click\", void 0);\n return ButtonProps;\n}(ChildProperty));\nexport { ButtonProps };\n/**\n * Configures the animation properties for both open and close the dialog.\n */\nvar AnimationSettings = /** @class */ (function (_super) {\n __extends(AnimationSettings, _super);\n function AnimationSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('Fade')\n ], AnimationSettings.prototype, \"effect\", void 0);\n __decorate([\n Property(400)\n ], AnimationSettings.prototype, \"duration\", void 0);\n __decorate([\n Property(0)\n ], AnimationSettings.prototype, \"delay\", void 0);\n return AnimationSettings;\n}(ChildProperty));\nexport { AnimationSettings };\nvar ROOT = 'e-dialog';\nvar RTL = 'e-rtl';\nvar DLG_HEADER_CONTENT = 'e-dlg-header-content';\nvar DLG_HEADER = 'e-dlg-header';\nvar DLG_FOOTER_CONTENT = 'e-footer-content';\nvar MODAL_DLG = 'e-dlg-modal';\nvar DLG_CONTENT = 'e-dlg-content';\nvar DLG_CLOSE_ICON = 'e-icon-dlg-close';\nvar DLG_OVERLAY = 'e-dlg-overlay';\nvar DLG_TARGET = 'e-dlg-target';\nvar DLG_CONTAINER = 'e-dlg-container';\nvar SCROLL_DISABLED = 'e-scroll-disabled';\nvar DLG_PRIMARY_BUTTON = 'e-primary';\nvar ICON = 'e-icons';\nvar POPUP_ROOT = 'e-popup';\nvar DEVICE = 'e-device';\nvar FULLSCREEN = 'e-dlg-fullscreen';\nvar DLG_CLOSE_ICON_BTN = 'e-dlg-closeicon-btn';\nvar DLG_HIDE = 'e-popup-close';\nvar DLG_SHOW = 'e-popup-open';\nvar DLG_UTIL_DEFAULT_TITLE = 'Information';\nvar DLG_UTIL_ROOT = 'e-scroll-disabled';\nvar DLG_UTIL_ALERT = 'e-alert-dialog';\nvar DLG_UTIL_CONFIRM = 'e-confirm-dialog';\nvar DLG_RESIZABLE = 'e-dlg-resizable';\nvar DLG_RESTRICT_LEFT_VALUE = 'e-restrict-left';\nvar DLG_RESTRICT_WIDTH_VALUE = 'e-resize-viewport';\nvar DLG_REF_ELEMENT = 'e-dlg-ref-element';\nvar DLG_USER_ACTION_CLOSED = 'user action';\nvar DLG_CLOSE_ICON_CLOSED = 'close icon';\nvar DLG_ESCAPE_CLOSED = 'escape';\nvar DLG_OVERLAYCLICK_CLOSED = 'overlayClick';\n/**\n * Represents the dialog component that displays the information and get input from the user.\n * Two types of dialog components are `Modal and Modeless (non-modal)` depending on its interaction with parent application.\n * ```html\n *
\n * ```\n * ```typescript\n * \n * ```\n */\nvar Dialog = /** @class */ (function (_super) {\n __extends(Dialog, _super);\n /*\n * * Constructor for creating the widget\n *\n * @param\n * @param\n * @hidden\n */\n function Dialog(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.dlgClosedBy = DLG_USER_ACTION_CLOSED;\n return _this;\n }\n /**\n *Initialize the control rendering\n *\n * @returns {void}\n * @private\n */\n Dialog.prototype.render = function () {\n this.initialize();\n this.initRender();\n this.wireEvents();\n if (this.width === '100%') {\n this.element.style.width = '';\n }\n if (this.minHeight !== '') {\n this.element.style.minHeight = formatUnit(this.minHeight);\n }\n if (this.enableResize) {\n this.setResize();\n if (this.animationSettings.effect === 'None') {\n this.getMinHeight();\n }\n }\n this.renderComplete();\n };\n /**\n *Initialize the event handler\n *\n * @returns {void}\n * @private\n */\n Dialog.prototype.preRender = function () {\n var _this = this;\n this.headerContent = null;\n this.allowMaxHeight = true;\n this.preventVisibility = true;\n this.clonedEle = this.element.cloneNode(true);\n this.closeIconClickEventHandler = function (event) {\n _this.dlgClosedBy = DLG_CLOSE_ICON_CLOSED;\n _this.hide(event);\n };\n // eslint-disable-next-line\n this.dlgOverlayClickEventHandler = function (event) {\n _this.dlgClosedBy = DLG_OVERLAYCLICK_CLOSED;\n event.preventFocus = false;\n _this.trigger('overlayClick', event, function (overlayClickEventArgs) {\n if (!overlayClickEventArgs.preventFocus) {\n _this.focusContent();\n }\n _this.dlgClosedBy = DLG_USER_ACTION_CLOSED;\n });\n };\n // eslint-disable-next-line\n var localeText = { close: 'Close' };\n this.l10n = new L10n('dialog', localeText, this.locale);\n this.checkPositionData();\n if (isNullOrUndefined(this.target)) {\n var prevOnChange = this.isProtectedOnChange;\n this.isProtectedOnChange = true;\n this.target = document.body;\n this.isProtectedOnChange = prevOnChange;\n }\n };\n Dialog.prototype.isNumberValue = function (value) {\n var isNumber = /^[-+]?\\d*\\.?\\d+$/.test(value);\n return isNumber;\n };\n Dialog.prototype.checkPositionData = function () {\n if (!isNullOrUndefined(this.position)) {\n if (!isNullOrUndefined(this.position.X) && (typeof (this.position.X) !== 'number')) {\n var isNumber = this.isNumberValue(this.position.X);\n if (isNumber) {\n var prevOnChange = this.isProtectedOnChange;\n this.isProtectedOnChange = true;\n this.position.X = parseFloat(this.position.X);\n this.isProtectedOnChange = prevOnChange;\n }\n }\n if (!isNullOrUndefined(this.position.Y) && (typeof (this.position.Y) !== 'number')) {\n var isNumber = this.isNumberValue(this.position.Y);\n if (isNumber) {\n var prevOnChange = this.isProtectedOnChange;\n this.isProtectedOnChange = true;\n this.position.Y = parseFloat(this.position.Y);\n this.isProtectedOnChange = prevOnChange;\n }\n }\n }\n };\n Dialog.prototype.getEle = function (list, selector) {\n var element = undefined;\n for (var i = 0; i < list.length; i++) {\n if (list[i].classList.contains(selector)) {\n element = list[i];\n break;\n }\n }\n return element;\n };\n /* istanbul ignore next */\n Dialog.prototype.getMinHeight = function () {\n var computedHeaderHeight = '0px';\n var computedFooterHeight = '0px';\n if (!isNullOrUndefined(this.element.querySelector('.' + DLG_HEADER_CONTENT))) {\n computedHeaderHeight = getComputedStyle(this.headerContent).height;\n }\n var footerEle = this.getEle(this.element.children, DLG_FOOTER_CONTENT);\n if (!isNullOrUndefined(footerEle)) {\n computedFooterHeight = getComputedStyle(footerEle).height;\n }\n var headerHeight = parseInt(computedHeaderHeight.slice(0, computedHeaderHeight.indexOf('p')), 10);\n var footerHeight = parseInt(computedFooterHeight.slice(0, computedFooterHeight.indexOf('p')), 10);\n setMinHeight(headerHeight + 30 + (isNaN(footerHeight) ? 0 : footerHeight));\n return (headerHeight + 30 + footerHeight);\n };\n Dialog.prototype.onResizeStart = function (args, dialogObj) {\n dialogObj.trigger('resizeStart', args);\n return args.cancel;\n };\n Dialog.prototype.onResizing = function (args, dialogObj) {\n dialogObj.trigger('resizing', args);\n };\n Dialog.prototype.onResizeComplete = function (args, dialogObj) {\n dialogObj.trigger('resizeStop', args);\n };\n Dialog.prototype.setResize = function () {\n if (this.enableResize) {\n if (this.isBlazorServerRender() && !isNullOrUndefined(this.element.querySelector('.e-icons.e-resize-handle'))) {\n return;\n }\n this.element.classList.add(DLG_RESIZABLE);\n var computedHeight = getComputedStyle(this.element).minHeight;\n var computedWidth = getComputedStyle(this.element).minWidth;\n var direction = '';\n for (var i = 0; i < this.resizeHandles.length; i++) {\n if (this.resizeHandles[i] === 'All') {\n direction = 'south north east west north-east north-west south-east south-west';\n break;\n }\n else {\n var directionValue = '';\n switch (this.resizeHandles[i].toString()) {\n case 'SouthEast':\n directionValue = 'south-east';\n break;\n case 'SouthWest':\n directionValue = 'south-west';\n break;\n case 'NorthEast':\n directionValue = 'north-east';\n break;\n case 'NorthWest':\n directionValue = 'north-west';\n break;\n default:\n directionValue = this.resizeHandles[i].toString();\n break;\n }\n direction += directionValue.toLocaleLowerCase() + ' ';\n }\n }\n if (this.enableRtl && direction.trim() === 'south-east') {\n direction = 'south-west';\n }\n else if (this.enableRtl && direction.trim() === 'south-west') {\n direction = 'south-east';\n }\n if (this.isModal && this.enableRtl) {\n this.element.classList.add(DLG_RESTRICT_LEFT_VALUE);\n }\n else if (this.isModal && this.target === document.body) {\n this.element.classList.add(DLG_RESTRICT_WIDTH_VALUE);\n }\n createResize({\n element: this.element,\n direction: direction,\n minHeight: parseInt(computedHeight.slice(0, computedWidth.indexOf('p')), 10),\n maxHeight: this.targetEle.clientHeight,\n minWidth: parseInt(computedWidth.slice(0, computedWidth.indexOf('p')), 10),\n maxWidth: this.targetEle.clientWidth,\n boundary: this.target === document.body ? null : this.targetEle,\n resizeBegin: this.onResizeStart.bind(this),\n resizeComplete: this.onResizeComplete.bind(this),\n resizing: this.onResizing.bind(this),\n proxy: this\n });\n this.wireWindowResizeEvent();\n }\n else {\n removeResize();\n this.unWireWindowResizeEvent();\n if (this.isModal) {\n this.element.classList.remove(DLG_RESTRICT_LEFT_VALUE);\n }\n else {\n this.element.classList.remove(DLG_RESTRICT_WIDTH_VALUE);\n }\n this.element.classList.remove(DLG_RESIZABLE);\n }\n };\n Dialog.prototype.getFocusElement = function (target) {\n var value = 'input,select,textarea,button:enabled,a,[contenteditable=\"true\"],[tabindex]';\n var items = target.querySelectorAll(value);\n return { element: items[items.length - 1] };\n };\n /* istanbul ignore next */\n Dialog.prototype.keyDown = function (event) {\n var _this = this;\n if (event.keyCode === 9) {\n if (this.isModal) {\n var buttonObj = void 0;\n if (!isNullOrUndefined(this.btnObj)) {\n buttonObj = this.btnObj[this.btnObj.length - 1];\n }\n if ((isNullOrUndefined(this.btnObj)) && (!isNullOrUndefined(this.ftrTemplateContent))) {\n buttonObj = this.getFocusElement(this.ftrTemplateContent);\n }\n if (isNullOrUndefined(this.btnObj) && isNullOrUndefined(this.ftrTemplateContent) && !isNullOrUndefined(this.contentEle)) {\n buttonObj = this.getFocusElement(this.contentEle);\n }\n if (!isNullOrUndefined(buttonObj) && document.activeElement === buttonObj.element && !event.shiftKey) {\n event.preventDefault();\n this.focusableElements(this.element).focus();\n }\n if (document.activeElement === this.focusableElements(this.element) && event.shiftKey) {\n event.preventDefault();\n if (!isNullOrUndefined(buttonObj)) {\n buttonObj.element.focus();\n }\n }\n }\n }\n var element = document.activeElement;\n var isTagName = (['input', 'textarea'].indexOf(element.tagName.toLowerCase()) > -1);\n var isContentEdit = false;\n if (!isTagName) {\n isContentEdit = element.hasAttribute('contenteditable') && element.getAttribute('contenteditable') === 'true';\n }\n if (event.keyCode === 27 && this.closeOnEscape) {\n this.dlgClosedBy = DLG_ESCAPE_CLOSED;\n this.hide(event);\n }\n if ((event.keyCode === 13 && !event.ctrlKey && element.tagName.toLowerCase() !== 'textarea' &&\n isTagName && !isNullOrUndefined(this.primaryButtonEle)) ||\n (event.keyCode === 13 && event.ctrlKey && (element.tagName.toLowerCase() === 'textarea' ||\n isContentEdit)) && !isNullOrUndefined(this.primaryButtonEle)) {\n var buttonIndex_1;\n // eslint-disable-next-line\n var firstPrimary = this.buttons.some(function (data, index) {\n buttonIndex_1 = index;\n // eslint-disable-next-line\n var buttonModel = data.buttonModel;\n return !isNullOrUndefined(buttonModel) && buttonModel.isPrimary === true;\n });\n if (firstPrimary && typeof (this.buttons[buttonIndex_1].click) === 'function') {\n setTimeout(function () {\n _this.buttons[buttonIndex_1].click.call(_this, event);\n });\n }\n }\n };\n /**\n * Initialize the control rendering\n *\n * @returns {void}\n * @private\n */\n Dialog.prototype.initialize = function () {\n if (!isNullOrUndefined(this.target)) {\n this.targetEle = ((typeof this.target) === 'string') ?\n document.querySelector(this.target) : this.target;\n }\n if (!this.isBlazorServerRender()) {\n addClass([this.element], ROOT);\n }\n if (Browser.isDevice) {\n addClass([this.element], DEVICE);\n }\n if (!this.isBlazorServerRender()) {\n this.setCSSClass();\n }\n this.setMaxHeight();\n };\n /**\n * Initialize the rendering\n *\n * @returns {void}\n * @private\n */\n Dialog.prototype.initRender = function () {\n var _this = this;\n this.initialRender = true;\n if (!this.isBlazorServerRender()) {\n attributes(this.element, { role: 'dialog' });\n }\n if (this.zIndex === 1000) {\n this.setzIndex(this.element, false);\n this.calculatezIndex = true;\n }\n else {\n this.calculatezIndex = false;\n }\n if (this.isBlazorServerRender() && isNullOrUndefined(this.headerContent)) {\n this.headerContent = this.element.getElementsByClassName('e-dlg-header-content')[0];\n }\n if (this.isBlazorServerRender() && isNullOrUndefined(this.contentEle)) {\n this.contentEle = this.element.querySelector('#' + this.element.id + '_dialog-content');\n }\n if (!this.isBlazorServerRender()) {\n this.setTargetContent();\n if (this.header !== '' && !isNullOrUndefined(this.header)) {\n this.setHeader();\n }\n if (this.showCloseIcon) {\n this.renderCloseIcon();\n }\n this.setContent();\n if (this.footerTemplate !== '' && !isNullOrUndefined(this.footerTemplate)) {\n this.setFooterTemplate();\n }\n else if (!isNullOrUndefined(this.buttons[0].buttonModel)) {\n this.setButton();\n }\n }\n if (this.isBlazorServerRender()) {\n if (!isNullOrUndefined(this.buttons[0].buttonModel) && this.footerTemplate === '') {\n this.setButton();\n }\n }\n if (this.allowDragging && (!isNullOrUndefined(this.headerContent))) {\n this.setAllowDragging();\n }\n if (!this.isBlazorServerRender()) {\n attributes(this.element, { 'aria-modal': (this.isModal ? 'true' : 'false') });\n if (this.isModal) {\n this.setIsModal();\n }\n }\n if (this.isBlazorServerRender() && isNullOrUndefined(this.dlgContainer)) {\n this.dlgContainer = this.element.parentElement;\n for (var i = 0, childNodes = this.dlgContainer.children; i < childNodes.length; i++) {\n if (childNodes[i].classList.contains('e-dlg-overlay')) {\n this.dlgOverlay = childNodes[i];\n }\n }\n }\n if (this.element.classList.contains(DLG_UTIL_ALERT) !== true && this.element.classList.contains(DLG_UTIL_CONFIRM) !== true\n && !isNullOrUndefined(this.element.parentElement)) {\n var parentEle = this.isModal ? this.dlgContainer.parentElement : this.element.parentElement;\n this.refElement = this.createElement('div', { className: DLG_REF_ELEMENT });\n parentEle.insertBefore(this.refElement, (this.isModal ? this.dlgContainer : this.element));\n }\n if (!isNullOrUndefined(this.targetEle)) {\n // eslint-disable-next-line\n this.isModal ? this.targetEle.appendChild(this.dlgContainer) : this.targetEle.appendChild(this.element);\n }\n this.popupObj = new Popup(this.element, {\n height: this.height,\n width: this.width,\n zIndex: this.zIndex,\n relateTo: this.target,\n actionOnScroll: 'none',\n enableRtl: this.enableRtl,\n // eslint-disable-next-line\n open: function (event) {\n // eslint-disable-next-line\n var eventArgs = {\n container: _this.isModal ? _this.dlgContainer : _this.element,\n element: _this.element,\n target: _this.target,\n preventFocus: false\n };\n if (_this.enableResize) {\n _this.resetResizeIcon();\n }\n // eslint-disable-next-line\n _this.trigger('open', eventArgs, function (openEventArgs) {\n if (!openEventArgs.preventFocus) {\n _this.focusContent();\n }\n });\n },\n // eslint-disable-next-line\n close: function (event) {\n if (_this.isModal) {\n addClass([_this.dlgOverlay], 'e-fade');\n }\n _this.unBindEvent(_this.element);\n if (_this.isModal) {\n _this.dlgContainer.style.display = 'none';\n }\n _this.trigger('close', _this.closeArgs);\n var activeEle = document.activeElement;\n if (!isNullOrUndefined(activeEle) && !isNullOrUndefined((activeEle).blur)) {\n activeEle.blur();\n }\n if (!isNullOrUndefined(_this.storeActiveElement) && !isNullOrUndefined(_this.storeActiveElement.focus)) {\n _this.storeActiveElement.focus();\n }\n }\n });\n this.positionChange();\n this.setEnableRTL();\n if (!this.isBlazorServerRender()) {\n addClass([this.element], DLG_HIDE);\n if (this.isModal) {\n this.setOverlayZindex();\n }\n }\n if (this.visible) {\n this.show();\n }\n else {\n if (this.isModal) {\n this.dlgOverlay.style.display = 'none';\n }\n }\n this.initialRender = false;\n };\n Dialog.prototype.resetResizeIcon = function () {\n var dialogConHeight = this.getMinHeight();\n if (this.targetEle.offsetHeight < dialogConHeight) {\n var className = this.enableRtl ? 'e-south-west' : 'e-south-east';\n var resizeIcon = this.element.querySelector('.' + className);\n if (!isNullOrUndefined(resizeIcon)) {\n resizeIcon.style.bottom = '-' + dialogConHeight.toString() + 'px';\n }\n }\n };\n Dialog.prototype.setOverlayZindex = function (zIndexValue) {\n var zIndex;\n if (isNullOrUndefined(zIndexValue)) {\n zIndex = parseInt(this.element.style.zIndex, 10) ? parseInt(this.element.style.zIndex, 10) : this.zIndex;\n }\n else {\n zIndex = zIndexValue;\n }\n this.dlgOverlay.style.zIndex = (zIndex - 1).toString();\n this.dlgContainer.style.zIndex = zIndex.toString();\n };\n Dialog.prototype.positionChange = function () {\n if (this.isModal) {\n if (!isNaN(parseFloat(this.position.X)) && !isNaN(parseFloat(this.position.Y))) {\n this.setPopupPosition();\n }\n else if ((!isNaN(parseFloat(this.position.X)) && isNaN(parseFloat(this.position.Y)))\n || (isNaN(parseFloat(this.position.X)) && !isNaN(parseFloat(this.position.Y)))) {\n this.setPopupPosition();\n }\n else {\n this.element.style.top = '0px';\n this.element.style.left = '0px';\n this.dlgContainer.classList.add('e-dlg-' + this.position.X + '-' + this.position.Y);\n }\n }\n else {\n this.setPopupPosition();\n }\n };\n Dialog.prototype.setPopupPosition = function () {\n this.popupObj.setProperties({\n position: {\n X: this.position.X, Y: this.position.Y\n }\n });\n };\n Dialog.prototype.setAllowDragging = function () {\n var _this = this;\n var handleContent = '.' + DLG_HEADER_CONTENT;\n this.dragObj = new Draggable(this.element, {\n clone: false,\n isDragScroll: true,\n abort: '.e-dlg-closeicon-btn',\n handle: handleContent,\n // eslint-disable-next-line\n dragStart: function (event) {\n // eslint-disable-next-line\n _this.trigger('dragStart', event, function (dragEventArgs) {\n if (isBlazor()) {\n dragEventArgs.bindEvents(event.dragElement);\n }\n });\n },\n // eslint-disable-next-line\n dragStop: function (event) {\n if (_this.isModal) {\n if (!isNullOrUndefined(_this.position)) {\n _this.dlgContainer.classList.remove('e-dlg-' + _this.position.X + '-' + _this.position.Y);\n }\n // Reset the dialog position after drag completion.\n _this.element.style.position = 'relative';\n }\n _this.trigger('dragStop', event);\n _this.element.classList.remove(DLG_RESTRICT_LEFT_VALUE);\n },\n // eslint-disable-next-line\n drag: function (event) {\n _this.trigger('drag', event);\n }\n });\n if (!isNullOrUndefined(this.targetEle)) {\n this.dragObj.dragArea = this.targetEle;\n }\n };\n Dialog.prototype.setButton = function () {\n if (!this.isBlazorServerRender()) {\n this.buttonContent = [];\n this.btnObj = [];\n // eslint-disable-next-line\n var primaryBtnFlag = true;\n for (var i = 0; i < this.buttons.length; i++) {\n var buttonType = !isNullOrUndefined(this.buttons[i].type) ? this.buttons[i].type.toLowerCase() : 'button';\n var btn = this.createElement('button', { attrs: { type: buttonType } });\n this.buttonContent.push(btn.outerHTML);\n }\n this.setFooterTemplate();\n }\n var footerBtn;\n for (var i = 0, childNodes = this.element.children; i < childNodes.length; i++) {\n if (childNodes[i].classList.contains(DLG_FOOTER_CONTENT)) {\n footerBtn = childNodes[i].querySelectorAll('button');\n }\n }\n for (var i = 0; i < this.buttons.length; i++) {\n if (!this.isBlazorServerRender()) {\n this.btnObj[i] = new Button(this.buttons[i].buttonModel);\n }\n if (this.isBlazorServerRender()) {\n this.ftrTemplateContent = this.element.querySelector('.' + DLG_FOOTER_CONTENT);\n }\n if (!isNullOrUndefined(this.ftrTemplateContent) && footerBtn.length > 0) {\n if (typeof (this.buttons[i].click) === 'function') {\n EventHandler.add(footerBtn[i], 'click', this.buttons[i].click, this);\n }\n if (typeof (this.buttons[i].click) === 'object') {\n EventHandler.add(footerBtn[i], 'click', this.buttonClickHandler.bind(this, i), this);\n }\n }\n if (!this.isBlazorServerRender() && !isNullOrUndefined(this.ftrTemplateContent)) {\n this.btnObj[i].appendTo(this.ftrTemplateContent.children[i]);\n if (this.buttons[i].isFlat) {\n this.btnObj[i].element.classList.add('e-flat');\n }\n this.primaryButtonEle = this.element.getElementsByClassName('e-primary')[0];\n }\n }\n };\n Dialog.prototype.buttonClickHandler = function (index) {\n this.trigger('buttons[' + index + '].click', {});\n };\n ;\n Dialog.prototype.setContent = function () {\n attributes(this.element, { 'aria-describedby': this.element.id + '_dialog-content' });\n this.contentEle = this.createElement('div', { className: DLG_CONTENT, id: this.element.id + '_dialog-content' });\n if (this.innerContentElement) {\n this.contentEle.appendChild(this.innerContentElement);\n }\n else if (!isNullOrUndefined(this.content) && this.content !== '' || !this.initialRender) {\n // eslint-disable-next-line\n var blazorContain = Object.keys(window);\n if (typeof (this.content) === 'string' && !isBlazor()) {\n this.contentEle.innerHTML = this.sanitizeHelper(this.content);\n }\n else if (this.content instanceof HTMLElement) {\n this.contentEle.appendChild(this.content);\n }\n else {\n this.setTemplate(this.content, this.contentEle, 'content');\n }\n }\n if (!isNullOrUndefined(this.headerContent)) {\n this.element.insertBefore(this.contentEle, this.element.children[1]);\n }\n else {\n this.element.insertBefore(this.contentEle, this.element.children[0]);\n }\n if (this.height === 'auto') {\n if (!this.isBlazorServerRender() && Browser.isIE && this.element.style.width === '' && !isNullOrUndefined(this.width)) {\n this.element.style.width = formatUnit(this.width);\n }\n this.setMaxHeight();\n }\n };\n Dialog.prototype.setTemplate = function (template, toElement, prop) {\n // eslint-disable-next-line\n var templateFn;\n var templateProps;\n // eslint-disable-next-line\n var blazorContain = Object.keys(window);\n if (toElement.classList.contains(DLG_HEADER)) {\n templateProps = this.element.id + 'header';\n }\n else if (toElement.classList.contains(DLG_FOOTER_CONTENT)) {\n templateProps = this.element.id + 'footerTemplate';\n }\n else {\n templateProps = this.element.id + 'content';\n }\n var templateValue;\n if (!isNullOrUndefined(template.outerHTML)) {\n toElement.appendChild(template);\n }\n else if ((typeof template !== 'string') || (isBlazor() && !this.isStringTemplate)) {\n templateFn = compile(template);\n templateValue = template;\n }\n else {\n toElement.innerHTML = this.sanitizeHelper(template);\n }\n var fromElements = [];\n if (!isNullOrUndefined(templateFn)) {\n var isString = (isBlazor() &&\n !this.isStringTemplate && (templateValue).indexOf('
Blazor') === 0) ?\n this.isStringTemplate : true;\n for (var _i = 0, _a = templateFn({}, this, prop, templateProps, isString); _i < _a.length; _i++) {\n var item = _a[_i];\n fromElements.push(item);\n }\n append([].slice.call(fromElements), toElement);\n }\n };\n /*\n * @returns {void}\n * @hidden\n * @value\n */\n Dialog.prototype.sanitizeHelper = function (value) {\n if (this.enableHtmlSanitizer) {\n var dialogItem = SanitizeHtmlHelper.beforeSanitize();\n var beforeEvent = {\n cancel: false,\n helper: null\n };\n extend(dialogItem, dialogItem, beforeEvent);\n this.trigger('beforeSanitizeHtml', dialogItem);\n if (dialogItem.cancel && !isNullOrUndefined(dialogItem.helper)) {\n value = dialogItem.helper(value);\n }\n else if (!dialogItem.cancel) {\n value = SanitizeHtmlHelper.serializeValue(dialogItem, value);\n }\n }\n return value;\n };\n Dialog.prototype.setMaxHeight = function () {\n if (!this.allowMaxHeight) {\n return;\n }\n var display = this.element.style.display;\n this.element.style.display = 'none';\n this.element.style.maxHeight = (!isNullOrUndefined(this.target)) && (this.targetEle.offsetHeight < window.innerHeight) ?\n (this.targetEle.offsetHeight - 20) + 'px' : (window.innerHeight - 20) + 'px';\n this.element.style.display = display;\n if (Browser.isIE && this.height === 'auto' && !isNullOrUndefined(this.contentEle)\n && this.element.offsetHeight < this.contentEle.offsetHeight) {\n this.element.style.height = 'inherit';\n }\n };\n Dialog.prototype.setEnableRTL = function () {\n if (!this.isBlazorServerRender()) {\n // eslint-disable-next-line\n this.enableRtl ? addClass([this.element], RTL) : removeClass([this.element], RTL);\n }\n if (!isNullOrUndefined(this.element.querySelector('.e-resize-handle'))) {\n removeResize();\n this.setResize();\n }\n };\n Dialog.prototype.setTargetContent = function () {\n var _this = this;\n if (isNullOrUndefined(this.content) || this.content === '') {\n var isContent = this.element.innerHTML.replace(/\\s|<(\\/?|\\/?)(!--!--)>/g, '') !== '';\n if (this.element.children.length > 0 || isContent) {\n this.innerContentElement = document.createDocumentFragment();\n [].slice.call(this.element.childNodes).forEach(function (el) {\n if (el.nodeType !== 8) {\n _this.innerContentElement.appendChild(el);\n }\n });\n }\n }\n };\n Dialog.prototype.setHeader = function () {\n if (this.headerEle) {\n this.headerEle.innerHTML = '';\n }\n else {\n this.headerEle = this.createElement('div', { id: this.element.id + '_title', className: DLG_HEADER });\n }\n this.createHeaderContent();\n this.headerContent.appendChild(this.headerEle);\n this.setTemplate(this.header, this.headerEle, 'header');\n attributes(this.element, { 'aria-labelledby': this.element.id });\n this.element.insertBefore(this.headerContent, this.element.children[0]);\n };\n Dialog.prototype.setFooterTemplate = function () {\n if (this.ftrTemplateContent) {\n this.ftrTemplateContent.innerHTML = '';\n }\n else {\n this.ftrTemplateContent = this.createElement('div', {\n className: DLG_FOOTER_CONTENT\n });\n }\n if (this.footerTemplate !== '' && !isNullOrUndefined(this.footerTemplate)) {\n this.setTemplate(this.footerTemplate, this.ftrTemplateContent, 'footerTemplate');\n }\n else {\n this.ftrTemplateContent.innerHTML = this.buttonContent.join('');\n }\n this.element.appendChild(this.ftrTemplateContent);\n };\n Dialog.prototype.createHeaderContent = function () {\n if (isNullOrUndefined(this.headerContent)) {\n this.headerContent = this.createElement('div', { id: this.element.id + '_dialog-header', className: DLG_HEADER_CONTENT });\n }\n };\n Dialog.prototype.renderCloseIcon = function () {\n this.closeIcon = this.createElement('button', { className: DLG_CLOSE_ICON_BTN, attrs: { type: 'button' } });\n this.closeIconBtnObj = new Button({ cssClass: 'e-flat', iconCss: DLG_CLOSE_ICON + ' ' + ICON });\n this.closeIconTitle();\n if (!isNullOrUndefined(this.headerContent)) {\n prepend([this.closeIcon], this.headerContent);\n }\n else {\n this.createHeaderContent();\n prepend([this.closeIcon], this.headerContent);\n this.element.insertBefore(this.headerContent, this.element.children[0]);\n }\n this.closeIconBtnObj.appendTo(this.closeIcon);\n };\n Dialog.prototype.closeIconTitle = function () {\n this.l10n.setLocale(this.locale);\n var closeIconTitle = this.l10n.getConstant('close');\n this.closeIcon.setAttribute('title', closeIconTitle);\n this.closeIcon.setAttribute('aria-label', closeIconTitle);\n };\n Dialog.prototype.setCSSClass = function (oldCSSClass) {\n if (this.cssClass) {\n addClass([this.element], this.cssClass.split(' '));\n }\n if (oldCSSClass) {\n removeClass([this.element], oldCSSClass.split(' '));\n }\n };\n Dialog.prototype.setIsModal = function () {\n this.dlgContainer = this.createElement('div', { className: DLG_CONTAINER });\n this.element.classList.remove(DLG_SHOW);\n this.element.parentNode.insertBefore(this.dlgContainer, this.element);\n this.dlgContainer.appendChild(this.element);\n addClass([this.element], MODAL_DLG);\n this.dlgOverlay = this.createElement('div', { className: DLG_OVERLAY });\n this.dlgOverlay.style.zIndex = (this.zIndex - 1).toString();\n this.dlgContainer.appendChild(this.dlgOverlay);\n };\n Dialog.prototype.getValidFocusNode = function (items) {\n var node;\n for (var u = 0; u < items.length; u++) {\n node = items[u];\n if ((node.clientHeight > 0 || (node.tagName.toLowerCase() === 'a' && node.hasAttribute('href'))) && node.tabIndex > -1 &&\n !node.disabled && !this.disableElement(node, '[disabled],[aria-disabled=\"true\"],[type=\"hidden\"]')) {\n return node;\n }\n else {\n node = null;\n }\n }\n return node;\n };\n Dialog.prototype.focusableElements = function (content) {\n if (!isNullOrUndefined(content)) {\n var value = 'input,select,textarea,button,a,[contenteditable=\"true\"],[tabindex]';\n var items = content.querySelectorAll(value);\n return this.getValidFocusNode(items);\n }\n return null;\n };\n Dialog.prototype.getAutoFocusNode = function (container) {\n var node = container.querySelector('.' + DLG_CLOSE_ICON_BTN);\n var value = '[autofocus]';\n var items = container.querySelectorAll(value);\n var validNode = this.getValidFocusNode(items);\n if (isBlazor()) {\n this.primaryButtonEle = this.element.getElementsByClassName('e-primary')[0];\n }\n if (!isNullOrUndefined(validNode)) {\n node = validNode;\n }\n else {\n validNode = this.focusableElements(this.contentEle);\n if (!isNullOrUndefined(validNode)) {\n return node = validNode;\n }\n else if (!isNullOrUndefined(this.primaryButtonEle)) {\n return this.element.querySelector('.' + DLG_PRIMARY_BUTTON);\n }\n }\n return node;\n };\n Dialog.prototype.disableElement = function (element, t) {\n // eslint-disable-next-line\n var elementMatch = element ? element.matches || element.webkitMatchesSelector || element.msGetRegionContent : null;\n if (elementMatch) {\n for (; element; element = element.parentNode) {\n if (element instanceof Element && elementMatch.call(element, t)) {\n /* istanbul ignore next */\n return element;\n }\n }\n }\n return null;\n };\n Dialog.prototype.focusContent = function () {\n var element = this.getAutoFocusNode(this.element);\n var node = !isNullOrUndefined(element) ? element : this.element;\n var userAgent = Browser.userAgent;\n if (userAgent.indexOf('MSIE ') > 0 || userAgent.indexOf('Trident/') > 0) {\n this.element.focus();\n }\n node.focus();\n this.bindEvent(this.element);\n };\n Dialog.prototype.bindEvent = function (element) {\n EventHandler.add(element, 'keydown', this.keyDown, this);\n };\n Dialog.prototype.unBindEvent = function (element) {\n EventHandler.remove(element, 'keydown', this.keyDown);\n };\n Dialog.prototype.updateSanitizeContent = function () {\n if (!this.isBlazorServerRender()) {\n this.contentEle.innerHTML = this.sanitizeHelper(this.content);\n }\n };\n Dialog.prototype.isBlazorServerRender = function () {\n return isBlazor() && this.isServerRendered;\n };\n /**\n * Module required function\n *\n * @returns {void}\n * @private\n */\n Dialog.prototype.getModuleName = function () {\n return 'dialog';\n };\n /**\n * Called internally if any of the property value changed\n *\n * @param {DialogModel} newProp - specifies the new property\n * @param {DialogModel} oldProp - specifies the old property\n * @private\n * @returns {void}\n */\n Dialog.prototype.onPropertyChanged = function (newProp, oldProp) {\n if (!this.element.classList.contains(ROOT)) {\n return;\n }\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'content':\n if (!isNullOrUndefined(this.content) && this.content !== '') {\n if (this.isBlazorServerRender()) {\n this.contentEle = this.element.querySelector('.e-dlg-content');\n }\n if (!isNullOrUndefined(this.contentEle) && this.contentEle.getAttribute('role') !== 'dialog') {\n if (!this.isBlazorServerRender()) {\n this.contentEle.innerHTML = '';\n }\n // eslint-disable-next-line\n if (typeof (this.content) === 'function') {\n this.clearTemplate(['content']);\n detach(this.contentEle);\n this.contentEle = null;\n this.setContent();\n }\n else {\n typeof (this.content) === 'string' ? (this.isBlazorServerRender() && (this.contentEle.innerText === '')) ?\n this.contentEle.insertAdjacentHTML('beforeend', this.sanitizeHelper(this.content)) :\n this.updateSanitizeContent() : this.contentEle.appendChild(this.content);\n }\n this.setMaxHeight();\n }\n else {\n if (!this.isBlazorServerRender() ||\n isNullOrUndefined(this.element.querySelector('.e-dlg-content'))) {\n this.setContent();\n }\n }\n }\n else if (!isNullOrUndefined(this.contentEle)) {\n detach(this.contentEle);\n this.contentEle = null;\n }\n break;\n case 'header':\n if (this.header === '' || isNullOrUndefined(this.header)) {\n if (this.headerEle) {\n detach(this.headerEle);\n this.headerEle = null;\n }\n }\n else {\n if (!this.isBlazorServerRender() ||\n isNullOrUndefined(this.element.querySelector('.e-dlg-header-content'))) {\n this.setHeader();\n }\n }\n break;\n case 'footerTemplate':\n if (this.footerTemplate === '' || isNullOrUndefined(this.footerTemplate)) {\n if (!this.ftrTemplateContent) {\n return;\n }\n detach(this.ftrTemplateContent);\n this.ftrTemplateContent = null;\n this.buttons = [{}];\n }\n else {\n if (!this.isBlazorServerRender() ||\n isNullOrUndefined(this.element.querySelector('.e-footer-content'))) {\n this.setFooterTemplate();\n }\n this.buttons = [{}];\n }\n break;\n case 'showCloseIcon':\n if (this.element.getElementsByClassName(DLG_CLOSE_ICON).length > 0) {\n if (!this.showCloseIcon && (this.header === '' || isNullOrUndefined(this.header))) {\n detach(this.headerContent);\n this.headerContent = null;\n }\n else if (!this.showCloseIcon) {\n detach(this.closeIcon);\n }\n else {\n if (this.isBlazorServerRender()) {\n this.wireEvents();\n }\n }\n }\n else {\n if (!this.isBlazorServerRender()) {\n this.renderCloseIcon();\n }\n this.wireEvents();\n }\n break;\n case 'locale':\n if (this.showCloseIcon) {\n this.closeIconTitle();\n }\n break;\n case 'visible':\n // eslint-disable-next-line\n this.visible ? this.show() : this.hide();\n break;\n case 'isModal':\n this.updateIsModal();\n break;\n case 'height':\n setStyleAttribute(this.element, { 'height': formatUnit(newProp.height) });\n break;\n case 'width':\n setStyleAttribute(this.element, { 'width': formatUnit(newProp.width) });\n break;\n case 'zIndex':\n this.popupObj.zIndex = this.zIndex;\n if (this.isModal) {\n this.setOverlayZindex(this.zIndex);\n }\n if (this.element.style.zIndex !== this.zIndex.toString()) {\n this.calculatezIndex = false;\n }\n break;\n case 'cssClass':\n this.setCSSClass(oldProp.cssClass);\n break;\n case 'buttons': {\n var buttonCount = this.buttons.length;\n if (!isNullOrUndefined(this.ftrTemplateContent) && !this.isBlazorServerRender()) {\n detach(this.ftrTemplateContent);\n this.ftrTemplateContent = null;\n }\n for (var i = 0; i < buttonCount; i++) {\n if (!isNullOrUndefined(this.buttons[i].buttonModel)) {\n this.footerTemplate = '';\n this.setButton();\n }\n }\n break;\n }\n case 'allowDragging':\n if (this.allowDragging && (!isNullOrUndefined(this.headerContent))) {\n this.setAllowDragging();\n }\n else {\n this.dragObj.destroy();\n }\n break;\n case 'target':\n this.setTarget(newProp.target);\n break;\n case 'position':\n this.checkPositionData();\n if (this.isModal) {\n var positionX = isNullOrUndefined(oldProp.position.X) ? this.position.X : oldProp.position.X;\n var positionY = isNullOrUndefined(oldProp.position.Y) ? this.position.Y : oldProp.position.Y;\n if (this.dlgContainer.classList.contains('e-dlg-' + positionX + '-' + positionY)) {\n this.dlgContainer.classList.remove('e-dlg-' + positionX + '-' + positionY);\n }\n }\n this.positionChange();\n break;\n case 'enableRtl':\n this.setEnableRTL();\n break;\n case 'enableResize':\n this.setResize();\n break;\n }\n }\n };\n Dialog.prototype.setTarget = function (target) {\n this.popupObj.relateTo = target;\n this.target = target;\n this.targetEle = ((typeof this.target) === 'string') ?\n document.querySelector(this.target) : this.target;\n if (this.dragObj) {\n this.dragObj.dragArea = this.targetEle;\n }\n this.setMaxHeight();\n if (this.isModal) {\n this.updateIsModal();\n }\n if (this.enableResize) {\n this.setResize();\n }\n };\n Dialog.prototype.updateIsModal = function () {\n this.element.setAttribute('aria-modal', this.isModal ? 'true' : 'false');\n if (this.isModal) {\n if (isNullOrUndefined(this.dlgOverlay)) {\n this.setIsModal();\n this.element.style.top = '0px';\n this.element.style.left = '0px';\n if (!isNullOrUndefined(this.targetEle)) {\n this.targetEle.appendChild(this.dlgContainer);\n }\n }\n }\n else {\n removeClass([this.element], MODAL_DLG);\n removeClass([document.body], [DLG_TARGET, SCROLL_DISABLED]);\n detach(this.dlgOverlay);\n while (this.dlgContainer.firstChild) {\n this.dlgContainer.parentElement.insertBefore(this.dlgContainer.firstChild, this.dlgContainer);\n }\n this.dlgContainer.parentElement.removeChild(this.dlgContainer);\n }\n if (this.visible) {\n this.show();\n }\n this.positionChange();\n if (this.isModal && this.dlgOverlay) {\n EventHandler.add(this.dlgOverlay, 'click', this.dlgOverlayClickEventHandler, this);\n }\n };\n Dialog.prototype.setzIndex = function (zIndexElement, setPopupZindex) {\n var prevOnChange = this.isProtectedOnChange;\n this.isProtectedOnChange = true;\n this.zIndex = getZindexPartial(zIndexElement);\n this.isProtectedOnChange = prevOnChange;\n if (setPopupZindex) {\n this.popupObj.zIndex = this.zIndex;\n }\n };\n Dialog.prototype.windowResizeHandler = function () {\n setMaxWidth(this.targetEle.clientWidth);\n setMaxHeight(this.targetEle.clientHeight);\n this.setMaxHeight();\n };\n /**\n * Get the properties to be maintained in the persisted state.\n *\n * @returns {void}\n * @private\n */\n Dialog.prototype.getPersistData = function () {\n return this.addOnPersist([]);\n };\n /**\n * To destroy the widget\n *\n * @returns {void}\n */\n Dialog.prototype.destroy = function () {\n if (this.isDestroyed) {\n return;\n }\n var classArray = [RTL, MODAL_DLG, DLG_RESIZABLE, DLG_RESTRICT_LEFT_VALUE, FULLSCREEN, DEVICE];\n var attrs = ['role', 'aria-modal', 'aria-labelledby', 'aria-describedby', 'aria-grabbed', 'tabindex', 'style'];\n removeClass([this.targetEle], [DLG_TARGET, SCROLL_DISABLED]);\n if (!isNullOrUndefined(this.element) && this.element.classList.contains(FULLSCREEN)) {\n removeClass([document.body], [DLG_TARGET, SCROLL_DISABLED]);\n }\n if (this.isModal) {\n removeClass([(!isNullOrUndefined(this.targetEle) ? this.targetEle : document.body)], SCROLL_DISABLED);\n }\n this.unWireEvents();\n if (!isNullOrUndefined(this.btnObj)) {\n for (var i = 0; i < this.btnObj.length; i++) {\n this.btnObj[i].destroy();\n }\n }\n if (!isNullOrUndefined(this.dragObj)) {\n this.dragObj.destroy();\n }\n if (!isNullOrUndefined(this.popupObj.element) && this.popupObj.element.classList.contains(POPUP_ROOT)) {\n this.popupObj.destroy();\n }\n removeClass([this.element], classArray);\n if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {\n removeClass([this.element], this.cssClass.split(' '));\n }\n if (!isNullOrUndefined(this.refElement) && !isNullOrUndefined(this.refElement.parentElement)) {\n this.refElement.parentElement.insertBefore((this.isModal ? this.dlgContainer : this.element), this.refElement);\n detach(this.refElement);\n this.refElement = undefined;\n }\n if (this.isModal && !this.isBlazorServerRender()) {\n detach(this.dlgOverlay);\n this.dlgContainer.parentNode.insertBefore(this.element, this.dlgContainer);\n detach(this.dlgContainer);\n }\n if (!this.isBlazorServerRender()) {\n this.element.innerHTML = this.clonedEle.innerHTML;\n }\n if (this.isBlazorServerRender()) {\n if (!isNullOrUndefined(this.element.children)) {\n for (var i = 0; i <= this.element.children.length; i++) {\n i = i - i;\n detach(this.element.children[i]);\n }\n }\n }\n for (var i = 0; i < attrs.length; i++) {\n this.element.removeAttribute(attrs[i]);\n }\n if (!this.isBlazorServerRender()) {\n _super.prototype.destroy.call(this);\n }\n else {\n this.isDestroyed = true;\n }\n // eslint-disable-next-line\n if (this.isReact) {\n this.clearTemplate();\n }\n };\n Dialog.prototype.wireWindowResizeEvent = function () {\n window.addEventListener('resize', this.windowResizeHandler.bind(this));\n };\n Dialog.prototype.unWireWindowResizeEvent = function () {\n window.removeEventListener('resize', this.windowResizeHandler.bind(this));\n };\n /**\n * Binding event to the element while widget creation\n *\n * @returns {void}\n * @hidden\n */\n Dialog.prototype.wireEvents = function () {\n if (this.isBlazorServerRender() && this.showCloseIcon) {\n this.closeIcon = this.element.getElementsByClassName('e-dlg-closeicon-btn')[0];\n }\n if (this.showCloseIcon) {\n EventHandler.add(this.closeIcon, 'click', this.closeIconClickEventHandler, this);\n }\n if (this.isModal && this.dlgOverlay) {\n EventHandler.add(this.dlgOverlay, 'click', this.dlgOverlayClickEventHandler, this);\n }\n };\n /**\n * Unbinding event to the element while widget destroy\n *\n * @returns {void}\n * @hidden\n */\n Dialog.prototype.unWireEvents = function () {\n if (this.showCloseIcon) {\n EventHandler.remove(this.closeIcon, 'click', this.closeIconClickEventHandler);\n }\n if (this.isModal) {\n EventHandler.remove(this.dlgOverlay, 'click', this.dlgOverlayClickEventHandler);\n }\n if (this.buttons.length > 0 && !isNullOrUndefined(this.buttons[0].buttonModel) && this.footerTemplate === '') {\n for (var i = 0; i < this.buttons.length; i++) {\n if (typeof (this.buttons[i].click) === 'function') {\n EventHandler.remove(this.ftrTemplateContent.children[i], 'click', this.buttons[i].click);\n }\n }\n }\n };\n /**\n * Refreshes the dialog's position when the user changes its header and footer height/width dynamically.\n *\n * @returns {void}\n */\n Dialog.prototype.refreshPosition = function () {\n this.popupObj.refreshPosition();\n };\n /**\n * Opens the dialog if it is in hidden state.\n * To open the dialog with full screen width, set the parameter to true.\n *\n * @param { boolean } isFullScreen - Enable the fullScreen Dialog.\n * @returns {void}\n */\n Dialog.prototype.show = function (isFullScreen) {\n var _this = this;\n if (!this.element.classList.contains(ROOT)) {\n return;\n }\n if (!this.element.classList.contains(DLG_SHOW) || (!isNullOrUndefined(isFullScreen))) {\n if (!isNullOrUndefined(isFullScreen)) {\n this.fullScreen(isFullScreen);\n }\n var eventArgs_1 = isBlazor() ? {\n cancel: false,\n element: this.element,\n container: this.isModal ? this.dlgContainer : this.element,\n maxHeight: this.element.style.maxHeight\n } : {\n cancel: false,\n element: this.element,\n container: this.isModal ? this.dlgContainer : this.element,\n target: this.target,\n maxHeight: this.element.style.maxHeight\n };\n this.trigger('beforeOpen', eventArgs_1, function (beforeOpenArgs) {\n if (!beforeOpenArgs.cancel) {\n if (_this.element.style.maxHeight !== eventArgs_1.maxHeight) {\n _this.allowMaxHeight = false;\n _this.element.style.maxHeight = eventArgs_1.maxHeight;\n }\n _this.storeActiveElement = document.activeElement;\n _this.element.tabIndex = -1;\n if (_this.isModal && (!isNullOrUndefined(_this.dlgOverlay))) {\n _this.dlgOverlay.style.display = 'block';\n _this.dlgContainer.style.display = 'flex';\n removeClass([_this.dlgOverlay], 'e-fade');\n if (!isNullOrUndefined(_this.targetEle)) {\n if (_this.targetEle === document.body) {\n _this.dlgContainer.style.position = 'fixed';\n }\n else {\n _this.dlgContainer.style.position = 'absolute';\n }\n _this.dlgOverlay.style.position = 'absolute';\n _this.element.style.position = 'relative';\n addClass([_this.targetEle], [DLG_TARGET, SCROLL_DISABLED]);\n }\n else {\n addClass([document.body], [DLG_TARGET, SCROLL_DISABLED]);\n }\n }\n // eslint-disable-next-line\n var openAnimation = {\n name: _this.animationSettings.effect + 'In',\n duration: _this.animationSettings.duration,\n delay: _this.animationSettings.delay\n };\n var zIndexElement = (_this.isModal) ? _this.element.parentElement : _this.element;\n if (_this.calculatezIndex) {\n _this.setzIndex(zIndexElement, true);\n setStyleAttribute(_this.element, { 'zIndex': _this.zIndex });\n if (_this.isModal) {\n _this.setOverlayZindex(_this.zIndex);\n }\n }\n // eslint-disable-next-line\n _this.animationSettings.effect === 'None' ? _this.popupObj.show() : _this.popupObj.show(openAnimation);\n _this.dialogOpen = true;\n var prevOnChange = _this.isProtectedOnChange;\n _this.isProtectedOnChange = true;\n _this.visible = true;\n _this.preventVisibility = true;\n _this.isProtectedOnChange = prevOnChange;\n }\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (this.isReact) {\n this.renderReactTemplates();\n }\n };\n /**\n * Closes the dialog if it is in visible state.\n *\n * @param { Event } event - specifies the event\n * @returns {void}\n */\n Dialog.prototype.hide = function (event) {\n var _this = this;\n if (!this.element.classList.contains(ROOT)) {\n return;\n }\n if (this.preventVisibility) {\n var eventArgs = isBlazor() ? {\n cancel: false,\n isInteracted: event ? true : false,\n element: this.element,\n container: this.isModal ? this.dlgContainer : this.element,\n event: event\n } : {\n cancel: false,\n isInteracted: event ? true : false,\n element: this.element,\n target: this.target,\n container: this.isModal ? this.dlgContainer : this.element,\n event: event,\n closedBy: this.dlgClosedBy\n };\n this.closeArgs = eventArgs;\n this.trigger('beforeClose', eventArgs, function (beforeCloseArgs) {\n if (!beforeCloseArgs.cancel) {\n if (_this.isModal) {\n if (!isNullOrUndefined(_this.targetEle)) {\n removeClass([_this.targetEle], [DLG_TARGET, SCROLL_DISABLED]);\n }\n }\n if (document.body.classList.contains(DLG_TARGET) &&\n document.body.classList.contains(SCROLL_DISABLED)) {\n removeClass([document.body], [DLG_TARGET, SCROLL_DISABLED]);\n }\n // eslint-disable-next-line\n var closeAnimation = {\n name: _this.animationSettings.effect + 'Out',\n duration: _this.animationSettings.duration,\n delay: _this.animationSettings.delay\n };\n // eslint-disable-next-line\n _this.animationSettings.effect === 'None' ? _this.popupObj.hide() : _this.popupObj.hide(closeAnimation);\n _this.dialogOpen = false;\n var prevOnChange = _this.isProtectedOnChange;\n _this.isProtectedOnChange = true;\n _this.visible = false;\n _this.preventVisibility = false;\n _this.isProtectedOnChange = prevOnChange;\n }\n _this.dlgClosedBy = DLG_USER_ACTION_CLOSED;\n });\n }\n };\n // eslint-disable-next-line\n /**\n * Specifies to view the Full screen Dialog.\n *\n * @returns {void}\n * @private\n */\n Dialog.prototype.fullScreen = function (args) {\n /* eslint-disable */\n var top = this.element.offsetTop;\n var left = this.element.offsetLeft;\n /* eslint-enable */\n if (args) {\n addClass([this.element], FULLSCREEN);\n var display = this.element.style.display;\n this.element.style.display = 'none';\n this.element.style.maxHeight = (!isNullOrUndefined(this.target)) ?\n (this.targetEle.offsetHeight) + 'px' : (window.innerHeight) + 'px';\n this.element.style.display = display;\n addClass([document.body], [DLG_TARGET, SCROLL_DISABLED]);\n if (this.allowDragging && !isNullOrUndefined(this.dragObj)) {\n this.dragObj.destroy();\n }\n }\n else {\n removeClass([this.element], FULLSCREEN);\n removeClass([document.body], [DLG_TARGET, SCROLL_DISABLED]);\n if (this.allowDragging && (!isNullOrUndefined(this.headerContent))) {\n this.setAllowDragging();\n }\n }\n return args;\n };\n /**\n * Returns the dialog button instances.\n * Based on that, you can dynamically change the button states.\n *\n * @param { number } index - Index of the button.\n * @returns {Button} - returns the button element\n */\n Dialog.prototype.getButtons = function (index) {\n if (!isNullOrUndefined(index)) {\n return this.btnObj[index];\n }\n return this.btnObj;\n };\n __decorate([\n Property('')\n ], Dialog.prototype, \"content\", void 0);\n __decorate([\n Property(true)\n ], Dialog.prototype, \"enableHtmlSanitizer\", void 0);\n __decorate([\n Property(false)\n ], Dialog.prototype, \"showCloseIcon\", void 0);\n __decorate([\n Property(false)\n ], Dialog.prototype, \"isModal\", void 0);\n __decorate([\n Property('')\n ], Dialog.prototype, \"header\", void 0);\n __decorate([\n Property(true)\n ], Dialog.prototype, \"visible\", void 0);\n __decorate([\n Property(false)\n ], Dialog.prototype, \"enableResize\", void 0);\n __decorate([\n Property(['South-East'])\n ], Dialog.prototype, \"resizeHandles\", void 0);\n __decorate([\n Property('auto')\n ], Dialog.prototype, \"height\", void 0);\n __decorate([\n Property('')\n ], Dialog.prototype, \"minHeight\", void 0);\n __decorate([\n Property('100%')\n ], Dialog.prototype, \"width\", void 0);\n __decorate([\n Property('')\n ], Dialog.prototype, \"cssClass\", void 0);\n __decorate([\n Property(1000)\n ], Dialog.prototype, \"zIndex\", void 0);\n __decorate([\n Property(null)\n ], Dialog.prototype, \"target\", void 0);\n __decorate([\n Property('')\n ], Dialog.prototype, \"footerTemplate\", void 0);\n __decorate([\n Property(false)\n ], Dialog.prototype, \"allowDragging\", void 0);\n __decorate([\n Collection([{}], ButtonProps)\n ], Dialog.prototype, \"buttons\", void 0);\n __decorate([\n Property(true)\n ], Dialog.prototype, \"closeOnEscape\", void 0);\n __decorate([\n Complex({}, AnimationSettings)\n ], Dialog.prototype, \"animationSettings\", void 0);\n __decorate([\n Complex({ X: 'center', Y: 'center' }, PositionData)\n ], Dialog.prototype, \"position\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"open\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"beforeSanitizeHtml\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"beforeOpen\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"close\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"beforeClose\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"dragStart\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"dragStop\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"drag\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"overlayClick\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"resizeStart\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"resizing\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"resizeStop\", void 0);\n __decorate([\n Event()\n ], Dialog.prototype, \"destroyed\", void 0);\n Dialog = __decorate([\n NotifyPropertyChanges\n ], Dialog);\n return Dialog;\n}(Component));\nexport { Dialog };\n/**\n * Base for creating Alert and Confirmation Dialog through util method.\n */\n// eslint-disable-next-line\nexport var DialogUtility;\n(function (DialogUtility) {\n /**\n * An alert dialog box is used to display warning like messages to the users.\n * ```\n * Eg : DialogUtility.alert('Alert message');\n *\n * ```\n */\n /* istanbul ignore next */\n /**\n *\n * @param {AlertDialogArgs} args - specifies the string\n * @returns {Dialog} - returns the dialog element.\n */\n function alert(args) {\n // eslint-disable-next-line\n var dialogComponent;\n var dialogElement = createElement('div', { 'className': DLG_UTIL_ALERT });\n document.body.appendChild(dialogElement);\n var alertDialogObj;\n var okButtonModel = [{\n buttonModel: { isPrimary: true, content: 'OK' },\n click: function () {\n this.hide();\n }\n }];\n if (typeof (args) === 'string') {\n alertDialogObj = createDialog({ content: args,\n position: { X: 'center', Y: 'top' },\n isModal: true, header: DLG_UTIL_DEFAULT_TITLE,\n buttons: okButtonModel }, dialogElement);\n }\n else {\n alertDialogObj = createDialog(alertOptions(args), dialogElement);\n }\n alertDialogObj.close = function () {\n if (args && args.close) {\n args.close.apply(alertDialogObj);\n }\n alertDialogObj.destroy();\n if (alertDialogObj.element.classList.contains('e-dlg-modal')) {\n alertDialogObj.element.parentElement.remove();\n alertDialogObj.target.classList.remove(DLG_UTIL_ROOT);\n }\n else {\n alertDialogObj.element.remove();\n }\n };\n return alertDialogObj;\n }\n DialogUtility.alert = alert;\n /**\n * A confirm dialog displays a specified message along with ‘OK’ and ‘Cancel’ button.\n * ```\n * Eg : DialogUtility.confirm('Confirm dialog message');\n *\n * ```\n */\n /* istanbul ignore next */\n /**\n *\n * @param {ConfirmDialogArgs} args - specifies the args\n * @returns {Dialog} - returns te element\n */\n function confirm(args) {\n // eslint-disable-next-line\n var dialogComponent;\n var dialogElement = createElement('div', { 'className': DLG_UTIL_CONFIRM });\n document.body.appendChild(dialogElement);\n var confirmDialogObj;\n var okCancelButtonModel = [{\n buttonModel: { isPrimary: true, content: 'OK' },\n click: function () {\n this.hide();\n }\n }, {\n buttonModel: { content: 'Cancel' },\n click: function () {\n this.hide();\n }\n }];\n if (typeof (args) === 'string') {\n confirmDialogObj = createDialog({ position: { X: 'center', Y: 'top' }, content: args, isModal: true,\n header: DLG_UTIL_DEFAULT_TITLE, buttons: okCancelButtonModel\n }, dialogElement);\n }\n else {\n confirmDialogObj = createDialog(confirmOptions(args), dialogElement);\n }\n confirmDialogObj.close = function () {\n if (args && args.close) {\n args.close.apply(confirmDialogObj);\n }\n confirmDialogObj.destroy();\n if (confirmDialogObj.element.classList.contains('e-dlg-modal')) {\n confirmDialogObj.element.parentElement.remove();\n confirmDialogObj.target.classList.remove(DLG_UTIL_ROOT);\n }\n else {\n confirmDialogObj.element.remove();\n }\n };\n return confirmDialogObj;\n }\n DialogUtility.confirm = confirm;\n // eslint-disable-next-line\n function createDialog(options, element) {\n var dialogObject = new Dialog(options);\n dialogObject.appendTo(element);\n return dialogObject;\n }\n // eslint-disable-next-line\n function alertOptions(option) {\n var options = {};\n options.buttons = [];\n options = formOptions(options, option);\n options = setAlertButtonModel(options, option);\n return options;\n }\n // eslint-disable-next-line\n function confirmOptions(option) {\n var options = {};\n options.buttons = [];\n options = formOptions(options, option);\n options = setConfirmButtonModel(options, option);\n return options;\n }\n // eslint-disable-next-line\n function formOptions(options, option) {\n options.header = !isNullOrUndefined(option.title) ? option.title : DLG_UTIL_DEFAULT_TITLE;\n options.content = !isNullOrUndefined(option.content) ? option.content : '';\n options.isModal = !isNullOrUndefined(option.isModal) ? option.isModal : true;\n options.showCloseIcon = !isNullOrUndefined(option.showCloseIcon) ? option.showCloseIcon : false;\n options.allowDragging = !isNullOrUndefined(option.isDraggable) ? option.isDraggable : false;\n options.closeOnEscape = !isNullOrUndefined(option.closeOnEscape) ? option.closeOnEscape : false;\n options.position = !isNullOrUndefined(option.position) ? option.position : { X: 'center', Y: 'top' };\n options.animationSettings = !isNullOrUndefined(option.animationSettings) ? option.animationSettings :\n { effect: 'Fade', duration: 400, delay: 0 };\n options.cssClass = !isNullOrUndefined(option.cssClass) ? option.cssClass : '';\n options.zIndex = !isNullOrUndefined(option.zIndex) ? option.zIndex : 1000;\n options.open = !isNullOrUndefined(option.open) ? option.open : null;\n return options;\n }\n // eslint-disable-next-line\n function setAlertButtonModel(options, option) {\n var alertButtonModel = [{\n buttonModel: { isPrimary: true, content: 'OK' },\n click: function () {\n this.hide();\n }\n }];\n if (!isNullOrUndefined(option.okButton)) {\n options.buttons[0] = formButtonModel(options.buttons[0], option.okButton, alertButtonModel[0]);\n }\n else {\n options.buttons = alertButtonModel;\n }\n return options;\n }\n // eslint-disable-next-line\n function setConfirmButtonModel(options, option) {\n var okButtonModel = {\n buttonModel: { isPrimary: true, content: 'OK' },\n click: function () {\n this.hide();\n }\n };\n var cancelButtonModel = {\n buttonModel: { content: 'Cancel' },\n click: function () {\n this.hide();\n }\n };\n if (!isNullOrUndefined(option.okButton)) {\n options.buttons[0] = formButtonModel(options.buttons[0], option.okButton, okButtonModel);\n }\n else {\n options.buttons[0] = okButtonModel;\n }\n if (!isNullOrUndefined(option.cancelButton)) {\n options.buttons[1] = formButtonModel(options.buttons[1], option.cancelButton, cancelButtonModel);\n }\n else {\n options.buttons[1] = cancelButtonModel;\n }\n return options;\n }\n // eslint-disable-next-line\n function formButtonModel(buttonModel, option, buttonPropModel) {\n var buttonProps = buttonPropModel;\n if (!isNullOrUndefined(option.text)) {\n buttonProps.buttonModel.content = option.text;\n }\n if (!isNullOrUndefined(option.icon)) {\n buttonProps.buttonModel.iconCss = option.icon;\n }\n if (!isNullOrUndefined(option.cssClass)) {\n buttonProps.buttonModel.cssClass = option.cssClass;\n }\n if (!isNullOrUndefined(option.click)) {\n buttonProps.click = option.click;\n }\n return buttonProps;\n }\n})(DialogUtility || (DialogUtility = {}));\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { selectAll, select, createElement, Base, detach } from '@syncfusion/ej2-base';\nimport { extend, isNullOrUndefined, EventHandler } from '@syncfusion/ej2-base';\nimport { Property, NotifyPropertyChanges, Event, onIntlChange } from '@syncfusion/ej2-base';\nimport { L10n } from '@syncfusion/ej2-base';\n/**\n * global declarations\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport var regex = {\n /* eslint-disable no-useless-escape */\n EMAIL: new RegExp('^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}' +\n '|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$'),\n URL: /^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$/m,\n DATE_ISO: new RegExp('^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'),\n DIGITS: new RegExp('^[0-9]*$'),\n PHONE: new RegExp('^[+]?[0-9]{9,13}$'),\n CREDITCARD: new RegExp('^\\\\d{13,16}$')\n /* eslint-enable no-useless-escape */\n};\n/**\n * ErrorOption values\n *\n * @private\n */\nexport var ErrorOption;\n(function (ErrorOption) {\n /**\n * Defines the error message.\n */\n ErrorOption[ErrorOption[\"Message\"] = 0] = \"Message\";\n /**\n * Defines the error element type.\n */\n ErrorOption[ErrorOption[\"Label\"] = 1] = \"Label\";\n})(ErrorOption || (ErrorOption = {}));\n/**\n * FormValidator class enables you to validate the form fields based on your defined rules\n * ```html\n *
\n * \n * ```\n */\nvar FormValidator = /** @class */ (function (_super) {\n __extends(FormValidator, _super);\n /**\n * Initializes the FormValidator.\n *\n * @param {string | HTMLFormElement} element - Specifies the element to render as component.\n * @param {FormValidatorModel} options - Specifies the FormValidator model.\n * @private\n */\n function FormValidator(element, options) {\n var _this = _super.call(this, options, element) || this;\n _this.validated = [];\n _this.errorRules = [];\n _this.allowSubmit = false;\n _this.required = 'required';\n _this.infoElement = null;\n _this.inputElement = null;\n _this.selectQuery = 'input:not([type=reset]):not([type=button]), select, textarea';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _this.localyMessage = {};\n /**\n * Specifies the default messages for validation rules.\n *\n * @default { List of validation message }\n */\n _this.defaultMessages = {\n required: 'This field is required.',\n email: 'Please enter a valid email address.',\n url: 'Please enter a valid URL.',\n date: 'Please enter a valid date.',\n dateIso: 'Please enter a valid date ( ISO ).',\n creditcard: 'Please enter valid card number',\n number: 'Please enter a valid number.',\n digits: 'Please enter only digits.',\n maxLength: 'Please enter no more than {0} characters.',\n minLength: 'Please enter at least {0} characters.',\n rangeLength: 'Please enter a value between {0} and {1} characters long.',\n range: 'Please enter a value between {0} and {1}.',\n max: 'Please enter a value less than or equal to {0}.',\n min: 'Please enter a value greater than or equal to {0}.',\n regex: 'Please enter a correct value.',\n tel: 'Please enter a valid phone number.',\n pattern: 'Please enter a correct pattern value.',\n equalTo: 'Please enter the valid match text'\n };\n if (typeof _this.rules === 'undefined') {\n _this.rules = {};\n }\n _this.l10n = new L10n('formValidator', _this.defaultMessages, _this.locale);\n if (_this.locale) {\n _this.localeFunc();\n }\n onIntlChange.on('notifyExternalChange', _this.afterLocalization, _this);\n element = typeof element === 'string' ? select(element, document) : element;\n // Set novalidate to prevent default HTML5 form validation\n if (_this.element != null) {\n _this.element.setAttribute('novalidate', '');\n _this.inputElements = selectAll(_this.selectQuery, _this.element);\n _this.createHTML5Rules();\n _this.wireEvents();\n }\n else {\n return undefined;\n }\n return _this;\n }\n FormValidator_1 = FormValidator;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n /**\n * Add validation rules to the corresponding input element based on `name` attribute.\n *\n * @param {string} name `name` of form field.\n * @param {Object} rules Validation rules for the corresponding element.\n * @returns {void}\n */\n FormValidator.prototype.addRules = function (name, rules) {\n if (name) {\n // eslint-disable-next-line no-prototype-builtins\n if (this.rules.hasOwnProperty(name)) {\n extend(this.rules[name], rules, {});\n }\n else {\n this.rules[name] = rules;\n }\n }\n };\n /**\n * Remove validation to the corresponding field based on name attribute.\n * When no parameter is passed, remove all the validations in the form.\n *\n * @param {string} name Input name attribute value.\n * @param {string[]} rules List of validation rules need to be remove from the corresponding element.\n * @returns {void}\n */\n FormValidator.prototype.removeRules = function (name, rules) {\n if (!name && !rules) {\n this.rules = {};\n }\n else if (this.rules[name] && !rules) {\n delete this.rules[name];\n }\n else if (!isNullOrUndefined(this.rules[name] && rules)) {\n for (var i = 0; i < rules.length; i++) {\n delete this.rules[name][rules[i]];\n }\n }\n else {\n return;\n }\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Validate the current form values using defined rules.\n * Returns `true` when the form is valid otherwise `false`\n *\n * @param {string} selected - Optional parameter to validate specified element.\n * @returns {boolean}\n */\n FormValidator.prototype.validate = function (selected) {\n var rules = Object.keys(this.rules);\n if (selected && rules.length) {\n this.validateRules(selected);\n //filter the selected element it don't have any valid input element\n return rules.indexOf(selected) !== -1 && this.errorRules.filter(function (data) {\n return data.name === selected;\n }).length === 0;\n }\n else {\n this.errorRules = [];\n for (var _i = 0, rules_1 = rules; _i < rules_1.length; _i++) {\n var name_1 = rules_1[_i];\n this.validateRules(name_1);\n }\n return this.errorRules.length === 0;\n }\n };\n /* eslint-enable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Reset the value of all the fields in form.\n *\n * @returns {void}\n */\n FormValidator.prototype.reset = function () {\n this.element.reset();\n this.clearForm();\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Get input element by name.\n *\n * @param {string} name - Input element name attribute value.\n * @returns {HTMLInputElement}\n */\n FormValidator.prototype.getInputElement = function (name) {\n this.inputElement = (select('[name=\"' + name + '\"]', this.element));\n return this.inputElement;\n };\n /* eslint-enable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Destroy the form validator object and error elements.\n *\n * @returns {void}\n */\n FormValidator.prototype.destroy = function () {\n this.reset();\n this.unwireEvents();\n this.rules = {};\n var elements = selectAll('.' + this.errorClass + ', .' + this.validClass, this.element);\n for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {\n var element = elements_1[_i];\n detach(element);\n }\n _super.prototype.destroy.call(this);\n onIntlChange.off('notifyExternalChange', this.afterLocalization);\n };\n /**\n * @param {FormValidatorModel} newProp - Returns the dynamic property value of the component.\n * @param {FormValidatorModel} oldProp - Returns the previous property value of the component.\n * @returns {void}\n * @private\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n FormValidator.prototype.onPropertyChanged = function (newProp, oldProp) {\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'locale':\n this.localeFunc();\n break;\n }\n }\n };\n /**\n * @private\n * @returns {void}\n */\n FormValidator.prototype.localeFunc = function () {\n for (var _i = 0, _a = Object.keys(this.defaultMessages); _i < _a.length; _i++) {\n var key = _a[_i];\n this.l10n.setLocale(this.locale);\n var value = this.l10n.getConstant(key);\n this.localyMessage[key] = value;\n }\n };\n /**\n * @private\n * @returns {string} - Returns the component name.\n */\n FormValidator.prototype.getModuleName = function () {\n return 'formValidator';\n };\n /**\n * @param {any} args - Specifies the culture name.\n * @private\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n FormValidator.prototype.afterLocalization = function (args) {\n this.locale = args.locale;\n this.localeFunc();\n };\n /**\n * Allows you to refresh the form validator base events to the elements inside the form.\n *\n * @returns {void}\n */\n FormValidator.prototype.refresh = function () {\n this.unwireEvents();\n this.inputElements = selectAll(this.selectQuery, this.element);\n this.wireEvents();\n };\n FormValidator.prototype.clearForm = function () {\n this.errorRules = [];\n this.validated = [];\n var elements = selectAll(this.selectQuery, this.element);\n for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) {\n var element = elements_2[_i];\n var input = element;\n input.removeAttribute('aria-invalid');\n input.classList.remove(this.errorClass);\n if (input.name.length > 0) {\n this.getInputElement(input.name);\n this.getErrorElement(input.name);\n this.hideMessage(input.name);\n }\n input.classList.remove(this.validClass);\n }\n };\n FormValidator.prototype.createHTML5Rules = function () {\n var defRules = ['required', 'validateHidden', 'regex', 'rangeLength', 'maxLength', 'minLength', 'dateIso', 'digits',\n 'pattern', 'data-val-required', 'type', 'data-validation', 'min', 'max', 'range', 'equalTo', 'data-val-minlength-min',\n 'data-val-equalto-other', 'data-val-maxlength-max', 'data-val-range-min', 'data-val-regex-pattern', 'data-val-length-max',\n 'data-val-creditcard', 'data-val-phone'];\n var acceptedTypes = ['hidden', 'email', 'url', 'date', 'number', 'tel'];\n for (var _i = 0, _a = (this.inputElements); _i < _a.length; _i++) {\n var input = _a[_i];\n // Default attribute rules\n var allRule = {};\n for (var _b = 0, defRules_1 = defRules; _b < defRules_1.length; _b++) {\n var rule = defRules_1[_b];\n if (input.getAttribute(rule) !== null) {\n switch (rule) {\n case 'required':\n this.defRule(input, allRule, rule, input.required);\n break;\n case 'data-validation':\n rule = input.getAttribute(rule);\n this.defRule(input, allRule, rule, true);\n break;\n case 'type':\n if (acceptedTypes.indexOf(input.type) !== -1) {\n this.defRule(input, allRule, input.type, true);\n }\n break;\n case 'rangeLength':\n case 'range':\n this.defRule(input, allRule, rule, JSON.parse(input.getAttribute(rule)));\n break;\n case 'equalTo':\n {\n var id = input.getAttribute(rule);\n this.defRule(input, allRule, rule, id);\n }\n break;\n default:\n if (input.getAttribute('data-val') === 'true') {\n this.annotationRule(input, allRule, rule, input.getAttribute(rule));\n }\n else {\n this.defRule(input, allRule, rule, input.getAttribute(rule));\n }\n }\n }\n }\n //adding pattern type validation\n if (Object.keys(allRule).length !== 0) {\n this.addRules(input.name, allRule);\n }\n }\n };\n FormValidator.prototype.annotationRule = function (input, ruleCon, ruleName, value) {\n var annotationRule = ruleName.split('-');\n var rulesList = ['required', 'creditcard', 'phone', 'maxlength', 'minlength', 'range', 'regex', 'equalto'];\n var ruleFirstName = annotationRule[annotationRule.length - 1];\n var ruleSecondName = annotationRule[annotationRule.length - 2];\n if (rulesList.indexOf(ruleFirstName) !== -1) {\n switch (ruleFirstName) {\n case 'required':\n this.defRule(input, ruleCon, 'required', value);\n break;\n case 'creditcard':\n this.defRule(input, ruleCon, 'creditcard', value);\n break;\n case 'phone':\n this.defRule(input, ruleCon, 'tel', value);\n break;\n }\n }\n else if (rulesList.indexOf(ruleSecondName) !== -1) {\n switch (ruleSecondName) {\n case 'maxlength':\n this.defRule(input, ruleCon, 'maxLength', value);\n break;\n case 'minlength':\n this.defRule(input, ruleCon, 'minLength', value);\n break;\n case 'range':\n {\n var minvalue = input.getAttribute('data-val-range-min');\n var maxvalue = input.getAttribute('data-val-range-max');\n this.defRule(input, ruleCon, 'range', [minvalue, maxvalue]);\n }\n break;\n case 'equalto':\n {\n var id = input.getAttribute(ruleName).split('.');\n this.defRule(input, ruleCon, 'equalTo', id[id.length - 1]);\n }\n break;\n case 'regex':\n this.defRule(input, ruleCon, 'regex', value);\n break;\n }\n }\n };\n FormValidator.prototype.defRule = function (input, ruleCon, ruleName, value) {\n var message = input.getAttribute('data-' + ruleName + '-message');\n var annotationMessage = input.getAttribute('data-val-' + ruleName);\n var customMessage;\n if (this.rules[input.name] && ruleName !== 'validateHidden' && ruleName !== 'hidden') {\n this.getInputElement(input.name);\n customMessage = this.getErrorMessage(this.rules[input.name][ruleName], ruleName);\n }\n if (message) {\n value = [value, message];\n }\n else if (annotationMessage) {\n value = [value, annotationMessage];\n }\n else if (customMessage) {\n value = [value, customMessage];\n }\n ruleCon[ruleName] = value;\n };\n // Wire events to the form elements\n FormValidator.prototype.wireEvents = function () {\n for (var _i = 0, _a = (this.inputElements); _i < _a.length; _i++) {\n var input = _a[_i];\n if (FormValidator_1.isCheckable(input)) {\n EventHandler.add(input, 'click', this.clickHandler, this);\n }\n else if (input.tagName === 'SELECT') {\n EventHandler.add(input, 'change', this.changeHandler, this);\n }\n else {\n EventHandler.add(input, 'focusout', this.focusOutHandler, this);\n EventHandler.add(input, 'keyup', this.keyUpHandler, this);\n }\n }\n EventHandler.add(this.element, 'submit', this.submitHandler, this);\n EventHandler.add(this.element, 'reset', this.resetHandler, this);\n };\n // UnWire events to the form elements\n FormValidator.prototype.unwireEvents = function () {\n for (var _i = 0, _a = (this.inputElements); _i < _a.length; _i++) {\n var input = _a[_i];\n EventHandler.clearEvents(input);\n }\n EventHandler.remove(this.element, 'submit', this.submitHandler);\n EventHandler.remove(this.element, 'reset', this.resetHandler);\n };\n // Handle input element focusout event\n FormValidator.prototype.focusOutHandler = function (e) {\n this.trigger('focusout', e);\n //FormValidator.triggerCallback(this.focusout, e);\n var element = e.target;\n if (this.rules[element.name]) {\n if (this.rules[element.name][this.required] || element.value.length > 0) {\n this.validate(element.name);\n }\n else if (this.validated.indexOf(element.name) === -1) {\n this.validated.push(element.name);\n }\n }\n };\n // Handle input element keyup event\n FormValidator.prototype.keyUpHandler = function (e) {\n this.trigger('keyup', e);\n var element = e.target;\n // List of keys need to prevent while validation\n var excludeKeys = [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225];\n if (e.which === 9 && (!this.rules[element.name] || (this.rules[element.name] && !this.rules[element.name][this.required]))) {\n return;\n }\n if (this.validated.indexOf(element.name) !== -1 && this.rules[element.name] && excludeKeys.indexOf(e.which) === -1) {\n this.validate(element.name);\n }\n };\n // Handle input click event\n FormValidator.prototype.clickHandler = function (e) {\n this.trigger('click', e);\n var element = e.target;\n // If element type is not submit allow validation\n if (element.type !== 'submit') {\n this.validate(element.name);\n }\n else if (element.getAttribute('formnovalidate') !== null) {\n // Prevent form validation, if submit button has formnovalidate attribute\n this.allowSubmit = true;\n }\n };\n // Handle input change event\n FormValidator.prototype.changeHandler = function (e) {\n this.trigger('change', e);\n var element = e.target;\n this.validate(element.name);\n };\n // Handle form submit event\n FormValidator.prototype.submitHandler = function (e) {\n this.trigger('submit', e);\n //FormValidator.triggerCallback(this.submit, e);\n // Prevent form submit if validation failed\n if (!this.allowSubmit && !this.validate()) {\n e.preventDefault();\n }\n else {\n this.allowSubmit = false;\n }\n };\n // Handle form reset\n FormValidator.prototype.resetHandler = function () {\n this.clearForm();\n };\n // Validate each rule based on input element name\n FormValidator.prototype.validateRules = function (name) {\n if (!this.rules[name]) {\n return;\n }\n var rules = Object.keys(this.rules[name]);\n var hiddenType = false;\n var validateHiddenType = false;\n var vhPos = rules.indexOf('validateHidden');\n var hPos = rules.indexOf('hidden');\n this.getInputElement(name);\n if (hPos !== -1) {\n hiddenType = true;\n }\n if (vhPos !== -1) {\n validateHiddenType = true;\n }\n if (!hiddenType || (hiddenType && validateHiddenType)) {\n if (vhPos !== -1) {\n rules.splice(vhPos, 1);\n }\n if (hPos !== -1) {\n rules.splice((hPos - 1), 1);\n }\n this.getErrorElement(name);\n for (var _i = 0, rules_2 = rules; _i < rules_2.length; _i++) {\n var rule = rules_2[_i];\n var errorMessage = this.getErrorMessage(this.rules[name][rule], rule);\n var errorRule = { name: name, message: errorMessage };\n var eventArgs = {\n inputName: name,\n element: this.inputElement,\n message: errorMessage\n };\n if (!this.isValid(name, rule) && !this.inputElement.classList.contains(this.ignore)) {\n this.removeErrorRules(name);\n this.errorRules.push(errorRule);\n // Set aria attributes to invalid elements\n this.inputElement.setAttribute('aria-invalid', 'true');\n this.inputElement.setAttribute('aria-describedby', this.inputElement.id + '-info');\n this.inputElement.classList.add(this.errorClass);\n this.inputElement.classList.remove(this.validClass);\n if (!this.infoElement) {\n this.createErrorElement(name, errorRule.message, this.inputElement);\n }\n else {\n this.showMessage(errorRule);\n }\n eventArgs.errorElement = this.infoElement;\n eventArgs.status = 'failure';\n this.inputElement.classList.add(this.errorClass);\n this.inputElement.classList.remove(this.validClass);\n this.optionalValidationStatus(name, eventArgs);\n this.trigger('validationComplete', eventArgs);\n // Set aria-required to required rule elements\n if (rule === 'required') {\n this.inputElement.setAttribute('aria-required', 'true');\n }\n break;\n }\n else {\n this.hideMessage(name);\n eventArgs.status = 'success';\n this.trigger('validationComplete', eventArgs);\n }\n }\n }\n else {\n return;\n }\n };\n // Update the optional validation status\n FormValidator.prototype.optionalValidationStatus = function (name, refer) {\n if (!this.rules[name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {\n this.infoElement.innerHTML = this.inputElement.value;\n this.infoElement.setAttribute('aria-invalid', 'false');\n refer.status = '';\n this.hideMessage(name);\n }\n };\n // Check the input element whether it's value satisfy the validation rule or not\n FormValidator.prototype.isValid = function (name, rule) {\n var params = this.rules[name][rule];\n var param = (params instanceof Array && typeof params[1] === 'string') ? params[0] : params;\n var currentRule = this.rules[name][rule];\n var args = { value: this.inputElement.value, param: param, element: this.inputElement, formElement: this.element };\n this.trigger('validationBegin', args);\n if (!args.param && rule === 'required') {\n return true;\n }\n if (currentRule && typeof currentRule[0] === 'function') {\n var fn = currentRule[0];\n return fn.call(this, { element: this.inputElement, value: this.inputElement.value });\n }\n else if (FormValidator_1.isCheckable(this.inputElement)) {\n if (rule !== 'required') {\n return true;\n }\n return selectAll('input[name=\"' + name + '\"]:checked', this.element).length > 0;\n }\n else {\n return FormValidator_1.checkValidator[rule](args);\n }\n };\n // Return default error message or custom error message\n FormValidator.prototype.getErrorMessage = function (ruleValue, rule) {\n var message = this.inputElement.getAttribute('data-' + rule + '-message') ?\n this.inputElement.getAttribute('data-' + rule + '-message') :\n (ruleValue instanceof Array && typeof ruleValue[1] === 'string') ? ruleValue[1] :\n (Object.keys(this.localyMessage).length !== 0) ? this.localyMessage[rule] : this.defaultMessages[rule];\n var formats = message.match(/{(\\d)}/g);\n if (!isNullOrUndefined(formats)) {\n for (var i = 0; i < formats.length; i++) {\n var value = ruleValue instanceof Array ? ruleValue[i] : ruleValue;\n message = message.replace(formats[i], value);\n }\n }\n return message;\n };\n // Create error element based on name and error message\n FormValidator.prototype.createErrorElement = function (name, message, input) {\n var errorElement = createElement(this.errorElement, {\n className: this.errorClass,\n innerHTML: message,\n attrs: { for: name }\n });\n // Create message design if errorOption is message\n if (this.errorOption === ErrorOption.Message) {\n errorElement.classList.remove(this.errorClass);\n errorElement.classList.add('e-message');\n errorElement = createElement(this.errorContainer, { className: this.errorClass, innerHTML: errorElement.outerHTML });\n }\n errorElement.id = this.inputElement.name + '-info';\n // Append error message into MVC error message element\n if (this.element.querySelector('[data-valmsg-for=\"' + input.id + '\"]')) {\n this.element.querySelector('[data-valmsg-for=\"' + input.id + '\"]').appendChild(errorElement);\n }\n else if (input.hasAttribute('data-msg-containerid') === true) {\n // Append error message into custom div element\n var containerId = input.getAttribute('data-msg-containerid');\n var divElement = select('#' + containerId, this.element);\n divElement.appendChild(errorElement);\n }\n else if (this.customPlacement != null) {\n // Call custom placement function if customPlacement is not null\n this.customPlacement.call(this, this.inputElement, errorElement);\n }\n else {\n this.inputElement.parentNode.insertBefore(errorElement, this.inputElement.nextSibling);\n }\n errorElement.style.display = 'block';\n this.getErrorElement(name);\n this.validated.push(name);\n this.checkRequired(name);\n };\n // Get error element by name\n FormValidator.prototype.getErrorElement = function (name) {\n this.infoElement = select(this.errorElement + '.' + this.errorClass, this.inputElement.parentElement);\n if (!this.infoElement) {\n this.infoElement = select(this.errorElement + '.' + this.errorClass + '[for=\"' + name + '\"]', this.element);\n }\n return this.infoElement;\n };\n // Remove existing rule from errorRules object\n FormValidator.prototype.removeErrorRules = function (name) {\n for (var i = 0; i < this.errorRules.length; i++) {\n var rule = this.errorRules[i];\n if (rule.name === name) {\n this.errorRules.splice(i, 1);\n }\n }\n };\n // Show error message to the input element\n FormValidator.prototype.showMessage = function (errorRule) {\n this.infoElement.style.display = 'block';\n this.infoElement.innerHTML = errorRule.message;\n this.checkRequired(errorRule.name);\n };\n // Hide error message based on input name\n FormValidator.prototype.hideMessage = function (name) {\n if (this.infoElement) {\n this.infoElement.style.display = 'none';\n this.removeErrorRules(name);\n this.inputElement.classList.add(this.validClass);\n this.inputElement.classList.remove(this.errorClass);\n this.inputElement.setAttribute('aria-invalid', 'false');\n }\n };\n // Check whether the input element have required rule and its value is not empty\n FormValidator.prototype.checkRequired = function (name) {\n if (!this.rules[name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {\n this.infoElement.innerHTML = this.inputElement.value;\n this.infoElement.setAttribute('aria-invalid', 'false');\n this.hideMessage(name);\n }\n };\n // Return boolean result if the input have chekcable or submit types\n FormValidator.isCheckable = function (input) {\n var inputType = input.getAttribute('type');\n return inputType && (inputType === 'checkbox' || inputType === 'radio' || inputType === 'submit');\n };\n var FormValidator_1;\n // List of function to validate the rules\n FormValidator.checkValidator = {\n required: function (option) {\n return !isNaN(Date.parse(option.value)) ? !isNaN(new Date(option.value).getTime()) : option.value.toString().length > 0;\n },\n email: function (option) {\n return regex.EMAIL.test(option.value);\n },\n url: function (option) {\n return regex.URL.test(option.value);\n },\n dateIso: function (option) {\n return regex.DATE_ISO.test(option.value);\n },\n tel: function (option) {\n return regex.PHONE.test(option.value);\n },\n creditcard: function (option) {\n return regex.CREDITCARD.test(option.value);\n },\n number: function (option) {\n return !isNaN(Number(option.value)) && option.value.indexOf(' ') === -1;\n },\n digits: function (option) {\n return regex.DIGITS.test(option.value);\n },\n maxLength: function (option) {\n return option.value.length <= option.param;\n },\n minLength: function (option) {\n return option.value.length >= option.param;\n },\n rangeLength: function (option) {\n var param = option.param;\n return option.value.length >= param[0] && option.value.length <= param[1];\n },\n range: function (option) {\n var param = option.param;\n return !isNaN(Number(option.value)) && Number(option.value) >= param[0] && Number(option.value) <= param[1];\n },\n date: function (option) {\n return !isNaN(new Date(option.value).getTime());\n },\n max: function (option) {\n if (!isNaN(Number(option.value))) {\n // Maximum rule validation for number\n return +option.value <= option.param;\n }\n // Maximum rule validation for date\n return new Date(option.value).getTime() <= new Date(JSON.parse(JSON.stringify(option.param))).getTime();\n },\n min: function (option) {\n if (!isNaN(Number(option.value))) {\n // Minimum rule validation for number\n return +option.value >= option.param;\n }\n else if ((option.value).indexOf(',') !== -1) {\n var uNum = (option.value).replace(/,/g, '');\n return parseFloat(uNum) >= option.param;\n }\n else {\n // Minimum rule validation for date\n return new Date(option.value).getTime() >= new Date(JSON.parse(JSON.stringify(option.param))).getTime();\n }\n },\n regex: function (option) {\n return new RegExp(option.param).test(option.value);\n },\n equalTo: function (option) {\n var compareTo = option.formElement.querySelector('#' + option.param);\n option.param = compareTo.value;\n return option.param === option.value;\n }\n };\n __decorate([\n Property('')\n ], FormValidator.prototype, \"locale\", void 0);\n __decorate([\n Property('e-hidden')\n ], FormValidator.prototype, \"ignore\", void 0);\n __decorate([\n Property()\n ], FormValidator.prototype, \"rules\", void 0);\n __decorate([\n Property('e-error')\n ], FormValidator.prototype, \"errorClass\", void 0);\n __decorate([\n Property('e-valid')\n ], FormValidator.prototype, \"validClass\", void 0);\n __decorate([\n Property('label')\n ], FormValidator.prototype, \"errorElement\", void 0);\n __decorate([\n Property('div')\n ], FormValidator.prototype, \"errorContainer\", void 0);\n __decorate([\n Property(ErrorOption.Label)\n ], FormValidator.prototype, \"errorOption\", void 0);\n __decorate([\n Event()\n ], FormValidator.prototype, \"focusout\", void 0);\n __decorate([\n Event()\n ], FormValidator.prototype, \"keyup\", void 0);\n __decorate([\n Event()\n ], FormValidator.prototype, \"click\", void 0);\n __decorate([\n Event()\n ], FormValidator.prototype, \"change\", void 0);\n __decorate([\n Event()\n ], FormValidator.prototype, \"submit\", void 0);\n __decorate([\n Event()\n ], FormValidator.prototype, \"validationBegin\", void 0);\n __decorate([\n Event()\n ], FormValidator.prototype, \"validationComplete\", void 0);\n __decorate([\n Event()\n ], FormValidator.prototype, \"customPlacement\", void 0);\n FormValidator = FormValidator_1 = __decorate([\n NotifyPropertyChanges\n ], FormValidator);\n return FormValidator;\n}(Base));\nexport { FormValidator };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createElement, isNullOrUndefined, remove } from '@syncfusion/ej2-base';\nimport { FormValidator } from '@syncfusion/ej2-inputs';\nimport * as cls from '../base/css-constant';\n/**\n * Appointment window field validation\n */\nvar FieldValidator = /** @class */ (function () {\n function FieldValidator() {\n }\n FieldValidator.prototype.renderFormValidator = function (form, rules, element, locale) {\n var _this = this;\n this.element = element;\n this.formObj = new FormValidator(form, {\n locale: locale,\n customPlacement: function (inputElement, error) {\n _this.errorPlacement(inputElement, error);\n },\n rules: rules,\n validationComplete: function (args) {\n _this.validationComplete(args);\n },\n focusout: function (args) {\n _this.focusOut(args);\n }\n });\n };\n FieldValidator.prototype.focusOut = function (args) {\n var target = args.relatedTarget;\n if (target && (target.classList.contains('e-dlg-closeicon-btn') || target.classList.contains('e-close')\n || target.classList.contains(cls.ALLDAY_CELLS_CLASS) || target.classList.contains(cls.HEADER_CELLS_CLASS)\n || target.classList.contains(cls.QUICK_POPUP_EVENT_DETAILS_CLASS) || target.classList.contains(cls.WORK_CELLS_CLASS)\n || target.classList.contains(cls.EVENT_WINDOW_CANCEL_BUTTON_CLASS))) {\n this.ignoreError = true;\n }\n else {\n this.ignoreError = false;\n }\n };\n FieldValidator.prototype.validationComplete = function (args) {\n var elem = this.element.querySelector('#' + args.inputName + '_Error');\n if (elem) {\n elem.style.display = (args.status === 'failure') ? '' : 'none';\n }\n };\n FieldValidator.prototype.errorPlacement = function (inputElement, error) {\n var id = error.getAttribute('for');\n var elem = this.element.querySelector('#' + id + '_Error');\n if (!elem && !this.ignoreError) {\n this.createTooltip(inputElement, error, id, '');\n }\n if (!isNullOrUndefined(elem)) {\n elem.querySelector('.e-error').innerHTML = error.innerHTML;\n }\n };\n FieldValidator.prototype.createTooltip = function (element, error, name, display) {\n var dlgContent;\n var client;\n var inputClient = element.getBoundingClientRect();\n if (this.element.classList.contains(cls.POPUP_WRAPPER_CLASS)) {\n dlgContent = this.element;\n client = this.element.getBoundingClientRect();\n }\n else {\n dlgContent = this.element.querySelector('.e-schedule-dialog .e-dlg-content');\n client = dlgContent.getBoundingClientRect();\n }\n var div = createElement('div', {\n className: 'e-tooltip-wrap e-popup ' + cls.ERROR_VALIDATION_CLASS,\n id: name + '_Error',\n styles: 'display:' + display + ';top:' +\n (inputClient.bottom - client.top + dlgContent.scrollTop + 9) + 'px;left:' +\n (inputClient.left - client.left + dlgContent.scrollLeft + inputClient.width / 2) + 'px;'\n });\n var content = createElement('div', { className: 'e-tip-content' });\n content.appendChild(error);\n var arrow = createElement('div', { className: 'e-arrow-tip e-tip-top' });\n arrow.appendChild(createElement('div', { className: 'e-arrow-tip-outer e-tip-top' }));\n arrow.appendChild(createElement('div', { className: 'e-arrow-tip-inner e-tip-top' }));\n div.appendChild(content);\n div.appendChild(arrow);\n dlgContent.appendChild(div);\n div.style.left = (parseInt(div.style.left, 10) - div.offsetWidth / 2) + 'px';\n };\n FieldValidator.prototype.destroyToolTip = function () {\n if (this.element) {\n var elements = [].slice.call(this.element.querySelectorAll('.' + cls.ERROR_VALIDATION_CLASS));\n for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {\n var elem = elements_1[_i];\n remove(elem);\n }\n }\n if (this.formObj && this.formObj.element) {\n this.formObj.reset();\n }\n };\n FieldValidator.prototype.destroy = function () {\n if (this.formObj && this.formObj.element && !this.formObj.isDestroyed) {\n this.formObj.destroy();\n }\n this.formObj = null;\n this.element = null;\n };\n return FieldValidator;\n}());\nexport { FieldValidator };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { closest, EventHandler, isNullOrUndefined, formatUnit, append } from '@syncfusion/ej2-base';\nimport { addClass, removeClass, createElement, remove, extend } from '@syncfusion/ej2-base';\nimport { Dialog, Popup, isCollide } from '@syncfusion/ej2-popups';\nimport { Button } from '@syncfusion/ej2-buttons';\nimport { Input } from '@syncfusion/ej2-inputs';\nimport { FieldValidator } from './form-validator';\nimport * as event from '../base/constant';\nimport * as cls from '../base/css-constant';\nimport * as util from '../base/util';\nvar EVENT_FIELD = 'e-field';\n/**\n * Quick Popups interactions\n */\nvar QuickPopups = /** @class */ (function () {\n function QuickPopups(parent) {\n this.isMultipleEventSelect = false;\n this.isCrudAction = false;\n this.parent = parent;\n this.l10n = this.parent.localeObj;\n this.fieldValidator = new FieldValidator();\n this.render();\n this.addEventListener();\n }\n QuickPopups.prototype.render = function () {\n this.renderQuickPopup();\n this.renderMorePopup();\n this.renderQuickDialog();\n };\n QuickPopups.prototype.renderQuickPopup = function () {\n var quickPopupWrapper = createElement('div', { className: cls.POPUP_WRAPPER_CLASS + ' e-popup-close' });\n if (this.parent.isAdaptive) {\n document.body.appendChild(quickPopupWrapper);\n addClass([quickPopupWrapper], cls.DEVICE_CLASS);\n }\n else {\n this.parent.element.appendChild(quickPopupWrapper);\n }\n this.quickPopup = new Popup(quickPopupWrapper, {\n targetType: (this.parent.isAdaptive ? 'container' : 'relative'),\n enableRtl: this.parent.enableRtl,\n open: this.quickPopupOpen.bind(this),\n close: this.quickPopupClose.bind(this),\n hideAnimation: (this.parent.isAdaptive ? { name: 'ZoomOut' } : { name: 'FadeOut', duration: 150 }),\n showAnimation: (this.parent.isAdaptive ? { name: 'ZoomIn' } : { name: 'FadeIn', duration: 150 }),\n collision: (this.parent.isAdaptive ? { X: 'fit', Y: 'fit' } :\n (this.parent.enableRtl ? { X: 'flip', Y: 'fit' } : { X: 'none', Y: 'fit' })),\n position: (this.parent.isAdaptive || this.parent.enableRtl ? { X: 'left', Y: 'top' } : { X: 'right', Y: 'top' }),\n viewPortElement: (this.parent.isAdaptive ? document.body : this.parent.element),\n zIndex: (this.parent.isAdaptive ? 1004 : 3)\n });\n };\n QuickPopups.prototype.renderMorePopup = function () {\n var moreEventPopup = \"
\");\n var moreEventWrapper = createElement('div', {\n className: cls.MORE_POPUP_WRAPPER_CLASS + ' e-popup-close',\n innerHTML: moreEventPopup\n });\n if (this.parent.isAdaptive) {\n document.body.appendChild(moreEventWrapper);\n addClass([moreEventWrapper], cls.DEVICE_CLASS);\n }\n else {\n this.parent.element.appendChild(moreEventWrapper);\n }\n this.morePopup = new Popup(moreEventWrapper, {\n targetType: (this.parent.isAdaptive ? 'container' : 'relative'),\n enableRtl: this.parent.enableRtl,\n hideAnimation: { name: 'ZoomOut', duration: 300 },\n showAnimation: { name: 'ZoomIn', duration: 300 },\n open: this.morePopupOpen.bind(this),\n close: this.morePopupClose.bind(this),\n collision: (this.parent.isAdaptive ? { X: 'fit', Y: 'fit' } :\n (this.parent.enableRtl ? { X: 'flip', Y: 'fit' } : { X: 'flip', Y: 'flip' })),\n viewPortElement: (this.parent.isAdaptive ? document.body : this.parent.element),\n zIndex: (this.parent.isAdaptive ? 1002 : 2)\n });\n var closeButton = this.morePopup.element.querySelector('.' + cls.MORE_EVENT_CLOSE_CLASS);\n this.renderButton('e-round', cls.ICON + ' ' + cls.CLOSE_ICON_CLASS, false, closeButton, this.closeClick);\n EventHandler.add(this.morePopup.element.querySelector('.' + cls.MORE_EVENT_HEADER_DATE_CLASS), 'click', this.navigationClick, this);\n };\n QuickPopups.prototype.renderQuickDialog = function () {\n var buttonModel = [\n { buttonModel: { cssClass: 'e-quick-alertok e-flat', isPrimary: true }, click: this.dialogButtonClick.bind(this) },\n { buttonModel: { cssClass: 'e-quick-alertcancel e-flat', isPrimary: false }, click: this.dialogButtonClick.bind(this) },\n {\n buttonModel: { cssClass: 'e-quick-dialog-cancel e-disable e-flat', isPrimary: false },\n click: this.dialogButtonClick.bind(this)\n }\n ];\n if (this.parent.eventSettings.editFollowingEvents) {\n var followingSeriesButton = {\n buttonModel: { cssClass: 'e-quick-alertfollowing e-flat', isPrimary: false }, click: this.dialogButtonClick.bind(this)\n };\n buttonModel.splice(1, 0, followingSeriesButton);\n }\n this.quickDialog = new Dialog({\n animationSettings: { effect: 'Zoom' },\n buttons: buttonModel,\n cssClass: cls.QUICK_DIALOG_CLASS,\n closeOnEscape: true,\n enableRtl: this.parent.enableRtl,\n beforeClose: this.beforeQuickDialogClose.bind(this),\n isModal: true,\n position: { X: 'center', Y: 'center' },\n showCloseIcon: true,\n target: document.body,\n visible: false,\n width: 'auto'\n });\n var dialogElement = createElement('div', { id: this.parent.element.id + 'QuickDialog' });\n this.parent.element.appendChild(dialogElement);\n this.quickDialog.appendTo(dialogElement);\n var okButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_OK);\n if (okButton) {\n okButton.setAttribute('aria-label', this.l10n.getConstant('occurrence'));\n okButton.setAttribute('aria-label', okButton.innerHTML);\n }\n var cancelButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_CANCEL);\n if (cancelButton) {\n cancelButton.setAttribute('aria-label', this.l10n.getConstant('series'));\n cancelButton.setAttribute('aria-label', cancelButton.innerHTML);\n }\n if (this.quickDialog.element.querySelector('.e-dlg-closeicon-btn')) {\n this.quickDialog.element.querySelector('.e-dlg-closeicon-btn').setAttribute('title', this.l10n.getConstant('close'));\n }\n };\n // eslint-disable-next-line max-len\n QuickPopups.prototype.renderButton = function (className, iconName, isDisabled, element, clickEvent) {\n var buttonObj = new Button({\n cssClass: className,\n disabled: isDisabled,\n enableRtl: this.parent.enableRtl,\n iconCss: iconName\n });\n buttonObj.appendTo(element);\n EventHandler.add(element, 'click', clickEvent, this);\n removeClass([element], cls.ICON);\n };\n QuickPopups.prototype.quickDialogClass = function (action) {\n var classList = [\n cls.QUICK_DIALOG_OCCURRENCE_CLASS, cls.QUICK_DIALOG_SERIES_CLASS, cls.QUICK_DIALOG_DELETE_CLASS,\n cls.QUICK_DIALOG_CANCEL_CLASS, cls.QUICK_DIALOG_ALERT_BTN_CLASS, cls.DISABLE_CLASS\n ];\n var okButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_OK);\n var cancelButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_CANCEL);\n var followingEventButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_FOLLOWING);\n removeClass([okButton, cancelButton], classList);\n addClass([this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_CANCEL_CLASS)], cls.DISABLE_CLASS);\n if (this.parent.eventSettings.editFollowingEvents) {\n addClass([followingEventButton], cls.DISABLE_CLASS);\n removeClass([this.quickDialog.element], cls.FOLLOWING_EVENTS_DIALOG);\n }\n switch (action) {\n case 'Recurrence':\n addClass([okButton], cls.QUICK_DIALOG_OCCURRENCE_CLASS);\n addClass([cancelButton], cls.QUICK_DIALOG_SERIES_CLASS);\n if (this.parent.eventSettings.editFollowingEvents) {\n removeClass([followingEventButton], cls.DISABLE_CLASS);\n addClass([this.quickDialog.element], cls.FOLLOWING_EVENTS_DIALOG);\n addClass([followingEventButton], cls.QUICK_DIALOG_FOLLOWING_EVENTS_CLASS);\n }\n break;\n case 'Delete':\n addClass([okButton], cls.QUICK_DIALOG_DELETE_CLASS);\n addClass([cancelButton], cls.QUICK_DIALOG_CANCEL_CLASS);\n break;\n case 'Alert':\n addClass([okButton], [cls.QUICK_DIALOG_ALERT_OK, cls.QUICK_DIALOG_ALERT_BTN_CLASS]);\n addClass([cancelButton], [cls.QUICK_DIALOG_ALERT_CANCEL, cls.DISABLE_CLASS]);\n break;\n }\n };\n QuickPopups.prototype.applyFormValidation = function () {\n var form = this.quickPopup.element.querySelector('.' + cls.FORM_CLASS);\n var rules = {};\n rules[this.parent.eventSettings.fields.subject.name] = this.parent.eventSettings.fields.subject.validation;\n this.fieldValidator.renderFormValidator(form, rules, this.quickPopup.element, this.parent.locale);\n };\n QuickPopups.prototype.openRecurrenceAlert = function () {\n var editDeleteOnly = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_OK);\n if (editDeleteOnly) {\n editDeleteOnly.innerHTML = this.l10n.getConstant(this.parent.currentAction === 'Delete' ? 'deleteEvent' : 'editEvent');\n editDeleteOnly.setAttribute('aria-label', editDeleteOnly.innerHTML);\n }\n var editFollowingEventsOnly = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_FOLLOWING);\n if (editFollowingEventsOnly) {\n editFollowingEventsOnly.innerHTML = this.l10n.getConstant('editFollowingEvent');\n editFollowingEventsOnly.setAttribute('aria-label', editFollowingEventsOnly.innerHTML);\n }\n var editDeleteSeries = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_CANCEL);\n if (editDeleteSeries) {\n editDeleteSeries.innerHTML = this.l10n.getConstant(this.parent.currentAction === 'Delete' ? 'deleteSeries' : 'editSeries');\n editDeleteSeries.setAttribute('aria-label', editDeleteSeries.innerHTML);\n }\n this.quickDialog.content = this.l10n.getConstant('editContent');\n this.quickDialog.header = this.l10n.getConstant(this.parent.currentAction === 'Delete' ? 'deleteTitle' : 'editTitle');\n this.quickDialogClass('Recurrence');\n var activeEvent = this.parent.activeEventData.event;\n if (this.parent.eventSettings.editFollowingEvents && this.parent.currentAction === 'EditOccurrence'\n && !isNullOrUndefined(activeEvent[this.parent.eventFields.recurrenceID]) && activeEvent[this.parent.eventFields.recurrenceID]\n !== activeEvent[this.parent.eventFields.id]) {\n var followingEventButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_FOLLOWING);\n addClass([followingEventButton], cls.DISABLE_CLASS);\n }\n this.showQuickDialog('RecurrenceAlert');\n };\n QuickPopups.prototype.openRecurrenceValidationAlert = function (type) {\n this.quickDialogClass('Alert');\n var okButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_OK);\n okButton.innerHTML = this.l10n.getConstant('ok');\n okButton.setAttribute('aria-label', okButton.innerHTML);\n var cancelButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_CANCEL);\n cancelButton.innerHTML = this.l10n.getConstant('cancel');\n cancelButton.setAttribute('aria-label', cancelButton.innerHTML);\n this.quickDialog.header = this.l10n.getConstant('alert');\n var dialogCancel;\n switch (type) {\n case 'wrongPattern':\n addClass([cancelButton], cls.DISABLE_CLASS);\n this.quickDialog.content = this.l10n.getConstant('wrongPattern');\n break;\n case 'createError':\n addClass([cancelButton], cls.DISABLE_CLASS);\n this.quickDialog.content = this.l10n.getConstant('createError');\n break;\n case 'sameDayAlert':\n addClass([cancelButton], cls.DISABLE_CLASS);\n this.quickDialog.content = this.l10n.getConstant('sameDayAlert');\n break;\n case 'seriesChangeAlert':\n dialogCancel = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_CANCEL_CLASS);\n removeClass([cancelButton, dialogCancel], cls.DISABLE_CLASS);\n this.quickDialog.content = this.l10n.getConstant('seriesChangeAlert');\n okButton.innerHTML = this.l10n.getConstant('yes');\n cancelButton.innerHTML = this.l10n.getConstant('no');\n dialogCancel.innerHTML = this.l10n.getConstant('cancel');\n break;\n case 'occurrenceAlert':\n addClass([cancelButton], cls.DISABLE_CLASS);\n this.quickDialog.content = this.l10n.getConstant('occurenceAlert');\n break;\n }\n if ((!this.parent.enableRecurrenceValidation && type === 'wrongPattern') || this.parent.enableRecurrenceValidation) {\n this.showQuickDialog('RecurrenceValidationAlert');\n }\n };\n QuickPopups.prototype.openDeleteAlert = function () {\n if (this.parent.activeViewOptions.readonly) {\n return;\n }\n var okButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_OK);\n if (okButton) {\n okButton.innerHTML = this.l10n.getConstant('delete');\n okButton.setAttribute('aria-label', okButton.innerHTML);\n }\n var cancelButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_CANCEL);\n if (cancelButton) {\n cancelButton.innerHTML = this.l10n.getConstant('cancel');\n cancelButton.setAttribute('aria-label', cancelButton.innerHTML);\n }\n this.quickDialog.content = (this.parent.activeEventData.event.length > 1) ?\n this.l10n.getConstant('deleteMultipleContent') : this.l10n.getConstant('deleteContent');\n this.quickDialog.header = (this.parent.activeEventData.event.length > 1) ?\n this.l10n.getConstant('deleteMultipleEvent') : this.l10n.getConstant('deleteEvent');\n this.quickDialogClass('Delete');\n this.showQuickDialog('DeleteAlert');\n };\n QuickPopups.prototype.openValidationError = function (type, eventData) {\n this.quickDialog.header = this.l10n.getConstant('alert');\n this.quickDialog.content = this.l10n.getConstant(type);\n var okButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_OK);\n if (okButton) {\n okButton.innerHTML = this.l10n.getConstant('ok');\n okButton.setAttribute('aria-label', okButton.innerHTML);\n }\n var cancelButton = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_CANCEL);\n if (cancelButton) {\n cancelButton.innerHTML = this.l10n.getConstant('cancel');\n okButton.setAttribute('aria-label', cancelButton.innerHTML);\n }\n this.quickDialogClass('Alert');\n this.showQuickDialog('ValidationAlert', eventData);\n };\n QuickPopups.prototype.showQuickDialog = function (popupType, eventData) {\n var _this = this;\n this.quickDialog.dataBind();\n var eventProp = {\n type: popupType, cancel: false, element: this.quickDialog.element,\n data: extend({}, (eventData || this.parent.activeEventData.event), null, true)\n };\n this.parent.trigger(event.popupOpen, eventProp, function (popupArgs) {\n if (!popupArgs.cancel) {\n _this.quickDialog.show();\n }\n });\n };\n QuickPopups.prototype.createMoreEventList = function (eventCollection, groupOrder, groupIndex) {\n var _this = this;\n var fields = this.parent.eventFields;\n var moreEventContentEle = createElement('div', { className: cls.MORE_EVENT_CONTENT_CLASS });\n var moreEventWrapperEle = createElement('div', { className: cls.MORE_EVENT_WRAPPER_CLASS });\n if (eventCollection.length === 0) {\n moreEventWrapperEle = createElement('div', {\n className: cls.MORE_EVENT_CONTENT_CLASS,\n innerHTML: this.l10n.getConstant('emptyContainer')\n });\n }\n else {\n var _loop_1 = function (eventData) {\n var eventText = (eventData[fields.subject] || this_1.parent.eventSettings.fields.subject.default\n || this_1.parent.localeObj.getConstant('addTitle'));\n var appointmentElement = createElement('div', {\n className: cls.APPOINTMENT_CLASS,\n attrs: {\n 'data-id': '' + eventData[fields.id],\n 'data-guid': eventData.Guid, 'role': 'button', 'tabindex': '0',\n 'aria-readonly': this_1.parent.eventBase.getReadonlyAttribute(eventData),\n 'aria-selected': 'false', 'aria-grabbed': 'true', 'aria-label': this_1.parent.getAnnouncementString(eventData)\n }\n });\n var templateElement = void 0;\n if (!isNullOrUndefined(this_1.parent.activeViewOptions.eventTemplate)) {\n var tempId = this_1.parent.element.id + '_' + this_1.parent.activeViewOptions.eventTemplateName + 'eventTemplate';\n templateElement = this_1.parent.getAppointmentTemplate()(eventData, this_1.parent, 'eventTemplate', tempId, false);\n append(templateElement, appointmentElement);\n }\n else {\n appointmentElement.appendChild(createElement('div', { className: cls.SUBJECT_CLASS, innerHTML: eventText }));\n }\n if (!isNullOrUndefined(groupIndex)) {\n appointmentElement.setAttribute('data-group-index', groupIndex);\n }\n if (!isNullOrUndefined(eventData[fields.recurrenceRule])) {\n var iconClass = (eventData[fields.id] === eventData[fields.recurrenceID]) ?\n cls.EVENT_RECURRENCE_ICON_CLASS : cls.EVENT_RECURRENCE_EDIT_ICON_CLASS;\n appointmentElement.appendChild(createElement('div', { className: cls.ICON + ' ' + iconClass }));\n }\n var args = {\n data: extend({}, eventData, null, true),\n element: appointmentElement, cancel: false\n };\n this_1.parent.trigger(event.eventRendered, args, function (eventArgs) {\n if (!eventArgs.cancel) {\n moreEventWrapperEle.appendChild(appointmentElement);\n var isPreventCrud = _this.parent.isAdaptive || _this.parent.currentView === 'Year';\n _this.parent.eventBase.wireAppointmentEvents(appointmentElement, eventData, isPreventCrud);\n _this.parent.eventBase.applyResourceColor(appointmentElement, eventData, 'backgroundColor', groupOrder);\n }\n });\n };\n var this_1 = this;\n for (var _i = 0, eventCollection_1 = eventCollection; _i < eventCollection_1.length; _i++) {\n var eventData = eventCollection_1[_i];\n _loop_1(eventData);\n }\n }\n moreEventContentEle.appendChild(moreEventWrapperEle);\n return moreEventContentEle;\n };\n QuickPopups.prototype.tapHoldEventPopup = function (e) {\n var target = closest(e.target, '.' + cls.APPOINTMENT_CLASS);\n this.isMultipleEventSelect = false;\n this.parent.selectedElements = [];\n this.isMultipleEventSelect = true;\n this.parent.eventBase.getSelectedEventElements(target);\n this.parent.activeEventData = this.parent.eventBase.getSelectedEvents();\n var guid = target.getAttribute('data-guid');\n var eventObj = this.parent.eventBase.getEventByGuid(guid);\n if (isNullOrUndefined(eventObj)) {\n return;\n }\n var eventTitle = (eventObj[this.parent.eventFields.subject] || this.l10n.getConstant('noTitle'));\n var eventTemplate = \"
\" +\n (\"
\") +\n (\"
\" + eventTitle + \"
\") +\n (\"
\") +\n (\"
\");\n this.quickPopup.element.innerHTML = eventTemplate;\n var closeIcon = this.quickPopup.element.querySelector('.' + cls.CLOSE_CLASS);\n this.renderButton('e-flat e-round e-small', cls.ICON + ' ' + cls.CLOSE_ICON_CLASS, false, closeIcon, this.closeClick);\n var readonly = this.parent.activeViewOptions.readonly || eventObj[this.parent.eventFields.isReadonly];\n var editAction = !this.parent.eventSettings.allowEditing || readonly;\n var deleteAction = !this.parent.eventSettings.allowDeleting || readonly;\n var editIcon = this.quickPopup.element.querySelector('.' + cls.EDIT_CLASS);\n if (editIcon) {\n this.renderButton('e-flat e-round e-small', cls.ICON + ' ' + cls.EDIT_ICON_CLASS, editAction, editIcon, this.editClick);\n }\n var deleteIcon = this.quickPopup.element.querySelector('.' + cls.DELETE_CLASS);\n if (deleteIcon) {\n this.renderButton('e-flat e-round e-small', cls.ICON + ' ' + cls.DELETE_ICON_CLASS, deleteAction, deleteIcon, this.deleteClick);\n }\n this.beforeQuickPopupOpen(target);\n };\n QuickPopups.prototype.isCellBlocked = function (args) {\n var tempObj = {};\n tempObj[this.parent.eventFields.startTime] = this.parent.activeCellsData.startTime;\n tempObj[this.parent.eventFields.endTime] = this.parent.activeCellsData.endTime;\n tempObj[this.parent.eventFields.isAllDay] = this.parent.activeCellsData.isAllDay;\n if (this.parent.activeViewOptions.group.resources.length > 0) {\n var targetCell = args.element instanceof Array ? args.element[0] : args.element;\n var groupIndex = parseInt(targetCell.getAttribute('data-group-index'), 10);\n this.parent.resourceBase.setResourceValues(tempObj, isNaN(groupIndex) ? null : groupIndex);\n }\n return this.parent.eventBase.isBlockRange(tempObj);\n };\n QuickPopups.prototype.cellClick = function (args) {\n var date = new Date(args.startTime.getTime());\n if (!this.parent.showQuickInfo || !this.parent.eventSettings.allowAdding ||\n this.parent.currentView === 'MonthAgenda' || this.isCellBlocked(args) ||\n !this.parent.isMinMaxDate(new Date(date.setHours(0, 0, 0, 0)))) {\n this.quickPopupHide();\n return;\n }\n var targetEle = args.event.target;\n if (this.parent.isAdaptive) {\n this.quickPopupHide();\n var newEventClone = this.parent.element.querySelector('.' + cls.NEW_EVENT_CLASS);\n if (isNullOrUndefined(newEventClone)) {\n newEventClone = createElement('div', {\n className: cls.NEW_EVENT_CLASS,\n innerHTML: \"
+ \" + this.l10n.getConstant('newEvent') + \"
\"\n });\n }\n var targetCell = closest(targetEle, '.' + cls.WORK_CELLS_CLASS + ',.' + cls.ALLDAY_CELLS_CLASS);\n if (targetCell) {\n targetCell.appendChild(newEventClone);\n }\n return;\n }\n var target = closest(targetEle, '.' + cls.WORK_CELLS_CLASS + ',.' + cls.ALLDAY_CELLS_CLASS + ',.' +\n cls.HEADER_CELLS_CLASS);\n if (isNullOrUndefined(target) || targetEle.classList.contains(cls.MORE_INDICATOR_CLASS)) {\n return;\n }\n var isSameTarget = this.quickPopup.relateTo === target;\n if (isSameTarget && this.quickPopup.element.classList.contains(cls.POPUP_OPEN)) {\n var subjectElement_1 = this.quickPopup.element.querySelector('.' + cls.SUBJECT_CLASS);\n if (subjectElement_1) {\n subjectElement_1.focus();\n }\n return;\n }\n var temp = {};\n temp[this.parent.eventFields.startTime] = this.parent.activeCellsData.startTime;\n temp[this.parent.eventFields.endTime] = this.parent.activeCellsData.endTime;\n temp[this.parent.eventFields.isAllDay] = this.parent.activeCellsData.isAllDay;\n var quickCellPopup = createElement('div', { className: cls.CELL_POPUP_CLASS });\n quickCellPopup.appendChild(this.getPopupHeader('Cell', temp));\n quickCellPopup.appendChild(this.getPopupContent('Cell', args, temp));\n quickCellPopup.appendChild(this.getPopupFooter('Cell', temp));\n var subjectElement = quickCellPopup.querySelector('.' + cls.SUBJECT_CLASS);\n if (subjectElement) {\n Input.createInput({ element: subjectElement, properties: { placeholder: this.l10n.getConstant('addTitle') } });\n }\n if (!isNullOrUndefined(this.parent.eventSettings.fields.subject.default)) {\n subjectElement.value = this.parent.eventSettings.fields.subject.default;\n }\n var closeIcon = quickCellPopup.querySelector('.' + cls.CLOSE_CLASS);\n if (closeIcon) {\n this.renderButton('e-flat e-round e-small', cls.ICON + ' ' + cls.CLOSE_ICON_CLASS, false, closeIcon, this.popupClose);\n }\n var moreButton = quickCellPopup.querySelector('.' + cls.QUICK_POPUP_EVENT_DETAILS_CLASS);\n if (moreButton) {\n this.renderButton('e-flat', '', false, moreButton, this.detailsClick);\n }\n var saveButton = quickCellPopup.querySelector('.' + cls.EVENT_CREATE_CLASS);\n if (saveButton) {\n this.renderButton('e-flat e-primary', '', this.parent.activeViewOptions.readonly, saveButton, this.saveClick);\n }\n this.quickPopup.content = quickCellPopup;\n this.quickPopup.dataBind();\n this.applyFormValidation();\n if (this.morePopup) {\n this.morePopup.hide();\n }\n this.quickPopup.relateTo = target;\n this.beforeQuickPopupOpen(target);\n };\n QuickPopups.prototype.isSameEventClick = function (events) {\n var isSameTarget = this.quickPopup.relateTo === closest(events.element, '.' + cls.APPOINTMENT_CLASS);\n if (isSameTarget && this.quickPopup.element.classList.contains(cls.POPUP_OPEN)) {\n var editIcon = this.quickPopup.element.querySelector('.' + cls.EDIT_CLASS);\n if (editIcon) {\n editIcon.focus();\n }\n if (!this.parent.isAdaptive) {\n var editButton = this.quickPopup.element.querySelector('.' + cls.EDIT_EVENT_CLASS);\n if (editButton) {\n editButton.focus();\n }\n }\n return true;\n }\n return false;\n };\n QuickPopups.prototype.isQuickTemplate = function (type) {\n return this.parent.quickInfoTemplates.templateType === 'Both' || this.parent.quickInfoTemplates.templateType === type;\n };\n QuickPopups.prototype.eventClick = function (events) {\n if (this.parent.eventTooltip) {\n this.parent.eventTooltip.close();\n }\n if (!this.parent.showQuickInfo) {\n return;\n }\n if (this.parent.isAdaptive && this.isMultipleEventSelect) {\n this.updateTapHoldEventPopup(closest(events.element, '.' + cls.APPOINTMENT_CLASS));\n }\n else {\n var isSameTarget = this.isSameEventClick(events);\n if (isSameTarget) {\n return;\n }\n var eventData = events.event;\n var quickEventPopup = createElement('div', { className: cls.EVENT_POPUP_CLASS });\n quickEventPopup.appendChild(this.getPopupHeader('Event', eventData));\n quickEventPopup.appendChild(this.getPopupContent('Event', events, eventData));\n quickEventPopup.appendChild(this.getPopupFooter('Event', eventData));\n var readonly = this.parent.activeViewOptions.readonly || eventData[this.parent.eventFields.isReadonly];\n var editAction = !this.parent.eventSettings.allowEditing || readonly;\n var deleteAction = !this.parent.eventSettings.allowDeleting || readonly;\n var editIcon = quickEventPopup.querySelector('.' + cls.EDIT_CLASS);\n var buttonClass = 'e-flat e-round e-small';\n if (editIcon) {\n this.renderButton(buttonClass, cls.ICON + ' ' + cls.EDIT_ICON_CLASS, editAction, editIcon, this.editClick);\n }\n var deleteIcon = quickEventPopup.querySelector('.' + cls.DELETE_CLASS);\n if (deleteIcon) {\n this.renderButton(buttonClass, cls.ICON + ' ' + cls.DELETE_ICON_CLASS, deleteAction, deleteIcon, this.deleteClick);\n }\n var closeIcon = quickEventPopup.querySelector('.' + cls.CLOSE_CLASS);\n if (closeIcon) {\n this.renderButton(buttonClass, cls.ICON + ' ' + cls.CLOSE_ICON_CLASS, false, closeIcon, this.popupClose);\n }\n var editButton = quickEventPopup.querySelector('.' + cls.EDIT_EVENT_CLASS);\n if (editButton) {\n this.renderButton('e-flat e-primary', '', editAction, editButton, this.editClick);\n }\n var deleteButton = quickEventPopup.querySelector('.' + cls.DELETE_EVENT_CLASS);\n if (deleteButton) {\n this.renderButton('e-flat', '', deleteAction, deleteButton, this.deleteClick);\n }\n this.quickPopup.content = quickEventPopup;\n this.quickPopup.dataBind();\n if (this.morePopup && !closest(events.element, '.' + cls.MORE_EVENT_WRAPPER_CLASS)) {\n this.morePopup.hide();\n }\n this.quickPopup.relateTo = this.parent.isAdaptive ? document.body :\n closest(events.element, '.' + cls.APPOINTMENT_CLASS);\n this.beforeQuickPopupOpen(events.element);\n }\n };\n QuickPopups.prototype.getPopupHeader = function (headerType, headerData) {\n var headerTemplate = createElement('div', { className: cls.POPUP_HEADER_CLASS });\n if (this.isQuickTemplate(headerType) && this.parent.quickInfoTemplates.header) {\n var headerArgs = extend({}, headerData, { elementType: headerType.toLowerCase() }, true);\n var templateId = this.parent.element.id;\n var headerTemp = [].slice.call(this.parent.getQuickInfoTemplatesHeader()(headerArgs, this.parent, 'header', templateId + '_headerTemplate', false));\n append([].slice.call(headerTemp), headerTemplate);\n }\n else {\n var header = void 0;\n var args = void 0;\n switch (headerType) {\n case 'Cell':\n header = \"
\");\n break;\n case 'Event':\n args = this.getFormattedString(headerData);\n header = \"
\" +\n (\"\") +\n (\"\") +\n (\"
\") +\n (\"
\" + args.eventSubject + \"
\");\n break;\n }\n var templateWrapper = createElement('div', { innerHTML: header });\n append([].slice.call(templateWrapper.childNodes), headerTemplate);\n }\n return headerTemplate;\n };\n QuickPopups.prototype.getPopupContent = function (type, args, data) {\n var contentTemplate = createElement('div', { className: cls.POPUP_CONTENT_CLASS });\n if (this.isQuickTemplate(type) && this.parent.quickInfoTemplates.content) {\n var contentArgs = extend({}, data, { elementType: type.toLowerCase() }, true);\n var templateId = this.parent.element.id;\n var contentTemp = [].slice.call(this.parent.getQuickInfoTemplatesContent()(contentArgs, this.parent, 'content', templateId + '_contentTemplate', false));\n append([].slice.call(contentTemp), contentTemplate);\n }\n else {\n var content = void 0;\n var cellDetails = void 0;\n var argsData = void 0;\n var resourceText = this.getResourceText(args, type.toLowerCase());\n switch (type) {\n case 'Cell':\n cellDetails = this.getFormattedString(data);\n content = \"
|
\") +\n (\" \" + cellDetails.details + \" \") +\n ((this.parent.activeViewOptions.group.resources.length > 0 ? \"\" +\n (\" \" + resourceText + \" \") : '') + \" |
\");\n break;\n case 'Event':\n argsData = this.getFormattedString(data);\n content = '
' + argsData.details + '
';\n if (data[this.parent.eventFields.recurrenceRule]) {\n content += '
' +\n this.getRecurrenceSummary(data) + '
';\n }\n content += '
';\n if (data[this.parent.eventFields.location]) {\n content += '
' +\n data[this.parent.eventFields.location] + '
';\n }\n if (data[this.parent.eventFields.startTimezone] || data[this.parent.eventFields.endTimezone]) {\n content += '
' +\n this.getTimezone(data) + '
';\n }\n if (data[this.parent.eventFields.description]) {\n content += '
' +\n data[this.parent.eventFields.description] + '
';\n }\n if (this.parent.resourceCollection.length > 0) {\n content += '
';\n }\n break;\n }\n var templateWrapper = createElement('div', { innerHTML: content });\n append([].slice.call(templateWrapper.childNodes), contentTemplate);\n }\n return contentTemplate;\n };\n QuickPopups.prototype.getPopupFooter = function (footerType, footerData) {\n var footerTemplate = createElement('div', { className: cls.POPUP_FOOTER_CLASS });\n if (this.isQuickTemplate(footerType) && this.parent.quickInfoTemplates.footer) {\n var footerArgs = extend({}, footerData, { elementType: footerType.toLowerCase() }, true);\n var templateId = this.parent.element.id;\n var footerTemp = [].slice.call(this.parent.getQuickInfoTemplatesFooter()(footerArgs, this.parent, 'footer', templateId + '_footerTemplate', false));\n append([].slice.call(footerTemp), footerTemplate);\n }\n else {\n var footer = void 0;\n switch (footerType) {\n case 'Cell':\n footer = \"
\") +\n (\"
\");\n break;\n case 'Event':\n footer = \"\" + (this.parent.isAdaptive ? '' : \"
\") +\n (\"
\"));\n break;\n }\n var templateWrapper = createElement('div', { innerHTML: footer });\n append([].slice.call(templateWrapper.childNodes), footerTemplate);\n }\n return footerTemplate;\n };\n QuickPopups.prototype.getResourceText = function (args, type) {\n if (this.parent.resourceCollection.length === 0) {\n return null;\n }\n var resourceValue = '';\n if (this.parent.activeViewOptions.group.resources.length === 0) {\n var resourceCollection_1 = this.parent.resourceBase.resourceCollection.slice(-1)[0];\n var resourceData = resourceCollection_1.dataSource;\n if (type === 'event') {\n var eventData = args.event;\n var _loop_2 = function (data) {\n var resourceId = eventData[resourceCollection_1.field];\n if (resourceId instanceof Array) {\n if (resourceId.indexOf(data[resourceCollection_1.idField]) > -1) {\n var id_1 = resourceId[resourceId.indexOf(data[resourceCollection_1.idField])];\n var resource = resourceData.filter(function (e) {\n return e[resourceCollection_1.idField] === id_1;\n })[0];\n resourceValue += (resourceValue === '') ? resource[resourceCollection_1.textField] :\n ', ' + resource[resourceCollection_1.textField];\n }\n }\n else if (data[resourceCollection_1.idField] === resourceId) {\n resourceValue = data[resourceCollection_1.textField].toString();\n }\n };\n for (var _i = 0, resourceData_1 = resourceData; _i < resourceData_1.length; _i++) {\n var data = resourceData_1[_i];\n _loop_2(data);\n }\n }\n else {\n resourceValue = resourceData[0][resourceCollection_1.textField].toString();\n }\n }\n else {\n if (type === 'event') {\n var eventData = args.event;\n var resourceData = void 0;\n var lastResource_1;\n for (var i = this.parent.resourceBase.resourceCollection.length - 1; i >= 0; i--) {\n resourceData = eventData[this.parent.resourceBase.resourceCollection[i].field];\n if (!isNullOrUndefined(resourceData)) {\n lastResource_1 = this.parent.resourceBase.resourceCollection[i];\n break;\n }\n }\n if (!Array.isArray(resourceData)) {\n resourceData = [resourceData];\n }\n var resNames_1 = [];\n var lastResourceData_1 = lastResource_1.dataSource;\n resourceData.forEach(function (value) {\n var text;\n var i = util.findIndexInData(lastResourceData_1, lastResource_1.idField, value);\n if (i > -1) {\n text = lastResourceData_1[i][lastResource_1.textField];\n }\n if (text) {\n resNames_1.push(text);\n }\n });\n resourceValue = resNames_1.join(', ');\n }\n else {\n var argsData = args;\n var groupIndex = !isNullOrUndefined(argsData.groupIndex) ? argsData.groupIndex : 0;\n var resourceDetails = this.parent.resourceBase.lastResourceLevel[groupIndex];\n resourceValue = resourceDetails.resourceData[resourceDetails.resource.textField];\n }\n }\n return resourceValue;\n };\n QuickPopups.prototype.getFormattedString = function (eventData) {\n var fields = this.parent.eventFields;\n var eventSubject = (eventData[fields.subject] || this.l10n.getConstant('noTitle'));\n var startDate = eventData[fields.startTime];\n var endDate = eventData[fields.endTime];\n var startDateDetails = this.getDateFormat(startDate, 'long');\n var endDateDetails = (eventData[fields.isAllDay] && endDate.getHours() === 0 && endDate.getMinutes() === 0) ?\n this.getDateFormat(util.addDays(new Date(endDate.getTime()), -1), 'long') :\n this.getDateFormat(endDate, 'long');\n var startTimeDetail = this.parent.getTimeString(startDate);\n var endTimeDetail = this.parent.getTimeString(endDate);\n var details = '';\n var spanLength = endDate.getDate() !== startDate.getDate() &&\n (endDate.getTime() - startDate.getTime()) / (60 * 60 * 1000) < 24 ? 1 : 0;\n if (eventData[fields.isAllDay]) {\n details = startDateDetails + ' (' + this.l10n.getConstant('allDay') + ')';\n if (((endDate.getTime() - startDate.getTime()) / util.MS_PER_DAY) > 1) {\n details += ' - ' + endDateDetails + ' (' + this.l10n.getConstant('allDay') + ')';\n }\n }\n else if ((((endDate.getTime() - startDate.getTime()) / util.MS_PER_DAY) >= 1) || spanLength > 0) {\n details = startDateDetails + ' (' + startTimeDetail + ')' + ' - ' + endDateDetails + ' (' + endTimeDetail + ')';\n }\n else {\n details = startDateDetails + ' (' + (startTimeDetail + ' - ' + endTimeDetail) + ')';\n }\n return { eventSubject: eventSubject, details: details };\n };\n QuickPopups.prototype.moreEventClick = function (data, endDate, groupIndex) {\n var _this = this;\n this.quickPopupHide(true);\n var moreEventContentEle = this.morePopup.element.querySelector('.' + cls.MORE_EVENT_CONTENT_CLASS);\n if (moreEventContentEle) {\n remove(moreEventContentEle);\n }\n var selectedDate = ((data.date).getTime()).toString();\n var target = closest(data.element, '.' + cls.MORE_INDICATOR_CLASS + ',.' + cls.WORK_CELLS_CLASS);\n var day = this.parent.globalize.formatDate(data.date, { format: 'E', calendar: this.parent.getCalendarMode() });\n this.morePopup.element.querySelector('.' + cls.MORE_EVENT_HEADER_DAY_CLASS).innerHTML = util.capitalizeFirstWord(day, 'single');\n var dateElement = this.morePopup.element.querySelector('.' + cls.MORE_EVENT_HEADER_DATE_CLASS);\n dateElement.innerHTML = this.getDateFormat(data.date, 'd');\n dateElement.setAttribute('data-date', selectedDate);\n dateElement.setAttribute('data-end-date', endDate.getTime().toString());\n var groupOrder;\n if (!isNullOrUndefined(groupIndex)) {\n dateElement.setAttribute('data-group-index', groupIndex);\n groupOrder = this.parent.resourceBase.lastResourceLevel[parseInt(groupIndex, 10)].groupOrder;\n }\n var moreEventElements = this.createMoreEventList(data.event, groupOrder, groupIndex);\n this.morePopup.element.querySelector('.' + cls.MORE_EVENT_POPUP_CLASS).appendChild(moreEventElements);\n removeClass(this.morePopup.element.querySelector('.' + cls.MORE_EVENT_DATE_HEADER_CLASS).childNodes, cls.CURRENTDATE_CLASS);\n if (util.resetTime(data.date).getTime() === util.resetTime(this.parent.getCurrentTime()).getTime()) {\n addClass(this.morePopup.element.querySelector('.' + cls.MORE_EVENT_DATE_HEADER_CLASS).childNodes, cls.CURRENTDATE_CLASS);\n }\n if (!this.parent.isAdaptive) {\n if (this.parent.currentView.indexOf('Timeline') !== -1) {\n var gIndex = target.getAttribute('data-group-index');\n var startDate = new Date(parseInt(target.getAttribute('data-start-date'), 10));\n startDate.setHours(startDate.getHours(), startDate.getMinutes(), 0);\n var tdDate = startDate.getTime().toString();\n if (isNullOrUndefined(gIndex)) {\n this.morePopup.relateTo = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS +\n ' tbody tr td[data-date=\"' + tdDate + '\"]');\n }\n else {\n this.morePopup.relateTo = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS +\n ' tbody tr td[data-group-index=\"' + gIndex + '\"][data-date=\"' + tdDate + '\"]');\n if (isNullOrUndefined(this.morePopup.relateTo)) {\n var workCells = [].slice.call(this.parent.element.querySelectorAll('.' + cls.CONTENT_WRAP_CLASS +\n ' tbody tr td[data-group-index=\"' + gIndex + '\"]'));\n for (var i = 0; i < workCells.length; i++) {\n var date = workCells[i].getAttribute('data-date');\n if (date < tdDate) {\n this.morePopup.relateTo = workCells[i];\n }\n }\n }\n }\n }\n else {\n this.morePopup.relateTo = closest(target, '.' + cls.WORK_CELLS_CLASS);\n }\n }\n this.parent.renderTemplates();\n var eventProp = {\n type: 'EventContainer', cancel: false,\n element: this.morePopup.element, data: data\n };\n this.parent.trigger(event.popupOpen, eventProp, function (popupArgs) {\n if (!popupArgs.cancel) {\n _this.morePopup.show();\n }\n });\n };\n QuickPopups.prototype.saveClick = function (event) {\n this.dialogEvent = event;\n this.isCrudAction = true;\n this.quickPopupHide();\n };\n QuickPopups.prototype.detailsClick = function (event) {\n var subjectEle = this.quickPopup.element.querySelector('.' + cls.SUBJECT_CLASS);\n if (subjectEle && subjectEle.value !== '') {\n extend(this.parent.activeCellsData, { subject: subjectEle.value });\n }\n this.dialogEvent = event;\n this.isCrudAction = false;\n this.fieldValidator.destroyToolTip();\n this.quickPopupHide();\n this.parent.eventWindow.openEditor(this.parent.activeCellsData, 'Add');\n };\n QuickPopups.prototype.editClick = function (event) {\n this.dialogEvent = event;\n this.quickPopupHide(true);\n var data = this.parent.activeEventData.event;\n this.parent.currentAction = 'EditSeries';\n if (!isNullOrUndefined(data[this.parent.eventFields.recurrenceRule])) {\n this.parent.currentAction = 'EditOccurrence';\n this.openRecurrenceAlert();\n }\n else {\n this.parent.eventWindow.openEditor(data, this.parent.currentAction);\n }\n };\n QuickPopups.prototype.deleteClick = function (event) {\n this.dialogEvent = event;\n this.quickPopupHide(true);\n this.parent.currentAction = 'Delete';\n if (this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]) {\n this.openRecurrenceAlert();\n }\n else {\n this.openDeleteAlert();\n }\n };\n QuickPopups.prototype.updateMoreEventContent = function () {\n if (this.morePopup.element.classList.contains('e-popup-close')) {\n return;\n }\n var moreEventContentEle = this.morePopup.element.querySelector('.' + cls.MORE_EVENT_CONTENT_CLASS);\n if (moreEventContentEle) {\n remove(moreEventContentEle);\n }\n var dateElement = this.morePopup.element.querySelector('.' + cls.MORE_EVENT_HEADER_DATE_CLASS);\n var startDate = new Date(parseInt(dateElement.getAttribute('data-date'), 10));\n var endDate = new Date(parseInt(dateElement.getAttribute('data-end-date'), 10));\n var groupIndex = dateElement.getAttribute('data-group-index');\n var data;\n var groupOrder;\n if (!isNullOrUndefined(groupIndex)) {\n data = this.parent.resourceBase.lastResourceLevel[parseInt(groupIndex, 10)];\n groupOrder = data.groupOrder;\n }\n var events = this.parent.eventBase.filterEvents(startDate, endDate, this.parent.eventsProcessed, data);\n var moreElement = this.createMoreEventList(events, groupOrder, groupIndex);\n this.morePopup.element.querySelector('.' + cls.MORE_EVENT_POPUP_CLASS).appendChild(moreElement);\n };\n QuickPopups.prototype.closeClick = function (event) {\n this.dialogEvent = event;\n this.quickPopupHide();\n this.morePopup.hide();\n };\n QuickPopups.prototype.dialogButtonClick = function (event) {\n this.dialogEvent = event;\n this.quickDialog.hide();\n var target = event.target;\n var cancelBtn = this.quickDialog.element.querySelector('.' + cls.QUICK_DIALOG_ALERT_CANCEL);\n var eventData = this.parent.activeEventData.event;\n if (target.classList.contains(cls.QUICK_DIALOG_OCCURRENCE_CLASS)) {\n this.parent.currentAction = (this.parent.currentAction === 'Delete') ? 'DeleteOccurrence' : 'EditOccurrence';\n switch (this.parent.currentAction) {\n case 'EditOccurrence':\n this.parent.eventWindow.openEditor(eventData, this.parent.currentAction);\n break;\n case 'DeleteOccurrence':\n this.parent.crudModule.deleteEvent(eventData, this.parent.currentAction);\n break;\n }\n }\n else if (target.classList.contains(cls.QUICK_DIALOG_FOLLOWING_EVENTS_CLASS)) {\n this.parent.currentAction = (this.parent.currentAction === 'Delete') ? 'DeleteFollowingEvents' : 'EditFollowingEvents';\n switch (this.parent.currentAction) {\n case 'EditFollowingEvents':\n this.parent.eventWindow.openEditor(eventData, this.parent.currentAction);\n break;\n case 'DeleteFollowingEvents':\n this.parent.crudModule.deleteEvent(eventData, this.parent.currentAction);\n break;\n }\n }\n else if (target.classList.contains(cls.QUICK_DIALOG_SERIES_CLASS)) {\n this.parent.currentAction = (this.parent.currentAction === 'Delete') ? 'DeleteSeries' : 'EditSeries';\n switch (this.parent.currentAction) {\n case 'EditSeries':\n this.parent.eventWindow.openEditor(this.parent.eventBase.getParentEvent(eventData, true), this.parent.currentAction);\n break;\n case 'DeleteSeries':\n this.parent.crudModule.deleteEvent(eventData, this.parent.currentAction);\n break;\n }\n }\n else if (target.classList.contains(cls.QUICK_DIALOG_DELETE_CLASS)) {\n this.parent.crudModule.deleteEvent(eventData, this.parent.currentAction);\n }\n else if (!cancelBtn.classList.contains(cls.DISABLE_CLASS) && (target.classList.contains(cls.QUICK_DIALOG_ALERT_OK) ||\n (target.classList.contains(cls.QUICK_DIALOG_ALERT_CANCEL) && !cancelBtn.classList.contains(cls.QUICK_DIALOG_CANCEL_CLASS)))) {\n this.parent.uiStateValues.isIgnoreOccurrence = target.classList.contains(cls.QUICK_DIALOG_ALERT_CANCEL);\n this.parent.eventWindow.eventSave(event, this.l10n.getConstant('ok'));\n }\n };\n QuickPopups.prototype.updateTapHoldEventPopup = function (target) {\n var selectedElements = this.parent.eventBase.getSelectedEventElements(target);\n this.parent.activeEventData = this.parent.eventBase.getSelectedEvents();\n if (selectedElements.length > 0) {\n var eventObj = this.parent.eventBase.getEventByGuid(selectedElements[0].getAttribute('data-guid'));\n var titleContent = (selectedElements.length === 1) ?\n (eventObj[this.parent.eventFields.subject] || this.l10n.getConstant('noTitle')) :\n '(' + selectedElements.length + ')' + ' ' + this.l10n.getConstant('selectedItems');\n this.quickPopup.element.querySelector('.' + cls.SUBJECT_CLASS).innerHTML = titleContent;\n if (selectedElements.length > 1) {\n addClass([this.quickPopup.element.querySelector('.' + cls.EDIT_ICON_CLASS)], cls.HIDDEN_CLASS);\n }\n else {\n removeClass([this.quickPopup.element.querySelector('.' + cls.EDIT_ICON_CLASS)], cls.HIDDEN_CLASS);\n }\n }\n else {\n this.parent.selectedElements = [];\n this.quickPopupHide();\n }\n };\n QuickPopups.prototype.getTimezone = function (event) {\n var zoneDetails = '';\n zoneDetails += event[this.parent.eventFields.startTimezone] || '';\n zoneDetails += zoneDetails === '' ? '' : ' - ';\n zoneDetails += event[this.parent.eventFields.endTimezone] || '';\n return zoneDetails;\n };\n QuickPopups.prototype.getRecurrenceSummary = function (event) {\n var recurrenceEditor = this.parent.eventWindow.getRecurrenceEditorInstance();\n if (recurrenceEditor) {\n var ruleSummary = recurrenceEditor.getRuleSummary(event[this.parent.eventFields.recurrenceRule]);\n return ruleSummary.charAt(0).toUpperCase() + ruleSummary.slice(1);\n }\n return '';\n };\n QuickPopups.prototype.getDateFormat = function (date, skeletonString) {\n return util.capitalizeFirstWord(this.parent.globalize.formatDate(date, { skeleton: skeletonString, calendar: this.parent.getCalendarMode() }), 'single');\n };\n QuickPopups.prototype.getDataFromTarget = function (target) {\n if (target.classList.contains(cls.APPOINTMENT_CLASS)) {\n return this.parent.activeEventData.event;\n }\n // Deprecated cells data in quick popups\n var eventObj = {\n startTime: this.parent.activeCellsData.startTime,\n endTime: this.parent.activeCellsData.endTime,\n isAllDay: this.parent.activeCellsData.isAllDay,\n groupIndex: this.parent.activeCellsData.groupIndex\n };\n var cellsData = this.parent.activeCellsData;\n this.parent.eventWindow.convertToEventData(cellsData, eventObj);\n return eventObj;\n };\n QuickPopups.prototype.beforeQuickDialogClose = function (e) {\n var _this = this;\n var args = {\n event: e.event || this.dialogEvent,\n type: (isNullOrUndefined(this.parent.activeEventData.event)) ? 'ValidationAlert' :\n !isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])\n ? 'RecurrenceAlert' : 'DeleteAlert', cancel: false, data: this.parent.activeEventData.event,\n element: this.quickDialog.element\n };\n this.parent.trigger(event.popupClose, args, function (popupCloseArgs) {\n if (!popupCloseArgs.cancel) {\n _this.parent.eventBase.focusElement(true);\n }\n });\n };\n QuickPopups.prototype.beforeQuickPopupOpen = function (target) {\n var _this = this;\n this.parent.renderTemplates();\n var isEventPopup = this.quickPopup.element.querySelector('.' + cls.EVENT_POPUP_CLASS);\n var popupType = this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo';\n var eventProp = {\n type: popupType, cancel: false, data: extend({}, this.getDataFromTarget(target), null, true),\n target: target, element: this.quickPopup.element\n };\n this.parent.trigger(event.popupOpen, eventProp, function (popupArgs) {\n if (popupArgs.cancel) {\n _this.quickPopupHide();\n _this.destroyPopupButtons('quickPopup');\n if (popupArgs.element.classList.contains(cls.POPUP_OPEN)) {\n _this.quickPopupClose();\n }\n util.removeChildren(_this.quickPopup.element);\n _this.isMultipleEventSelect = false;\n }\n else {\n var display = _this.quickPopup.element.style.display;\n _this.quickPopup.element.style.display = 'block';\n if (_this.parent.isAdaptive) {\n _this.quickPopup.element.removeAttribute('style');\n _this.quickPopup.element.style.display = 'block';\n _this.quickPopup.element.style.height = formatUnit((popupType === 'EditEventInfo') ? 65 : window.innerHeight);\n }\n else {\n _this.quickPopup.offsetX = 10;\n _this.quickPopup.collision = { X: _this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };\n _this.quickPopup.position = { X: _this.parent.enableRtl ? 'left' : 'right', Y: _this.parent.enableRtl ? 'bottom' : 'top' };\n _this.quickPopup.dataBind();\n _this.quickPopup.refreshPosition(null, true);\n var collide = isCollide(_this.quickPopup.element, _this.parent.element);\n if (collide.indexOf(_this.parent.enableRtl ? 'left' : 'right') > -1) {\n _this.quickPopup.offsetX = -target.offsetWidth - 10 - _this.quickPopup.element.offsetWidth;\n _this.quickPopup.dataBind();\n var leftCollide = isCollide(_this.quickPopup.element, _this.parent.element);\n if (leftCollide.indexOf('left') > -1) {\n _this.quickPopup.position = { X: 'center', Y: 'center' };\n _this.quickPopup.collision = { X: 'fit', Y: 'fit' };\n _this.quickPopup.offsetX = -(_this.quickPopup.element.offsetWidth / 2);\n _this.quickPopup.dataBind();\n }\n }\n if (_this.parent.virtualScrollModule && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {\n var element = _this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS + ' table');\n var translateY = util.getTranslateY(element);\n _this.quickPopup.offsetY = translateY;\n _this.quickPopup.dataBind();\n }\n }\n if (isEventPopup) {\n _this.applyEventColor();\n }\n _this.quickPopup.element.style.display = display;\n _this.quickPopup.dataBind();\n _this.quickPopup.show();\n }\n });\n };\n QuickPopups.prototype.applyEventColor = function () {\n var colorField = '';\n if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {\n colorField = this.parent.enableRtl ? 'border-right-color' : 'border-left-color';\n }\n else {\n colorField = 'background-color';\n }\n var color = this.parent.activeEventData.element.style[colorField];\n if (color === '') {\n return;\n }\n var colorEle = this.quickPopup.element.querySelector('.' + cls.POPUP_HEADER_CLASS);\n var footerEle = this.quickPopup.element.querySelector('.' + cls.POPUP_FOOTER_CLASS);\n if (footerEle && footerEle.offsetParent) {\n colorEle = this.quickPopup.element.querySelector('.' + cls.SUBJECT_CLASS);\n if (colorEle) {\n colorEle.style.borderLeftColor = color;\n color = \"rgba(\" + color.match(/\\d+/g).join() + \",0.3)\";\n }\n }\n if (colorEle) {\n colorEle.style.backgroundColor = color;\n }\n };\n QuickPopups.prototype.quickPopupOpen = function () {\n if (this.parent.isAdaptive) {\n this.quickPopup.element.style.top = '0px';\n return;\n }\n if (this.quickPopup.element.querySelector('.' + cls.CELL_POPUP_CLASS)) {\n var subjectElement = this.quickPopup.element.querySelector('.' + cls.SUBJECT_CLASS);\n if (subjectElement) {\n subjectElement.focus();\n }\n }\n else {\n var editElement = this.quickPopup.element.querySelector('.' + cls.EDIT_EVENT_CLASS);\n if (editElement) {\n editElement.focus();\n }\n var editIcon = this.quickPopup.element.querySelector('.' + cls.EDIT_CLASS);\n if (editIcon) {\n editIcon.focus();\n }\n }\n };\n QuickPopups.prototype.quickPopupClose = function () {\n this.parent.eventBase.focusElement();\n this.quickPopup.relateTo = cls.WORK_CELLS_CLASS;\n this.fieldValidator.destroyToolTip();\n if (this.quickPopup.element.querySelectorAll('.e-formvalidator').length) {\n this.fieldValidator.destroy();\n }\n this.destroyPopupButtons('quickPopup');\n util.removeChildren(this.quickPopup.element);\n };\n QuickPopups.prototype.morePopupOpen = function () {\n if (this.parent.isAdaptive) {\n this.morePopup.element.style.top = '0px';\n this.morePopup.element.style.left = '0px';\n this.morePopup.element.style.height = formatUnit(window.innerHeight);\n return;\n }\n this.morePopup.element.querySelector('.' + cls.MORE_EVENT_HEADER_DATE_CLASS).focus();\n this.morePopup.refreshPosition();\n };\n QuickPopups.prototype.morePopupClose = function () {\n var moreWrapper = this.parent.element.querySelector('.' + cls.MORE_EVENT_WRAPPER_CLASS);\n if (moreWrapper) {\n remove(moreWrapper);\n }\n };\n QuickPopups.prototype.popupClose = function (event) {\n this.dialogEvent = event;\n this.isCrudAction = false;\n this.quickPopupHide(true);\n };\n QuickPopups.prototype.quickPopupHide = function (hideAnimation) {\n var _this = this;\n if (!this.quickPopup.element.classList.contains(cls.POPUP_OPEN)) {\n return;\n }\n var isCellPopup = this.quickPopup.element.querySelector('.' + cls.CELL_POPUP_CLASS);\n var popupData;\n if (isCellPopup) {\n var formvalidator = this.quickPopup.element.querySelector('.e-formvalidator');\n if (this.isCrudAction && formvalidator &&\n !formvalidator.ej2_instances[0].validate()) {\n return;\n }\n var fields = this.parent.eventFields;\n var saveObj = this.parent.eventWindow.getObjectFromFormData(cls.POPUP_WRAPPER_CLASS);\n this.parent.eventWindow.setDefaultValueToObject(saveObj);\n saveObj[fields.id] = this.parent.eventBase.getEventMaxID();\n saveObj[fields.startTime] = this.parent.activeCellsData.startTime;\n saveObj[fields.endTime] = this.parent.activeCellsData.endTime;\n saveObj[fields.isAllDay] = this.parent.activeCellsData.isAllDay;\n if (this.parent.resourceBase) {\n this.parent.resourceBase.setResourceValues(saveObj);\n }\n popupData = saveObj;\n }\n else {\n popupData = this.parent.activeEventData.event;\n }\n var isEventPopup = this.quickPopup.element.querySelector('.' + cls.EVENT_POPUP_CLASS);\n var args = {\n event: this.dialogEvent,\n type: this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo',\n cancel: false, data: popupData, element: this.quickPopup.element,\n target: (isCellPopup ? this.parent.activeCellsData.element : this.parent.activeEventData.element)\n };\n this.parent.trigger(event.popupClose, args, function (popupCloseArgs) {\n if (!popupCloseArgs.cancel) {\n if (_this.quickPopup.element.classList.contains('e-popup-open')) {\n if (isCellPopup && _this.isCrudAction) {\n _this.parent.currentAction = 'Add';\n _this.parent.crudModule.addEvent(popupCloseArgs.data);\n }\n if (hideAnimation) {\n var animation = _this.quickPopup.hideAnimation;\n _this.quickPopup.hideAnimation = null;\n _this.quickPopup.hide();\n _this.quickPopup.hideAnimation = animation;\n }\n else {\n _this.quickPopup.hide();\n }\n _this.isMultipleEventSelect = false;\n _this.isCrudAction = false;\n }\n }\n });\n };\n QuickPopups.prototype.navigationClick = function (e) {\n var navigateEle = closest(e.target, '.' + cls.NAVIGATE_CLASS);\n if (!isNullOrUndefined(navigateEle)) {\n var date = this.parent.getDateFromElement(e.currentTarget);\n if (!isNullOrUndefined(date)) {\n this.closeClick(e);\n this.parent.setProperties({ selectedDate: date }, true);\n this.parent.changeView(this.parent.getNavigateView(), e);\n }\n }\n };\n QuickPopups.prototype.documentClick = function (e) {\n var target = e.event.target;\n var classNames = '.' + cls.POPUP_WRAPPER_CLASS + ',.' + cls.HEADER_CELLS_CLASS + ',.' + cls.ALLDAY_CELLS_CLASS +\n ',.' + cls.WORK_CELLS_CLASS + ',.' + cls.APPOINTMENT_CLASS + ',.e-popup';\n var popupWrap = this.parent.element.querySelector('.' + cls.POPUP_WRAPPER_CLASS);\n if ((popupWrap && popupWrap.childElementCount > 0 && !closest(target, classNames)) || !closest(target, classNames)) {\n this.quickPopupHide();\n this.parent.removeNewEventElement();\n }\n var tar = this.parent.element.querySelector('.' + cls.INLINE_SUBJECT_CLASS);\n if (tar && tar !== target && this.parent.allowInline) {\n this.parent.inlineModule.documentClick();\n }\n if (closest(target, '.' + cls.APPOINTMENT_CLASS + ',.' + cls.HEADER_CELLS_CLASS)) {\n this.parent.removeNewEventElement();\n }\n if (!closest(target, '.' + cls.MORE_POPUP_WRAPPER_CLASS) && (target.classList &&\n !target.classList.contains(cls.MORE_INDICATOR_CLASS))\n && (!closest(target, '.' + cls.POPUP_OPEN)) && !closest(target, '.' + cls.WORK_CELLS_CLASS)) {\n this.morePopup.hide();\n }\n };\n QuickPopups.prototype.onClosePopup = function (event) {\n if (!isNullOrUndefined(event)) {\n this.dialogEvent = event;\n }\n this.quickPopupHide();\n this.parent.eventBase.focusElement();\n };\n QuickPopups.prototype.addEventListener = function () {\n this.parent.on(event.cellClick, this.cellClick, this);\n this.parent.on(event.eventClick, this.eventClick, this);\n this.parent.on(event.documentClick, this.documentClick, this);\n this.parent.on(event.dataReady, this.updateMoreEventContent, this);\n };\n QuickPopups.prototype.removeEventListener = function () {\n this.parent.off(event.cellClick, this.cellClick);\n this.parent.off(event.eventClick, this.eventClick);\n this.parent.off(event.documentClick, this.documentClick);\n this.parent.off(event.dataReady, this.updateMoreEventContent);\n };\n QuickPopups.prototype.destroyPopupButtons = function (popupName) {\n var popup = popupName === 'quickPopup' ? this.quickPopup : this.morePopup;\n var buttonCollections = [].slice.call(popup.element.querySelectorAll('.e-control.e-btn'));\n for (var _i = 0, buttonCollections_1 = buttonCollections; _i < buttonCollections_1.length; _i++) {\n var button = buttonCollections_1[_i];\n var instance = button.ej2_instances[0];\n if (instance) {\n instance.destroy();\n }\n }\n };\n QuickPopups.prototype.refreshQuickDialog = function () {\n this.destroyQuickDialog();\n this.renderQuickDialog();\n };\n QuickPopups.prototype.refreshQuickPopup = function () {\n this.destroyQuickPopup();\n this.renderQuickPopup();\n };\n QuickPopups.prototype.refreshMorePopup = function () {\n this.destroyMorePopup();\n this.renderMorePopup();\n };\n QuickPopups.prototype.destroyQuickDialog = function () {\n if (this.quickDialog.element) {\n this.quickDialog.destroy();\n remove(this.quickDialog.element);\n this.quickDialog = null;\n }\n };\n QuickPopups.prototype.destroyQuickPopup = function () {\n if (this.quickPopup.element) {\n this.destroyPopupButtons('quickPopup');\n this.quickPopup.destroy();\n remove(this.quickPopup.element);\n this.quickPopup = null;\n }\n };\n QuickPopups.prototype.destroyMorePopup = function () {\n if (this.morePopup.element) {\n this.destroyPopupButtons('morePopup');\n this.morePopup.destroy();\n remove(this.morePopup.element);\n this.morePopup = null;\n }\n };\n QuickPopups.prototype.destroy = function () {\n if (this.quickPopup.element.querySelectorAll('.e-formvalidator').length) {\n this.fieldValidator.destroy();\n }\n this.removeEventListener();\n this.destroyQuickPopup();\n this.destroyMorePopup();\n this.destroyQuickDialog();\n this.parent = null;\n this.l10n = null;\n this.isCrudAction = null;\n this.fieldValidator = null;\n this.isMultipleEventSelect = null;\n };\n return QuickPopups;\n}());\nexport { QuickPopups };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, Property, ChildProperty, Event, append, compile } from '@syncfusion/ej2-base';\nimport { EventHandler, Touch, Browser, Animation as PopupAnimation } from '@syncfusion/ej2-base';\nimport { isNullOrUndefined, getUniqueID, formatUnit, select, selectAll } from '@syncfusion/ej2-base';\nimport { attributes, closest, removeClass, addClass, remove } from '@syncfusion/ej2-base';\nimport { NotifyPropertyChanges, Complex, SanitizeHtmlHelper } from '@syncfusion/ej2-base';\nimport { Popup } from '../popup/popup';\nimport { calculatePosition } from '../common/position';\nimport { isCollide, fit } from '../common/collision';\nvar TOUCHEND_HIDE_DELAY = 1500;\nvar TAPHOLD_THRESHOLD = 500;\nvar SHOW_POINTER_TIP_GAP = 0;\nvar HIDE_POINTER_TIP_GAP = 8;\nvar MOUSE_TRAIL_GAP = 2;\nvar POINTER_ADJUST = 2;\nvar ROOT = 'e-tooltip';\nvar RTL = 'e-rtl';\nvar DEVICE = 'e-bigger';\nvar ICON = 'e-icons';\nvar CLOSE = 'e-tooltip-close';\nvar TOOLTIP_WRAP = 'e-tooltip-wrap';\nvar CONTENT = 'e-tip-content';\nvar ARROW_TIP = 'e-arrow-tip';\nvar ARROW_TIP_OUTER = 'e-arrow-tip-outer';\nvar ARROW_TIP_INNER = 'e-arrow-tip-inner';\nvar TIP_BOTTOM = 'e-tip-bottom';\nvar TIP_TOP = 'e-tip-top';\nvar TIP_LEFT = 'e-tip-left';\nvar TIP_RIGHT = 'e-tip-right';\nvar POPUP_ROOT = 'e-popup';\nvar POPUP_OPEN = 'e-popup-open';\nvar POPUP_CLOSE = 'e-popup-close';\nvar POPUP_LIB = 'e-lib';\nvar HIDE_POPUP = 'e-hidden';\nvar Animation = /** @class */ (function (_super) {\n __extends(Animation, _super);\n function Animation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property({ effect: 'FadeIn', duration: 150, delay: 0 })\n ], Animation.prototype, \"open\", void 0);\n __decorate([\n Property({ effect: 'FadeOut', duration: 150, delay: 0 })\n ], Animation.prototype, \"close\", void 0);\n return Animation;\n}(ChildProperty));\nexport { Animation };\n/**\n * Represents the Tooltip component that displays a piece of information about the target element on mouse hover.\n * ```html\n *
Show Tooltip
\n * ```\n * ```typescript\n * \n * ```\n */\nvar Tooltip = /** @class */ (function (_super) {\n __extends(Tooltip, _super);\n /* eslint-enable */\n /**\n * Constructor for creating the Tooltip Component\n *\n * @param {TooltipModel} options - specifies the options for the constructor\n * @param {string| HTMLElement} element - specifies the element for the constructor\n *\n */\n function Tooltip(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.mouseMoveEvent = null;\n _this.mouseMoveTarget = null;\n return _this;\n }\n Tooltip.prototype.initialize = function () {\n this.formatPosition();\n addClass([this.element], ROOT);\n };\n Tooltip.prototype.formatPosition = function () {\n var _a, _b;\n if (this.position.indexOf('Top') === 0 || this.position.indexOf('Bottom') === 0) {\n _a = this.position.split(/(?=[A-Z])/), this.tooltipPositionY = _a[0], this.tooltipPositionX = _a[1];\n }\n else {\n _b = this.position.split(/(?=[A-Z])/), this.tooltipPositionX = _b[0], this.tooltipPositionY = _b[1];\n }\n };\n Tooltip.prototype.renderArrow = function () {\n this.setTipClass(this.position);\n var tip = this.createElement('div', { className: ARROW_TIP + ' ' + this.tipClass });\n tip.appendChild(this.createElement('div', { className: ARROW_TIP_OUTER + ' ' + this.tipClass }));\n tip.appendChild(this.createElement('div', { className: ARROW_TIP_INNER + ' ' + this.tipClass }));\n this.tooltipEle.appendChild(tip);\n };\n Tooltip.prototype.setTipClass = function (position) {\n if (position.indexOf('Right') === 0) {\n this.tipClass = TIP_LEFT;\n }\n else if (position.indexOf('Bottom') === 0) {\n this.tipClass = TIP_TOP;\n }\n else if (position.indexOf('Left') === 0) {\n this.tipClass = TIP_RIGHT;\n }\n else {\n this.tipClass = TIP_BOTTOM;\n }\n };\n Tooltip.prototype.renderPopup = function (target) {\n var elePos = this.mouseTrail ? { top: 0, left: 0 } : this.getTooltipPosition(target);\n this.tooltipEle.classList.remove(POPUP_LIB);\n this.popupObj = new Popup(this.tooltipEle, {\n height: this.height,\n width: this.width,\n position: { X: elePos.left, Y: elePos.top },\n enableRtl: this.enableRtl,\n open: this.openPopupHandler.bind(this),\n close: this.closePopupHandler.bind(this)\n });\n };\n Tooltip.prototype.getTooltipPosition = function (target) {\n this.tooltipEle.style.display = 'block';\n var pos = calculatePosition(target, this.tooltipPositionX, this.tooltipPositionY);\n var offsetPos = this.calculateTooltipOffset(this.position);\n var elePos = this.collisionFlipFit(target, pos.left + offsetPos.left, pos.top + offsetPos.top);\n this.tooltipEle.style.display = '';\n return elePos;\n };\n Tooltip.prototype.windowResize = function () {\n this.reposition(this.findTarget());\n };\n Tooltip.prototype.reposition = function (target) {\n if (this.popupObj && target) {\n var elePos = this.getTooltipPosition(target);\n this.popupObj.position = { X: elePos.left, Y: elePos.top };\n this.popupObj.dataBind();\n }\n };\n Tooltip.prototype.openPopupHandler = function () {\n if (!this.mouseTrail && this.needTemplateReposition()) {\n this.reposition(this.findTarget());\n }\n this.trigger('afterOpen', this.tooltipEventArgs);\n };\n Tooltip.prototype.closePopupHandler = function () {\n this.clearTemplate(['content']);\n this.clear();\n this.trigger('afterClose', this.tooltipEventArgs);\n };\n Tooltip.prototype.calculateTooltipOffset = function (position) {\n var pos = { top: 0, left: 0 };\n var tooltipEleWidth = this.tooltipEle.offsetWidth;\n var tooltipEleHeight = this.tooltipEle.offsetHeight;\n var arrowEle = select('.' + ARROW_TIP, this.tooltipEle);\n var tipWidth = arrowEle ? arrowEle.offsetWidth : 0;\n var tipHeight = arrowEle ? arrowEle.offsetHeight : 0;\n var tipAdjust = (this.showTipPointer ? SHOW_POINTER_TIP_GAP : HIDE_POINTER_TIP_GAP);\n var tipHeightAdjust = (tipHeight / 2) + POINTER_ADJUST + (this.tooltipEle.offsetHeight - this.tooltipEle.clientHeight);\n var tipWidthAdjust = (tipWidth / 2) + POINTER_ADJUST + (this.tooltipEle.offsetWidth - this.tooltipEle.clientWidth);\n if (this.mouseTrail) {\n tipAdjust += MOUSE_TRAIL_GAP;\n }\n switch (position) {\n case 'RightTop':\n pos.left += tipWidth + tipAdjust;\n pos.top -= tooltipEleHeight - tipHeightAdjust;\n break;\n case 'RightCenter':\n pos.left += tipWidth + tipAdjust;\n pos.top -= (tooltipEleHeight / 2);\n break;\n case 'RightBottom':\n pos.left += tipWidth + tipAdjust;\n pos.top -= (tipHeightAdjust);\n break;\n case 'BottomRight':\n pos.top += (tipHeight + tipAdjust);\n pos.left -= (tipWidthAdjust);\n break;\n case 'BottomCenter':\n pos.top += (tipHeight + tipAdjust);\n pos.left -= (tooltipEleWidth / 2);\n break;\n case 'BottomLeft':\n pos.top += (tipHeight + tipAdjust);\n pos.left -= (tooltipEleWidth - tipWidthAdjust);\n break;\n case 'LeftBottom':\n pos.left -= (tipWidth + tooltipEleWidth + tipAdjust);\n pos.top -= (tipHeightAdjust);\n break;\n case 'LeftCenter':\n pos.left -= (tipWidth + tooltipEleWidth + tipAdjust);\n pos.top -= (tooltipEleHeight / 2);\n break;\n case 'LeftTop':\n pos.left -= (tipWidth + tooltipEleWidth + tipAdjust);\n pos.top -= (tooltipEleHeight - tipHeightAdjust);\n break;\n case 'TopLeft':\n pos.top -= (tooltipEleHeight + tipHeight + tipAdjust);\n pos.left -= (tooltipEleWidth - tipWidthAdjust);\n break;\n case 'TopRight':\n pos.top -= (tooltipEleHeight + tipHeight + tipAdjust);\n pos.left -= (tipWidthAdjust);\n break;\n default:\n pos.top -= (tooltipEleHeight + tipHeight + tipAdjust);\n pos.left -= (tooltipEleWidth / 2);\n break;\n }\n pos.left += this.offsetX;\n pos.top += this.offsetY;\n return pos;\n };\n Tooltip.prototype.updateTipPosition = function (position) {\n var selEle = selectAll('.' + ARROW_TIP + ',.' + ARROW_TIP_OUTER + ',.' + ARROW_TIP_INNER, this.tooltipEle);\n var removeList = [TIP_BOTTOM, TIP_TOP, TIP_LEFT, TIP_RIGHT];\n removeClass(selEle, removeList);\n this.setTipClass(position);\n addClass(selEle, this.tipClass);\n };\n Tooltip.prototype.adjustArrow = function (target, position, tooltipPositionX, tooltipPositionY) {\n if (this.showTipPointer === false) {\n return;\n }\n this.updateTipPosition(position);\n var leftValue;\n var topValue;\n this.tooltipEle.style.display = 'block';\n var tooltipWidth = this.tooltipEle.clientWidth;\n var tooltipHeight = this.tooltipEle.clientHeight;\n var arrowEle = select('.' + ARROW_TIP, this.tooltipEle);\n var arrowInnerELe = select('.' + ARROW_TIP_INNER, this.tooltipEle);\n var tipWidth = arrowEle.offsetWidth;\n var tipHeight = arrowEle.offsetHeight;\n this.tooltipEle.style.display = '';\n if (this.tipClass === TIP_BOTTOM || this.tipClass === TIP_TOP) {\n if (this.tipClass === TIP_BOTTOM) {\n topValue = '99.9%';\n // Arrow icon aligned -2px height from ArrowOuterTip div\n arrowInnerELe.style.top = '-' + (tipHeight - 2) + 'px';\n }\n else {\n topValue = -(tipHeight - 1) + 'px';\n // Arrow icon aligned -6px height from ArrowOuterTip div\n arrowInnerELe.style.top = '-' + (tipHeight - 6) + 'px';\n }\n if (target) {\n var tipPosExclude = tooltipPositionX !== 'Center' || (tooltipWidth > target.offsetWidth) || this.mouseTrail;\n if ((tipPosExclude && tooltipPositionX === 'Left') || (!tipPosExclude && this.tipPointerPosition === 'End')) {\n leftValue = (tooltipWidth - tipWidth - POINTER_ADJUST) + 'px';\n }\n else if ((tipPosExclude && tooltipPositionX === 'Right') || (!tipPosExclude && this.tipPointerPosition === 'Start')) {\n leftValue = POINTER_ADJUST + 'px';\n }\n else {\n leftValue = ((tooltipWidth / 2) - (tipWidth / 2)) + 'px';\n }\n }\n }\n else {\n if (this.tipClass === TIP_RIGHT) {\n leftValue = '99.9%';\n // Arrow icon aligned -2px left from ArrowOuterTip div\n arrowInnerELe.style.left = '-' + (tipWidth - 2) + 'px';\n }\n else {\n leftValue = -(tipWidth - 1) + 'px';\n // Arrow icon aligned -2px from ArrowOuterTip width\n arrowInnerELe.style.left = (-(tipWidth) + (tipWidth - 2)) + 'px';\n }\n var tipPosExclude = tooltipPositionY !== 'Center' || (tooltipHeight > target.offsetHeight) || this.mouseTrail;\n if ((tipPosExclude && tooltipPositionY === 'Top') || (!tipPosExclude && this.tipPointerPosition === 'End')) {\n topValue = (tooltipHeight - tipHeight - POINTER_ADJUST) + 'px';\n }\n else if ((tipPosExclude && tooltipPositionY === 'Bottom') || (!tipPosExclude && this.tipPointerPosition === 'Start')) {\n topValue = POINTER_ADJUST + 'px';\n }\n else {\n topValue = ((tooltipHeight / 2) - (tipHeight / 2)) + 'px';\n }\n }\n arrowEle.style.top = topValue;\n arrowEle.style.left = leftValue;\n };\n Tooltip.prototype.renderContent = function (target) {\n var tooltipContent = select('.' + CONTENT, this.tooltipEle);\n if (this.cssClass) {\n addClass([this.tooltipEle], this.cssClass.split(' '));\n }\n if (target && !isNullOrUndefined(target.getAttribute('title'))) {\n target.setAttribute('data-content', target.getAttribute('title'));\n target.removeAttribute('title');\n }\n if (!isNullOrUndefined(this.content)) {\n tooltipContent.innerHTML = '';\n if (this.content instanceof HTMLElement) {\n tooltipContent.appendChild(this.content);\n }\n else if (typeof this.content === 'string') {\n if (this.enableHtmlSanitizer) {\n this.setProperties({ content: SanitizeHtmlHelper.sanitize(this.content) }, true);\n }\n tooltipContent[this.enableHtmlParse ? 'innerHTML' : 'textContent'] = this.content;\n }\n else {\n // eslint-disable-next-line\n var templateFunction = compile(this.content);\n var tempArr = templateFunction({}, this, 'content', this.element.id + 'content', undefined, undefined, tooltipContent);\n if (tempArr) {\n append(tempArr, tooltipContent);\n }\n this.renderReactTemplates();\n }\n }\n else {\n if (target && !isNullOrUndefined(target.getAttribute('data-content'))) {\n tooltipContent.innerHTML = target.getAttribute('data-content');\n }\n }\n };\n Tooltip.prototype.renderCloseIcon = function () {\n if (!this.isSticky) {\n return;\n }\n var tipClose = this.createElement('div', { className: ICON + ' ' + CLOSE });\n this.tooltipEle.appendChild(tipClose);\n EventHandler.add(tipClose, Browser.touchStartEvent, this.onStickyClose, this);\n };\n Tooltip.prototype.addDescribedBy = function (target, id) {\n var describedby = (target.getAttribute('aria-describedby') || '').split(/\\s+/);\n if (describedby.indexOf(id) < 0) {\n describedby.push(id);\n }\n attributes(target, { 'aria-describedby': describedby.join(' ').trim(), 'data-tooltip-id': id });\n };\n Tooltip.prototype.removeDescribedBy = function (target) {\n var id = target.getAttribute('data-tooltip-id');\n var describedby = (target.getAttribute('aria-describedby') || '').split(/\\s+/);\n var index = describedby.indexOf(id);\n if (index !== -1) {\n describedby.splice(index, 1);\n }\n target.removeAttribute('data-tooltip-id');\n var orgdescribedby = describedby.join(' ').trim();\n if (orgdescribedby) {\n target.setAttribute('aria-describedby', orgdescribedby);\n }\n else {\n target.removeAttribute('aria-describedby');\n }\n };\n Tooltip.prototype.tapHoldHandler = function (evt) {\n clearTimeout(this.autoCloseTimer);\n this.targetHover(evt.originalEvent);\n };\n Tooltip.prototype.touchEndHandler = function (e) {\n var _this = this;\n if (this.isSticky) {\n return;\n }\n // eslint-disable-next-line\n var close = function () {\n _this.close();\n };\n this.autoCloseTimer = setTimeout(close, TOUCHEND_HIDE_DELAY);\n };\n Tooltip.prototype.targetClick = function (e) {\n var target;\n if (this.target) {\n target = closest(e.target, this.target);\n }\n else {\n target = this.element;\n }\n if (isNullOrUndefined(target)) {\n return;\n }\n if (target.getAttribute('data-tooltip-id') === null) {\n this.targetHover(e);\n }\n else if (!this.isSticky) {\n this.hideTooltip(this.animation.close, e, target);\n }\n };\n Tooltip.prototype.targetHover = function (e) {\n var target;\n if (this.target) {\n target = closest(e.target, this.target);\n }\n else {\n target = this.element;\n }\n if (isNullOrUndefined(target) || (target.getAttribute('data-tooltip-id') !== null && this.closeDelay === 0)) {\n return;\n }\n var targetList = [].slice.call(selectAll('[data-tooltip-id= \"' + this.ctrlId + '_content\"]', document));\n for (var _i = 0, targetList_1 = targetList; _i < targetList_1.length; _i++) {\n var target_1 = targetList_1[_i];\n this.restoreElement(target_1);\n }\n this.showTooltip(target, this.animation.open, e);\n };\n Tooltip.prototype.mouseMoveBeforeOpen = function (e) {\n this.mouseMoveEvent = e;\n };\n Tooltip.prototype.mouseMoveBeforeRemove = function () {\n if (this.mouseMoveTarget) {\n EventHandler.remove(this.mouseMoveTarget, 'mousemove touchstart', this.mouseMoveBeforeOpen);\n }\n };\n Tooltip.prototype.showTooltip = function (target, showAnimation, e) {\n var _this = this;\n clearTimeout(this.showTimer);\n clearTimeout(this.hideTimer);\n if (this.openDelay && this.mouseTrail) {\n this.mouseMoveBeforeRemove();\n this.mouseMoveTarget = target;\n EventHandler.add(this.mouseMoveTarget, 'mousemove touchstart', this.mouseMoveBeforeOpen, this);\n }\n this.tooltipEventArgs = {\n type: e ? e.type : null, cancel: false, target: target, event: e ? e : null,\n element: this.tooltipEle, isInteracted: !isNullOrUndefined(e)\n };\n // eslint-disable-next-line\n var observeCallback = function (beforeRenderArgs) {\n _this.beforeRenderCallback(beforeRenderArgs, target, e, showAnimation);\n };\n this.trigger('beforeRender', this.tooltipEventArgs, observeCallback.bind(this));\n };\n Tooltip.prototype.beforeRenderCallback = function (beforeRenderArgs, target, e, showAnimation) {\n if (beforeRenderArgs.cancel) {\n this.isHidden = true;\n this.clear();\n this.mouseMoveBeforeRemove();\n }\n else {\n this.isHidden = false;\n if (isNullOrUndefined(this.tooltipEle)) {\n this.ctrlId = this.element.getAttribute('id') ?\n getUniqueID(this.element.getAttribute('id')) : getUniqueID('tooltip');\n this.tooltipEle = this.createElement('div', {\n className: TOOLTIP_WRAP + ' ' + POPUP_ROOT + ' ' + POPUP_LIB, attrs: {\n role: 'tooltip', 'aria-hidden': 'false', 'id': this.ctrlId + '_content'\n }, styles: 'width:' +\n formatUnit(this.width) + ';height:' + formatUnit(this.height) + ';position:absolute;'\n });\n this.tooltipBeforeRender(target, this);\n this.tooltipAfterRender(target, e, showAnimation, this);\n }\n else {\n if (target) {\n this.adjustArrow(target, this.position, this.tooltipPositionX, this.tooltipPositionY);\n this.addDescribedBy(target, this.ctrlId + '_content');\n this.renderContent(target);\n PopupAnimation.stop(this.tooltipEle);\n this.reposition(target);\n this.tooltipAfterRender(target, e, showAnimation, this);\n }\n }\n }\n };\n Tooltip.prototype.tooltipBeforeRender = function (target, ctrlObj) {\n if (target) {\n if (Browser.isDevice) {\n addClass([ctrlObj.tooltipEle], DEVICE);\n }\n if (ctrlObj.width !== 'auto') {\n ctrlObj.tooltipEle.style.maxWidth = formatUnit(ctrlObj.width);\n }\n ctrlObj.tooltipEle.appendChild(ctrlObj.createElement('div', { className: CONTENT }));\n document.body.appendChild(ctrlObj.tooltipEle);\n removeClass([ctrlObj.tooltipEle], HIDE_POPUP);\n ctrlObj.addDescribedBy(target, ctrlObj.ctrlId + '_content');\n ctrlObj.renderContent(target);\n addClass([ctrlObj.tooltipEle], POPUP_OPEN);\n if (ctrlObj.showTipPointer) {\n ctrlObj.renderArrow();\n }\n ctrlObj.renderCloseIcon();\n ctrlObj.renderPopup(target);\n ctrlObj.adjustArrow(target, ctrlObj.position, ctrlObj.tooltipPositionX, ctrlObj.tooltipPositionY);\n PopupAnimation.stop(ctrlObj.tooltipEle);\n ctrlObj.reposition(target);\n }\n };\n Tooltip.prototype.tooltipAfterRender = function (target, e, showAnimation, ctrlObj) {\n if (target) {\n removeClass([ctrlObj.tooltipEle], POPUP_OPEN);\n addClass([ctrlObj.tooltipEle], POPUP_CLOSE);\n ctrlObj.tooltipEventArgs = {\n type: e ? e.type : null, cancel: false, target: target, event: e ? e : null,\n element: ctrlObj.tooltipEle, isInteracted: !isNullOrUndefined(e)\n };\n if (ctrlObj.needTemplateReposition() && !ctrlObj.mouseTrail) {\n ctrlObj.tooltipEle.style.display = 'none';\n }\n // eslint-disable-next-line\n var observeCallback = function (observedArgs) {\n ctrlObj.beforeOpenCallback(observedArgs, target, showAnimation, e);\n };\n ctrlObj.trigger('beforeOpen', ctrlObj.tooltipEventArgs, observeCallback.bind(ctrlObj));\n }\n };\n Tooltip.prototype.beforeOpenCallback = function (observedArgs, target, showAnimation, e) {\n var _this = this;\n if (observedArgs.cancel) {\n this.isHidden = true;\n this.clear();\n this.mouseMoveBeforeRemove();\n this.restoreElement(target);\n }\n else {\n // eslint-disable-next-line\n var openAnimation_1 = {\n name: showAnimation.effect,\n duration: showAnimation.duration,\n delay: showAnimation.delay,\n timingFunction: 'easeOut'\n };\n if (showAnimation.effect === 'None') {\n openAnimation_1 = undefined;\n }\n if (this.openDelay > 0) {\n // eslint-disable-next-line\n var show = function () {\n if (_this.mouseTrail) {\n EventHandler.add(target, 'mousemove touchstart mouseenter', _this.onMouseMove, _this);\n }\n if (_this.popupObj) {\n _this.popupObj.show(openAnimation_1, target);\n if (_this.mouseMoveEvent && _this.mouseTrail) {\n _this.onMouseMove(_this.mouseMoveEvent);\n }\n }\n };\n this.showTimer = setTimeout(show, this.openDelay);\n }\n else {\n if (this.popupObj) {\n this.popupObj.show(openAnimation_1, target);\n }\n }\n }\n if (e) {\n this.wireMouseEvents(e, target);\n }\n };\n Tooltip.prototype.needTemplateReposition = function () {\n // eslint-disable-next-line\n var tooltip = this;\n return !isNullOrUndefined(tooltip.viewContainerRef)\n && typeof tooltip.viewContainerRef !== 'string';\n };\n Tooltip.prototype.checkCollision = function (target, x, y) {\n var elePos = {\n left: x, top: y, position: this.position,\n horizontal: this.tooltipPositionX, vertical: this.tooltipPositionY\n };\n var affectedPos = isCollide(this.tooltipEle, this.checkCollideTarget(), x, y);\n if (affectedPos.length > 0) {\n elePos.horizontal = affectedPos.indexOf('left') >= 0 ? 'Right' : affectedPos.indexOf('right') >= 0 ? 'Left' :\n this.tooltipPositionX;\n elePos.vertical = affectedPos.indexOf('top') >= 0 ? 'Bottom' : affectedPos.indexOf('bottom') >= 0 ? 'Top' :\n this.tooltipPositionY;\n }\n return elePos;\n };\n Tooltip.prototype.collisionFlipFit = function (target, x, y) {\n var elePos = this.checkCollision(target, x, y);\n var newpos = elePos.position;\n if (this.tooltipPositionY !== elePos.vertical) {\n newpos = ((this.position.indexOf('Bottom') === 0 || this.position.indexOf('Top') === 0) ?\n elePos.vertical + this.tooltipPositionX : this.tooltipPositionX + elePos.vertical);\n }\n if (this.tooltipPositionX !== elePos.horizontal) {\n if (newpos.indexOf('Left') === 0) {\n elePos.vertical = (newpos === 'LeftTop' || newpos === 'LeftCenter') ? 'Top' : 'Bottom';\n newpos = (elePos.vertical + 'Left');\n }\n if (newpos.indexOf('Right') === 0) {\n elePos.vertical = (newpos === 'RightTop' || newpos === 'RightCenter') ? 'Top' : 'Bottom';\n newpos = (elePos.vertical + 'Right');\n }\n elePos.horizontal = this.tooltipPositionX;\n }\n this.tooltipEventArgs = {\n type: null, cancel: false, target: target, event: null,\n element: this.tooltipEle, collidedPosition: newpos\n };\n this.trigger('beforeCollision', this.tooltipEventArgs);\n if (elePos.position !== newpos) {\n var pos = calculatePosition(target, elePos.horizontal, elePos.vertical);\n this.adjustArrow(target, newpos, elePos.horizontal, elePos.vertical);\n var offsetPos = this.calculateTooltipOffset(newpos);\n offsetPos.top -= (('TopBottom'.indexOf(this.position.split(/(?=[A-Z])/)[0]) !== -1) &&\n ('TopBottom'.indexOf(newpos.split(/(?=[A-Z])/)[0]) !== -1)) ? (2 * this.offsetY) : 0;\n offsetPos.left -= (('RightLeft'.indexOf(this.position.split(/(?=[A-Z])/)[0]) !== -1) &&\n ('RightLeft'.indexOf(newpos.split(/(?=[A-Z])/)[0]) !== -1)) ? (2 * this.offsetX) : 0;\n elePos.position = newpos;\n elePos.left = pos.left + offsetPos.left;\n elePos.top = pos.top + offsetPos.top;\n }\n else {\n this.adjustArrow(target, newpos, elePos.horizontal, elePos.vertical);\n }\n var eleOffset = { left: elePos.left, top: elePos.top };\n var left = fit(this.tooltipEle, this.checkCollideTarget(), { X: true, Y: false }, eleOffset).left;\n this.tooltipEle.style.display = 'block';\n if (this.showTipPointer && (newpos.indexOf('Bottom') === 0 || newpos.indexOf('Top') === 0)) {\n var arrowEle = select('.' + ARROW_TIP, this.tooltipEle);\n var arrowleft = parseInt(arrowEle.style.left, 10) - (left - elePos.left);\n if (arrowleft < 0) {\n arrowleft = 0;\n }\n else if ((arrowleft + arrowEle.offsetWidth) > this.tooltipEle.clientWidth) {\n arrowleft = this.tooltipEle.clientWidth - arrowEle.offsetWidth;\n }\n arrowEle.style.left = arrowleft.toString() + 'px';\n }\n this.tooltipEle.style.display = '';\n eleOffset.left = left;\n return eleOffset;\n };\n Tooltip.prototype.checkCollideTarget = function () {\n return !this.windowCollision && this.target ? this.element : null;\n };\n Tooltip.prototype.hideTooltip = function (hideAnimation, e, targetElement) {\n var _this = this;\n if (this.closeDelay > 0) {\n clearTimeout(this.hideTimer);\n clearTimeout(this.showTimer);\n // eslint-disable-next-line\n var hide = function () {\n if (_this.closeDelay && _this.tooltipEle && _this.isTooltipOpen) {\n return;\n }\n _this.tooltipHide(hideAnimation, e, targetElement);\n };\n this.hideTimer = setTimeout(hide, this.closeDelay);\n }\n else {\n this.tooltipHide(hideAnimation, e, targetElement);\n }\n };\n Tooltip.prototype.tooltipHide = function (hideAnimation, e, targetElement) {\n var _this = this;\n var target;\n if (e) {\n target = this.target ? (targetElement || e.target) : this.element;\n }\n else {\n target = select('[data-tooltip-id= \"' + this.ctrlId + '_content\"]', document);\n }\n this.tooltipEventArgs = {\n type: e ? e.type : null, cancel: false, target: target, event: e ? e : null,\n element: this.tooltipEle, isInteracted: !isNullOrUndefined(e)\n };\n // this line commented for close the tooltip popup element even the target element destroyed in a page.\n //if (isNullOrUndefined(target)) { return; }\n this.trigger('beforeClose', this.tooltipEventArgs, function (observedArgs) {\n if (!observedArgs.cancel) {\n _this.mouseMoveBeforeRemove();\n _this.popupHide(hideAnimation, target);\n }\n else {\n _this.isHidden = false;\n }\n });\n };\n Tooltip.prototype.popupHide = function (hideAnimation, target) {\n if (target) {\n this.restoreElement(target);\n }\n this.isHidden = true;\n // eslint-disable-next-line\n var closeAnimation = {\n name: hideAnimation.effect,\n duration: hideAnimation.duration,\n delay: hideAnimation.delay,\n timingFunction: 'easeIn'\n };\n if (hideAnimation.effect === 'None') {\n closeAnimation = undefined;\n }\n if (this.popupObj) {\n this.popupObj.hide(closeAnimation);\n }\n };\n Tooltip.prototype.restoreElement = function (target) {\n this.unwireMouseEvents(target);\n if (!isNullOrUndefined(target.getAttribute('data-content'))) {\n target.setAttribute('title', target.getAttribute('data-content'));\n target.removeAttribute('data-content');\n }\n this.removeDescribedBy(target);\n };\n Tooltip.prototype.clear = function () {\n if (this.tooltipEle) {\n removeClass([this.tooltipEle], POPUP_CLOSE);\n addClass([this.tooltipEle], POPUP_OPEN);\n }\n if (this.isHidden) {\n if (this.popupObj) {\n this.popupObj.destroy();\n }\n if (this.tooltipEle) {\n remove(this.tooltipEle);\n }\n this.tooltipEle = null;\n this.popupObj = null;\n }\n };\n Tooltip.prototype.tooltipHover = function (e) {\n if (this.tooltipEle) {\n this.isTooltipOpen = true;\n }\n };\n Tooltip.prototype.tooltipMouseOut = function (e) {\n this.isTooltipOpen = false;\n this.hideTooltip(this.animation.close, e, this.findTarget());\n };\n Tooltip.prototype.onMouseOut = function (e) {\n var enteredElement = e.relatedTarget;\n // don't close the tooltip only if it is tooltip content element\n if (enteredElement && !this.mouseTrail) {\n var checkForTooltipElement = closest(enteredElement, \".\" + TOOLTIP_WRAP + \".\" + POPUP_LIB + \".\" + POPUP_ROOT);\n if (checkForTooltipElement) {\n EventHandler.add(checkForTooltipElement, 'mouseleave', this.tooltipElementMouseOut, this);\n }\n else {\n this.hideTooltip(this.animation.close, e, this.findTarget());\n if (this.closeDelay === 0) {\n this.clear();\n }\n }\n }\n else {\n this.hideTooltip(this.animation.close, e, this.findTarget());\n this.clear();\n }\n };\n Tooltip.prototype.tooltipElementMouseOut = function (e) {\n this.hideTooltip(this.animation.close, e, this.findTarget());\n EventHandler.remove(this.element, 'mouseleave', this.tooltipElementMouseOut);\n this.clear();\n };\n Tooltip.prototype.onStickyClose = function (e) {\n this.close();\n };\n Tooltip.prototype.onMouseMove = function (event) {\n var eventPageX = 0;\n var eventPageY = 0;\n if (event.type.indexOf('touch') > -1) {\n event.preventDefault();\n eventPageX = event.touches[0].pageX;\n eventPageY = event.touches[0].pageY;\n }\n else {\n eventPageX = event.pageX;\n eventPageY = event.pageY;\n }\n PopupAnimation.stop(this.tooltipEle);\n removeClass([this.tooltipEle], POPUP_CLOSE);\n addClass([this.tooltipEle], POPUP_OPEN);\n this.adjustArrow(event.target, this.position, this.tooltipPositionX, this.tooltipPositionY);\n var pos = this.calculateTooltipOffset(this.position);\n var x = eventPageX + pos.left + this.offsetX;\n var y = eventPageY + pos.top + this.offsetY;\n var elePos = this.checkCollision(event.target, x, y);\n if (this.tooltipPositionX !== elePos.horizontal || this.tooltipPositionY !== elePos.vertical) {\n var newpos = (this.position.indexOf('Bottom') === 0 || this.position.indexOf('Top') === 0) ?\n elePos.vertical + elePos.horizontal : elePos.horizontal + elePos.vertical;\n elePos.position = newpos;\n this.adjustArrow(event.target, elePos.position, elePos.horizontal, elePos.vertical);\n var colpos = this.calculateTooltipOffset(elePos.position);\n elePos.left = eventPageX + colpos.left - this.offsetX;\n elePos.top = eventPageY + colpos.top - this.offsetY;\n }\n this.tooltipEle.style.left = elePos.left + 'px';\n this.tooltipEle.style.top = elePos.top + 'px';\n };\n Tooltip.prototype.keyDown = function (event) {\n if (this.tooltipEle && event.keyCode === 27) {\n this.close();\n }\n };\n Tooltip.prototype.touchEnd = function (e) {\n if (this.tooltipEle && closest(e.target, '.' + ROOT) === null && !this.isSticky) {\n this.close();\n }\n };\n Tooltip.prototype.scrollHandler = function (e) {\n if (this.tooltipEle) {\n if (!(closest(e.target, \".\" + TOOLTIP_WRAP + \".\" + POPUP_LIB + \".\" + POPUP_ROOT))) {\n this.close();\n }\n }\n };\n /**\n * Core method that initializes the control rendering.\n *\n * @private\n * @returns {void}\n */\n Tooltip.prototype.render = function () {\n this.initialize();\n this.wireEvents(this.opensOn);\n this.renderComplete();\n };\n /**\n * Initializes the values of private members.\n *\n * @private\n * @returns {void}\n */\n Tooltip.prototype.preRender = function () {\n this.tipClass = TIP_BOTTOM;\n this.tooltipPositionX = 'Center';\n this.tooltipPositionY = 'Top';\n this.isHidden = true;\n };\n /**\n * Binding events to the Tooltip element.\n *\n * @hidden\n * @param {string} trigger - specify the trigger string to the function\n * @returns {void}\n *\n */\n Tooltip.prototype.wireEvents = function (trigger) {\n var triggerList = this.getTriggerList(trigger);\n for (var _i = 0, triggerList_1 = triggerList; _i < triggerList_1.length; _i++) {\n var opensOn = triggerList_1[_i];\n if (opensOn === 'Custom') {\n return;\n }\n if (opensOn === 'Focus') {\n this.wireFocusEvents();\n }\n if (opensOn === 'Click') {\n EventHandler.add(this.element, Browser.touchStartEvent, this.targetClick, this);\n }\n if (opensOn === 'Hover') {\n if (Browser.isDevice) {\n this.touchModule = new Touch(this.element, {\n tapHoldThreshold: TAPHOLD_THRESHOLD,\n tapHold: this.tapHoldHandler.bind(this)\n });\n EventHandler.add(this.element, Browser.touchEndEvent, this.touchEndHandler, this);\n }\n else {\n EventHandler.add(this.element, 'mouseover', this.targetHover, this);\n }\n }\n }\n EventHandler.add(document, 'touchend', this.touchEnd, this);\n EventHandler.add(document, 'scroll wheel', this.scrollHandler, this);\n EventHandler.add(window, 'resize', this.windowResize, this);\n EventHandler.add(document, 'keydown', this.keyDown, this);\n };\n Tooltip.prototype.getTriggerList = function (trigger) {\n if (trigger === 'Auto') {\n trigger = (Browser.isDevice) ? 'Hover' : 'Hover Focus';\n }\n return trigger.split(' ');\n };\n Tooltip.prototype.wireFocusEvents = function () {\n if (!isNullOrUndefined(this.target)) {\n var targetList = [].slice.call(selectAll(this.target, this.element));\n for (var _i = 0, targetList_2 = targetList; _i < targetList_2.length; _i++) {\n var target = targetList_2[_i];\n EventHandler.add(target, 'focus', this.targetHover, this);\n }\n }\n else {\n EventHandler.add(this.element, 'focus', this.targetHover, this);\n }\n };\n Tooltip.prototype.wireMouseEvents = function (e, target) {\n if (this.tooltipEle) {\n if (!this.isSticky) {\n if (e.type === 'focus') {\n EventHandler.add(target, 'blur', this.onMouseOut, this);\n }\n if (e.type === 'mouseover') {\n EventHandler.add(target, 'mouseleave', this.onMouseOut, this);\n }\n if (this.closeDelay) {\n EventHandler.add(this.tooltipEle, 'mouseenter', this.tooltipHover, this);\n EventHandler.add(this.tooltipEle, 'mouseleave', this.tooltipMouseOut, this);\n }\n }\n if (this.mouseTrail && this.openDelay === 0) {\n EventHandler.add(target, 'mousemove touchstart mouseenter', this.onMouseMove, this);\n }\n }\n };\n /**\n * Unbinding events from the element on widget destroy.\n *\n * @hidden\n *\n * @param {string} trigger - specify the trigger string to the function\n * @returns {void}\n *\n */\n Tooltip.prototype.unwireEvents = function (trigger) {\n var triggerList = this.getTriggerList(trigger);\n for (var _i = 0, triggerList_2 = triggerList; _i < triggerList_2.length; _i++) {\n var opensOn = triggerList_2[_i];\n if (opensOn === 'Custom') {\n return;\n }\n if (opensOn === 'Focus') {\n this.unwireFocusEvents();\n }\n if (opensOn === 'Click') {\n EventHandler.remove(this.element, Browser.touchStartEvent, this.targetClick);\n }\n if (opensOn === 'Hover') {\n if (Browser.isDevice) {\n if (this.touchModule) {\n this.touchModule.destroy();\n }\n EventHandler.remove(this.element, Browser.touchEndEvent, this.touchEndHandler);\n }\n else {\n EventHandler.remove(this.element, 'mouseover', this.targetHover);\n }\n }\n }\n EventHandler.remove(document, 'touchend', this.touchEnd);\n EventHandler.remove(document, 'scroll wheel', this.scrollHandler);\n EventHandler.remove(window, 'resize', this.windowResize);\n EventHandler.remove(document, 'keydown', this.keyDown);\n };\n Tooltip.prototype.unwireFocusEvents = function () {\n if (!isNullOrUndefined(this.target)) {\n var targetList = [].slice.call(selectAll(this.target, this.element));\n for (var _i = 0, targetList_3 = targetList; _i < targetList_3.length; _i++) {\n var target = targetList_3[_i];\n EventHandler.remove(target, 'focus', this.targetHover);\n }\n }\n else {\n EventHandler.remove(this.element, 'focus', this.targetHover);\n }\n };\n Tooltip.prototype.unwireMouseEvents = function (target) {\n if (!this.isSticky) {\n var triggerList = this.getTriggerList(this.opensOn);\n for (var _i = 0, triggerList_3 = triggerList; _i < triggerList_3.length; _i++) {\n var opensOn = triggerList_3[_i];\n if (opensOn === 'Focus') {\n EventHandler.remove(target, 'blur', this.onMouseOut);\n }\n if (opensOn === 'Hover' && !Browser.isDevice) {\n EventHandler.remove(target, 'mouseleave', this.onMouseOut);\n }\n }\n if (this.closeDelay) {\n EventHandler.remove(target, 'mouseenter', this.tooltipHover);\n EventHandler.remove(target, 'mouseleave', this.tooltipMouseOut);\n }\n }\n if (this.mouseTrail) {\n EventHandler.remove(target, 'mousemove touchstart mouseenter', this.onMouseMove);\n }\n };\n Tooltip.prototype.findTarget = function () {\n var target = select('[data-tooltip-id= \"' + this.ctrlId + '_content\"]', document);\n return target;\n };\n /**\n * Core method to return the component name.\n *\n * @private\n *\n * @returns {string} - this method returns module name.\n */\n Tooltip.prototype.getModuleName = function () {\n return 'tooltip';\n };\n /**\n * Returns the properties to be maintained in the persisted state.\n *\n * @private\n *\n * @returns {string} - this method returns persisted data.\n */\n Tooltip.prototype.getPersistData = function () {\n return this.addOnPersist([]);\n };\n /**\n * Called internally, if any of the property value changed.\n *\n * @private\n *\n * @param {TooltipModel} newProp - this param gives new property values to the method\n * @param {TooltipModel} oldProp - this param gives old property values to the method\n * @returns {void}\n *\n */\n Tooltip.prototype.onPropertyChanged = function (newProp, oldProp) {\n var targetElement = this.findTarget();\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'width':\n if (this.tooltipEle && targetElement) {\n this.tooltipEle.style.width = this.tooltipEle.style.maxWidth = formatUnit(newProp.width);\n this.reposition(targetElement);\n }\n break;\n case 'height':\n if (this.tooltipEle && targetElement) {\n this.tooltipEle.style.height = formatUnit(newProp.height);\n this.reposition(targetElement);\n }\n break;\n case 'content':\n if (this.tooltipEle) {\n this.renderContent();\n }\n break;\n case 'opensOn':\n this.unwireEvents(oldProp.opensOn);\n this.wireEvents(newProp.opensOn);\n break;\n case 'position':\n this.formatPosition();\n if (this.tooltipEle && targetElement) {\n var arrowInnerELe = select('.' + ARROW_TIP_INNER, this.tooltipEle);\n arrowInnerELe.style.top = arrowInnerELe.style.left = null;\n this.reposition(targetElement);\n }\n break;\n case 'tipPointerPosition':\n if (this.tooltipEle && targetElement) {\n this.reposition(targetElement);\n }\n break;\n case 'offsetX':\n if (this.tooltipEle) {\n var x = newProp.offsetX - oldProp.offsetX;\n this.tooltipEle.style.left = (parseInt(this.tooltipEle.style.left, 10) + (x)).toString() + 'px';\n }\n break;\n case 'offsetY':\n if (this.tooltipEle) {\n var y = newProp.offsetY - oldProp.offsetY;\n this.tooltipEle.style.top = (parseInt(this.tooltipEle.style.top, 10) + (y)).toString() + 'px';\n }\n break;\n case 'cssClass':\n if (this.tooltipEle) {\n if (oldProp.cssClass) {\n removeClass([this.tooltipEle], oldProp.cssClass.split(' '));\n }\n if (newProp.cssClass) {\n addClass([this.tooltipEle], newProp.cssClass.split(' '));\n }\n }\n break;\n case 'enableRtl':\n if (this.tooltipEle) {\n if (this.enableRtl) {\n addClass([this.tooltipEle], RTL);\n }\n else {\n removeClass([this.tooltipEle], RTL);\n }\n }\n break;\n }\n }\n };\n /**\n * It is used to show the Tooltip on the specified target with specific animation settings.\n *\n * @param {HTMLElement} element - Target element where the Tooltip is to be displayed. (It is an optional parameter)\n * @param {TooltipAnimationSettings} animation - Sets the specific animation, while showing the Tooltip on the screen. (It is an optional parameter)\n * @returns {void}\n */\n Tooltip.prototype.open = function (element, animation) {\n if (isNullOrUndefined(animation)) {\n animation = this.animation.open;\n }\n if (isNullOrUndefined(element)) {\n element = this.element;\n }\n if (element.style.display === 'none') {\n return;\n }\n this.showTooltip(element, animation);\n };\n /**\n * It is used to hide the Tooltip with specific animation effect.\n *\n * @param {TooltipAnimationSettings} animation - Sets the specific animation when hiding Tooltip from the screen. (It is an optional parameter)\n * @returns {void}\n */\n Tooltip.prototype.close = function (animation) {\n if (!animation) {\n animation = this.animation.close;\n }\n this.hideTooltip(animation);\n };\n /**\n * It is used to refresh the Tooltip content and its position.\n *\n * @param {HTMLElement} target - Target element where the Tooltip content or position needs to be refreshed.\n * @returns {void}\n */\n Tooltip.prototype.refresh = function (target) {\n if (this.tooltipEle) {\n this.renderContent(target);\n }\n if (this.popupObj && target) {\n this.reposition(target);\n }\n };\n /**\n * It is used to destroy the Tooltip component.\n * @method destroy\n * @returns {void}\n * @memberof Tooltip\n */\n Tooltip.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n if (this.tooltipEle) {\n remove(this.tooltipEle);\n }\n if (this.popupObj) {\n this.popupObj.destroy();\n }\n removeClass([this.element], ROOT);\n this.unwireEvents(this.opensOn);\n this.unwireMouseEvents(this.element);\n this.tooltipEle = null;\n this.popupObj = null;\n };\n __decorate([\n Property('auto')\n ], Tooltip.prototype, \"width\", void 0);\n __decorate([\n Property('auto')\n ], Tooltip.prototype, \"height\", void 0);\n __decorate([\n Property()\n ], Tooltip.prototype, \"content\", void 0);\n __decorate([\n Property()\n ], Tooltip.prototype, \"target\", void 0);\n __decorate([\n Property('TopCenter')\n ], Tooltip.prototype, \"position\", void 0);\n __decorate([\n Property(0)\n ], Tooltip.prototype, \"offsetX\", void 0);\n __decorate([\n Property(0)\n ], Tooltip.prototype, \"offsetY\", void 0);\n __decorate([\n Property(true)\n ], Tooltip.prototype, \"showTipPointer\", void 0);\n __decorate([\n Property(true)\n ], Tooltip.prototype, \"enableHtmlParse\", void 0);\n __decorate([\n Property(false)\n ], Tooltip.prototype, \"windowCollision\", void 0);\n __decorate([\n Property('Auto')\n ], Tooltip.prototype, \"tipPointerPosition\", void 0);\n __decorate([\n Property('Auto')\n ], Tooltip.prototype, \"opensOn\", void 0);\n __decorate([\n Property(false)\n ], Tooltip.prototype, \"mouseTrail\", void 0);\n __decorate([\n Property(false)\n ], Tooltip.prototype, \"isSticky\", void 0);\n __decorate([\n Complex({}, Animation)\n ], Tooltip.prototype, \"animation\", void 0);\n __decorate([\n Property(0)\n ], Tooltip.prototype, \"openDelay\", void 0);\n __decorate([\n Property(0)\n ], Tooltip.prototype, \"closeDelay\", void 0);\n __decorate([\n Property()\n ], Tooltip.prototype, \"cssClass\", void 0);\n __decorate([\n Property(false)\n ], Tooltip.prototype, \"enableHtmlSanitizer\", void 0);\n __decorate([\n Event()\n ], Tooltip.prototype, \"beforeRender\", void 0);\n __decorate([\n Event()\n ], Tooltip.prototype, \"beforeOpen\", void 0);\n __decorate([\n Event()\n ], Tooltip.prototype, \"afterOpen\", void 0);\n __decorate([\n Event()\n ], Tooltip.prototype, \"beforeClose\", void 0);\n __decorate([\n Event()\n ], Tooltip.prototype, \"afterClose\", void 0);\n __decorate([\n Event()\n ], Tooltip.prototype, \"beforeCollision\", void 0);\n __decorate([\n Event()\n ], Tooltip.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], Tooltip.prototype, \"destroyed\", void 0);\n Tooltip = __decorate([\n NotifyPropertyChanges\n ], Tooltip);\n return Tooltip;\n}(Component));\nexport { Tooltip };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isNullOrUndefined, append, createElement, addClass } from '@syncfusion/ej2-base';\nimport { Tooltip } from '@syncfusion/ej2-popups';\nimport * as cls from '../base/css-constant';\nimport * as util from '../base/util';\n/**\n * Tooltip for Schedule\n */\nvar EventTooltip = /** @class */ (function () {\n function EventTooltip(parent) {\n this.parent = parent;\n this.tooltipObj = new Tooltip({\n animation: { close: { effect: 'FadeOut' } },\n content: 'No title',\n position: 'BottomRight',\n offsetY: 10,\n mouseTrail: this.parent.isAdaptive ? false : true,\n showTipPointer: false,\n cssClass: this.parent.cssClass + ' ' + cls.EVENT_TOOLTIP_ROOT_CLASS,\n target: this.getTargets(),\n beforeRender: this.onBeforeRender.bind(this),\n beforeClose: this.onBeforeClose.bind(this),\n enableRtl: this.parent.enableRtl\n });\n this.tooltipObj.appendTo(this.parent.element);\n }\n EventTooltip.prototype.getTargets = function () {\n var targets = [];\n if (this.parent.activeViewOptions.group.headerTooltipTemplate) {\n targets.push('.' + cls.RESOURCE_CELLS_CLASS);\n }\n if (this.parent.eventSettings.enableTooltip) {\n targets.push('.' + cls.APPOINTMENT_CLASS);\n }\n return targets.join(',');\n };\n EventTooltip.prototype.onBeforeRender = function (args) {\n if (!isNullOrUndefined(args.target.getAttribute('data-tooltip-id'))) {\n return;\n }\n if (args.target.classList.contains(cls.RESOURCE_CELLS_CLASS) && this.parent.activeViewOptions.group.resources.length > 0) {\n var resCollection = void 0;\n if (this.parent.activeView.isTimelineView()) {\n var index = parseInt(args.target.getAttribute('data-group-index'), 10);\n resCollection = this.parent.resourceBase.lastResourceLevel[index];\n }\n else {\n var rowIndex = args.target.parentNode.sectionRowIndex;\n var cellIndex = args.target.cellIndex;\n resCollection = this.parent.activeView.getColumnLevels()[rowIndex][cellIndex];\n }\n var data = {\n resource: resCollection.resource,\n resourceData: resCollection.resourceData\n };\n var contentContainer = createElement('div');\n var templateId = this.parent.element.id + '_headerTooltipTemplate';\n var tooltipTemplate = [].slice.call(this.parent.getHeaderTooltipTemplate()(data, this.parent, 'headerTooltipTemplate', templateId, false));\n append(tooltipTemplate, contentContainer);\n this.setContent(contentContainer);\n this.parent.renderTemplates();\n return;\n }\n var record = this.parent.eventBase.getEventByGuid(args.target.getAttribute('data-guid'));\n if (isNullOrUndefined(record)) {\n return;\n }\n if (!isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)) {\n var contentContainer = createElement('div');\n var templateId = this.parent.element.id + '_tooltipTemplate';\n var tooltipTemplate = [].slice.call(this.parent.getEventTooltipTemplate()(record, this.parent, 'tooltipTemplate', templateId, false));\n append(tooltipTemplate, contentContainer);\n this.setContent(contentContainer);\n }\n else {\n var globalize = this.parent.globalize;\n var fields = this.parent.eventFields;\n var eventStart = new Date('' + record[fields.startTime]);\n var eventEnd = new Date('' + record[fields.endTime]);\n eventEnd = (eventEnd.getHours() === 0 && eventEnd.getMinutes() === 0) ? new Date(eventEnd.setMilliseconds(-1000)) : eventEnd;\n var startDate = util.resetTime(new Date('' + eventStart));\n var endDate = util.resetTime(new Date('' + eventEnd));\n var tooltipSubject = (record[fields.subject] || this.parent.eventSettings.fields.subject.default\n || this.parent.localeObj.getConstant('addTitle'));\n var tooltipLocation = !isNullOrUndefined(record[fields.location]) ? record[fields.location] : '';\n var startMonthDate = '';\n var startMonthYearDate = '';\n var endMonthYearDate = '';\n startMonthDate = globalize.formatDate(eventStart, {\n type: 'date', skeleton: 'MMMd', calendar: this.parent.getCalendarMode()\n });\n startMonthYearDate = globalize.formatDate(eventStart, {\n type: 'date', skeleton: 'medium', calendar: this.parent.getCalendarMode()\n });\n endMonthYearDate = globalize.formatDate(eventEnd, {\n type: 'date', skeleton: 'medium', calendar: this.parent.getCalendarMode()\n });\n startMonthDate = util.capitalizeFirstWord(startMonthDate, 'single');\n startMonthYearDate = util.capitalizeFirstWord(startMonthYearDate, 'single');\n endMonthYearDate = util.capitalizeFirstWord(endMonthYearDate, 'single');\n var skeleton = 'short';\n var startTime = globalize.formatDate(eventStart, {\n type: 'time', skeleton: skeleton, calendar: this.parent.getCalendarMode()\n });\n var endTime = globalize.formatDate(eventEnd, {\n type: 'time', skeleton: skeleton, calendar: this.parent.getCalendarMode()\n });\n var tooltipDetails = void 0;\n if (startDate.getTime() === endDate.getTime()) {\n tooltipDetails =\n globalize.formatDate(eventStart, {\n type: 'date', skeleton: 'long', calendar: this.parent.getCalendarMode()\n });\n tooltipDetails = util.capitalizeFirstWord(tooltipDetails, 'single');\n }\n else {\n tooltipDetails = (startDate.getFullYear() === endDate.getFullYear()) ? (startMonthDate + ' - ' + endMonthYearDate) :\n (startMonthYearDate + ' - ' + endMonthYearDate);\n }\n var tooltipTime = (record[fields.isAllDay]) ? this.parent.localeObj.getConstant('allDay') :\n (startTime + ' - ' + endTime);\n var content = '
' + tooltipSubject + '
' +\n '
' + tooltipLocation + '
' +\n '
' + tooltipDetails + '
' +\n '
' + tooltipTime + '
';\n this.setContent(content);\n }\n this.parent.renderTemplates();\n };\n EventTooltip.prototype.onBeforeClose = function () {\n this.parent.resetTemplates(['tooltipTemplate', 'headerTooltipTemplate']);\n };\n EventTooltip.prototype.setContent = function (content) {\n this.tooltipObj.setProperties({ content: content }, true);\n };\n EventTooltip.prototype.close = function () {\n this.tooltipObj.close();\n };\n EventTooltip.prototype.destroy = function () {\n this.tooltipObj.destroy();\n addClass([this.parent.element], 'e-control');\n this.tooltipObj = null;\n this.parent = null;\n };\n return EventTooltip;\n}());\nexport { EventTooltip };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, NotifyPropertyChanges, Property } from '@syncfusion/ej2-base';\nimport { Event, EventHandler, isNullOrUndefined, SanitizeHtmlHelper } from '@syncfusion/ej2-base';\nimport { addClass, detach, getUniqueID, isRippleEnabled, removeClass, rippleEffect, closest } from '@syncfusion/ej2-base';\nimport { wrapperInitialize, rippleMouseHandler, setHiddenInput } from './../common/common';\nvar CHECK = 'e-check';\nvar DISABLED = 'e-checkbox-disabled';\nvar FRAME = 'e-frame';\nvar INDETERMINATE = 'e-stop';\nvar LABEL = 'e-label';\nvar RIPPLE = 'e-ripple-container';\nvar RIPPLECHECK = 'e-ripple-check';\nvar RIPPLEINDETERMINATE = 'e-ripple-stop';\nvar RTL = 'e-rtl';\nvar WRAPPER = 'e-checkbox-wrapper';\nvar containerAttr = ['title', 'class', 'style', 'disabled', 'readonly', 'name', 'value'];\n/**\n * The CheckBox is a graphical user interface element that allows you to select one or more options from the choices.\n * It contains checked, unchecked, and indeterminate states.\n * ```html\n *
\n * \n * ```\n */\nvar CheckBox = /** @class */ (function (_super) {\n __extends(CheckBox, _super);\n /**\n * Constructor for creating the widget\n *\n * @private\n * @param {CheckBoxModel} options - Specifies checkbox model\n * @param {string | HTMLInputElement} element - Specifies target element\n */\n function CheckBox(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.isFocused = false;\n _this.isMouseClick = false;\n return _this;\n }\n CheckBox.prototype.changeState = function (state) {\n var ariaState;\n var rippleSpan;\n var frameSpan = this.getWrapper().getElementsByClassName(FRAME)[0];\n if (isRippleEnabled) {\n rippleSpan = this.getWrapper().getElementsByClassName(RIPPLE)[0];\n }\n if (state === 'check') {\n frameSpan.classList.remove(INDETERMINATE);\n frameSpan.classList.add(CHECK);\n if (rippleSpan) {\n rippleSpan.classList.remove(RIPPLEINDETERMINATE);\n rippleSpan.classList.add(RIPPLECHECK);\n }\n ariaState = 'true';\n this.element.checked = true;\n }\n else if (state === 'uncheck') {\n removeClass([frameSpan], [CHECK, INDETERMINATE]);\n if (rippleSpan) {\n removeClass([rippleSpan], [RIPPLECHECK, RIPPLEINDETERMINATE]);\n }\n ariaState = 'false';\n this.element.checked = false;\n }\n else {\n frameSpan.classList.remove(CHECK);\n frameSpan.classList.add(INDETERMINATE);\n if (rippleSpan) {\n rippleSpan.classList.remove(RIPPLECHECK);\n rippleSpan.classList.add(RIPPLEINDETERMINATE);\n }\n ariaState = 'mixed';\n this.element.indeterminate = true;\n }\n this.getWrapper().setAttribute('aria-checked', ariaState);\n };\n CheckBox.prototype.clickHandler = function (event) {\n if (this.isMouseClick) {\n this.focusOutHandler();\n this.isMouseClick = false;\n }\n if (this.indeterminate) {\n this.changeState(this.checked ? 'check' : 'uncheck');\n this.indeterminate = false;\n this.element.indeterminate = false;\n }\n else if (this.checked) {\n this.changeState('uncheck');\n this.checked = false;\n }\n else {\n this.changeState('check');\n this.checked = true;\n }\n var changeEventArgs = { checked: this.updateVueArrayModel(false), event: event };\n this.trigger('change', changeEventArgs);\n event.stopPropagation();\n };\n /**\n * Destroys the widget.\n *\n * @returns {void}\n */\n CheckBox.prototype.destroy = function () {\n var _this = this;\n var wrapper = this.getWrapper();\n _super.prototype.destroy.call(this);\n if (this.wrapper) {\n wrapper = this.wrapper;\n if (!this.disabled) {\n this.unWireEvents();\n }\n if (this.tagName === 'INPUT') {\n if (this.getWrapper() && wrapper.parentNode) {\n wrapper.parentNode.insertBefore(this.element, wrapper);\n }\n detach(wrapper);\n this.element.checked = false;\n if (this.indeterminate) {\n this.element.indeterminate = false;\n }\n ['name', 'value', 'disabled'].forEach(function (key) {\n _this.element.removeAttribute(key);\n });\n }\n else {\n ['role', 'aria-checked', 'class'].forEach(function (key) {\n wrapper.removeAttribute(key);\n });\n wrapper.innerHTML = '';\n }\n }\n };\n CheckBox.prototype.focusHandler = function () {\n this.isFocused = true;\n };\n CheckBox.prototype.focusOutHandler = function () {\n var wrapper = this.getWrapper();\n if (wrapper) {\n wrapper.classList.remove('e-focus');\n }\n this.isFocused = false;\n };\n /**\n * Gets the module name.\n *\n * @private\n * @returns {string} - Module Name\n */\n CheckBox.prototype.getModuleName = function () {\n return 'checkbox';\n };\n /**\n * Gets the properties to be maintained in the persistence state.\n *\n * @private\n * @returns {string} - Persist Data\n */\n CheckBox.prototype.getPersistData = function () {\n return this.addOnPersist(['checked', 'indeterminate']);\n };\n CheckBox.prototype.getWrapper = function () {\n if (this.element && this.element.parentElement) {\n return this.element.parentElement.parentElement;\n }\n else {\n return null;\n }\n };\n CheckBox.prototype.initialize = function () {\n if (isNullOrUndefined(this.initialCheckedValue)) {\n this.initialCheckedValue = this.checked;\n }\n if (this.name) {\n this.element.setAttribute('name', this.name);\n }\n if (this.value) {\n this.element.setAttribute('value', this.value);\n if (this.isVue && typeof this.value === 'boolean' && this.value === true) {\n this.setProperties({ 'checked': true }, true);\n }\n }\n if (this.checked) {\n this.changeState('check');\n }\n if (this.indeterminate) {\n this.changeState();\n }\n if (this.disabled) {\n this.setDisabled();\n }\n };\n CheckBox.prototype.initWrapper = function () {\n var wrapper = this.element.parentElement;\n if (!wrapper.classList.contains(WRAPPER)) {\n wrapper = this.createElement('div', {\n className: WRAPPER, attrs: { 'role': 'checkbox', 'aria-checked': 'false' }\n });\n this.element.parentNode.insertBefore(wrapper, this.element);\n }\n var label = this.createElement('label', { attrs: { for: this.element.id } });\n var frameSpan = this.createElement('span', { className: 'e-icons ' + FRAME });\n wrapper.classList.add('e-wrapper');\n if (this.enableRtl) {\n wrapper.classList.add(RTL);\n }\n if (this.cssClass) {\n addClass([wrapper], this.cssClass.split(' '));\n }\n wrapper.appendChild(label);\n label.appendChild(this.element);\n setHiddenInput(this, label);\n label.appendChild(frameSpan);\n if (isRippleEnabled) {\n var rippleSpan = this.createElement('span', { className: RIPPLE });\n if (this.labelPosition === 'Before') {\n label.appendChild(rippleSpan);\n }\n else {\n label.insertBefore(rippleSpan, frameSpan);\n }\n rippleEffect(rippleSpan, { duration: 400, isCenterRipple: true });\n }\n if (this.label) {\n this.setText(this.label);\n }\n };\n CheckBox.prototype.keyUpHandler = function () {\n if (this.isFocused) {\n this.getWrapper().classList.add('e-focus');\n }\n };\n CheckBox.prototype.labelMouseDownHandler = function (e) {\n this.isMouseClick = true;\n var rippleSpan = this.getWrapper().getElementsByClassName(RIPPLE)[0];\n rippleMouseHandler(e, rippleSpan);\n };\n CheckBox.prototype.labelMouseUpHandler = function (e) {\n this.isMouseClick = true;\n var rippleSpan = this.getWrapper().getElementsByClassName(RIPPLE)[0];\n if (rippleSpan) {\n var rippleElem = rippleSpan.querySelectorAll('.e-ripple-element');\n for (var i = 0; i < rippleElem.length - 1; i++) {\n rippleSpan.removeChild(rippleSpan.childNodes[i]);\n }\n rippleMouseHandler(e, rippleSpan);\n }\n };\n /**\n * Called internally if any of the property value changes.\n *\n * @private\n * @param {CheckBoxModel} newProp - Specifies new Properties\n * @param {CheckBoxModel} oldProp - Specifies old Properties\n *\n * @returns {void}\n */\n CheckBox.prototype.onPropertyChanged = function (newProp, oldProp) {\n var wrapper = this.getWrapper();\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'checked':\n this.indeterminate = false;\n this.element.indeterminate = false;\n this.changeState(newProp.checked ? 'check' : 'uncheck');\n break;\n case 'indeterminate':\n if (newProp.indeterminate) {\n this.changeState();\n }\n else {\n this.element.indeterminate = false;\n this.changeState(this.checked ? 'check' : 'uncheck');\n }\n break;\n case 'disabled':\n if (newProp.disabled) {\n this.setDisabled();\n this.wrapper = this.getWrapper();\n this.unWireEvents();\n }\n else {\n this.element.disabled = false;\n wrapper.classList.remove(DISABLED);\n wrapper.setAttribute('aria-disabled', 'false');\n this.wireEvents();\n }\n break;\n case 'cssClass':\n if (oldProp.cssClass) {\n removeClass([wrapper], oldProp.cssClass.split(' '));\n }\n if (newProp.cssClass) {\n addClass([wrapper], newProp.cssClass.split(' '));\n }\n break;\n case 'enableRtl':\n if (newProp.enableRtl) {\n wrapper.classList.add(RTL);\n }\n else {\n wrapper.classList.remove(RTL);\n }\n break;\n case 'label':\n this.setText(newProp.label);\n break;\n case 'labelPosition': {\n var label = wrapper.getElementsByClassName(LABEL)[0];\n var labelWrap = wrapper.getElementsByTagName('label')[0];\n detach(label);\n if (newProp.labelPosition === 'After') {\n labelWrap.appendChild(label);\n }\n else {\n labelWrap.insertBefore(label, wrapper.getElementsByClassName(FRAME)[0]);\n }\n break;\n }\n case 'name':\n this.element.setAttribute('name', newProp.name);\n break;\n case 'value':\n if (this.isVue && typeof newProp.value === 'object') {\n break;\n }\n this.element.setAttribute('value', newProp.value);\n break;\n case 'htmlAttributes':\n this.updateHtmlAttributeToWrapper();\n break;\n }\n }\n };\n /**\n * Initialize Angular, React and Unique ID support.\n *\n * @private\n * @returns {void}\n */\n CheckBox.prototype.preRender = function () {\n var element = this.element;\n this.formElement = closest(this.element, 'form');\n this.tagName = this.element.tagName;\n element = wrapperInitialize(this.createElement, 'EJS-CHECKBOX', 'checkbox', element, WRAPPER, 'checkbox');\n this.element = element;\n if (this.element.getAttribute('type') !== 'checkbox') {\n this.element.setAttribute('type', 'checkbox');\n }\n if (!this.element.id) {\n this.element.id = getUniqueID('e-' + this.getModuleName());\n }\n };\n /**\n * Initialize the control rendering.\n *\n * @private\n * @returns {void}\n */\n CheckBox.prototype.render = function () {\n this.initWrapper();\n this.initialize();\n if (!this.disabled) {\n this.wireEvents();\n }\n this.updateHtmlAttributeToWrapper();\n this.updateVueArrayModel(true);\n this.renderComplete();\n this.wrapper = this.getWrapper();\n };\n CheckBox.prototype.setDisabled = function () {\n var wrapper = this.getWrapper();\n this.element.disabled = true;\n wrapper.classList.add(DISABLED);\n wrapper.setAttribute('aria-disabled', 'true');\n };\n CheckBox.prototype.setText = function (text) {\n var wrapper = this.getWrapper();\n if (!wrapper) {\n return;\n }\n var label = wrapper.getElementsByClassName(LABEL)[0];\n if (label) {\n label.textContent = text;\n }\n else {\n text = (this.enableHtmlSanitizer) ? SanitizeHtmlHelper.sanitize(text) : text;\n label = this.createElement('span', { className: LABEL, innerHTML: text });\n var labelWrap = wrapper.getElementsByTagName('label')[0];\n if (this.labelPosition === 'Before') {\n labelWrap.insertBefore(label, wrapper.getElementsByClassName(FRAME)[0]);\n }\n else {\n labelWrap.appendChild(label);\n }\n }\n };\n CheckBox.prototype.changeHandler = function (e) {\n e.stopPropagation();\n };\n CheckBox.prototype.formResetHandler = function () {\n this.checked = this.initialCheckedValue;\n this.element.checked = this.initialCheckedValue;\n };\n CheckBox.prototype.unWireEvents = function () {\n var wrapper = this.wrapper;\n EventHandler.remove(this.element, 'click', this.clickHandler);\n EventHandler.remove(this.element, 'keyup', this.keyUpHandler);\n EventHandler.remove(this.element, 'focus', this.focusHandler);\n EventHandler.remove(this.element, 'focusout', this.focusOutHandler);\n var label = wrapper.getElementsByTagName('label')[0];\n EventHandler.remove(label, 'mousedown', this.labelMouseDownHandler);\n EventHandler.remove(label, 'mouseup', this.labelMouseUpHandler);\n if (this.formElement) {\n EventHandler.remove(this.formElement, 'reset', this.formResetHandler);\n }\n if (this.tagName === 'EJS-CHECKBOX') {\n EventHandler.remove(this.element, 'change', this.changeHandler);\n }\n };\n CheckBox.prototype.wireEvents = function () {\n var wrapper = this.getWrapper();\n EventHandler.add(this.element, 'click', this.clickHandler, this);\n EventHandler.add(this.element, 'keyup', this.keyUpHandler, this);\n EventHandler.add(this.element, 'focus', this.focusHandler, this);\n EventHandler.add(this.element, 'focusout', this.focusOutHandler, this);\n var label = wrapper.getElementsByTagName('label')[0];\n EventHandler.add(label, 'mousedown', this.labelMouseDownHandler, this);\n EventHandler.add(label, 'mouseup', this.labelMouseUpHandler, this);\n if (this.formElement) {\n EventHandler.add(this.formElement, 'reset', this.formResetHandler, this);\n }\n if (this.tagName === 'EJS-CHECKBOX') {\n EventHandler.add(this.element, 'change', this.changeHandler, this);\n }\n };\n CheckBox.prototype.updateVueArrayModel = function (init) {\n if (this.isVue && typeof this.value === 'object') {\n var value = this.element.value;\n if (value && this.value) {\n if (init) {\n for (var i = 0; i < this.value.length; i++) {\n if (value === this.value[i]) {\n this.changeState('check');\n this.setProperties({ 'checked': true }, true);\n }\n }\n }\n else {\n var index = this.value.indexOf(value);\n if (this.checked) {\n if (index < 0) {\n this.value.push(value);\n }\n }\n else {\n if (index > -1) {\n this.value.splice(index, 1);\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return this.value;\n }\n }\n }\n return this.element.checked;\n };\n CheckBox.prototype.updateHtmlAttributeToWrapper = function () {\n if (!isNullOrUndefined(this.htmlAttributes)) {\n for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {\n var key = _a[_i];\n if (containerAttr.indexOf(key) > -1) {\n var wrapper = this.getWrapper();\n if (key === 'class') {\n addClass([wrapper], this.htmlAttributes[key].split(' '));\n }\n else if (key === 'title') {\n wrapper.setAttribute(key, this.htmlAttributes[key]);\n }\n else if (key === 'style') {\n var frameSpan = this.getWrapper().getElementsByClassName(FRAME)[0];\n frameSpan.setAttribute(key, this.htmlAttributes[key]);\n }\n else {\n this.element.setAttribute(key, this.htmlAttributes[key]);\n }\n }\n }\n }\n };\n /**\n * Click the CheckBox element\n * its native method\n *\n * @public\n * @returns {void}\n */\n CheckBox.prototype.click = function () {\n this.element.click();\n };\n /**\n * Sets the focus to CheckBox\n * its native method\n *\n * @public\n * @returns {void}\n */\n CheckBox.prototype.focusIn = function () {\n this.element.focus();\n };\n __decorate([\n Event()\n ], CheckBox.prototype, \"change\", void 0);\n __decorate([\n Event()\n ], CheckBox.prototype, \"created\", void 0);\n __decorate([\n Property(false)\n ], CheckBox.prototype, \"checked\", void 0);\n __decorate([\n Property('')\n ], CheckBox.prototype, \"cssClass\", void 0);\n __decorate([\n Property(false)\n ], CheckBox.prototype, \"disabled\", void 0);\n __decorate([\n Property(false)\n ], CheckBox.prototype, \"indeterminate\", void 0);\n __decorate([\n Property('')\n ], CheckBox.prototype, \"label\", void 0);\n __decorate([\n Property('After')\n ], CheckBox.prototype, \"labelPosition\", void 0);\n __decorate([\n Property('')\n ], CheckBox.prototype, \"name\", void 0);\n __decorate([\n Property('')\n ], CheckBox.prototype, \"value\", void 0);\n __decorate([\n Property(false)\n ], CheckBox.prototype, \"enableHtmlSanitizer\", void 0);\n __decorate([\n Property({})\n ], CheckBox.prototype, \"htmlAttributes\", void 0);\n CheckBox = __decorate([\n NotifyPropertyChanges\n ], CheckBox);\n return CheckBox;\n}(Component));\nexport { CheckBox };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, EventHandler, addClass, append, Property, Event, L10n, compile } from '@syncfusion/ej2-base';\nimport { setStyleAttribute, extend, removeClass, prepend, isNullOrUndefined, detach, getValue } from '@syncfusion/ej2-base';\nimport { NotifyPropertyChanges, rippleEffect, ChildProperty, Complex } from '@syncfusion/ej2-base';\nimport { DataManager, Query, DataUtil } from '@syncfusion/ej2-data';\nimport { ListBase } from '@syncfusion/ej2-lists';\nimport { select, selectAll } from '@syncfusion/ej2-base';\nvar FieldSettings = /** @class */ (function (_super) {\n __extends(FieldSettings, _super);\n function FieldSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], FieldSettings.prototype, \"text\", void 0);\n __decorate([\n Property()\n ], FieldSettings.prototype, \"value\", void 0);\n __decorate([\n Property()\n ], FieldSettings.prototype, \"iconCss\", void 0);\n __decorate([\n Property()\n ], FieldSettings.prototype, \"groupBy\", void 0);\n __decorate([\n Property()\n ], FieldSettings.prototype, \"htmlAttributes\", void 0);\n return FieldSettings;\n}(ChildProperty));\nexport { FieldSettings };\nexport var dropDownBaseClasses = {\n root: 'e-dropdownbase',\n rtl: 'e-rtl',\n content: 'e-content',\n selected: 'e-active',\n hover: 'e-hover',\n noData: 'e-nodata',\n fixedHead: 'e-fixed-head',\n focus: 'e-item-focus',\n li: 'e-list-item',\n group: 'e-list-group-item',\n disabled: 'e-disabled',\n grouping: 'e-dd-group'\n};\nvar ITEMTEMPLATE_PROPERTY = 'ItemTemplate';\nvar VALUETEMPLATE_PROPERTY = 'ValueTemplate';\nvar GROUPTEMPLATE_PROPERTY = 'GroupTemplate';\nvar HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';\nvar FOOTERTEMPLATE_PROPERTY = 'FooterTemplate';\nvar NORECORDSTEMPLATE_PROPERTY = 'NoRecordsTemplate';\nvar ACTIONFAILURETEMPLATE_PROPERTY = 'ActionFailureTemplate';\n/**\n * DropDownBase component will generate the list items based on given data and act as base class to drop-down related components\n */\nvar DropDownBase = /** @class */ (function (_super) {\n __extends(DropDownBase, _super);\n /**\n * * Constructor for DropDownBase class\n *\n * @param {DropDownBaseModel} options - Specifies the DropDownBase model.\n * @param {string | HTMLElement} element - Specifies the element to render as component.\n * @private\n */\n function DropDownBase(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.preventChange = false;\n _this.isAngular = false;\n _this.isPreventChange = false;\n _this.isDynamicDataChange = false;\n return _this;\n }\n DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {\n var newProperty = new Object();\n var oldProperty = new Object();\n var propName = function (prop) {\n return prop;\n };\n newProperty[propName(prop)] = newProp[propName(prop)];\n oldProperty[propName(prop)] = oldProp[propName(prop)];\n var data = new Object();\n data.newProperty = newProperty;\n data.oldProperty = oldProperty;\n return data;\n };\n DropDownBase.prototype.getValueByText = function (text, ignoreCase, ignoreAccent) {\n var value = null;\n if (!isNullOrUndefined(this.listData)) {\n if (ignoreCase) {\n value = this.checkValueCase(text, true, ignoreAccent);\n }\n else {\n value = this.checkValueCase(text, false, ignoreAccent);\n }\n }\n return value;\n };\n DropDownBase.prototype.checkValueCase = function (text, ignoreCase, ignoreAccent, isTextByValue) {\n var _this = this;\n var value = null;\n if (isTextByValue) {\n value = text;\n }\n var dataSource = this.listData;\n var fields = this.fields;\n var type = this.typeOfData(dataSource).typeof;\n if (type === 'string' || type === 'number' || type === 'boolean') {\n for (var _i = 0, dataSource_1 = dataSource; _i < dataSource_1.length; _i++) {\n var item = dataSource_1[_i];\n if (!isNullOrUndefined(item)) {\n if (ignoreAccent) {\n value = this.checkingAccent(String(item), text, ignoreCase);\n }\n else {\n if (ignoreCase) {\n if (this.checkIgnoreCase(String(item), text)) {\n value = this.getItemValue(String(item), text, ignoreCase);\n }\n }\n else {\n if (this.checkNonIgnoreCase(String(item), text)) {\n value = this.getItemValue(String(item), text, ignoreCase, isTextByValue);\n }\n }\n }\n }\n }\n }\n else {\n if (ignoreCase) {\n dataSource.filter(function (item) {\n var itemValue = getValue(fields.value, item);\n if (!isNullOrUndefined(itemValue) && _this.checkIgnoreCase(getValue(fields.text, item).toString(), text)) {\n value = getValue(fields.value, item);\n }\n });\n }\n else {\n if (isTextByValue) {\n var compareValue_1 = null;\n compareValue_1 = value;\n dataSource.filter(function (item) {\n var itemValue = getValue(fields.value, item);\n if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value) && itemValue.toString() === compareValue_1.toString()) {\n value = getValue(fields.text, item);\n }\n });\n }\n else {\n dataSource.filter(function (item) {\n if (_this.checkNonIgnoreCase(getValue(fields.text, item), text)) {\n value = getValue(fields.value, item);\n }\n });\n }\n }\n }\n return value;\n };\n DropDownBase.prototype.checkingAccent = function (item, text, ignoreCase) {\n var dataItem = DataUtil.ignoreDiacritics(String(item));\n var textItem = DataUtil.ignoreDiacritics(text.toString());\n var value = null;\n if (ignoreCase) {\n if (this.checkIgnoreCase(dataItem, textItem)) {\n value = this.getItemValue(String(item), text, ignoreCase);\n }\n }\n else {\n if (this.checkNonIgnoreCase(String(item), text)) {\n value = this.getItemValue(String(item), text, ignoreCase);\n }\n }\n return value;\n };\n DropDownBase.prototype.checkIgnoreCase = function (item, text) {\n return String(item).toLowerCase() === text.toString().toLowerCase() ? true : false;\n };\n DropDownBase.prototype.checkNonIgnoreCase = function (item, text) {\n return String(item) === text.toString() ? true : false;\n };\n DropDownBase.prototype.getItemValue = function (dataItem, typedText, ignoreCase, isTextByValue) {\n var value = null;\n var dataSource = this.listData;\n var type = this.typeOfData(dataSource).typeof;\n if (isTextByValue) {\n value = dataItem.toString();\n }\n else {\n if (ignoreCase) {\n value = type === 'string' ? String(dataItem) : this.getFormattedValue(String(dataItem));\n }\n else {\n value = type === 'string' ? typedText : this.getFormattedValue(typedText);\n }\n }\n return value;\n };\n DropDownBase.prototype.templateCompiler = function (baseTemplate) {\n var checkTemplate = false;\n if (baseTemplate) {\n try {\n checkTemplate = (selectAll(baseTemplate, document).length) ? true : false;\n }\n catch (exception) {\n checkTemplate = false;\n }\n }\n return checkTemplate;\n };\n DropDownBase.prototype.l10nUpdate = function (actionFailure) {\n var ele = this.getModuleName() === 'listbox' ? this.ulElement : this.list;\n if (this.noRecordsTemplate !== 'No records found' || this.actionFailureTemplate !== 'Request failed') {\n var template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;\n var compiledString = void 0;\n var templateId = actionFailure ? this.actionFailureTemplateId : this.noRecordsTemplateId;\n ele.innerHTML = '';\n var tempaltecheck = this.templateCompiler(template);\n if (tempaltecheck) {\n compiledString = compile(select(template, document).innerHTML.trim());\n }\n else {\n compiledString = compile(template);\n }\n var templateName = actionFailure ? 'actionFailureTemplate' : 'noRecordsTemplate';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var noDataCompTemp = compiledString({}, this, templateName, templateId, this.isStringTemplate, null, ele);\n if (noDataCompTemp && noDataCompTemp.length > 0) {\n for (var i = 0; i < noDataCompTemp.length; i++) {\n ele.appendChild(noDataCompTemp[i]);\n }\n }\n this.renderReactTemplates();\n }\n else {\n var l10nLocale = { noRecordsTemplate: 'No records found', actionFailureTemplate: 'Request failed' };\n var componentLocale = new L10n(this.getLocaleName(), {}, this.locale);\n if (componentLocale.getConstant('actionFailureTemplate') !== '') {\n this.l10n = componentLocale;\n }\n else {\n this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' : 'dropdowns', l10nLocale, this.locale);\n }\n var content = actionFailure ?\n this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');\n if (this.getModuleName() === 'listbox') {\n var liElem = this.createElement('li');\n liElem.textContent = content;\n ele.appendChild(liElem);\n liElem.classList.add('e-list-nrt');\n }\n else {\n ele.innerHTML = content;\n }\n }\n };\n DropDownBase.prototype.getLocaleName = function () {\n return 'drop-down-base';\n };\n DropDownBase.prototype.getTextByValue = function (value) {\n var text = this.checkValueCase(value, false, false, true);\n return text;\n };\n DropDownBase.prototype.getFormattedValue = function (value) {\n if (this.listData && this.listData.length) {\n var item = this.typeOfData(this.listData);\n if (typeof getValue((this.fields.value ? this.fields.value : 'value'), item.item) === 'number'\n || item.typeof === 'number') {\n return parseFloat(value);\n }\n if (typeof getValue((this.fields.value ? this.fields.value : 'value'), item.item) === 'boolean'\n || item.typeof === 'boolean') {\n return ((value === 'true') || ('' + value === 'true'));\n }\n }\n return value;\n };\n /**\n * Sets RTL to dropdownbase wrapper\n *\n * @returns {void}\n */\n DropDownBase.prototype.setEnableRtl = function () {\n if (this.list) {\n this.enableRtlElements.push(this.list);\n }\n if (this.enableRtl) {\n addClass(this.enableRtlElements, dropDownBaseClasses.rtl);\n }\n else {\n removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);\n }\n };\n /**\n * Initialize the Component.\n *\n * @returns {void}\n */\n DropDownBase.prototype.initialize = function () {\n this.bindEvent = true;\n this.actionFailureTemplateId = \"\" + this.element.id + ACTIONFAILURETEMPLATE_PROPERTY;\n if (this.element.tagName === 'UL') {\n var jsonElement = ListBase.createJsonFromElement(this.element);\n this.setProperties({ fields: { text: 'text', value: 'text' } }, true);\n this.resetList(jsonElement, this.fields);\n }\n else if (this.element.tagName === 'SELECT') {\n var dataSource = this.dataSource instanceof Array ? (this.dataSource.length > 0 ? true : false)\n : !isNullOrUndefined(this.dataSource) ? true : false;\n if (!dataSource) {\n this.renderItemsBySelect();\n }\n else if (this.isDynamicDataChange) {\n this.setListData(this.dataSource, this.fields, this.query);\n }\n }\n else {\n this.setListData(this.dataSource, this.fields, this.query);\n }\n };\n /**\n * Get the properties to be maintained in persisted state.\n *\n * @returns {string} Returns the persisted data of the component.\n */\n DropDownBase.prototype.getPersistData = function () {\n return this.addOnPersist([]);\n };\n /**\n * Sets the enabled state to DropDownBase.\n *\n * @returns {void}\n */\n DropDownBase.prototype.setEnabled = function () {\n this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');\n };\n /**\n * Sets the enabled state to DropDownBase.\n *\n * @param {string} value - Specifies the attribute values to add on the input element.\n * @returns {void}\n */\n DropDownBase.prototype.updateDataAttribute = function (value) {\n var invalidAttr = ['class', 'style', 'id', 'type'];\n var attr = {};\n for (var a = 0; a < this.element.attributes.length; a++) {\n if (invalidAttr.indexOf(this.element.attributes[a].name) === -1 &&\n !(this.getModuleName() === 'dropdownlist' && this.element.attributes[a].name === 'readonly')) {\n attr[this.element.attributes[a].name] = this.element.getAttribute(this.element.attributes[a].name);\n }\n }\n extend(attr, value, attr);\n this.setProperties({ htmlAttributes: attr }, true);\n };\n DropDownBase.prototype.renderItemsBySelect = function () {\n var element = this.element;\n var fields = { value: 'value', text: 'text' };\n var jsonElement = [];\n var group = element.querySelectorAll('select>optgroup');\n var option = element.querySelectorAll('select>option');\n this.getJSONfromOption(jsonElement, option, fields);\n if (group.length) {\n for (var i = 0; i < group.length; i++) {\n var item = group[i];\n var optionGroup = {};\n optionGroup[fields.text] = item.label;\n optionGroup.isHeader = true;\n var child = item.querySelectorAll('option');\n jsonElement.push(optionGroup);\n this.getJSONfromOption(jsonElement, child, fields);\n }\n element.querySelectorAll('select>option');\n }\n this.updateFields(fields.text, fields.value, this.fields.groupBy, this.fields.htmlAttributes, this.fields.iconCss);\n this.resetList(jsonElement, fields);\n };\n DropDownBase.prototype.updateFields = function (text, value, groupBy, htmlAttributes, iconCss) {\n var field = {\n 'fields': {\n text: text,\n value: value,\n groupBy: !isNullOrUndefined(groupBy) ? groupBy : this.fields && this.fields.groupBy,\n htmlAttributes: !isNullOrUndefined(htmlAttributes) ? htmlAttributes : this.fields && this.fields.htmlAttributes,\n iconCss: !isNullOrUndefined(iconCss) ? iconCss : this.fields && this.fields.iconCss\n }\n };\n this.setProperties(field, true);\n };\n DropDownBase.prototype.getJSONfromOption = function (items, options, fields) {\n for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {\n var option = options_1[_i];\n var json = {};\n json[fields.text] = option.innerText;\n json[fields.value] = !isNullOrUndefined(option.getAttribute(fields.value)) ?\n option.getAttribute(fields.value) : option.innerText;\n items.push(json);\n }\n };\n /**\n * Execute before render the list items\n *\n * @private\n * @returns {void}\n */\n DropDownBase.prototype.preRender = function () {\n // there is no event handler\n this.scrollTimer = -1;\n this.enableRtlElements = [];\n this.isRequested = false;\n this.isDataFetched = false;\n this.itemTemplateId = \"\" + this.element.id + ITEMTEMPLATE_PROPERTY;\n this.valueTemplateId = \"\" + this.element.id + VALUETEMPLATE_PROPERTY;\n this.groupTemplateId = \"\" + this.element.id + GROUPTEMPLATE_PROPERTY;\n this.headerTemplateId = \"\" + this.element.id + HEADERTEMPLATE_PROPERTY;\n this.footerTemplateId = \"\" + this.element.id + FOOTERTEMPLATE_PROPERTY;\n this.noRecordsTemplateId = \"\" + this.element.id + NORECORDSTEMPLATE_PROPERTY;\n };\n /**\n * Creates the list items of DropDownBase component.\n *\n * @param {Object[] | string[] | number[] | DataManager | boolean[]} dataSource - Specifies the data to generate the list.\n * @param {FieldSettingsModel} fields - Maps the columns of the data table and binds the data to the component.\n * @param {Query} query - Accepts the external Query that execute along with data processing.\n * @returns {void}\n */\n DropDownBase.prototype.setListData = function (dataSource, fields, query) {\n var _this = this;\n fields = fields ? fields : this.fields;\n var ulElement;\n this.isActive = true;\n var eventArgs = { cancel: false, data: dataSource, query: query };\n this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;\n this.trigger('actionBegin', eventArgs, function (eventArgs) {\n if (!eventArgs.cancel) {\n _this.showSpinner();\n if (dataSource instanceof DataManager) {\n _this.isRequested = true;\n if (_this.isDataFetched) {\n _this.emptyDataRequest(fields);\n return;\n }\n eventArgs.data.executeQuery(_this.getQuery(eventArgs.query)).then(function (e) {\n _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;\n _this.trigger('actionComplete', e, function (e) {\n if (!e.cancel) {\n var listItems = e.result;\n if (listItems.length === 0) {\n _this.isDataFetched = true;\n }\n ulElement = _this.renderItems(listItems, fields);\n _this.onActionComplete(ulElement, listItems, e);\n if (_this.groupTemplate) {\n _this.renderGroupTemplate(ulElement);\n }\n _this.isRequested = false;\n _this.bindChildItems(listItems, ulElement, fields, e);\n }\n });\n }).catch(function (e) {\n _this.isRequested = false;\n _this.onActionFailure(e);\n _this.hideSpinner();\n });\n }\n else {\n var dataManager = new DataManager(eventArgs.data);\n var listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);\n var localDataArgs = { cancel: false, result: listItems };\n _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;\n _this.trigger('actionComplete', localDataArgs, function (localDataArgs) {\n if (!localDataArgs.cancel) {\n ulElement = _this.renderItems(localDataArgs.result, fields);\n _this.onActionComplete(ulElement, localDataArgs.result);\n if (_this.groupTemplate) {\n _this.renderGroupTemplate(ulElement);\n }\n _this.bindChildItems(localDataArgs.result, ulElement, fields);\n }\n });\n }\n }\n });\n };\n DropDownBase.prototype.bindChildItems = function (listItems, ulElement, fields, e) {\n var _this = this;\n if (listItems.length >= 100 && this.getModuleName() === 'autocomplete') {\n setTimeout(function () {\n var childNode = _this.remainingItems(_this.sortedData, fields);\n append(childNode, ulElement);\n _this.liCollections = _this.list.querySelectorAll('.' + dropDownBaseClasses.li);\n _this.updateListValues();\n _this.raiseDataBound(listItems, e);\n }, 0);\n }\n else {\n this.raiseDataBound(listItems, e);\n }\n };\n DropDownBase.prototype.updateListValues = function () {\n // Used this method in component side.\n };\n DropDownBase.prototype.findListElement = function (list, findNode, attribute, value) {\n var liElement = null;\n if (list) {\n var listArr = [].slice.call(list.querySelectorAll(findNode));\n for (var index = 0; index < listArr.length; index++) {\n if (listArr[index].getAttribute(attribute) === (value + '')) {\n liElement = listArr[index];\n break;\n }\n }\n }\n return liElement;\n };\n DropDownBase.prototype.raiseDataBound = function (listItems, e) {\n this.hideSpinner();\n var dataBoundEventArgs = {\n items: listItems,\n e: e\n };\n this.trigger('dataBound', dataBoundEventArgs);\n };\n DropDownBase.prototype.remainingItems = function (dataSource, fields) {\n var spliceData = new DataManager(dataSource).executeLocal(new Query().skip(100));\n if (this.itemTemplate) {\n var listElements = this.templateListItem(spliceData, fields);\n return [].slice.call(listElements.childNodes);\n }\n var type = this.typeOfData(spliceData).typeof;\n if (type === 'string' || type === 'number' || type === 'boolean') {\n return ListBase.createListItemFromArray(this.createElement, spliceData, true, this.listOption(spliceData, fields), this);\n }\n return ListBase.createListItemFromJson(this.createElement, spliceData, this.listOption(spliceData, fields), 1, true, this);\n };\n DropDownBase.prototype.emptyDataRequest = function (fields) {\n var listItems = [];\n this.onActionComplete(this.renderItems(listItems, fields), listItems);\n this.isRequested = false;\n this.hideSpinner();\n };\n DropDownBase.prototype.showSpinner = function () {\n // Used this method in component side.\n };\n DropDownBase.prototype.hideSpinner = function () {\n // Used this method in component side.\n };\n DropDownBase.prototype.onActionFailure = function (e) {\n this.liCollections = [];\n this.trigger('actionFailure', e);\n this.l10nUpdate(true);\n addClass([this.list], dropDownBaseClasses.noData);\n };\n /* eslint-disable @typescript-eslint/no-unused-vars */\n DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {\n /* eslint-enable @typescript-eslint/no-unused-vars */\n this.listData = list;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (this.isReact) {\n this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);\n }\n this.list.innerHTML = '';\n this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;\n this.list.appendChild(ulElement);\n this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);\n this.ulElement = this.list.querySelector('ul');\n this.postRender(this.list, list, this.bindEvent);\n };\n /* eslint-disable @typescript-eslint/no-unused-vars */\n DropDownBase.prototype.postRender = function (listElement, list, bindEvent) {\n /* eslint-enable @typescript-eslint/no-unused-vars */\n var focusItem = listElement.querySelector('.' + dropDownBaseClasses.li);\n var selectedItem = listElement.querySelector('.' + dropDownBaseClasses.selected);\n if (focusItem && !selectedItem) {\n focusItem.classList.add(dropDownBaseClasses.focus);\n }\n if (list.length <= 0) {\n this.l10nUpdate();\n addClass([listElement], dropDownBaseClasses.noData);\n }\n else {\n listElement.classList.remove(dropDownBaseClasses.noData);\n }\n };\n /**\n * Get the query to do the data operation before list item generation.\n *\n * @param {Query} query - Accepts the external Query that execute along with data processing.\n * @returns {Query} Returns the query to do the data query operation.\n */\n DropDownBase.prototype.getQuery = function (query) {\n return query ? query : this.query ? this.query : new Query();\n };\n /**\n * To render the template content for group header element.\n *\n * @param {HTMLElement} listEle - Specifies the group list elements.\n * @returns {void}\n */\n DropDownBase.prototype.renderGroupTemplate = function (listEle) {\n if (this.fields.groupBy !== null && this.dataSource || this.element.querySelector('.' + dropDownBaseClasses.group)) {\n var dataSource = this.dataSource;\n var option = { groupTemplateID: this.groupTemplateId, isStringTemplate: this.isStringTemplate };\n var headerItems = listEle.querySelectorAll('.' + dropDownBaseClasses.group);\n var groupcheck = this.templateCompiler(this.groupTemplate);\n if (groupcheck) {\n var groupValue = select(this.groupTemplate, document).innerHTML.trim();\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var tempHeaders = ListBase.renderGroupTemplate(groupValue, dataSource, this.fields.properties, headerItems, option, this);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var tempHeaders = ListBase.renderGroupTemplate(this.groupTemplate, dataSource, this.fields.properties, headerItems, option, this);\n }\n this.renderReactTemplates();\n }\n };\n /**\n * To create the ul li list items\n *\n * @param {object []} dataSource - Specifies the data to generate the list.\n * @param {FieldSettingsModel} fields - Maps the columns of the data table and binds the data to the component.\n * @returns {HTMLElement} Return the ul li list items.\n */\n DropDownBase.prototype.createListItems = function (dataSource, fields) {\n if (dataSource && fields.groupBy || this.element.querySelector('optgroup')) {\n if (fields.groupBy) {\n if (this.sortOrder !== 'None') {\n dataSource = this.getSortedDataSource(dataSource);\n }\n dataSource = ListBase.groupDataSource(dataSource, fields.properties, this.sortOrder);\n }\n addClass([this.list], dropDownBaseClasses.grouping);\n }\n else {\n dataSource = this.getSortedDataSource(dataSource);\n }\n var options = this.listOption(dataSource, fields);\n var spliceData = (dataSource.length > 100) ?\n new DataManager(dataSource).executeLocal(new Query().take(100))\n : dataSource;\n this.sortedData = dataSource;\n return ListBase.createList(this.createElement, (this.getModuleName() === 'autocomplete') ? spliceData : dataSource, options, true, this);\n };\n DropDownBase.prototype.listOption = function (dataSource, fields) {\n var iconCss = isNullOrUndefined(fields.iconCss) ? false : true;\n var fieldValues = !isNullOrUndefined(fields.properties) ?\n fields.properties : fields;\n var options = (fields.text !== null || fields.value !== null) ? {\n fields: fieldValues,\n showIcon: iconCss, ariaAttributes: { groupItemRole: 'presentation' }\n } : { fields: { value: 'text' } };\n return extend({}, options, fields, true);\n };\n DropDownBase.prototype.setFloatingHeader = function (e) {\n if (isNullOrUndefined(this.fixedHeaderElement)) {\n this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });\n if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {\n this.fixedHeaderElement.style.display = 'none';\n }\n prepend([this.fixedHeaderElement], this.list);\n this.setFixedHeader();\n }\n if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {\n this.setFixedHeader();\n }\n this.scrollStop(e);\n };\n DropDownBase.prototype.scrollStop = function (e) {\n var target = !isNullOrUndefined(e) ? e.target : this.list;\n var liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);\n var topIndex = Math.round(target.scrollTop / liHeight);\n var liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');\n for (var i = topIndex; i > -1; i--) {\n if (!isNullOrUndefined(liCollections[i]) && liCollections[i].classList.contains(dropDownBaseClasses.group)) {\n var currentLi = liCollections[i];\n this.fixedHeaderElement.innerHTML = currentLi.innerHTML;\n this.fixedHeaderElement.style.top = target.scrollTop + 'px';\n this.fixedHeaderElement.style.display = 'block';\n break;\n }\n else {\n this.fixedHeaderElement.style.display = 'none';\n this.fixedHeaderElement.style.top = 'none';\n }\n }\n };\n DropDownBase.prototype.getValidLi = function () {\n return this.liCollections[0];\n };\n /**\n * To render the list items\n *\n * @param {object[]} listData - Specifies the list of array of data.\n * @param {FieldSettingsModel} fields - Maps the columns of the data table and binds the data to the component.\n * @returns {HTMLElement} Return the list items.\n */\n DropDownBase.prototype.renderItems = function (listData, fields) {\n var ulElement;\n if (this.itemTemplate && listData) {\n var dataSource = listData;\n if (dataSource && fields.groupBy) {\n if (this.sortOrder !== 'None') {\n dataSource = this.getSortedDataSource(dataSource);\n }\n dataSource = ListBase.groupDataSource(dataSource, fields.properties, this.sortOrder);\n }\n else {\n dataSource = this.getSortedDataSource(dataSource);\n }\n this.sortedData = dataSource;\n var spliceData = (dataSource.length > 100) ?\n new DataManager(dataSource).executeLocal(new Query().take(100))\n : dataSource;\n ulElement = this.templateListItem((this.getModuleName() === 'autocomplete') ? spliceData : dataSource, fields);\n }\n else {\n ulElement = this.createListItems(listData, fields);\n }\n return ulElement;\n };\n DropDownBase.prototype.templateListItem = function (dataSource, fields) {\n var option = this.listOption(dataSource, fields);\n option.templateID = this.itemTemplateId;\n option.isStringTemplate = this.isStringTemplate;\n var itemcheck = this.templateCompiler(this.itemTemplate);\n if (itemcheck) {\n var itemValue = select(this.itemTemplate, document).innerHTML.trim();\n return ListBase.renderContentTemplate(this.createElement, itemValue, dataSource, fields.properties, option, this);\n }\n else {\n return ListBase.renderContentTemplate(this.createElement, this.itemTemplate, dataSource, fields.properties, option, this);\n }\n };\n DropDownBase.prototype.typeOfData = function (items) {\n var item = { typeof: null, item: null };\n for (var i = 0; (!isNullOrUndefined(items) && i < items.length); i++) {\n if (!isNullOrUndefined(items[i])) {\n var listDataType = typeof (items[i]) === 'string' ||\n typeof (items[i]) === 'number' || typeof (items[i]) === 'boolean';\n var isNullData = listDataType ? isNullOrUndefined(items[i]) :\n isNullOrUndefined(getValue((this.fields.value ? this.fields.value : 'value'), items[i]));\n if (!isNullData) {\n return item = { typeof: typeof items[i], item: items[i] };\n }\n }\n }\n return item;\n };\n DropDownBase.prototype.setFixedHeader = function () {\n this.list.parentElement.style.display = 'block';\n var borderWidth = 0;\n if (this.list && this.list.parentElement) {\n borderWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-width'), 10);\n /*Shorthand property not working in Firefox for getComputedStyle method.\n Refer bug report https://bugzilla.mozilla.org/show_bug.cgi?id=137688\n Refer alternate solution https://stackoverflow.com/a/41696234/9133493*/\n if (isNaN(borderWidth)) {\n var borderTopWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-top-width'), 10);\n var borderBottomWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-bottom-width'), 10);\n var borderLeftWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-left-width'), 10);\n var borderRightWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-right-width'), 10);\n borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);\n }\n }\n var liWidth = this.getValidLi().offsetWidth - borderWidth;\n this.fixedHeaderElement.style.width = liWidth.toString() + 'px';\n setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });\n var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');\n this.fixedHeaderElement.innerHTML = firstLi.innerHTML;\n };\n DropDownBase.prototype.getSortedDataSource = function (dataSource) {\n if (dataSource && this.sortOrder !== 'None') {\n var textField = this.fields.text ? this.fields.text : 'text';\n if (this.typeOfData(dataSource).typeof === 'string' || this.typeOfData(dataSource).typeof === 'number'\n || this.typeOfData(dataSource).typeof === 'boolean') {\n textField = '';\n }\n dataSource = ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, textField));\n }\n return dataSource;\n };\n /**\n * Return the index of item which matched with given value in data source\n *\n * @param {string | number | boolean} value - Specifies given value.\n * @returns {number} Returns the index of the item.\n */\n DropDownBase.prototype.getIndexByValue = function (value) {\n var index;\n var listItems = this.getItems();\n for (var i = 0; i < listItems.length; i++) {\n if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {\n index = i;\n break;\n }\n }\n return index;\n };\n /**\n * To dispatch the event manually\n *\n * @param {HTMLElement} element - Specifies the element to dispatch the event.\n * @param {string} type - Specifies the name of the event.\n * @returns {void}\n */\n DropDownBase.prototype.dispatchEvent = function (element, type) {\n var evt = document.createEvent('HTMLEvents');\n evt.initEvent(type, false, true);\n element.dispatchEvent(evt);\n };\n /**\n * To set the current fields\n *\n * @returns {void}\n */\n DropDownBase.prototype.setFields = function () {\n if (this.fields.value && !this.fields.text) {\n this.updateFields(this.fields.value, this.fields.value);\n }\n else if (!this.fields.value && this.fields.text) {\n this.updateFields(this.fields.text, this.fields.text);\n }\n else if (!this.fields.value && !this.fields.text) {\n this.updateFields('text', 'text');\n }\n };\n /**\n * reset the items list.\n *\n * @param {Object[] | string[] | number[] | DataManager | boolean[]} dataSource - Specifies the data to generate the list.\n * @param {FieldSettingsModel} fields - Maps the columns of the data table and binds the data to the component.\n * @param {Query} query - Accepts the external Query that execute along with data processing.\n * @returns {void}\n */\n DropDownBase.prototype.resetList = function (dataSource, fields, query) {\n if (this.list) {\n if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)\n || (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {\n var data = dataSource instanceof Array ? (dataSource.length > 0)\n : !isNullOrUndefined(dataSource);\n if (!data && this.selectData && this.selectData.length > 0) {\n dataSource = this.selectData;\n }\n }\n this.setListData(dataSource, fields, query);\n }\n };\n DropDownBase.prototype.updateSelectElementData = function (isFiltering) {\n if (isFiltering && isNullOrUndefined(this.selectData) && this.listData && this.listData.length > 0) {\n this.selectData = this.listData;\n }\n };\n DropDownBase.prototype.updateSelection = function () {\n // This is for after added the item, need to update the selected index values.\n };\n DropDownBase.prototype.renderList = function () {\n // This is for render the list items.\n this.render();\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DropDownBase.prototype.updateDataSource = function (props) {\n this.resetList(this.dataSource);\n };\n DropDownBase.prototype.setUpdateInitial = function (props, newProp) {\n this.isDataFetched = false;\n var updateData = {};\n for (var j = 0; props.length > j; j++) {\n if (newProp[props[j]] && props[j] === 'fields') {\n this.setFields();\n updateData[props[j]] = newProp[props[j]];\n }\n else if (newProp[props[j]]) {\n updateData[props[j]] = newProp[props[j]];\n }\n }\n if (Object.keys(updateData).length > 0) {\n if (Object.keys(updateData).indexOf('dataSource') === -1) {\n updateData.dataSource = this.dataSource;\n }\n this.updateDataSource(updateData);\n }\n };\n /**\n * When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.\n *\n * @param {DropDownBaseModel} newProp - Returns the dynamic property value of the component.\n * @param {DropDownBaseModel} oldProp - Returns the previous property value of the component.\n * @private\n * @returns {void}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DropDownBase.prototype.onPropertyChanged = function (newProp, oldProp) {\n if (this.getModuleName() === 'dropdownbase') {\n this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);\n }\n this.setUpdateInitial(['sortOrder', 'itemTemplate'], newProp);\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'query':\n case 'sortOrder':\n case 'dataSource':\n case 'itemTemplate':\n break;\n case 'enableRtl':\n this.setEnableRtl();\n break;\n case 'enabled':\n this.setEnabled();\n break;\n case 'groupTemplate':\n this.renderGroupTemplate(this.list);\n if (this.ulElement && this.fixedHeaderElement) {\n var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group);\n this.fixedHeaderElement.innerHTML = firstLi.innerHTML;\n }\n break;\n case 'locale':\n if (this.list && (!isNullOrUndefined(this.liCollections) && this.liCollections.length === 0)) {\n this.l10nUpdate();\n }\n break;\n case 'zIndex':\n this.setProperties({ zIndex: newProp.zIndex }, true);\n this.setZIndex();\n break;\n }\n }\n };\n /**\n * Build and render the component\n *\n * @param {boolean} isEmptyData - Specifies the component to initialize with list data or not.\n * @private\n * @returns {void}\n */\n DropDownBase.prototype.render = function (isEmptyData) {\n this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });\n this.list.classList.add(dropDownBaseClasses.root);\n this.setFields();\n var rippleModel = { duration: 300, selector: '.' + dropDownBaseClasses.li };\n this.rippleFun = rippleEffect(this.list, rippleModel);\n var group = this.element.querySelector('select>optgroup');\n if ((this.fields.groupBy || !isNullOrUndefined(group)) && !this.isGroupChecking) {\n EventHandler.add(this.list, 'scroll', this.setFloatingHeader, this);\n }\n if (this.getModuleName() === 'dropdownbase') {\n if (this.element.getAttribute('tabindex')) {\n this.list.setAttribute('tabindex', this.element.getAttribute('tabindex'));\n }\n removeClass([this.element], dropDownBaseClasses.root);\n this.element.style.display = 'none';\n var wrapperElement = this.createElement('div');\n this.element.parentElement.insertBefore(wrapperElement, this.element);\n wrapperElement.appendChild(this.element);\n wrapperElement.appendChild(this.list);\n }\n this.setEnableRtl();\n this.setEnabled();\n if (!isEmptyData) {\n this.initialize();\n }\n };\n /**\n * Return the module name of this component.\n *\n * @private\n * @returns {string} Return the module name of this component.\n */\n DropDownBase.prototype.getModuleName = function () {\n return 'dropdownbase';\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Gets all the list items bound on this component.\n *\n * @returns {Element[]}\n */\n DropDownBase.prototype.getItems = function () {\n return this.ulElement.querySelectorAll('.' + dropDownBaseClasses.li);\n };\n /* eslint-enable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Adds a new item to the popup list. By default, new item appends to the list as the last item,\n * but you can insert based on the index parameter.\n *\n * @param { Object[] } items - Specifies an array of JSON data or a JSON data.\n * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.\n * @returns {void}\n\n */\n DropDownBase.prototype.addItem = function (items, itemIndex) {\n if (!this.list || (this.list.textContent === this.noRecordsTemplate && this.getModuleName() !== 'listbox')) {\n this.renderList();\n }\n if (this.sortOrder !== 'None' && isNullOrUndefined(itemIndex)) {\n var newList = [].slice.call(this.listData);\n newList.push(items);\n newList = this.getSortedDataSource(newList);\n if (this.fields.groupBy) {\n newList = ListBase.groupDataSource(newList, this.fields.properties, this.sortOrder);\n itemIndex = newList.indexOf(items);\n }\n else {\n itemIndex = newList.indexOf(items);\n }\n }\n var itemsCount = this.getItems().length;\n var selectedItemValue = this.list.querySelector('.' + dropDownBaseClasses.selected);\n items = (items instanceof Array ? items : [items]);\n var index;\n index = (isNullOrUndefined(itemIndex) || itemIndex < 0 || itemIndex > itemsCount - 1) ? itemsCount : itemIndex;\n var fields = this.fields;\n if (items && fields.groupBy) {\n items = ListBase.groupDataSource(items, fields.properties);\n }\n var liCollections = [];\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n var isHeader = item.isHeader;\n var li = this.createElement('li', { className: isHeader ? dropDownBaseClasses.group : dropDownBaseClasses.li, id: 'option-add-' + i });\n var itemText = item instanceof Object ? getValue(fields.text, item) : item;\n if (isHeader) {\n li.innerText = itemText;\n }\n if (this.itemTemplate && !isHeader) {\n var compiledString = compile(this.itemTemplate);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var addItemTemplate = compiledString(item, this, 'itemTemplate', this.itemTemplateId, this.isStringTemplate, null, li);\n if (addItemTemplate) {\n append(addItemTemplate, li);\n }\n }\n else if (!isHeader) {\n li.appendChild(document.createTextNode(itemText));\n }\n li.setAttribute('data-value', item instanceof Object ? getValue(fields.value, item) : item);\n li.setAttribute('role', 'option');\n this.notify('addItem', { module: 'CheckBoxSelection', item: li });\n liCollections.push(li);\n this.listData.push(item);\n if (this.sortOrder === 'None' && isNullOrUndefined(itemIndex) && index === 0) {\n index = null;\n }\n this.updateActionCompleteData(li, item, index);\n //Listbox event\n this.trigger('beforeItemRender', { element: li, item: item });\n }\n if (itemsCount === 0 && isNullOrUndefined(this.list.querySelector('ul'))) {\n this.list.innerHTML = '';\n this.list.classList.remove(dropDownBaseClasses.noData);\n this.list.appendChild(this.ulElement);\n this.liCollections = liCollections;\n append(liCollections, this.ulElement);\n this.updateAddItemList(this.list, itemsCount);\n }\n else {\n if (this.getModuleName() === 'listbox' && itemsCount === 0) {\n this.ulElement.innerHTML = '';\n }\n var attr = [];\n for (var i = 0; i < items.length; i++) {\n var listGroupItem = this.ulElement.querySelectorAll('.e-list-group-item');\n for (var j = 0; j < listGroupItem.length; j++) {\n attr[j] = listGroupItem[j].innerText;\n }\n if (attr.indexOf(liCollections[i].innerText) > -1 && fields.groupBy) {\n for (var j = 0; j < listGroupItem.length; j++) {\n if (attr[j] === liCollections[i].innerText) {\n if (this.sortOrder === 'None') {\n this.ulElement.insertBefore(liCollections[i + 1], listGroupItem[j + 1]);\n }\n else {\n this.ulElement.insertBefore(liCollections[i + 1], this.ulElement.childNodes[itemIndex]);\n }\n i = i + 1;\n break;\n }\n }\n }\n else {\n if (this.liCollections[index]) {\n this.liCollections[index].parentNode.insertBefore(liCollections[i], this.liCollections[index]);\n }\n else {\n this.ulElement.appendChild(liCollections[i]);\n }\n }\n var tempLi = [].slice.call(this.liCollections);\n tempLi.splice(index, 0, liCollections[i]);\n this.liCollections = tempLi;\n index += 1;\n if (this.getModuleName() === 'multiselect') {\n this.updateDataList();\n }\n }\n }\n if (selectedItemValue || itemIndex === 0) {\n this.updateSelection();\n }\n };\n DropDownBase.prototype.validationAttribute = function (target, hidden) {\n var name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');\n hidden.setAttribute('name', name);\n target.removeAttribute('name');\n var attributes = ['required', 'aria-required', 'form'];\n for (var i = 0; i < attributes.length; i++) {\n if (!target.getAttribute(attributes[i])) {\n continue;\n }\n var attr = target.getAttribute(attributes[i]);\n hidden.setAttribute(attributes[i], attr);\n target.removeAttribute(attributes[i]);\n }\n };\n DropDownBase.prototype.setZIndex = function () {\n // this is for component wise\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DropDownBase.prototype.updateActionCompleteData = function (li, item, index) {\n // this is for ComboBox custom value\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DropDownBase.prototype.updateAddItemList = function (list, itemCount) {\n // this is for multiselect add item\n };\n DropDownBase.prototype.updateDataList = function () {\n // this is for multiselect update list items\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Gets the data Object that matches the given value.\n *\n * @param { string | number } value - Specifies the value of the list item.\n * @returns {Object}\n */\n DropDownBase.prototype.getDataByValue = function (value) {\n if (!isNullOrUndefined(this.listData)) {\n var type = this.typeOfData(this.listData).typeof;\n if (type === 'string' || type === 'number' || type === 'boolean') {\n for (var _i = 0, _a = this.listData; _i < _a.length; _i++) {\n var item = _a[_i];\n if (!isNullOrUndefined(item) && item === value) {\n return item;\n }\n }\n }\n else {\n for (var _b = 0, _c = this.listData; _b < _c.length; _b++) {\n var item = _c[_b];\n if (!isNullOrUndefined(item) && getValue((this.fields.value ? this.fields.value : 'value'), item) === value) {\n return item;\n }\n }\n }\n }\n return null;\n };\n /* eslint-enable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Removes the component from the DOM and detaches all its related event handlers. It also removes the attributes and classes.\n *\n * @method destroy\n * @returns {void}\n */\n DropDownBase.prototype.destroy = function () {\n if (document.body.contains(this.list)) {\n EventHandler.remove(this.list, 'scroll', this.setFloatingHeader);\n if (!isNullOrUndefined(this.rippleFun)) {\n this.rippleFun();\n }\n detach(this.list);\n }\n _super.prototype.destroy.call(this);\n };\n __decorate([\n Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)\n ], DropDownBase.prototype, \"fields\", void 0);\n __decorate([\n Property(false)\n ], DropDownBase.prototype, \"enablePersistence\", void 0);\n __decorate([\n Property(null)\n ], DropDownBase.prototype, \"itemTemplate\", void 0);\n __decorate([\n Property(null)\n ], DropDownBase.prototype, \"groupTemplate\", void 0);\n __decorate([\n Property('No records found')\n ], DropDownBase.prototype, \"noRecordsTemplate\", void 0);\n __decorate([\n Property('Request failed')\n ], DropDownBase.prototype, \"actionFailureTemplate\", void 0);\n __decorate([\n Property('None')\n ], DropDownBase.prototype, \"sortOrder\", void 0);\n __decorate([\n Property(true)\n ], DropDownBase.prototype, \"enabled\", void 0);\n __decorate([\n Property([])\n ], DropDownBase.prototype, \"dataSource\", void 0);\n __decorate([\n Property(null)\n ], DropDownBase.prototype, \"query\", void 0);\n __decorate([\n Property('StartsWith')\n ], DropDownBase.prototype, \"filterType\", void 0);\n __decorate([\n Property(true)\n ], DropDownBase.prototype, \"ignoreCase\", void 0);\n __decorate([\n Property(1000)\n ], DropDownBase.prototype, \"zIndex\", void 0);\n __decorate([\n Property(false)\n ], DropDownBase.prototype, \"ignoreAccent\", void 0);\n __decorate([\n Property()\n ], DropDownBase.prototype, \"locale\", void 0);\n __decorate([\n Event()\n ], DropDownBase.prototype, \"actionBegin\", void 0);\n __decorate([\n Event()\n ], DropDownBase.prototype, \"actionComplete\", void 0);\n __decorate([\n Event()\n ], DropDownBase.prototype, \"actionFailure\", void 0);\n __decorate([\n Event()\n ], DropDownBase.prototype, \"select\", void 0);\n __decorate([\n Event()\n ], DropDownBase.prototype, \"dataBound\", void 0);\n __decorate([\n Event()\n ], DropDownBase.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], DropDownBase.prototype, \"destroyed\", void 0);\n DropDownBase = __decorate([\n NotifyPropertyChanges\n ], DropDownBase);\n return DropDownBase;\n}(Component));\nexport { DropDownBase };\n","/**\n * IncrementalSearch module file\n */\nvar queryString = '';\nvar prevString = '';\nvar matches = [];\nvar activeClass = 'e-active';\nvar prevElementId = '';\n/**\n * Search and focus the list item based on key code matches with list text content\n *\n * @param { number } keyCode - Specifies the key code which pressed on keyboard events.\n * @param { HTMLElement[]} items - Specifies an array of HTMLElement, from which matches find has done.\n * @param { number } selectedIndex - Specifies the selected item in list item, so that search will happen\n * after selected item otherwise it will do from initial.\n * @param { boolean } ignoreCase - Specifies the case consideration when search has done.\n * @param {string} elementId - Specifies the list element ID.\n * @returns {Element} Returns list item based on key code matches with list text content.\n */\nexport function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId) {\n queryString += String.fromCharCode(keyCode);\n setTimeout(function () {\n queryString = '';\n }, 1000);\n var index;\n queryString = ignoreCase ? queryString.toLowerCase() : queryString;\n if (prevElementId === elementId && prevString === queryString) {\n for (var i = 0; i < matches.length; i++) {\n if (matches[i].classList.contains(activeClass)) {\n index = i;\n break;\n }\n }\n index = index + 1;\n return matches[index] ? matches[index] : matches[0];\n }\n else {\n var listItems = items;\n var strLength = queryString.length;\n var text = void 0;\n var item = void 0;\n selectedIndex = selectedIndex ? selectedIndex + 1 : 0;\n var i = selectedIndex;\n matches = [];\n do {\n if (i === listItems.length) {\n i = -1;\n }\n if (i === -1) {\n index = 0;\n }\n else {\n index = i;\n }\n item = listItems[index];\n text = ignoreCase ? item.innerText.toLowerCase() : item.innerText;\n if (text.substr(0, strLength) === queryString) {\n matches.push(listItems[index]);\n }\n i++;\n } while (i !== selectedIndex);\n prevString = queryString;\n prevElementId = elementId;\n return matches[0];\n }\n}\n/**\n * Search the list item based on given input value matches with search type.\n *\n * @param {string} inputVal - Specifies the given input value.\n * @param {HTMLElement[]} items - Specifies the list items.\n * @param {SearchType} searchType - Specifies the filter type.\n * @param {boolean} ignoreCase - Specifies the case sensitive option for search operation.\n * @returns {Element | number} Returns the search matched items.\n */\nexport function Search(inputVal, items, searchType, ignoreCase) {\n var listItems = items;\n ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;\n var itemData = { item: null, index: null };\n if (inputVal && inputVal.length) {\n var strLength = inputVal.length;\n var queryStr = ignoreCase ? inputVal.toLocaleLowerCase() : inputVal;\n for (var i = 0, itemsData = listItems; i < itemsData.length; i++) {\n var item = itemsData[i];\n var text = (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\\s+|\\s+$/g, '');\n if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr)) {\n itemData.item = item;\n itemData.index = i;\n return { item: item, index: i };\n }\n }\n return itemData;\n }\n return itemData;\n}\nexport function resetIncrementalSearchValues(elementId) {\n if (prevElementId === elementId) {\n prevElementId = '';\n prevString = '';\n queryString = '';\n matches = [];\n }\n}\n","/**\n * FloatLable Moduel\n * Specifies whether to display the floating label above the input element.\n */\nimport { removeClass, addClass, detach } from '@syncfusion/ej2-base';\nimport { attributes, isNullOrUndefined, createElement } from '@syncfusion/ej2-base';\nvar FLOATLINE = 'e-float-line';\nvar FLOATTEXT = 'e-float-text';\nvar LABELTOP = 'e-label-top';\nvar LABELBOTTOM = 'e-label-bottom';\n/* eslint-disable valid-jsdoc */\n/**\n * Function to create Float Label element.\n *\n * @param {HTMLDivElement} overAllWrapper - Overall wrapper of multiselect.\n * @param {HTMLElement} searchWrapper - Search wrapper of multiselect.\n * @param {HTMLElement} element - The given html element.\n * @param {HTMLInputElement} inputElement - Specify the input wrapper.\n * @param {number[] | string[] | boolean[]} value - Value of the MultiSelect.\n * @param {FloatLabelType} floatLabelType - Specify the FloatLabel Type.\n * @param {string} placeholder - Specify the PlaceHolder text.\n */\nexport function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement, value, floatLabelType, placeholder) {\n var floatLinelement = createElement('span', { className: FLOATLINE });\n var floatLabelElement = createElement('label', { className: FLOATTEXT });\n if (!isNullOrUndefined(element.id) && element.id !== '') {\n floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');\n attributes(element, { 'aria-labelledby': floatLabelElement.id });\n }\n if (!isNullOrUndefined(inputElement.placeholder) && inputElement.placeholder !== '') {\n floatLabelElement.innerText = encodePlaceholder(inputElement.placeholder);\n inputElement.removeAttribute('placeholder');\n }\n floatLabelElement.innerText = encodePlaceholder(placeholder);\n searchWrapper.appendChild(floatLinelement);\n searchWrapper.appendChild(floatLabelElement);\n overAllWrapper.classList.add('e-float-input');\n updateFloatLabelState(value, floatLabelElement);\n if (floatLabelType === 'Always') {\n if (floatLabelElement.classList.contains(LABELBOTTOM)) {\n removeClass([floatLabelElement], LABELBOTTOM);\n }\n addClass([floatLabelElement], LABELTOP);\n }\n}\n/**\n * Function to update status of the Float Label element.\n *\n * @param {string[] | number[] | boolean[]} value - Value of the MultiSelect.\n * @param {HTMLElement} label - Float label element.\n */\nexport function updateFloatLabelState(value, label) {\n if (value && value.length > 0) {\n addClass([label], LABELTOP);\n removeClass([label], LABELBOTTOM);\n }\n else {\n removeClass([label], LABELTOP);\n addClass([label], LABELBOTTOM);\n }\n}\n/**\n * Function to remove Float Label element.\n *\n * @param {HTMLDivElement} overAllWrapper - Overall wrapper of multiselect.\n * @param {HTMLDivElement} componentWrapper - Wrapper element of multiselect.\n * @param {HTMLElement} searchWrapper - Search wrapper of multiselect.\n * @param {HTMLInputElement} inputElement - Specify the input wrapper.\n * @param {number[] | string[] | boolean[]} value - Value of the MultiSelect.\n * @param {FloatLabelType} floatLabelType - Specify the FloatLabel Type.\n * @param {string} placeholder - Specify the PlaceHolder text.\n */\nexport function removeFloating(overAllWrapper, componentWrapper, searchWrapper, inputElement, value, floatLabelType, placeholder) {\n var placeholderElement = componentWrapper.querySelector('.' + FLOATTEXT);\n var floatLine = componentWrapper.querySelector('.' + FLOATLINE);\n var placeholderText;\n if (!isNullOrUndefined(placeholderElement)) {\n placeholderText = placeholderElement.innerText;\n detach(searchWrapper.querySelector('.' + FLOATTEXT));\n setPlaceHolder(value, inputElement, placeholderText);\n if (!isNullOrUndefined(floatLine)) {\n detach(searchWrapper.querySelector('.' + FLOATLINE));\n }\n }\n else {\n placeholderText = (placeholder !== null) ? placeholder : '';\n setPlaceHolder(value, inputElement, placeholderText);\n }\n overAllWrapper.classList.remove('e-float-input');\n}\n/**\n * Function to set the placeholder to the element.\n *\n * @param {number[] | string[] | boolean[]} value - Value of the MultiSelect.\n * @param {HTMLInputElement} inputElement - Specify the input wrapper.\n * @param {string} placeholder - Specify the PlaceHolder text.\n */\nexport function setPlaceHolder(value, inputElement, placeholder) {\n if (value && value.length) {\n inputElement.placeholder = '';\n }\n else {\n inputElement.placeholder = placeholder;\n }\n}\n/**\n * Function for focusing the Float Element.\n *\n * @param {HTMLDivElement} overAllWrapper - Overall wrapper of multiselect.\n * @param {HTMLDivElement} componentWrapper - Wrapper element of multiselect.\n */\nexport function floatLabelFocus(overAllWrapper, componentWrapper) {\n overAllWrapper.classList.add('e-input-focus');\n var label = componentWrapper.querySelector('.' + FLOATTEXT);\n if (!isNullOrUndefined(label)) {\n addClass([label], LABELTOP);\n if (label.classList.contains(LABELBOTTOM)) {\n removeClass([label], LABELBOTTOM);\n }\n }\n}\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n * Function to focus the Float Label element.\n *\n * @param {HTMLDivElement} overAllWrapper - Overall wrapper of multiselect.\n * @param {HTMLDivElement} componentWrapper - Wrapper element of multiselect.\n * @param {number[] | string[] | boolean[]} value - Value of the MultiSelect.\n * @param {FloatLabelType} floatLabelType - Specify the FloatLabel Type.\n * @param {string} placeholder - Specify the PlaceHolder text.\n */\nexport function floatLabelBlur(overAllWrapper, componentWrapper, value, floatLabelType, placeholder) {\n /* eslint-enable @typescript-eslint/no-unused-vars */\n overAllWrapper.classList.remove('e-input-focus');\n var label = componentWrapper.querySelector('.' + FLOATTEXT);\n if (value && value.length <= 0 && floatLabelType === 'Auto' && !isNullOrUndefined(label)) {\n if (label.classList.contains(LABELTOP)) {\n removeClass([label], LABELTOP);\n }\n addClass([label], LABELBOTTOM);\n }\n}\nexport function encodePlaceholder(placeholder) {\n var result = '';\n if (!isNullOrUndefined(placeholder) && placeholder !== '') {\n var spanElement = document.createElement('span');\n spanElement.innerHTML = '
';\n var hiddenInput = (spanElement.children[0]);\n result = hiddenInput.placeholder;\n }\n return result;\n}\n/* eslint-enable valid-jsdoc */\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n///
\nimport { DropDownBase, dropDownBaseClasses } from '../drop-down-base/drop-down-base';\nimport { FieldSettings } from '../drop-down-base/drop-down-base';\nimport { Popup, createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';\nimport { attributes, setValue, SanitizeHtmlHelper, getValue } from '@syncfusion/ej2-base';\nimport { NotifyPropertyChanges, extend } from '@syncfusion/ej2-base';\nimport { EventHandler, Property, Event, compile, L10n } from '@syncfusion/ej2-base';\nimport { Animation, Browser, prepend, Complex } from '@syncfusion/ej2-base';\nimport { Search } from '../common/incremental-search';\nimport { append, addClass, removeClass, closest, detach, remove, select, selectAll } from '@syncfusion/ej2-base';\nimport { getUniqueID, formatUnit, isNullOrUndefined, isUndefined } from '@syncfusion/ej2-base';\nimport { DataManager, Query, Predicate } from '@syncfusion/ej2-data';\nimport { createFloatLabel, removeFloating, floatLabelFocus, floatLabelBlur, encodePlaceholder } from './float-label';\nvar FOCUS = 'e-input-focus';\nvar DISABLED = 'e-disabled';\nvar OVER_ALL_WRAPPER = 'e-multiselect e-input-group e-control-wrapper';\nvar ELEMENT_WRAPPER = 'e-multi-select-wrapper';\nvar ELEMENT_MOBILE_WRAPPER = 'e-mob-wrapper';\nvar HIDE_LIST = 'e-hide-listitem';\nvar DELIMITER_VIEW = 'e-delim-view';\nvar CHIP_WRAPPER = 'e-chips-collection';\nvar CHIP = 'e-chips';\nvar CHIP_CONTENT = 'e-chipcontent';\nvar CHIP_CLOSE = 'e-chips-close';\nvar CHIP_SELECTED = 'e-chip-selected';\nvar SEARCHBOX_WRAPPER = 'e-searcher';\nvar DELIMITER_VIEW_WRAPPER = 'e-delimiter';\nvar ZERO_SIZE = 'e-zero-size';\nvar REMAIN_WRAPPER = 'e-remain';\nvar CLOSEICON_CLASS = 'e-chips-close e-close-hooker';\nvar DELIMITER_WRAPPER = 'e-delim-values';\nvar POPUP_WRAPPER = 'e-ddl e-popup e-multi-select-list-wrapper';\nvar INPUT_ELEMENT = 'e-dropdownbase';\nvar RTL_CLASS = 'e-rtl';\nvar CLOSE_ICON_HIDE = 'e-close-icon-hide';\nvar MOBILE_CHIP = 'e-mob-chip';\nvar FOOTER = 'e-ddl-footer';\nvar HEADER = 'e-ddl-header';\nvar DISABLE_ICON = 'e-ddl-disable-icon';\nvar SPINNER_CLASS = 'e-ms-spinner-icon';\nvar HIDDEN_ELEMENT = 'e-multi-hidden';\nvar destroy = 'destroy';\nvar dropdownIcon = 'e-input-group-icon e-ddl-icon';\nvar iconAnimation = 'e-icon-anim';\nvar TOTAL_COUNT_WRAPPER = 'e-delim-total';\nvar BOX_ELEMENT = 'e-multiselect-box';\nvar FILTERPARENT = 'e-filter-parent';\nvar CUSTOM_WIDTH = 'e-search-custom-width';\nvar FILTERINPUT = 'e-input-filter';\n/**\n * The Multiselect allows the user to pick a more than one value from list of predefined values.\n * ```html\n *
\n * ```\n * ```typescript\n * \n * ```\n */\nvar MultiSelect = /** @class */ (function (_super) {\n __extends(MultiSelect, _super);\n /**\n * Constructor for creating the DropDownList widget.\n *\n * @param {MultiSelectModel} option - Specifies the MultiSelect model.\n * @param {string | HTMLElement} element - Specifies the element to render as component.\n * @private\n */\n function MultiSelect(option, element) {\n var _this = _super.call(this, option, element) || this;\n _this.clearIconWidth = 0;\n _this.isValidKey = false;\n _this.selectAllEventData = [];\n _this.selectAllEventEle = [];\n _this.scrollFocusStatus = false;\n _this.keyDownStatus = false;\n return _this;\n }\n MultiSelect.prototype.enableRTL = function (state) {\n if (state) {\n this.overAllWrapper.classList.add(RTL_CLASS);\n }\n else {\n this.overAllWrapper.classList.remove(RTL_CLASS);\n }\n if (this.popupObj) {\n this.popupObj.enableRtl = state;\n this.popupObj.dataBind();\n }\n };\n MultiSelect.prototype.requiredModules = function () {\n var modules = [];\n if (this.mode === 'CheckBox') {\n this.isGroupChecking = this.enableGroupCheckBox;\n if (this.enableGroupCheckBox) {\n var prevOnChange = this.isProtectedOnChange;\n this.isProtectedOnChange = true;\n this.enableSelectionOrder = false;\n this.isProtectedOnChange = prevOnChange;\n }\n this.allowCustomValue = false;\n this.hideSelectedItem = false;\n this.closePopupOnSelect = false;\n modules.push({\n member: 'CheckBoxSelection',\n args: [this]\n });\n }\n return modules;\n };\n MultiSelect.prototype.updateHTMLAttribute = function () {\n if (Object.keys(this.htmlAttributes).length) {\n for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {\n var htmlAttr = _a[_i];\n switch (htmlAttr) {\n case 'class': {\n var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\\s+/g, ' ')).trim();\n if (updatedClassValue !== '') {\n addClass([this.overAllWrapper], updatedClassValue.split(' '));\n addClass([this.popupWrapper], updatedClassValue.split(' '));\n }\n break;\n }\n case 'disabled':\n this.enable(false);\n break;\n case 'placeholder':\n if (!this.placeholder) {\n this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);\n this.setProperties({ placeholder: this.inputElement.placeholder }, true);\n this.refreshPlaceHolder();\n }\n break;\n default: {\n var defaultAttr = ['id'];\n var validateAttr = ['name', 'required', 'aria-required', 'form'];\n var containerAttr = ['title', 'role', 'style', 'class'];\n if (defaultAttr.indexOf(htmlAttr) > -1) {\n this.element.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);\n }\n else if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {\n this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);\n }\n else if (containerAttr.indexOf(htmlAttr) > -1) {\n this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);\n }\n else {\n this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);\n }\n break;\n }\n }\n }\n }\n };\n MultiSelect.prototype.updateReadonly = function (state) {\n if (state || this.mode === 'CheckBox') {\n this.inputElement.setAttribute('readonly', 'true');\n }\n else {\n this.inputElement.removeAttribute('readonly');\n }\n };\n MultiSelect.prototype.updateClearButton = function (state) {\n if (state) {\n if (this.overAllClear.parentNode) {\n this.overAllClear.style.display = '';\n }\n else {\n this.componentWrapper.appendChild(this.overAllClear);\n }\n this.componentWrapper.classList.remove(CLOSE_ICON_HIDE);\n }\n else {\n this.overAllClear.style.display = 'none';\n this.componentWrapper.classList.add(CLOSE_ICON_HIDE);\n }\n };\n MultiSelect.prototype.updateCssClass = function () {\n if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {\n var updatedCssClassValues = this.cssClass;\n updatedCssClassValues = (this.cssClass.replace(/\\s+/g, ' ')).trim();\n if (updatedCssClassValues !== '') {\n addClass([this.overAllWrapper], updatedCssClassValues.split(' '));\n addClass([this.popupWrapper], updatedCssClassValues.split(' '));\n }\n }\n };\n MultiSelect.prototype.updateOldPropCssClass = function (oldClass) {\n if (!isNullOrUndefined(oldClass) && oldClass !== '') {\n oldClass = (oldClass.replace(/\\s+/g, ' ')).trim();\n if (oldClass !== '') {\n removeClass([this.overAllWrapper], oldClass.split(' '));\n removeClass([this.popupWrapper], oldClass.split(' '));\n }\n }\n };\n MultiSelect.prototype.onPopupShown = function () {\n var _this = this;\n if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var proxy_1 = this;\n window.onpopstate = function () {\n proxy_1.hidePopup();\n proxy_1.inputElement.focus();\n };\n history.pushState({}, '');\n }\n var animModel = { name: 'FadeIn', duration: 100 };\n var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };\n this.trigger('open', eventArgs, function (eventArgs) {\n if (!eventArgs.cancel) {\n _this.focusAtFirstListItem();\n document.body.appendChild(_this.popupObj.element);\n if (_this.mode === 'CheckBox' && _this.enableGroupCheckBox && !isNullOrUndefined(_this.fields.groupBy)) {\n _this.updateListItems(_this.list.querySelectorAll('li.e-list-item'), _this.mainList.querySelectorAll('li.e-list-item'));\n }\n if (_this.mode === 'CheckBox' || _this.showDropDownIcon) {\n addClass([_this.overAllWrapper], [iconAnimation]);\n }\n _this.refreshPopup();\n _this.renderReactTemplates();\n _this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);\n attributes(_this.inputElement, { 'aria-expanded': 'true' });\n if (_this.isFirstClick) {\n _this.loadTemplate();\n }\n }\n });\n };\n MultiSelect.prototype.updateListItems = function (listItems, mainListItems) {\n for (var i = 0; i < listItems.length; i++) {\n this.findGroupStart(listItems[i]);\n this.findGroupStart(mainListItems[i]);\n }\n this.deselectHeader();\n };\n MultiSelect.prototype.loadTemplate = function () {\n this.refreshListItems(null);\n if (this.mode === 'CheckBox') {\n this.removeFocus();\n }\n this.notify('reOrder', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', e: this });\n };\n MultiSelect.prototype.setScrollPosition = function () {\n if (((!this.hideSelectedItem && this.mode !== 'CheckBox') || (this.mode === 'CheckBox' && !this.enableSelectionOrder)) &&\n (!isNullOrUndefined(this.value) && (this.value.length > 0))) {\n var valueEle = this.findListElement((this.hideSelectedItem ? this.ulElement : this.list), 'li', 'data-value', this.value[this.value.length - 1]);\n if (!isNullOrUndefined(valueEle)) {\n this.scrollBottom(valueEle);\n }\n }\n };\n MultiSelect.prototype.focusAtFirstListItem = function () {\n if (this.ulElement && this.ulElement.querySelector('li.'\n + dropDownBaseClasses.li)) {\n var element = void 0;\n if (this.mode === 'CheckBox') {\n this.removeFocus();\n return;\n }\n else {\n element = this.ulElement.querySelector('li.'\n + dropDownBaseClasses.li + ':not(.'\n + HIDE_LIST + ')');\n }\n if (element !== null) {\n this.removeFocus();\n this.addListFocus(element);\n }\n }\n };\n MultiSelect.prototype.focusAtLastListItem = function (data) {\n var activeElement;\n if (data) {\n activeElement = Search(data, this.liCollections, 'StartsWith', this.ignoreCase);\n }\n else {\n if (this.value && this.value.length) {\n Search(this.value[this.value.length - 1], this.liCollections, 'StartsWith', this.ignoreCase);\n }\n else {\n activeElement = null;\n }\n }\n if (activeElement && activeElement.item !== null) {\n this.addListFocus(activeElement.item);\n this.scrollBottom(activeElement.item, activeElement.index);\n }\n };\n MultiSelect.prototype.getAriaAttributes = function () {\n var ariaAttributes = {\n 'aria-disabled': 'false',\n 'aria-owns': this.element.id + '_options',\n 'role': 'listbox',\n 'aria-multiselectable': 'true',\n 'aria-activedescendant': 'null',\n 'aria-haspopup': 'true',\n 'aria-expanded': 'false'\n };\n return ariaAttributes;\n };\n MultiSelect.prototype.updateListARIA = function () {\n attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });\n var disableStatus = (this.inputElement.disabled) ? true : false;\n attributes(this.inputElement, this.getAriaAttributes());\n if (disableStatus) {\n attributes(this.inputElement, { 'aria-disabled': 'true' });\n }\n this.ensureAriaDisabled((disableStatus) ? 'true' : 'false');\n };\n MultiSelect.prototype.ensureAriaDisabled = function (status) {\n if (this.htmlAttributes && this.htmlAttributes['aria-disabled']) {\n var attr = this.htmlAttributes;\n extend(attr, { 'aria-disabled': status }, attr);\n this.setProperties({ htmlAttributes: attr }, true);\n }\n };\n MultiSelect.prototype.removelastSelection = function (e) {\n var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP);\n var value = elements[elements.length - 1].getAttribute('data-value');\n if (!isNullOrUndefined(this.value)) {\n this.tempValues = this.value.slice();\n }\n var customValue = this.getFormattedValue(value);\n if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&\n customValue.toString() === 'NaN'))) {\n customValue = value;\n }\n this.removeValue(customValue, e);\n this.removeChipSelection();\n this.updateDelimeter(this.delimiterChar, e);\n this.makeTextBoxEmpty();\n if (this.mainList && this.listData) {\n this.refreshSelection();\n }\n this.checkPlaceholderSize();\n };\n MultiSelect.prototype.onActionFailure = function (e) {\n _super.prototype.onActionFailure.call(this, e);\n this.renderPopup();\n this.onPopupShown();\n };\n MultiSelect.prototype.targetElement = function () {\n this.targetInputElement = this.inputElement;\n if (this.mode === 'CheckBox' && this.allowFiltering) {\n this.notify('targetElement', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });\n }\n return this.targetInputElement.value;\n };\n MultiSelect.prototype.getForQuery = function (valuecheck) {\n var predicate;\n var field = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;\n for (var i = 0; i < valuecheck.length; i++) {\n if (i === 0) {\n predicate = new Predicate(field, 'equal', valuecheck[i]);\n }\n else {\n predicate = predicate.or(field, 'equal', valuecheck[i]);\n }\n }\n return this.getQuery(this.query).where(predicate);\n };\n /* eslint-disable @typescript-eslint/no-unused-vars */\n MultiSelect.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {\n /* eslint-enable @typescript-eslint/no-unused-vars */\n _super.prototype.onActionComplete.call(this, ulElement, list, e);\n this.updateSelectElementData(this.allowFiltering);\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var proxy = this;\n if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {\n for (var i = 0; i < this.value.length; i++) {\n var checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', proxy.value[i]);\n if (!checkEle) {\n this.value.splice(i, 1);\n i -= 1;\n }\n }\n }\n this.updateActionList(ulElement, list, e);\n if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {\n this.removeFocus();\n }\n };\n /* eslint-disable @typescript-eslint/no-unused-vars */\n MultiSelect.prototype.updateActionList = function (ulElement, list, e, isUpdated) {\n /* eslint-enable @typescript-eslint/no-unused-vars */\n if (this.mode === 'CheckBox' && this.showSelectAll) {\n this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });\n }\n if (!this.mainList && !this.mainData) {\n this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;\n this.mainData = list;\n this.mainListCollection = this.liCollections;\n }\n else if (!isNullOrUndefined(this.mainData) && this.mainData.length === 0) {\n this.mainData = list;\n }\n if ((this.remoteCustomValue || list.length <= 0) && this.allowCustomValue && this.inputFocus && this.allowFiltering &&\n this.inputElement.value && this.inputElement.value !== '') {\n this.checkForCustomValue(this.tempQuery, this.fields);\n return;\n }\n if (this.value && this.value.length && ((this.mode !== 'CheckBox' && this.inputElement.value.trim() !== '') ||\n this.mode === 'CheckBox' || ((this.keyCode === 8 || this.keyCode === 46) && this.allowFiltering &&\n this.allowCustomValue && this.dataSource instanceof DataManager && this.inputElement.value === ''))) {\n this.refreshSelection();\n }\n this.updateListARIA();\n this.unwireListEvents();\n this.wireListEvents();\n if (!isNullOrUndefined(this.setInitialValue)) {\n this.setInitialValue();\n }\n if (!isNullOrUndefined(this.selectAllAction)) {\n this.selectAllAction();\n }\n if (this.setDynValue) {\n if (!isNullOrUndefined(this.text) && (isNullOrUndefined(this.value) || this.value.length === 0)) {\n this.initialTextUpdate();\n }\n this.initialValueUpdate();\n this.initialUpdate();\n this.refreshPlaceHolder();\n if (this.mode !== 'CheckBox' && this.changeOnBlur) {\n this.updateValueState(null, this.value, null);\n }\n }\n this.renderPopup();\n if (this.beforePopupOpen) {\n this.beforePopupOpen = false;\n this.onPopupShown();\n }\n };\n MultiSelect.prototype.refreshSelection = function () {\n var value;\n var element;\n var className = this.hideSelectedItem ?\n HIDE_LIST :\n dropDownBaseClasses.selected;\n if (!isNullOrUndefined(this.value)) {\n for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {\n value = this.value[index];\n element = this.findListElement(this.list, 'li', 'data-value', value);\n if (element) {\n addClass([element], className);\n if (this.hideSelectedItem && element.previousSibling\n && element.previousElementSibling.classList.contains(dropDownBaseClasses.group)\n && (!element.nextElementSibling ||\n element.nextElementSibling.classList.contains(dropDownBaseClasses.group))) {\n addClass([element.previousElementSibling], className);\n }\n if (this.hideSelectedItem && this.fields.groupBy && !element.previousElementSibling.classList.contains(HIDE_LIST)) {\n this.hideGroupItem(value);\n }\n if (this.hideSelectedItem && element.classList.contains(dropDownBaseClasses.focus)) {\n removeClass([element], dropDownBaseClasses.focus);\n var listEle = element.parentElement.querySelectorAll('.' +\n dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');\n if (listEle.length > 0) {\n addClass([listEle[0]], dropDownBaseClasses.focus);\n }\n else {\n this.ulElement = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;\n if (!(this.list && this.list.querySelectorAll('.' + dropDownBaseClasses.li).length > 0)) {\n this.l10nUpdate();\n addClass([this.list], dropDownBaseClasses.noData);\n }\n }\n }\n element.setAttribute('aria-selected', 'true');\n if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {\n var ariaValue = element.firstElementChild.getAttribute('aria-checked');\n if (isNullOrUndefined(ariaValue) || ariaValue === 'false') {\n var args = {\n module: 'CheckBoxSelection',\n enable: this.mode === 'CheckBox',\n li: element,\n e: null\n };\n this.notify('updatelist', args);\n }\n }\n }\n }\n }\n this.checkSelectAll();\n this.checkMaxSelection();\n };\n MultiSelect.prototype.hideGroupItem = function (value) {\n var element;\n var element1;\n var className = this.hideSelectedItem ?\n HIDE_LIST :\n dropDownBaseClasses.selected;\n element1 = element = this.findListElement(this.ulElement, 'li', 'data-value', value);\n var i = 0;\n var j = 0;\n var temp = true;\n var temp1 = true;\n do {\n if (element && element.previousElementSibling\n && (!element.previousElementSibling.classList.contains(HIDE_LIST) &&\n element.previousElementSibling.classList.contains(dropDownBaseClasses.li))) {\n temp = false;\n }\n if (!temp || !element || (element.previousElementSibling\n && element.previousElementSibling.classList.contains(dropDownBaseClasses.group))) {\n i = 10;\n }\n else {\n element = element.previousElementSibling;\n }\n if (element1 && element1.nextElementSibling\n && (!element1.nextElementSibling.classList.contains(HIDE_LIST) &&\n element1.nextElementSibling.classList.contains(dropDownBaseClasses.li))) {\n temp1 = false;\n }\n if (!temp1 || !element1 || (element1.nextElementSibling\n && element1.nextElementSibling.classList.contains(dropDownBaseClasses.group))) {\n j = 10;\n }\n else {\n element1 = element1.nextElementSibling;\n }\n } while (i < 10 || j < 10);\n if (temp && temp1 && !element.previousElementSibling.classList.contains(HIDE_LIST)) {\n addClass([element.previousElementSibling], className);\n }\n else if (temp && temp1 && element.previousElementSibling.classList.contains(HIDE_LIST)) {\n removeClass([element.previousElementSibling], className);\n }\n };\n MultiSelect.prototype.getValidLi = function () {\n var liElement = this.ulElement.querySelector('li.' + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');\n return (!isNullOrUndefined(liElement) ? liElement : this.liCollections[0]);\n };\n MultiSelect.prototype.checkSelectAll = function () {\n var groupItemLength = this.list.querySelectorAll('li.e-list-group-item.e-active').length;\n var listItem = this.list.querySelectorAll('li.e-list-item');\n var searchCount = this.list.querySelectorAll('li.' + dropDownBaseClasses.li).length;\n var searchActiveCount = this.list.querySelectorAll('li.' + dropDownBaseClasses.selected).length;\n if (this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy)) {\n searchActiveCount = searchActiveCount - groupItemLength;\n }\n if ((searchCount === searchActiveCount || searchActiveCount === this.maximumSelectionLength)\n && (this.mode === 'CheckBox' && this.showSelectAll)) {\n this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'check' });\n }\n else if ((searchCount !== searchActiveCount) && (this.mode === 'CheckBox' && this.showSelectAll)) {\n this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'uncheck' });\n }\n if (this.enableGroupCheckBox && this.fields.groupBy && !this.enableSelectionOrder) {\n for (var i = 0; i < listItem.length; i++) {\n this.findGroupStart(listItem[i]);\n }\n this.deselectHeader();\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n MultiSelect.prototype.openClick = function (e) {\n if (!this.openOnClick && this.mode !== 'CheckBox') {\n if (this.targetElement() !== '') {\n this.showPopup();\n }\n else {\n this.hidePopup();\n }\n }\n else if (!this.openOnClick && this.mode === 'CheckBox' && !this.isPopupOpen()) {\n this.showPopup();\n }\n };\n MultiSelect.prototype.keyUp = function (e) {\n if (this.mode === 'CheckBox' && !this.openOnClick) {\n var char = String.fromCharCode(e.keyCode);\n var isWordCharacter = char.match(/\\w/);\n if (!isNullOrUndefined(isWordCharacter)) {\n this.isValidKey = true;\n }\n }\n this.isValidKey = (this.isPopupOpen() && e.keyCode === 8) || this.isValidKey;\n this.isValidKey = e.ctrlKey && e.keyCode === 86 ? false : this.isValidKey;\n if (this.isValidKey) {\n this.isValidKey = false;\n this.expandTextbox();\n this.showOverAllClear();\n switch (e.keyCode) {\n default:\n // For filtering works in mobile firefox\n this.search(e);\n }\n }\n };\n /**\n * To filter the multiselect data from given data source by using query\n *\n * @param {Object[] | DataManager } dataSource - Set the data source to filter.\n * @param {Query} query - Specify the query to filter the data.\n * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.\n * @returns {void}\n */\n MultiSelect.prototype.filter = function (dataSource, query, fields) {\n this.isFiltered = true;\n this.remoteFilterAction = true;\n this.dataUpdater(dataSource, query, fields);\n };\n MultiSelect.prototype.getQuery = function (query) {\n var filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();\n if (this.filterAction) {\n if (this.targetElement() !== null) {\n var dataType = this.typeOfData(this.dataSource).typeof;\n if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {\n filterQuery.where('', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);\n }\n else {\n var fields = this.fields;\n filterQuery.where(!isNullOrUndefined(fields.text) ? fields.text : '', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);\n }\n }\n return filterQuery;\n }\n else {\n return query ? query : this.query ? this.query : new Query();\n }\n };\n MultiSelect.prototype.dataUpdater = function (dataSource, query, fields) {\n this.isDataFetched = false;\n if (this.targetElement().trim() === '') {\n var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;\n if (this.backCommand) {\n this.remoteCustomValue = false;\n if (this.allowCustomValue && list.querySelectorAll('li').length == 0 && this.mainData.length > 0) {\n this.mainData = [];\n }\n this.onActionComplete(list, this.mainData);\n if (this.value && this.value.length) {\n this.refreshSelection();\n }\n if (this.keyCode !== 8) {\n this.focusAtFirstListItem();\n }\n this.notify('reOrder', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', e: this });\n }\n }\n else {\n this.resetList(dataSource, fields, query);\n if (this.allowCustomValue) {\n if (!(dataSource instanceof DataManager)) {\n this.checkForCustomValue(query, fields);\n }\n else {\n this.remoteCustomValue = true;\n this.tempQuery = query;\n }\n }\n }\n this.refreshPopup();\n if (this.mode === 'CheckBox') {\n this.removeFocus();\n }\n };\n MultiSelect.prototype.checkForCustomValue = function (query, fields) {\n var dataChecks = !this.getValueByText(this.inputElement.value, this.ignoreCase);\n if (this.allowCustomValue && dataChecks) {\n var value = this.inputElement.value;\n var field = fields ? fields : this.fields;\n var customData = (!isNullOrUndefined(this.mainData) && this.mainData.length > 0) ?\n this.mainData[0] : this.mainData;\n if (typeof (customData) !== 'string' && typeof (customData) !== 'number' && typeof (customData) !== 'boolean') {\n var dataItem = {};\n setValue(field.text, value, dataItem);\n if (typeof getValue((this.fields.value ? this.fields.value : 'value'), customData)\n === 'number') {\n setValue(field.value, Math.random(), dataItem);\n }\n else {\n setValue(field.value, value, dataItem);\n }\n var tempData = JSON.parse(JSON.stringify(this.listData));\n tempData.splice(0, 0, dataItem);\n this.resetList(tempData, field, query);\n }\n else {\n var tempData = [this.inputElement.value];\n tempData[0] = (typeof customData === 'number' && !isNaN(parseFloat(tempData[0]))) ?\n parseFloat(tempData[0]) : tempData[0];\n tempData[0] = (typeof customData === 'boolean') ?\n (tempData[0] === 'true' ? true : (tempData[0] === 'false' ? false : tempData[0])) : tempData[0];\n this.resetList(tempData, field);\n }\n }\n if (this.value && this.value.length) {\n this.refreshSelection();\n }\n };\n MultiSelect.prototype.getNgDirective = function () {\n return 'EJS-MULTISELECT';\n };\n MultiSelect.prototype.wrapperClick = function (e) {\n this.setDynValue = false;\n if (!this.enabled) {\n return;\n }\n if (e.target === this.overAllClear) {\n e.preventDefault();\n return;\n }\n if (!this.inputFocus) {\n this.inputElement.focus();\n }\n if (!this.readonly) {\n if (e.target && e.target.classList.toString().indexOf(CHIP_CLOSE) !== -1) {\n if (this.isPopupOpen()) {\n this.refreshPopup();\n }\n return;\n }\n if (!this.isPopupOpen() &&\n (this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {\n this.showPopup();\n }\n else {\n this.hidePopup();\n if (this.mode === 'CheckBox') {\n this.showOverAllClear();\n this.inputFocus = true;\n if (!this.overAllWrapper.classList.contains(FOCUS)) {\n this.overAllWrapper.classList.add(FOCUS);\n }\n }\n }\n }\n if (!(this.targetElement() && this.targetElement() !== '')) {\n e.preventDefault();\n }\n };\n MultiSelect.prototype.enable = function (state) {\n if (state) {\n this.overAllWrapper.classList.remove(DISABLED);\n this.inputElement.removeAttribute('disabled');\n attributes(this.inputElement, { 'aria-disabled': 'false' });\n this.ensureAriaDisabled('false');\n }\n else {\n this.overAllWrapper.classList.add(DISABLED);\n this.inputElement.setAttribute('disabled', 'true');\n attributes(this.inputElement, { 'aria-disabled': 'true' });\n this.ensureAriaDisabled('true');\n }\n if (this.enabled !== state) {\n this.enabled = state;\n }\n this.hidePopup();\n };\n MultiSelect.prototype.onBlurHandler = function (eve, isDocClickFromCheck) {\n var target;\n if (!isNullOrUndefined(eve)) {\n target = eve.relatedTarget;\n }\n if (this.popupObj && document.body.contains(this.popupObj.element) && this.popupObj.element.contains(target)) {\n if (this.mode !== 'CheckBox') {\n this.inputElement.focus();\n }\n else if ((this.floatLabelType === 'Auto' &&\n ((this.overAllWrapper.classList.contains('e-outline')) || (this.overAllWrapper.classList.contains('e-filled'))))) {\n addClass([this.overAllWrapper], 'e-valid-input');\n }\n return;\n }\n if (this.floatLabelType === 'Auto' && (this.overAllWrapper.classList.contains('e-outline')) && this.mode === 'CheckBox' &&\n ((isNullOrUndefined(this.value)) || this.value.length === 0)) {\n removeClass([this.overAllWrapper], 'e-valid-input');\n }\n if (this.mode === 'CheckBox' && Browser.isIE && !isNullOrUndefined(eve) && !isDocClickFromCheck) {\n this.inputFocus = false;\n this.overAllWrapper.classList.remove(FOCUS);\n return;\n }\n if (this.scrollFocusStatus) {\n if (!isNullOrUndefined(eve)) {\n eve.preventDefault();\n }\n this.inputElement.focus();\n this.scrollFocusStatus = false;\n return;\n }\n this.inputFocus = false;\n this.overAllWrapper.classList.remove(FOCUS);\n if (this.addTagOnBlur) {\n var dataChecks = this.getValueByText(this.inputElement.value, this.ignoreCase, this.ignoreAccent);\n var listLiElement = this.findListElement(this.list, 'li', 'data-value', dataChecks);\n var className = this.hideSelectedItem ? HIDE_LIST : dropDownBaseClasses.selected;\n var allowChipAddition = (listLiElement && !listLiElement.classList.contains(className)) ? true : false;\n if (allowChipAddition) {\n this.updateListSelection(listLiElement, eve);\n if (this.mode === 'Delimiter') {\n this.updateDelimeter(this.delimiterChar);\n }\n }\n }\n this.refreshListItems(null);\n if (this.mode !== 'Box' && this.mode !== 'CheckBox') {\n this.updateDelimView();\n }\n if (this.changeOnBlur) {\n this.updateValueState(eve, this.value, this.tempValues);\n this.dispatchEvent(this.hiddenElement, 'change');\n }\n this.overAllClear.style.display = 'none';\n if (this.isPopupOpen()) {\n this.hidePopup();\n }\n this.makeTextBoxEmpty();\n this.trigger('blur');\n this.focused = true;\n if (Browser.isDevice && this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {\n this.removeChipFocus();\n }\n this.removeChipSelection();\n this.refreshInputHight();\n floatLabelBlur(this.overAllWrapper, this.componentWrapper, this.value, this.floatLabelType, this.placeholder);\n this.refreshPlaceHolder();\n if ((this.allowFiltering || (this.enableSelectionOrder === true && this.mode === 'CheckBox'))\n && !isNullOrUndefined(this.mainList)) {\n this.ulElement = this.mainList;\n }\n this.checkPlaceholderSize();\n };\n MultiSelect.prototype.checkPlaceholderSize = function () {\n if (this.showDropDownIcon) {\n var downIconWidth = this.dropIcon.offsetWidth +\n parseInt(window.getComputedStyle(this.dropIcon).marginRight, 10);\n this.setPlaceholderSize(downIconWidth);\n }\n else {\n if (!isNullOrUndefined(this.dropIcon)) {\n this.setPlaceholderSize(this.showDropDownIcon ? this.dropIcon.offsetWidth : 0);\n }\n }\n };\n MultiSelect.prototype.setPlaceholderSize = function (downIconWidth) {\n if (isNullOrUndefined(this.value) || this.value.length === 0) {\n if (this.dropIcon.offsetWidth !== 0) {\n this.searchWrapper.style.width = ('calc(100% - ' + (downIconWidth + 10)) + 'px';\n }\n else {\n addClass([this.searchWrapper], CUSTOM_WIDTH);\n }\n }\n else if (!isNullOrUndefined(this.value)) {\n this.searchWrapper.removeAttribute('style');\n removeClass([this.searchWrapper], CUSTOM_WIDTH);\n }\n };\n MultiSelect.prototype.refreshInputHight = function () {\n if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {\n this.searchWrapper.classList.remove(ZERO_SIZE);\n }\n else {\n this.searchWrapper.classList.add(ZERO_SIZE);\n }\n };\n MultiSelect.prototype.validateValues = function (newValue, oldValue) {\n return JSON.stringify(newValue.slice().sort()) !== JSON.stringify(oldValue.slice().sort());\n };\n MultiSelect.prototype.updateValueState = function (event, newVal, oldVal) {\n var newValue = newVal ? newVal : [];\n var oldValue = oldVal ? oldVal : [];\n if (this.initStatus && this.validateValues(newValue, oldValue)) {\n var eventArgs = {\n e: event,\n oldValue: oldVal,\n value: newVal,\n isInteracted: event ? true : false,\n element: this.element,\n event: event\n };\n if (this.isAngular && this.preventChange) {\n this.preventChange = false;\n }\n else {\n this.trigger('change', eventArgs);\n }\n this.updateTempValue();\n if (!this.changeOnBlur) {\n this.dispatchEvent(this.hiddenElement, 'change');\n }\n }\n };\n MultiSelect.prototype.updateTempValue = function () {\n if (!this.value) {\n this.tempValues = this.value;\n }\n else {\n this.tempValues = this.value.slice();\n }\n };\n MultiSelect.prototype.getPagingCount = function () {\n var height = this.list.classList.contains(dropDownBaseClasses.noData) ? null :\n getComputedStyle(this.getItems()[0], null).getPropertyValue('height');\n return Math.round(this.list.offsetHeight / parseInt(height, 10));\n };\n MultiSelect.prototype.pageUpSelection = function (steps) {\n var collection = this.list.querySelectorAll('li.'\n + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');\n var previousItem = steps >= 0 ? collection[steps + 1] : collection[0];\n this.addListFocus(previousItem);\n this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')));\n };\n MultiSelect.prototype.pageDownSelection = function (steps) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var list = this.getItems();\n var collection = this.list.querySelectorAll('li.'\n + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');\n var previousItem = steps <= collection.length ? collection[steps - 1] : collection[collection.length - 1];\n this.addListFocus(previousItem);\n this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')));\n };\n MultiSelect.prototype.getItems = function () {\n if (!this.list) {\n _super.prototype.render.call(this);\n }\n return this.ulElement && this.ulElement.querySelectorAll('.' + dropDownBaseClasses.li).length > 0 ?\n this.ulElement.querySelectorAll('.' + dropDownBaseClasses.li\n + ':not(.' + HIDE_LIST + ')') : [];\n };\n MultiSelect.prototype.focusInHandler = function (e) {\n if (this.enabled) {\n this.showOverAllClear();\n this.inputFocus = true;\n if (this.value && this.value.length) {\n if (this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {\n this.chipCollectionWrapper.style.display = '';\n }\n else {\n this.showDelimWrapper();\n }\n if (this.mode !== 'CheckBox') {\n this.viewWrapper.style.display = 'none';\n }\n }\n if (this.mode !== 'CheckBox') {\n this.searchWrapper.classList.remove(ZERO_SIZE);\n }\n this.checkPlaceholderSize();\n if (this.focused) {\n var args = { isInteracted: e ? true : false, event: e };\n this.trigger('focus', args);\n this.focused = false;\n }\n if (!this.overAllWrapper.classList.contains(FOCUS)) {\n this.overAllWrapper.classList.add(FOCUS);\n }\n floatLabelFocus(this.overAllWrapper, this.componentWrapper);\n if (this.isPopupOpen()) {\n this.refreshPopup();\n }\n return true;\n }\n else {\n return false;\n }\n };\n MultiSelect.prototype.showDelimWrapper = function () {\n if (this.mode === 'CheckBox') {\n this.viewWrapper.style.display = '';\n }\n else {\n this.delimiterWrapper.style.display = '';\n }\n this.componentWrapper.classList.add(DELIMITER_VIEW_WRAPPER);\n };\n MultiSelect.prototype.hideDelimWrapper = function () {\n this.delimiterWrapper.style.display = 'none';\n this.componentWrapper.classList.remove(DELIMITER_VIEW_WRAPPER);\n };\n MultiSelect.prototype.expandTextbox = function () {\n var size = 5;\n if (this.placeholder) {\n size = size > this.inputElement.placeholder.length ? size : this.inputElement.placeholder.length;\n }\n if (this.inputElement.value.length > size) {\n this.inputElement.size = this.inputElement.value.length;\n }\n else {\n this.inputElement.size = size;\n }\n };\n MultiSelect.prototype.isPopupOpen = function () {\n return ((this.popupWrapper !== null) && (this.popupWrapper.parentElement !== null));\n };\n MultiSelect.prototype.refreshPopup = function () {\n if (this.popupObj && this.mobFilter) {\n this.popupObj.setProperties({ width: this.calcPopupWidth() });\n this.popupObj.refreshPosition(this.overAllWrapper);\n this.popupObj.resolveCollision();\n }\n };\n MultiSelect.prototype.checkTextLength = function () {\n return this.targetElement().length < 1;\n };\n MultiSelect.prototype.popupKeyActions = function (e) {\n switch (e.keyCode) {\n case 38:\n this.hidePopup();\n if (this.mode === 'CheckBox') {\n this.inputElement.focus();\n }\n e.preventDefault();\n break;\n case 40:\n if (!this.isPopupOpen()) {\n this.showPopup();\n e.preventDefault();\n }\n break;\n }\n };\n MultiSelect.prototype.updateAriaAttribute = function () {\n var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);\n if (!isNullOrUndefined(focusedItem)) {\n this.inputElement.setAttribute('aria-activedescendant', focusedItem.id);\n }\n };\n MultiSelect.prototype.homeNavigation = function (isHome) {\n this.removeFocus();\n var scrollEle = this.ulElement.querySelectorAll('li.' + dropDownBaseClasses.li\n + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');\n if (scrollEle.length > 0) {\n var element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];\n element.classList.add(dropDownBaseClasses.focus);\n this.scrollBottom(element);\n }\n };\n MultiSelect.prototype.onKeyDown = function (e) {\n if (this.readonly || !this.enabled && this.mode !== 'CheckBox') {\n return;\n }\n this.keyCode = e.keyCode;\n this.keyDownStatus = true;\n if (e.keyCode > 111 && e.keyCode < 124) {\n return;\n }\n if (e.altKey) {\n this.popupKeyActions(e);\n return;\n }\n else if (this.isPopupOpen()) {\n var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);\n var activeIndex = void 0;\n switch (e.keyCode) {\n case 36:\n case 35:\n this.homeNavigation((e.keyCode === 36) ? true : false);\n break;\n case 33:\n e.preventDefault();\n if (focusedItem) {\n this.getIndexByValue(focusedItem.getAttribute('data-value'));\n this.pageUpSelection(activeIndex - this.getPagingCount());\n this.updateAriaAttribute();\n }\n return;\n case 34:\n e.preventDefault();\n if (focusedItem) {\n this.getIndexByValue(focusedItem.getAttribute('data-value'));\n this.pageDownSelection(activeIndex + this.getPagingCount());\n this.updateAriaAttribute();\n }\n return;\n case 38:\n this.arrowUp(e);\n break;\n case 40:\n this.arrowDown(e);\n break;\n case 27:\n e.preventDefault();\n this.hidePopup();\n if (this.mode === 'CheckBox') {\n this.inputElement.focus();\n }\n return;\n case 13:\n e.preventDefault();\n if (this.mode !== 'CheckBox') {\n this.selectByKey(e);\n }\n this.checkPlaceholderSize();\n return;\n case 32:\n this.spaceKeySelection(e);\n return;\n case 9:\n e.preventDefault();\n this.hidePopup();\n this.inputElement.focus();\n this.overAllWrapper.classList.add(FOCUS);\n }\n }\n else {\n switch (e.keyCode) {\n case 13:\n case 9:\n case 16:\n case 17:\n case 20:\n return;\n case 40:\n if (this.openOnClick) {\n this.showPopup();\n }\n break;\n case 27:\n e.preventDefault();\n this.escapeAction();\n return;\n }\n }\n if (this.checkTextLength()) {\n this.keyNavigation(e);\n }\n if (this.mode === 'CheckBox' && this.enableSelectionOrder) {\n this.checkBackCommand(e);\n }\n this.expandTextbox();\n if (!(this.mode === 'CheckBox' && this.showSelectAll)) {\n this.refreshPopup();\n }\n };\n MultiSelect.prototype.arrowDown = function (e) {\n e.preventDefault();\n this.moveByList(1);\n this.keyAction = true;\n if (document.activeElement.classList.contains(FILTERINPUT)\n || (this.mode === 'CheckBox' && !this.allowFiltering && document.activeElement !== this.list)) {\n this.list.focus();\n EventHandler.add(this.list, 'keydown', this.onKeyDown, this);\n }\n this.updateAriaAttribute();\n };\n MultiSelect.prototype.arrowUp = function (e) {\n e.preventDefault();\n this.keyAction = true;\n var list = this.list.querySelectorAll('li.'\n + dropDownBaseClasses.li\n + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');\n if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {\n list = this.list.querySelectorAll('li.'\n + dropDownBaseClasses.li + ',li.' + dropDownBaseClasses.group\n + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');\n }\n var focuseElem = this.list.querySelector('li.' + dropDownBaseClasses.focus);\n var index = Array.prototype.slice.call(list).indexOf(focuseElem);\n if (index <= 0 && (this.mode === 'CheckBox' && this.allowFiltering)) {\n this.keyAction = false;\n this.notify('inputFocus', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'focus' });\n }\n this.moveByList(-1);\n this.updateAriaAttribute();\n };\n MultiSelect.prototype.spaceKeySelection = function (e) {\n if (this.mode === 'CheckBox') {\n if (!document.activeElement.classList.contains(FILTERINPUT)) {\n e.preventDefault();\n this.keyAction = true;\n this.list.focus();\n }\n this.selectByKey(e);\n }\n this.checkPlaceholderSize();\n };\n MultiSelect.prototype.checkBackCommand = function (e) {\n if (e.keyCode === 8 && this.targetElement() === '') {\n this.backCommand = false;\n }\n else {\n this.backCommand = true;\n }\n };\n MultiSelect.prototype.keyNavigation = function (e) {\n if ((this.mode !== 'Delimiter' && this.mode !== 'CheckBox') && this.value && this.value.length) {\n switch (e.keyCode) {\n case 37: //left arrow\n e.preventDefault();\n this.moveBy(-1, e);\n break;\n case 39: //right arrow\n e.preventDefault();\n this.moveBy(1, e);\n break;\n case 8:\n this.removelastSelection(e);\n break;\n case 46: //del\n this.removeSelectedChip(e);\n break;\n }\n }\n else if (e.keyCode === 8 && this.mode === 'Delimiter') {\n if (this.value && this.value.length) {\n e.preventDefault();\n var temp = this.value[this.value.length - 1];\n this.removeValue(temp, e);\n this.updateDelimeter(this.delimiterChar, e);\n this.focusAtLastListItem(temp);\n }\n }\n };\n MultiSelect.prototype.selectByKey = function (e) {\n this.removeChipSelection();\n this.selectListByKey(e);\n if (this.hideSelectedItem) {\n this.focusAtFirstListItem();\n }\n };\n MultiSelect.prototype.escapeAction = function () {\n var temp = this.tempValues ? this.tempValues.slice() : [];\n if (this.value && this.validateValues(this.value, temp)) {\n if (this.mode !== 'CheckBox') {\n this.value = temp;\n this.initialValueUpdate();\n }\n if (this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {\n this.chipCollectionWrapper.style.display = '';\n }\n else {\n this.showDelimWrapper();\n }\n this.refreshPlaceHolder();\n if (this.value.length) {\n this.showOverAllClear();\n }\n else {\n this.hideOverAllClear();\n }\n }\n this.makeTextBoxEmpty();\n };\n MultiSelect.prototype.scrollBottom = function (selectedLI, activeIndex) {\n var currentOffset = this.list.offsetHeight;\n var nextBottom = selectedLI.offsetTop + selectedLI.offsetHeight - this.list.scrollTop;\n var nextOffset = this.list.scrollTop + nextBottom - currentOffset;\n var boxRange = (selectedLI.offsetTop + selectedLI.offsetHeight - this.list.scrollTop);\n boxRange = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?\n boxRange - this.fixedHeaderElement.offsetHeight : boxRange;\n if (activeIndex === 0) {\n this.list.scrollTop = 0;\n }\n else if (nextBottom > currentOffset) {\n this.list.scrollTop = nextOffset;\n }\n else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {\n this.list.scrollTop = nextOffset;\n }\n };\n MultiSelect.prototype.scrollTop = function (selectedLI, activeIndex) {\n var nextOffset = selectedLI.offsetTop - this.list.scrollTop;\n nextOffset = this.fields.groupBy && !isUndefined(this.fixedHeaderElement) ?\n nextOffset - this.fixedHeaderElement.offsetHeight : nextOffset;\n var boxRange = (selectedLI.offsetTop + selectedLI.offsetHeight - this.list.scrollTop);\n if (activeIndex === 0) {\n this.list.scrollTop = 0;\n }\n else if (nextOffset < 0) {\n this.list.scrollTop = this.list.scrollTop + nextOffset;\n }\n else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {\n this.list.scrollTop = selectedLI.offsetTop - (this.fields.groupBy && !isUndefined(this.fixedHeaderElement) ?\n this.fixedHeaderElement.offsetHeight : 0);\n }\n };\n MultiSelect.prototype.selectListByKey = function (e) {\n var li = this.list.querySelector('li.' + dropDownBaseClasses.focus);\n var limit = this.value && this.value.length ? this.value.length : 0;\n var target;\n if (li !== null) {\n if (li.classList.contains('e-active')) {\n limit = limit - 1;\n }\n if (this.isValidLI(li) && limit < this.maximumSelectionLength) {\n this.updateListSelection(li, e);\n this.addListFocus(li);\n if (this.mode === 'CheckBox') {\n this.updateDelimView();\n this.updateDelimeter(this.delimiterChar, e);\n this.refreshInputHight();\n this.checkPlaceholderSize();\n if (this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy)) {\n target = li.firstElementChild.lastElementChild;\n this.findGroupStart(target);\n this.deselectHeader();\n }\n }\n else {\n this.updateDelimeter(this.delimiterChar, e);\n }\n this.makeTextBoxEmpty();\n if (this.mode !== 'CheckBox') {\n this.refreshListItems(li.textContent);\n }\n if (!this.changeOnBlur) {\n this.updateValueState(e, this.value, this.tempValues);\n }\n this.refreshPopup();\n }\n else {\n if (!this.isValidLI(li) && limit < this.maximumSelectionLength) {\n target = li.firstElementChild.lastElementChild;\n if (target.classList.contains('e-check')) {\n this.selectAllItem(false, e, li);\n }\n else {\n this.selectAllItem(true, e, li);\n }\n }\n }\n this.refreshSelection();\n if (this.closePopupOnSelect) {\n this.hidePopup();\n }\n }\n this.refreshPlaceHolder();\n };\n MultiSelect.prototype.refreshListItems = function (data) {\n if ((this.allowFiltering || (this.mode === 'CheckBox' && this.enableSelectionOrder === true)\n || this.allowCustomValue) && this.mainList && this.listData) {\n var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;\n this.onActionComplete(list, this.mainData);\n this.focusAtLastListItem(data);\n if (this.value && this.value.length) {\n this.refreshSelection();\n }\n }\n };\n MultiSelect.prototype.removeSelectedChip = function (e) {\n var selectedElem = this.chipCollectionWrapper.querySelector('span.' + CHIP_SELECTED);\n var temp;\n if (selectedElem !== null) {\n if (!isNullOrUndefined(this.value)) {\n this.tempValues = this.value.slice();\n }\n temp = selectedElem.nextElementSibling;\n if (temp !== null) {\n this.removeChipSelection();\n this.addChipSelection(temp, e);\n }\n this.removeValue(selectedElem.getAttribute('data-value'), e);\n this.makeTextBoxEmpty();\n }\n if (this.closePopupOnSelect) {\n this.hidePopup();\n }\n this.checkPlaceholderSize();\n };\n MultiSelect.prototype.moveByTop = function (state) {\n var elements = this.list.querySelectorAll('li.' + dropDownBaseClasses.li);\n var index;\n if (elements.length > 1) {\n this.removeFocus();\n index = state ? 0 : (elements.length - 1);\n this.addListFocus(elements[index]);\n this.scrollBottom(elements[index], index);\n }\n this.updateAriaAttribute();\n };\n MultiSelect.prototype.moveByList = function (position) {\n if (this.list) {\n var elements = this.list.querySelectorAll('li.'\n + dropDownBaseClasses.li\n + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');\n if (this.mode === 'CheckBox' && this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy)) {\n elements = this.list.querySelectorAll('li.'\n + dropDownBaseClasses.li + ',li.' + dropDownBaseClasses.group\n + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');\n }\n var selectedElem = this.list.querySelector('li.' + dropDownBaseClasses.focus);\n var temp = -1;\n if (elements.length) {\n for (var index = 0; index < elements.length; index++) {\n if (elements[index] === selectedElem) {\n temp = index;\n break;\n }\n }\n if (position > 0) {\n if (temp < (elements.length - 1)) {\n this.removeFocus();\n this.addListFocus(elements[++temp]);\n this.updateCheck(elements[temp]);\n this.scrollBottom(elements[temp], temp);\n }\n }\n else {\n if (temp > 0) {\n this.removeFocus();\n this.addListFocus(elements[--temp]);\n this.updateCheck(elements[temp]);\n this.scrollTop(elements[temp], temp);\n }\n }\n }\n }\n };\n MultiSelect.prototype.updateCheck = function (element) {\n if (this.mode === 'CheckBox' && this.enableGroupCheckBox &&\n !isNullOrUndefined(this.fields.groupBy)) {\n var checkElement = element.firstElementChild.lastElementChild;\n if (checkElement.classList.contains('e-check')) {\n element.classList.add('e-active');\n }\n else {\n element.classList.remove('e-active');\n }\n }\n };\n MultiSelect.prototype.moveBy = function (position, e) {\n var temp;\n var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP);\n var selectedElem = this.chipCollectionWrapper.querySelector('span.' + CHIP_SELECTED);\n if (selectedElem === null) {\n if (position < 0) {\n this.addChipSelection(elements[elements.length - 1], e);\n }\n }\n else {\n if (position < 0) {\n temp = selectedElem.previousElementSibling;\n if (temp !== null) {\n this.removeChipSelection();\n this.addChipSelection(temp, e);\n }\n }\n else {\n temp = selectedElem.nextElementSibling;\n this.removeChipSelection();\n if (temp !== null) {\n this.addChipSelection(temp, e);\n }\n }\n }\n };\n MultiSelect.prototype.chipClick = function (e) {\n if (this.enabled) {\n var elem = closest(e.target, '.' + CHIP);\n this.removeChipSelection();\n this.addChipSelection(elem, e);\n }\n };\n MultiSelect.prototype.removeChipSelection = function () {\n if (this.chipCollectionWrapper) {\n this.removeChipFocus();\n }\n };\n MultiSelect.prototype.addChipSelection = function (element, e) {\n addClass([element], CHIP_SELECTED);\n this.trigger('chipSelection', e);\n };\n MultiSelect.prototype.onChipRemove = function (e) {\n if (e.which === 3 || e.button === 2) {\n return;\n }\n if (this.enabled && !this.readonly) {\n var element = e.target.parentElement;\n var customVal = element.getAttribute('data-value');\n var value = this.getFormattedValue(customVal);\n if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||\n (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {\n value = customVal;\n }\n if (this.isPopupOpen() && this.mode !== 'CheckBox') {\n this.hidePopup();\n }\n if (!this.inputFocus) {\n this.inputElement.focus();\n }\n this.removeValue(value, e);\n if (isNullOrUndefined(this.findListElement(this.list, 'li', 'data-value', value)) && this.mainList && this.listData) {\n var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;\n this.onActionComplete(list, this.mainData);\n }\n this.updateDelimeter(this.delimiterChar, e);\n if (this.placeholder && this.floatLabelType === 'Never') {\n this.makeTextBoxEmpty();\n this.checkPlaceholderSize();\n }\n else {\n this.inputElement.value = '';\n }\n e.preventDefault();\n }\n };\n MultiSelect.prototype.makeTextBoxEmpty = function () {\n this.inputElement.value = '';\n this.refreshPlaceHolder();\n };\n MultiSelect.prototype.refreshPlaceHolder = function () {\n if (this.placeholder && this.floatLabelType === 'Never') {\n if ((this.value && this.value.length) || (!isNullOrUndefined(this.text) && this.text !== '')) {\n this.inputElement.placeholder = '';\n }\n else {\n this.inputElement.placeholder = encodePlaceholder(this.placeholder);\n }\n }\n else {\n this.setFloatLabelType();\n }\n this.expandTextbox();\n };\n MultiSelect.prototype.removeAllItems = function (value, eve, isClearAll, element, mainElement) {\n var index = this.value.indexOf(value);\n var removeVal = this.value.slice(0);\n removeVal.splice(index, 1);\n this.setProperties({ value: [].concat([], removeVal) }, true);\n element.setAttribute('aria-selected', 'false');\n var className = this.hideSelectedItem ?\n HIDE_LIST :\n dropDownBaseClasses.selected;\n removeClass([element], className);\n this.notify('activeList', {\n module: 'CheckBoxSelection',\n enable: this.mode === 'CheckBox', li: element,\n e: this, index: index\n });\n this.invokeCheckboxSelection(element, eve, isClearAll);\n this.updateMainList(true, value, mainElement);\n this.updateChipStatus();\n };\n MultiSelect.prototype.invokeCheckboxSelection = function (element, eve, isClearAll) {\n this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: eve });\n attributes(this.inputElement, { 'aria-activedescendant': element.id });\n if ((this.value && this.value.length !== this.mainData.length)\n && (this.mode === 'CheckBox' && this.showSelectAll && !(this.isSelectAll || isClearAll))) {\n this.notify('checkSelectAll', {\n module: 'CheckBoxSelection',\n enable: this.mode === 'CheckBox',\n value: 'uncheck'\n });\n }\n };\n MultiSelect.prototype.removeValue = function (value, eve, length, isClearAll) {\n var _this = this;\n var index = this.value.indexOf(this.getFormattedValue(value));\n if (index === -1 && this.allowCustomValue && !isNullOrUndefined(value)) {\n index = this.value.indexOf(value.toString());\n }\n var targetEle = eve && eve.target;\n isClearAll = (isClearAll || targetEle && targetEle.classList.contains('e-close-hooker')) ? true : null;\n var className = this.hideSelectedItem ?\n HIDE_LIST :\n dropDownBaseClasses.selected;\n if (index !== -1) {\n var element_1 = this.findListElement(this.list, 'li', 'data-value', value);\n var val_1 = this.getDataByValue(value);\n var eventArgs = {\n e: eve,\n item: element_1,\n itemData: val_1,\n isInteracted: eve ? true : false,\n cancel: false\n };\n this.trigger('removing', eventArgs, function (eventArgs) {\n if (eventArgs.cancel) {\n _this.removeIndex++;\n }\n else {\n var removeVal = _this.value.slice(0);\n removeVal.splice(index, 1);\n _this.setProperties({ value: [].concat([], removeVal) }, true);\n if (element_1 !== null) {\n var hideElement = _this.findListElement(_this.mainList, 'li', 'data-value', value);\n element_1.setAttribute('aria-selected', 'false');\n removeClass([element_1], className);\n if (hideElement) {\n hideElement.setAttribute('aria-selected', 'false');\n removeClass([element_1, hideElement], className);\n }\n _this.notify('activeList', {\n module: 'CheckBoxSelection',\n enable: _this.mode === 'CheckBox', li: element_1,\n e: _this, index: index\n });\n _this.invokeCheckboxSelection(element_1, eve, isClearAll);\n }\n if (_this.hideSelectedItem && _this.fields.groupBy) {\n _this.hideGroupItem(value);\n }\n if (_this.hideSelectedItem && _this.fixedHeaderElement && _this.fields.groupBy && _this.mode !== 'CheckBox' &&\n _this.isPopupOpen()) {\n _super.prototype.scrollStop.call(_this);\n }\n _this.updateMainList(true, value);\n _this.removeChip(value);\n _this.updateChipStatus();\n var limit = _this.value && _this.value.length ? _this.value.length : 0;\n if (limit < _this.maximumSelectionLength) {\n var collection = _this.list.querySelectorAll('li.'\n + dropDownBaseClasses.li + ':not(.e-active)');\n removeClass(collection, 'e-disable');\n }\n _this.trigger('removed', eventArgs);\n var targetEle_1 = eve && eve.currentTarget;\n var isSelectAll = (targetEle_1 && targetEle_1.classList.contains('e-selectall-parent')) ? true : null;\n if (!_this.changeOnBlur && !isClearAll && (eve && length && !isSelectAll)) {\n _this.updateValueState(eve, _this.value, _this.tempValues);\n }\n if (length) {\n _this.selectAllEventData.push(val_1);\n _this.selectAllEventEle.push(element_1);\n }\n if (length === 1) {\n if (!_this.changeOnBlur) {\n _this.updateValueState(eve, _this.value, _this.tempValues);\n }\n var args = {\n event: eve,\n items: _this.selectAllEventEle,\n itemData: _this.selectAllEventData,\n isInteracted: eve ? true : false,\n isChecked: false\n };\n _this.trigger('selectedAll', args);\n _this.selectAllEventData = [];\n _this.selectAllEventEle = [];\n }\n if (isClearAll && (length === 1 || length === null)) {\n _this.clearAllCallback(eve, isClearAll);\n }\n }\n });\n }\n };\n MultiSelect.prototype.updateMainList = function (state, value, mainElement) {\n if (this.allowFiltering || this.mode === 'CheckBox') {\n var element2 = mainElement ? mainElement :\n this.findListElement(this.mainList, 'li', 'data-value', value);\n if (element2) {\n if (state) {\n element2.setAttribute('aria-selected', 'false');\n removeClass([element2], this.hideSelectedItem ?\n HIDE_LIST :\n dropDownBaseClasses.selected);\n if (this.mode === 'CheckBox') {\n element2.firstElementChild.setAttribute('aria-checked', 'false');\n removeClass([element2.firstElementChild.lastElementChild], 'e-check');\n }\n }\n else {\n element2.setAttribute('aria-selected', 'true');\n addClass([element2], this.hideSelectedItem ?\n HIDE_LIST :\n dropDownBaseClasses.selected);\n if (this.mode === 'CheckBox') {\n element2.firstElementChild.setAttribute('aria-checked', 'true');\n addClass([element2.firstElementChild.lastElementChild], 'e-check');\n }\n }\n }\n }\n };\n MultiSelect.prototype.removeChip = function (value) {\n if (this.chipCollectionWrapper) {\n var element = this.findListElement(this.chipCollectionWrapper, 'span', 'data-value', value);\n if (element) {\n remove(element);\n }\n }\n };\n MultiSelect.prototype.setWidth = function (width) {\n if (!isNullOrUndefined(width)) {\n if (typeof width === 'number') {\n this.overAllWrapper.style.width = formatUnit(width);\n }\n else if (typeof width === 'string') {\n this.overAllWrapper.style.width = (width.match(/px|%|em/)) ? (width) : (formatUnit(width));\n }\n }\n };\n MultiSelect.prototype.updateChipStatus = function () {\n if (this.value && this.value.length) {\n if (!isNullOrUndefined(this.chipCollectionWrapper)) {\n (this.chipCollectionWrapper.style.display = '');\n }\n if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {\n this.showDelimWrapper();\n }\n this.showOverAllClear();\n }\n else {\n if (!isNullOrUndefined(this.chipCollectionWrapper)) {\n this.chipCollectionWrapper.style.display = 'none';\n }\n if (!isNullOrUndefined(this.delimiterWrapper)) {\n (this.delimiterWrapper.style.display = 'none');\n }\n this.hideOverAllClear();\n }\n };\n MultiSelect.prototype.addValue = function (value, text, eve) {\n if (!this.value) {\n this.value = [];\n }\n if (this.value.indexOf(value) < 0) {\n this.setProperties({ value: [].concat([], this.value, [value]) }, true);\n }\n var element = this.findListElement(this.list, 'li', 'data-value', value);\n this.removeFocus();\n if (element) {\n this.addListFocus(element);\n this.addListSelection(element);\n }\n if (this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {\n this.addChip(text, value, eve);\n }\n if (this.hideSelectedItem && this.fields.groupBy) {\n this.hideGroupItem(value);\n }\n this.updateChipStatus();\n this.checkMaxSelection();\n };\n MultiSelect.prototype.checkMaxSelection = function () {\n var limit = this.value && this.value.length ? this.value.length : 0;\n if (limit === this.maximumSelectionLength) {\n var collection = this.list.querySelectorAll('li.'\n + dropDownBaseClasses.li + ':not(.e-active)');\n addClass(collection, 'e-disable');\n }\n };\n MultiSelect.prototype.dispatchSelect = function (value, eve, element, isNotTrigger, length) {\n var _this = this;\n var list = this.listData;\n if (this.initStatus && !isNotTrigger) {\n var val_2 = this.getDataByValue(value);\n var eventArgs = {\n e: eve,\n item: element,\n itemData: val_2,\n isInteracted: eve ? true : false,\n cancel: false\n };\n this.trigger('select', eventArgs, function (eventArgs) {\n if (!eventArgs.cancel) {\n if (length) {\n _this.selectAllEventData.push(val_2);\n _this.selectAllEventEle.push(element);\n }\n if (length === 1) {\n var args = {\n event: eve,\n items: _this.selectAllEventEle,\n itemData: _this.selectAllEventData,\n isInteracted: eve ? true : false,\n isChecked: true\n };\n _this.trigger('selectedAll', args);\n _this.selectAllEventData = [];\n }\n if (_this.allowCustomValue && _this.isServerRendered && _this.listData !== list) {\n _this.listData = list;\n }\n _this.updateListSelectEventCallback(value, element, eve);\n if (_this.hideSelectedItem && _this.fixedHeaderElement && _this.fields.groupBy && _this.mode !== 'CheckBox') {\n _super.prototype.scrollStop.call(_this);\n }\n }\n });\n }\n };\n MultiSelect.prototype.addChip = function (text, value, e) {\n if (this.chipCollectionWrapper) {\n this.getChip(text, value, e);\n }\n };\n MultiSelect.prototype.removeChipFocus = function () {\n var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP);\n var closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE.split(' ')[0]);\n removeClass(elements, CHIP_SELECTED);\n if (Browser.isDevice) {\n for (var index = 0; index < closeElements.length; index++) {\n closeElements[index].style.display = 'none';\n }\n }\n };\n MultiSelect.prototype.onMobileChipInteraction = function (e) {\n var chipElem = closest(e.target, '.' + CHIP);\n var chipClose = chipElem.querySelector('span.' + CHIP_CLOSE.split(' ')[0]);\n if (this.enabled && !this.readonly) {\n if (!chipElem.classList.contains(CHIP_SELECTED)) {\n this.removeChipFocus();\n chipClose.style.display = '';\n chipElem.classList.add(CHIP_SELECTED);\n }\n this.refreshPopup();\n e.preventDefault();\n }\n };\n MultiSelect.prototype.multiCompiler = function (multiselectTemplate) {\n var checkTemplate = false;\n if (multiselectTemplate) {\n try {\n checkTemplate = (selectAll(multiselectTemplate, document).length) ? true : false;\n }\n catch (exception) {\n checkTemplate = false;\n }\n }\n return checkTemplate;\n };\n MultiSelect.prototype.getChip = function (data, value, e) {\n var _this = this;\n var itemData = { text: value, value: value };\n var chip = this.createElement('span', {\n className: CHIP,\n attrs: { 'data-value': value, 'title': data }\n });\n var compiledString;\n var chipContent = this.createElement('span', { className: CHIP_CONTENT });\n var chipClose = this.createElement('span', { className: CHIP_CLOSE });\n if (this.mainData) {\n itemData = this.getDataByValue(value);\n }\n if (this.valueTemplate && !isNullOrUndefined(itemData)) {\n var valuecheck = this.multiCompiler(this.valueTemplate);\n if (valuecheck) {\n compiledString = compile(select(this.valueTemplate, document).innerHTML.trim());\n }\n else {\n compiledString = compile(this.valueTemplate);\n }\n // eslint-disable-next-line\n var valueCompTemp = compiledString(itemData, this, 'valueTemplate', this.valueTemplateId, this.isStringTemplate, null, chipContent);\n if (valueCompTemp && valueCompTemp.length > 0) {\n for (var i = 0; i < valueCompTemp.length; i++) {\n chipContent.appendChild(valueCompTemp[i]);\n }\n }\n this.renderReactTemplates();\n }\n else if (this.enableHtmlSanitizer) {\n chipContent.innerText = data;\n }\n else {\n chipContent.innerHTML = data;\n }\n chip.appendChild(chipContent);\n var eventArgs = {\n isInteracted: e ? true : false,\n itemData: itemData,\n e: e,\n setClass: function (classes) {\n addClass([chip], classes);\n },\n cancel: false\n };\n this.isPreventChange = this.isAngular && this.preventChange;\n this.trigger('tagging', eventArgs, function (eventArgs) {\n if (!eventArgs.cancel) {\n if (Browser.isDevice) {\n chip.classList.add(MOBILE_CHIP);\n append([chipClose], chip);\n chipClose.style.display = 'none';\n EventHandler.add(chip, 'click', _this.onMobileChipInteraction, _this);\n }\n else {\n EventHandler.add(chip, 'mousedown', _this.chipClick, _this);\n if (_this.showClearButton) {\n chip.appendChild(chipClose);\n }\n }\n EventHandler.add(chipClose, 'mousedown', _this.onChipRemove, _this);\n _this.chipCollectionWrapper.appendChild(chip);\n if (!_this.changeOnBlur && e) {\n _this.updateValueState(e, _this.value, _this.tempValues);\n }\n }\n });\n };\n MultiSelect.prototype.calcPopupWidth = function () {\n var width = formatUnit(this.popupWidth);\n if (width.indexOf('%') > -1) {\n var inputWidth = (this.componentWrapper.offsetWidth) * parseFloat(width) / 100;\n width = inputWidth.toString() + 'px';\n }\n return width;\n };\n MultiSelect.prototype.mouseIn = function () {\n if (this.enabled && !this.readonly) {\n this.showOverAllClear();\n }\n };\n MultiSelect.prototype.mouseOut = function () {\n if (!this.inputFocus) {\n this.overAllClear.style.display = 'none';\n }\n };\n MultiSelect.prototype.listOption = function (dataSource, fields) {\n var iconCss = isNullOrUndefined(fields.iconCss) ? false : true;\n var fieldProperty = isNullOrUndefined(fields.properties) ? fields :\n fields.properties;\n this.listCurrentOptions = (fields.text !== null || fields.value !== null) ? {\n fields: fieldProperty, showIcon: iconCss, ariaAttributes: { groupItemRole: 'presentation' }\n } : { fields: { value: 'text' } };\n extend(this.listCurrentOptions, this.listCurrentOptions, fields, true);\n if (this.mode === 'CheckBox') {\n this.notify('listoption', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', dataSource: dataSource, fieldProperty: fieldProperty });\n }\n return this.listCurrentOptions;\n };\n MultiSelect.prototype.renderPopup = function () {\n var _this = this;\n if (!this.list) {\n _super.prototype.render.call(this);\n }\n if (!this.popupObj) {\n document.body.appendChild(this.popupWrapper);\n var checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);\n if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {\n checkboxFilter.remove();\n this.filterParent = null;\n }\n var overAllHeight = parseInt(this.popupHeight, 10);\n this.popupWrapper.style.visibility = 'hidden';\n if (this.headerTemplate) {\n this.setHeaderTemplate();\n overAllHeight -= this.header.offsetHeight;\n }\n append([this.list], this.popupWrapper);\n if (this.footerTemplate) {\n this.setFooterTemplate();\n overAllHeight -= this.footer.offsetHeight;\n }\n if (this.mode === 'CheckBox' && this.showSelectAll) {\n this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });\n overAllHeight -= this.selectAllHeight;\n }\n else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {\n this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });\n overAllHeight = parseInt(this.popupHeight, 10);\n }\n else if (this.mode === 'CheckBox' && !this.showSelectAll) {\n this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });\n overAllHeight = parseInt(this.popupHeight, 10);\n if (this.headerTemplate && this.header) {\n overAllHeight -= this.header.offsetHeight;\n }\n if (this.footerTemplate && this.footer) {\n overAllHeight -= this.footer.offsetHeight;\n }\n }\n if (this.mode === 'CheckBox') {\n var args = {\n module: 'CheckBoxSelection',\n enable: this.mode === 'CheckBox',\n popupElement: this.popupWrapper\n };\n if (this.allowFiltering) {\n this.notify('searchBox', args);\n overAllHeight -= this.searchBoxHeight;\n }\n addClass([this.popupWrapper], 'e-checkbox');\n }\n if (this.popupHeight !== 'auto') {\n this.list.style.maxHeight = formatUnit(overAllHeight);\n this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);\n }\n else {\n this.list.style.maxHeight = formatUnit(this.popupHeight);\n }\n this.popupObj = new Popup(this.popupWrapper, {\n width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },\n relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,\n enableRtl: this.enableRtl, zIndex: this.zIndex,\n close: function () {\n if (_this.popupObj.element.parentElement) {\n _this.popupObj.unwireScrollEvents();\n // For restrict the page scrolling in safari browser\n var checkboxFilterInput = _this.popupWrapper.querySelector('.' + FILTERINPUT);\n if (_this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {\n checkboxFilterInput.blur();\n }\n detach(_this.popupObj.element);\n }\n },\n open: function () {\n _this.popupObj.resolveCollision();\n if (!_this.isFirstClick) {\n var ulElement = _this.list.querySelector('ul');\n if (ulElement) {\n if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&\n _this.targetElement().trim() !== '')) {\n _this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;\n }\n }\n _this.isFirstClick = true;\n }\n _this.popupObj.wireScrollEvents();\n if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&\n _this.targetElement().trim() !== '')) {\n _this.loadTemplate();\n }\n _this.setScrollPosition();\n if (_this.allowFiltering) {\n _this.notify('inputFocus', {\n module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'\n });\n }\n }, targetExitViewport: function () {\n if (!Browser.isDevice) {\n _this.hidePopup();\n }\n }\n });\n if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {\n this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });\n }\n this.popupObj.close();\n this.popupWrapper.style.visibility = '';\n }\n };\n MultiSelect.prototype.setHeaderTemplate = function () {\n var compiledString;\n if (this.header) {\n this.header.remove();\n }\n this.header = this.createElement('div');\n addClass([this.header], HEADER);\n var headercheck = this.multiCompiler(this.headerTemplate);\n if (headercheck) {\n compiledString = compile(select(this.headerTemplate, document).innerHTML.trim());\n }\n else {\n compiledString = compile(this.headerTemplate);\n }\n // eslint-disable-next-line\n var elements = compiledString({}, this, 'headerTemplate', this.headerTemplateId, this.isStringTemplate, null, this.header);\n if (elements && elements.length > 0) {\n for (var temp = 0; temp < elements.length; temp++) {\n this.header.appendChild(elements[temp]);\n }\n }\n if (this.mode === 'CheckBox' && this.showSelectAll) {\n prepend([this.header], this.popupWrapper);\n }\n else {\n append([this.header], this.popupWrapper);\n }\n EventHandler.add(this.header, 'mousedown', this.onListMouseDown, this);\n };\n MultiSelect.prototype.setFooterTemplate = function () {\n var compiledString;\n if (this.footer) {\n this.footer.remove();\n }\n this.footer = this.createElement('div');\n addClass([this.footer], FOOTER);\n var footercheck = this.multiCompiler(this.footerTemplate);\n if (footercheck) {\n compiledString = compile(select(this.footerTemplate, document).innerHTML.trim());\n }\n else {\n compiledString = compile(this.footerTemplate);\n }\n // eslint-disable-next-line\n var elements = compiledString({}, this, 'footerTemplate', this.footerTemplateId, this.isStringTemplate, null, this.footer);\n if (elements && elements.length > 0) {\n for (var temp = 0; temp < elements.length; temp++) {\n this.footer.appendChild(elements[temp]);\n }\n }\n append([this.footer], this.popupWrapper);\n EventHandler.add(this.footer, 'mousedown', this.onListMouseDown, this);\n };\n MultiSelect.prototype.clearAll = function (e) {\n if (this.enabled && !this.readonly) {\n var temp = void 0;\n if (this.value && this.value.length > 0) {\n var liElement = this.list && this.list.querySelectorAll('li.e-list-item');\n if (liElement && liElement.length > 0) {\n this.selectAllItems(false, e);\n }\n else {\n this.removeIndex = 0;\n for (temp = this.value[this.removeIndex]; this.removeIndex < this.value.length; temp = this.value[this.removeIndex]) {\n this.removeValue(temp, e, null, true);\n }\n }\n }\n else {\n this.clearAllCallback(e);\n }\n }\n };\n MultiSelect.prototype.clearAllCallback = function (e, isClearAll) {\n var tempValues = this.value ? this.value.slice() : [];\n if (this.mainList && this.listData && ((this.allowFiltering && this.mode !== 'CheckBox') || this.allowCustomValue)) {\n var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;\n this.onActionComplete(list, this.mainData);\n }\n this.focusAtFirstListItem();\n this.updateDelimeter(this.delimiterChar, e);\n if (this.mode !== 'Box' && (!this.inputFocus || this.mode === 'CheckBox')) {\n this.updateDelimView();\n }\n if (this.inputElement.value !== '') {\n this.makeTextBoxEmpty();\n this.search(null);\n }\n this.checkPlaceholderSize();\n if (this.isPopupOpen()) {\n this.refreshPopup();\n }\n if (!this.inputFocus) {\n if (this.changeOnBlur) {\n this.updateValueState(e, this.value, tempValues);\n }\n if (this.mode !== 'CheckBox') {\n this.inputElement.focus();\n }\n }\n if (this.mode === 'CheckBox') {\n this.refreshPlaceHolder();\n this.refreshInputHight();\n if (this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {\n this.updateValueState(e, this.value, this.tempValues);\n }\n }\n if (!this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {\n this.updateValueState(e, this.value, this.tempValues);\n }\n if (this.mode === 'CheckBox' && this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy)) {\n this.updateListItems(this.list.querySelectorAll('li.e-list-item'), this.mainList.querySelectorAll('li.e-list-item'));\n }\n e.preventDefault();\n };\n MultiSelect.prototype.windowResize = function () {\n this.refreshPopup();\n if ((!this.inputFocus || this.mode === 'CheckBox') && this.viewWrapper && this.viewWrapper.parentElement) {\n this.updateDelimView();\n }\n };\n MultiSelect.prototype.resetValueHandler = function (e) {\n var formElement = closest(this.inputElement, 'form');\n if (formElement && e.target === formElement) {\n var textVal = (this.element.tagName === this.getNgDirective()) ?\n null : this.element.getAttribute('data-initial-value');\n this.text = textVal;\n }\n };\n MultiSelect.prototype.wireEvent = function () {\n EventHandler.add(this.componentWrapper, 'mousedown', this.wrapperClick, this);\n EventHandler.add(window, 'resize', this.windowResize, this);\n EventHandler.add(this.inputElement, 'focus', this.focusInHandler, this);\n EventHandler.add(this.inputElement, 'keydown', this.onKeyDown, this);\n EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);\n if (this.mode !== 'CheckBox') {\n EventHandler.add(this.inputElement, 'input', this.onInput, this);\n }\n EventHandler.add(this.inputElement, 'blur', this.onBlurHandler, this);\n EventHandler.add(this.componentWrapper, 'mousemove', this.mouseIn, this);\n var formElement = closest(this.inputElement, 'form');\n if (formElement) {\n EventHandler.add(formElement, 'reset', this.resetValueHandler, this);\n }\n EventHandler.add(this.componentWrapper, 'mouseout', this.mouseOut, this);\n EventHandler.add(this.overAllClear, 'mouseup', this.clearAll, this);\n EventHandler.add(this.inputElement, 'paste', this.pasteHandler, this);\n };\n MultiSelect.prototype.onInput = function (e) {\n if (this.keyDownStatus) {\n this.isValidKey = true;\n }\n else {\n this.isValidKey = false;\n }\n this.keyDownStatus = false;\n // For Filtering works in mobile firefox\n if (Browser.isDevice && Browser.info.name === 'mozilla') {\n this.search(e);\n }\n };\n MultiSelect.prototype.pasteHandler = function (event) {\n var _this = this;\n setTimeout(function () {\n _this.expandTextbox();\n _this.search(event);\n });\n };\n MultiSelect.prototype.search = function (e) {\n var _this = this;\n if (!isNullOrUndefined(e)) {\n this.keyCode = e.keyCode;\n }\n if (!this.isPopupOpen() && this.openOnClick) {\n this.showPopup();\n }\n this.openClick(e);\n if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {\n this.focusAtFirstListItem();\n }\n else {\n var text = this.targetElement();\n if (this.allowFiltering) {\n var eventArgs_1 = {\n preventDefaultAction: false,\n text: this.targetElement(),\n updateData: function (dataSource, query, fields) {\n if (eventArgs_1.cancel) {\n return;\n }\n _this.isFiltered = true;\n _this.remoteFilterAction = true;\n _this.dataUpdater(dataSource, query, fields);\n },\n event: e,\n cancel: false\n };\n this.trigger('filtering', eventArgs_1, function (eventArgs) {\n if (!eventArgs.cancel) {\n if (!_this.isFiltered && !eventArgs.preventDefaultAction) {\n _this.filterAction = true;\n _this.dataUpdater(_this.dataSource, null, _this.fields);\n }\n }\n });\n }\n else if (this.allowCustomValue) {\n var query = new Query();\n query = (text !== '') ? query.where(this.fields.text, 'startswith', text, this.ignoreCase, this.ignoreAccent) : query;\n this.dataUpdater(this.mainData, query, this.fields);\n }\n else {\n var liCollections = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-hide-listitem)');\n var activeElement = Search(this.targetElement(), liCollections, 'StartsWith', this.ignoreCase);\n if (activeElement && activeElement.item !== null) {\n this.addListFocus(activeElement.item);\n this.list.scrollTop =\n activeElement.item.offsetHeight * activeElement.index;\n }\n else if (this.targetElement() !== '') {\n this.removeFocus();\n }\n else {\n this.focusAtFirstListItem();\n }\n }\n }\n };\n MultiSelect.prototype.preRender = function () {\n if (this.allowFiltering === null) {\n this.allowFiltering = (this.mode === 'CheckBox') ? true : false;\n }\n this.initializeData();\n this.updateDataAttribute(this.htmlAttributes);\n _super.prototype.preRender.call(this);\n };\n MultiSelect.prototype.getLocaleName = function () {\n return 'multi-select';\n };\n MultiSelect.prototype.initializeData = function () {\n this.mainListCollection = [];\n this.beforePopupOpen = false;\n this.filterAction = false;\n this.remoteFilterAction = false;\n this.isFirstClick = false;\n this.mobFilter = true;\n this.isFiltered = false;\n this.focused = true;\n this.initial = true;\n this.backCommand = true;\n };\n MultiSelect.prototype.updateData = function (delimiterChar, e) {\n var data = '';\n var delim = this.mode === 'Delimiter' || this.mode === 'CheckBox';\n var text = [];\n var temp;\n var tempData = this.listData;\n this.listData = this.mainData;\n this.hiddenElement.innerHTML = '';\n if (!isNullOrUndefined(this.value)) {\n for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {\n var listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);\n if (isNullOrUndefined(listValue) && !this.allowCustomValue) {\n this.value.splice(index, 1);\n index -= 1;\n }\n else {\n if (this.listData) {\n temp = this.getTextByValue(this.value[index]);\n }\n else {\n temp = this.value[index];\n }\n data += temp + delimiterChar + ' ';\n text.push(temp);\n }\n this.hiddenElement.innerHTML += '
';\n }\n }\n this.setProperties({ text: text.toString() }, true);\n if (delim) {\n this.updateWrapperText(this.delimiterWrapper, data);\n this.delimiterWrapper.setAttribute('id', getUniqueID('delim_val'));\n this.inputElement.setAttribute('aria-describedby', this.delimiterWrapper.id);\n this.inputElement.setAttribute('aria-labelledby', this.delimiterWrapper.id);\n }\n var targetEle = e && e.target;\n var isClearAll = (targetEle && targetEle.classList.contains('e-close-hooker')) ? true : null;\n if (!this.changeOnBlur && ((e && !isClearAll)) || this.isSelectAll) {\n this.isSelectAll = false;\n this.updateValueState(e, this.value, this.tempValues);\n }\n this.listData = tempData;\n this.addValidInputClass();\n };\n MultiSelect.prototype.initialTextUpdate = function () {\n if (!isNullOrUndefined(this.text)) {\n var textArr = this.text.split(this.delimiterChar);\n var textVal = [];\n for (var index = 0; textArr.length > index; index++) {\n var val = this.getValueByText(textArr[index]);\n if (!isNullOrUndefined(val)) {\n textVal.push(val);\n }\n else if (this.allowCustomValue) {\n textVal.push(textArr[index]);\n }\n }\n if (textVal && textVal.length) {\n this.setProperties({ value: textVal }, true);\n }\n }\n else {\n this.setProperties({ value: null }, true);\n }\n };\n MultiSelect.prototype.renderList = function (isEmptyData) {\n if (!isEmptyData && this.allowCustomValue && this.list && (this.list.textContent === this.noRecordsTemplate\n || this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {\n isEmptyData = true;\n }\n _super.prototype.render.call(this, isEmptyData);\n this.unwireListEvents();\n this.wireListEvents();\n };\n MultiSelect.prototype.initialValueUpdate = function () {\n if (this.list) {\n var text = void 0;\n var element = void 0;\n var value = void 0;\n if (this.chipCollectionWrapper) {\n this.chipCollectionWrapper.innerHTML = '';\n }\n this.removeListSelection();\n if (!isNullOrUndefined(this.value)) {\n for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {\n value = this.value[index];\n element = this.findListElement(this.hideSelectedItem ? this.ulElement : this.list, 'li', 'data-value', value);\n text = this.getTextByValue(value);\n if ((element && (element.getAttribute('aria-selected') !== 'true')) ||\n (element && (element.getAttribute('aria-selected') === 'true' && this.hideSelectedItem) &&\n (this.mode === 'Box' || this.mode === 'Default'))) {\n this.addChip(text, value);\n this.addListSelection(element);\n }\n else if (value && this.allowCustomValue) {\n var indexItem = this.listData.length;\n var newValue = {};\n setValue(this.fields.text, value, newValue);\n setValue(this.fields.value, value, newValue);\n var noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);\n this.addItem(newValue, indexItem);\n element = element ? element : this.findListElement(this.hideSelectedItem ? this.ulElement : this.list, 'li', 'data-value', value);\n if (this.popupWrapper.contains(noDataEle)) {\n this.list.setAttribute('style', noDataEle.getAttribute('style'));\n this.popupWrapper.replaceChild(this.list, noDataEle);\n this.wireListEvents();\n }\n this.addChip(text, value);\n this.addListSelection(element);\n }\n }\n }\n if (this.mode === 'CheckBox') {\n this.updateDelimView();\n if (this.changeOnBlur) {\n this.updateValueState(null, this.value, this.tempValues);\n }\n this.updateDelimeter(this.delimiterChar);\n this.refreshInputHight();\n }\n else {\n this.updateDelimeter(this.delimiterChar);\n }\n if (this.mode === 'CheckBox' && this.showSelectAll && (isNullOrUndefined(this.value) || !this.value.length)) {\n this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'uncheck' });\n }\n if (this.mode === 'Box' || (this.mode === 'Default' && this.inputFocus)) {\n this.chipCollectionWrapper.style.display = '';\n }\n else if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {\n this.showDelimWrapper();\n }\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n MultiSelect.prototype.updateActionCompleteData = function (li, item) {\n if (this.value && this.value.indexOf(li.getAttribute('data-value')) > -1) {\n this.mainList = this.ulElement;\n addClass([li], HIDE_LIST);\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n MultiSelect.prototype.updateAddItemList = function (list, itemCount) {\n if (this.popupObj && this.popupObj.element && this.popupObj.element.querySelector('.' + dropDownBaseClasses.noData) && list) {\n this.list = list;\n this.mainList = this.ulElement = list.querySelector('ul');\n remove(this.popupWrapper.querySelector('.e-content'));\n this.popupObj = null;\n this.renderPopup();\n }\n else if (this.allowCustomValue) {\n this.list = list;\n this.mainList = this.ulElement = list.querySelector('ul');\n }\n };\n MultiSelect.prototype.updateDataList = function () {\n if (this.mainList && this.ulElement && this.mainList.childElementCount < this.ulElement.childElementCount) {\n this.mainList = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;\n }\n };\n MultiSelect.prototype.isValidLI = function (li) {\n return (li && !li.classList.contains(dropDownBaseClasses.disabled) && !li.classList.contains(dropDownBaseClasses.group) &&\n li.classList.contains(dropDownBaseClasses.li));\n };\n MultiSelect.prototype.updateListSelection = function (li, e, length) {\n var customVal = li.getAttribute('data-value');\n var value = this.getFormattedValue(customVal);\n if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||\n (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {\n value = customVal;\n }\n this.removeHover();\n if (!this.value || this.value.indexOf(value) === -1) {\n this.dispatchSelect(value, e, li, (li.getAttribute('aria-selected') === 'true'), length);\n }\n else {\n this.removeValue(value, e, length);\n }\n };\n MultiSelect.prototype.updateListSelectEventCallback = function (value, li, e) {\n var _this = this;\n var text = this.getTextByValue(value);\n if ((this.allowCustomValue || this.allowFiltering) && !this.findListElement(this.mainList, 'li', 'data-value', value)) {\n var temp_1 = li.cloneNode(true);\n var fieldValue = this.fields.value ? this.fields.value : 'value';\n if (this.allowCustomValue && this.mainData.length && typeof getValue(fieldValue, this.mainData[0]) === 'number') {\n value = !isNaN(parseFloat(value.toString())) ? parseFloat(value.toString()) : value;\n }\n var data_1 = this.getDataByValue(value);\n var eventArgs = {\n newData: data_1,\n cancel: false\n };\n this.trigger('customValueSelection', eventArgs, function (eventArgs) {\n if (!eventArgs.cancel) {\n append([temp_1], _this.mainList);\n _this.mainData.push(data_1);\n _this.remoteCustomValue = false;\n _this.addValue(value, text, e);\n }\n });\n }\n else {\n this.remoteCustomValue = false;\n this.addValue(value, text, e);\n }\n };\n MultiSelect.prototype.removeListSelection = function () {\n var className = this.hideSelectedItem ?\n HIDE_LIST :\n dropDownBaseClasses.selected;\n var selectedItems = this.list.querySelectorAll('.' + className);\n var temp = selectedItems.length;\n if (selectedItems && selectedItems.length) {\n removeClass(selectedItems, className);\n while (temp > 0) {\n selectedItems[temp - 1].setAttribute('aria-selected', 'false');\n temp--;\n }\n }\n if (!isNullOrUndefined(this.mainList)) {\n var selectItems = this.mainList.querySelectorAll('.' + className);\n var temp1 = selectItems.length;\n if (selectItems && selectItems.length) {\n removeClass(selectItems, className);\n while (temp1 > 0) {\n selectItems[temp1 - 1].setAttribute('aria-selected', 'false');\n if (this.mode === 'CheckBox') {\n if (selectedItems && (selectedItems.length > (temp1 - 1))) {\n selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');\n removeClass([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');\n }\n selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');\n removeClass([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');\n }\n temp1--;\n }\n }\n }\n };\n MultiSelect.prototype.removeHover = function () {\n var hoveredItem = this.list.querySelectorAll('.' + dropDownBaseClasses.hover);\n if (hoveredItem && hoveredItem.length) {\n removeClass(hoveredItem, dropDownBaseClasses.hover);\n }\n };\n MultiSelect.prototype.removeFocus = function () {\n if (this.list && this.mainList) {\n var hoveredItem = this.list.querySelectorAll('.' + dropDownBaseClasses.focus);\n var mainlist = this.mainList.querySelectorAll('.' + dropDownBaseClasses.focus);\n if (hoveredItem && hoveredItem.length) {\n removeClass(hoveredItem, dropDownBaseClasses.focus);\n removeClass(mainlist, dropDownBaseClasses.focus);\n }\n }\n };\n MultiSelect.prototype.addListHover = function (li) {\n if (this.enabled && this.isValidLI(li)) {\n this.removeHover();\n addClass([li], dropDownBaseClasses.hover);\n }\n else {\n if ((li !== null && li.classList.contains('e-list-group-item')) && this.enableGroupCheckBox && this.mode === 'CheckBox'\n && !isNullOrUndefined(this.fields.groupBy)) {\n this.removeHover();\n addClass([li], dropDownBaseClasses.hover);\n }\n }\n };\n MultiSelect.prototype.addListFocus = function (element) {\n if (this.enabled && this.isValidLI(element)) {\n this.removeFocus();\n addClass([element], dropDownBaseClasses.focus);\n }\n else {\n if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {\n addClass([element], dropDownBaseClasses.focus);\n }\n }\n };\n MultiSelect.prototype.addListSelection = function (element, mainElement) {\n var className = this.hideSelectedItem ?\n HIDE_LIST :\n dropDownBaseClasses.selected;\n if (this.isValidLI(element) && !element.classList.contains(dropDownBaseClasses.hover)) {\n addClass([element], className);\n this.updateMainList(false, element.getAttribute('data-value'), mainElement);\n element.setAttribute('aria-selected', 'true');\n if (this.mode === 'CheckBox') {\n var ariaCheck = element.firstElementChild.getAttribute('aria-checked');\n if (ariaCheck === 'false' || isNullOrUndefined(ariaCheck)) {\n this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });\n }\n }\n this.notify('activeList', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });\n if (this.chipCollectionWrapper) {\n this.removeChipSelection();\n }\n attributes(this.inputElement, { 'aria-activedescendant': element.id });\n }\n };\n MultiSelect.prototype.updateDelimeter = function (delimChar, e) {\n this.updateData(delimChar, e);\n };\n MultiSelect.prototype.onMouseClick = function (e) {\n var _this = this;\n this.keyCode = null;\n this.scrollFocusStatus = false;\n var target = e.target;\n var li = closest(target, '.' + dropDownBaseClasses.li);\n var headerLi = closest(target, '.' + dropDownBaseClasses.group);\n if (headerLi && this.enableGroupCheckBox && this.mode === 'CheckBox' && this.fields.groupBy) {\n target = target.classList.contains('e-list-group-item') ? target.firstElementChild.lastElementChild\n : e.target;\n if (target.classList.contains('e-check')) {\n this.selectAllItem(false, e);\n target.classList.remove('e-check');\n target.classList.remove('e-stop');\n closest(target, '.' + 'e-list-group-item').classList.remove('e-active');\n target.setAttribute('aria-selected', 'false');\n }\n else {\n this.selectAllItem(true, e);\n target.classList.remove('e-stop');\n target.classList.add('e-check');\n closest(target, '.' + 'e-list-group-item').classList.add('e-active');\n target.setAttribute('aria-selected', 'true');\n }\n this.refreshSelection();\n this.checkSelectAll();\n }\n else {\n if (this.isValidLI(li)) {\n var limit = this.value && this.value.length ? this.value.length : 0;\n if (li.classList.contains('e-active')) {\n limit = limit - 1;\n }\n if (limit < this.maximumSelectionLength) {\n this.updateListSelection(li, e);\n this.checkPlaceholderSize();\n this.addListFocus(li);\n if ((this.allowCustomValue || this.allowFiltering) && this.mainList && this.listData) {\n if (this.mode !== 'CheckBox') {\n this.focusAtLastListItem(li.getAttribute('data-value'));\n this.refreshSelection();\n }\n }\n else {\n this.makeTextBoxEmpty();\n }\n }\n if (this.mode === 'CheckBox') {\n this.updateDelimView();\n if (this.value && this.value.length > 50) {\n setTimeout(function () {\n _this.updateDelimeter(_this.delimiterChar, e);\n }, 0);\n }\n else {\n this.updateDelimeter(this.delimiterChar, e);\n }\n this.refreshInputHight();\n }\n else {\n this.updateDelimeter(this.delimiterChar, e);\n }\n this.checkSelectAll();\n this.refreshPopup();\n if (this.hideSelectedItem) {\n this.focusAtFirstListItem();\n }\n if (this.closePopupOnSelect) {\n this.hidePopup();\n }\n else {\n e.preventDefault();\n }\n this.makeTextBoxEmpty();\n this.findGroupStart(target);\n if (this.mode !== 'CheckBox') {\n this.refreshListItems(isNullOrUndefined(li) ? null : li.textContent);\n }\n }\n else {\n e.preventDefault();\n }\n this.refreshPlaceHolder();\n this.deselectHeader();\n }\n };\n MultiSelect.prototype.findGroupStart = function (target) {\n if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {\n var count = 0;\n var liChecked = 0;\n var liUnchecked = 0;\n var groupValues = void 0;\n if (this.itemTemplate && !target.getElementsByClassName('e-frame').length) {\n while (!target.getElementsByClassName('e-frame').length) {\n target = target.parentElement;\n }\n }\n if (target.classList.contains('e-frame')) {\n target = target.parentElement.parentElement;\n }\n groupValues = this.findGroupAttrtibutes(target, liChecked, liUnchecked, count, 0);\n groupValues = this.findGroupAttrtibutes(target, groupValues[0], groupValues[1], groupValues[2], 1);\n while (!target.classList.contains('e-list-group-item')) {\n if (target.classList.contains('e-list-icon')) {\n target = target.parentElement;\n }\n target = target.previousElementSibling;\n if (target == null) {\n break;\n }\n }\n this.updateCheckBox(target, groupValues[0], groupValues[1], groupValues[2]);\n }\n };\n MultiSelect.prototype.findGroupAttrtibutes = function (listElement, checked, unChecked, count, position) {\n while (!listElement.classList.contains('e-list-group-item')) {\n if (listElement.classList.contains('e-list-icon')) {\n listElement = listElement.parentElement;\n }\n if (listElement.getElementsByClassName('e-frame')[0].classList.contains('e-check') &&\n listElement.classList.contains('e-list-item')) {\n checked++;\n }\n else if (listElement.classList.contains('e-list-item')) {\n unChecked++;\n }\n count++;\n listElement = position ? listElement.nextElementSibling : listElement.previousElementSibling;\n if (listElement == null) {\n break;\n }\n }\n return [checked, unChecked, count];\n };\n MultiSelect.prototype.updateCheckBox = function (groupHeader, checked, unChecked, count) {\n if (groupHeader === null) {\n return;\n }\n var checkBoxElement = groupHeader.getElementsByClassName('e-frame')[0];\n if (count === checked) {\n checkBoxElement.classList.remove('e-stop');\n checkBoxElement.classList.add('e-check');\n closest(checkBoxElement, '.' + 'e-list-group-item').classList.add('e-active');\n groupHeader.setAttribute('aria-selected', 'true');\n }\n else if (count === unChecked) {\n checkBoxElement.classList.remove('e-check');\n checkBoxElement.classList.remove('e-stop');\n closest(checkBoxElement, '.' + 'e-list-group-item').classList.remove('e-active');\n groupHeader.setAttribute('aria-selected', 'false');\n }\n else if (this.maximumSelectionLength === checked - 1) {\n checkBoxElement.classList.remove('e-stop');\n groupHeader.setAttribute('aria-selected', 'true');\n closest(checkBoxElement, '.' + 'e-list-group-item').classList.add('e-active');\n checkBoxElement.classList.add('e-check');\n }\n else {\n checkBoxElement.classList.remove('e-check');\n checkBoxElement.classList.add('e-stop');\n closest(checkBoxElement, '.' + 'e-list-group-item').classList.add('e-active');\n groupHeader.setAttribute('aria-selected', 'false');\n }\n };\n MultiSelect.prototype.deselectHeader = function () {\n var limit = this.value && this.value.length ? this.value.length : 0;\n var collection = this.list.querySelectorAll('li.e-list-group-item:not(.e-active)');\n if (limit < this.maximumSelectionLength) {\n removeClass(collection, 'e-disable');\n }\n if (limit === this.maximumSelectionLength) {\n addClass(collection, 'e-disable');\n }\n };\n MultiSelect.prototype.onMouseOver = function (e) {\n var currentLi = closest(e.target, '.' + dropDownBaseClasses.li);\n if (currentLi === null && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)\n && this.enableGroupCheckBox) {\n currentLi = closest(e.target, '.' + dropDownBaseClasses.group);\n }\n this.addListHover(currentLi);\n };\n MultiSelect.prototype.onMouseLeave = function () {\n this.removeHover();\n };\n MultiSelect.prototype.onListMouseDown = function (e) {\n e.preventDefault();\n this.scrollFocusStatus = true;\n };\n MultiSelect.prototype.onDocumentClick = function (e) {\n if (this.mode !== 'CheckBox') {\n var target = e.target;\n if (!(!isNullOrUndefined(this.popupObj) && closest(target, '[id=\"' + this.popupObj.element.id + '\"]')) &&\n !this.overAllWrapper.contains(e.target)) {\n this.scrollFocusStatus = false;\n }\n else {\n this.scrollFocusStatus = (Browser.isIE || Browser.info.name === 'edge') && (document.activeElement === this.inputElement);\n }\n }\n };\n MultiSelect.prototype.wireListEvents = function () {\n EventHandler.add(document, 'mousedown', this.onDocumentClick, this);\n EventHandler.add(this.list, 'mousedown', this.onListMouseDown, this);\n EventHandler.add(this.list, 'mouseup', this.onMouseClick, this);\n EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);\n EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);\n };\n MultiSelect.prototype.unwireListEvents = function () {\n EventHandler.remove(document, 'mousedown', this.onDocumentClick);\n if (this.list) {\n EventHandler.remove(this.list, 'mousedown', this.onListMouseDown);\n EventHandler.remove(this.list, 'mouseup', this.onMouseClick);\n EventHandler.remove(this.list, 'mouseover', this.onMouseOver);\n EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);\n }\n };\n MultiSelect.prototype.hideOverAllClear = function () {\n if (!this.value || !this.value.length || this.inputElement.value === '') {\n this.overAllClear.style.display = 'none';\n }\n };\n MultiSelect.prototype.showOverAllClear = function () {\n if (((this.value && this.value.length) || this.inputElement.value !== '') && this.showClearButton && this.readonly !== true) {\n this.overAllClear.style.display = '';\n }\n else {\n this.overAllClear.style.display = 'none';\n }\n };\n /**\n * Sets the focus to widget for interaction.\n *\n * @returns {void}\n */\n MultiSelect.prototype.focusIn = function () {\n if (document.activeElement !== this.inputElement && this.enabled) {\n this.inputElement.focus();\n }\n };\n /**\n * Remove the focus from widget, if the widget is in focus state.\n *\n * @returns {void}\n */\n MultiSelect.prototype.focusOut = function () {\n if (document.activeElement === this.inputElement && this.enabled) {\n this.inputElement.blur();\n }\n };\n /**\n * Shows the spinner loader.\n *\n * @returns {void}\n */\n MultiSelect.prototype.showSpinner = function () {\n if (isNullOrUndefined(this.spinnerElement)) {\n var filterClear = this.filterParent && this.filterParent.querySelector('.e-clear-icon.e-icons');\n if (this.overAllClear.style.display !== 'none' || filterClear) {\n this.spinnerElement = filterClear ? filterClear : this.overAllClear;\n }\n else {\n this.spinnerElement = this.createElement('span', { className: CLOSEICON_CLASS + ' ' + SPINNER_CLASS });\n this.componentWrapper.appendChild(this.spinnerElement);\n }\n createSpinner({ target: this.spinnerElement, width: Browser.isDevice ? '16px' : '14px' }, this.createElement);\n addClass([this.spinnerElement], DISABLE_ICON);\n showSpinner(this.spinnerElement);\n }\n };\n /**\n * Hides the spinner loader.\n *\n * @returns {void}\n */\n MultiSelect.prototype.hideSpinner = function () {\n if (!isNullOrUndefined(this.spinnerElement)) {\n hideSpinner(this.spinnerElement);\n removeClass([this.spinnerElement], DISABLE_ICON);\n if (this.spinnerElement.classList.contains(SPINNER_CLASS)) {\n detach(this.spinnerElement);\n }\n else {\n this.spinnerElement.innerHTML = '';\n }\n this.spinnerElement = null;\n }\n };\n MultiSelect.prototype.updateWrapperText = function (wrapperType, wrapperData) {\n if (this.valueTemplate || !this.enableHtmlSanitizer) {\n wrapperType.innerHTML = wrapperData;\n }\n else {\n wrapperType.innerText = SanitizeHtmlHelper.sanitize(wrapperData);\n }\n };\n MultiSelect.prototype.updateDelimView = function () {\n if (this.delimiterWrapper) {\n this.hideDelimWrapper();\n }\n if (this.chipCollectionWrapper) {\n this.chipCollectionWrapper.style.display = 'none';\n }\n this.viewWrapper.style.display = '';\n this.viewWrapper.style.width = '';\n this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER);\n if (this.value && this.value.length) {\n var data = '';\n var temp = void 0;\n var tempData = void 0;\n var tempIndex = 1;\n var wrapperleng = void 0;\n var remaining = void 0;\n var downIconWidth = 0;\n var overAllContainer = void 0;\n this.updateWrapperText(this.viewWrapper, data);\n var l10nLocale = {\n noRecordsTemplate: 'No records found',\n actionFailureTemplate: 'Request failed',\n overflowCountTemplate: '+${count} more..',\n totalCountTemplate: '${count} selected'\n };\n var l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);\n if (l10n.getConstant('actionFailureTemplate') === '') {\n l10n = new L10n('dropdowns', l10nLocale, this.locale);\n }\n if (l10n.getConstant('noRecordsTemplate') === '') {\n l10n = new L10n('dropdowns', l10nLocale, this.locale);\n }\n var remainContent = l10n.getConstant('overflowCountTemplate');\n var totalContent = l10n.getConstant('totalCountTemplate');\n var raminElement = this.createElement('span', {\n className: REMAIN_WRAPPER\n });\n var remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());\n raminElement.innerText = remainCompildTemp;\n this.viewWrapper.appendChild(raminElement);\n this.renderReactTemplates();\n var remainSize = raminElement.offsetWidth;\n remove(raminElement);\n if (this.showDropDownIcon) {\n downIconWidth = this.dropIcon.offsetWidth + parseInt(window.getComputedStyle(this.dropIcon).marginRight, 10);\n }\n this.checkClearIconWidth();\n if (!isNullOrUndefined(this.value)) {\n for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {\n data += (index === 0) ? '' : this.delimiterChar + ' ';\n temp = this.getOverflowVal(index);\n data += temp;\n temp = this.viewWrapper.innerHTML;\n this.updateWrapperText(this.viewWrapper, data);\n wrapperleng = this.viewWrapper.offsetWidth +\n parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);\n overAllContainer = this.componentWrapper.offsetWidth -\n parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -\n parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);\n if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {\n if (tempData !== undefined && tempData !== '') {\n temp = tempData;\n index = tempIndex + 1;\n }\n this.updateWrapperText(this.viewWrapper, temp);\n remaining = this.value.length - index;\n wrapperleng = this.viewWrapper.offsetWidth +\n parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);\n while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) > overAllContainer) && wrapperleng !== 0\n && this.viewWrapper.innerHTML !== '') {\n var textArr = [];\n this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);\n remaining = this.value.length;\n wrapperleng = this.viewWrapper.offsetWidth +\n parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);\n }\n break;\n }\n else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {\n tempData = data;\n tempIndex = index;\n }\n else if (index === 0) {\n tempData = '';\n tempIndex = -1;\n }\n }\n }\n if (remaining > 0) {\n var totalWidth = overAllContainer - downIconWidth - this.clearIconWidth;\n this.viewWrapper.appendChild(this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, remainContent, totalContent, totalWidth));\n this.updateRemainWidth(this.viewWrapper, totalWidth);\n this.updateRemainingText(raminElement, downIconWidth, remaining, remainContent, totalContent);\n }\n }\n else {\n this.viewWrapper.innerHTML = '';\n this.viewWrapper.style.display = 'none';\n }\n };\n MultiSelect.prototype.checkClearIconWidth = function () {\n if (this.showClearButton) {\n this.clearIconWidth = this.overAllClear.offsetWidth;\n }\n };\n MultiSelect.prototype.updateRemainWidth = function (viewWrapper, totalWidth) {\n if (viewWrapper.classList.contains(TOTAL_COUNT_WRAPPER) && totalWidth < (viewWrapper.offsetWidth +\n parseInt(window.getComputedStyle(viewWrapper).paddingLeft, 10)\n + parseInt(window.getComputedStyle(viewWrapper).paddingLeft, 10))) {\n viewWrapper.style.width = totalWidth + 'px';\n }\n };\n MultiSelect.prototype.updateRemainTemplate = function (raminElement, viewWrapper, remaining, remainContent, totalContent, totalWidth) {\n if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3 && viewWrapper.firstChild.nodeValue === '') {\n viewWrapper.removeChild(viewWrapper.firstChild);\n }\n raminElement.innerHTML = '';\n var remainTemp = remainContent.replace('${count}', remaining.toString());\n var totalTemp = totalContent.replace('${count}', remaining.toString());\n raminElement.innerText = (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ? remainTemp : totalTemp;\n if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) {\n viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER);\n }\n else {\n viewWrapper.classList.add(TOTAL_COUNT_WRAPPER);\n this.updateRemainWidth(viewWrapper, totalWidth);\n }\n return raminElement;\n };\n MultiSelect.prototype.updateRemainingText = function (raminElement, downIconWidth, remaining, remainContent, totalContent) {\n var overAllContainer = this.componentWrapper.offsetWidth -\n parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -\n parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);\n var wrapperleng = this.viewWrapper.offsetWidth + parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);\n if (((wrapperleng + downIconWidth) >= overAllContainer) && wrapperleng !== 0 && this.viewWrapper.firstChild &&\n this.viewWrapper.firstChild.nodeType === 3) {\n while (((wrapperleng + downIconWidth) > overAllContainer) && wrapperleng !== 0 && this.viewWrapper.firstChild &&\n this.viewWrapper.firstChild.nodeType === 3) {\n var textArr = this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);\n textArr.pop();\n this.viewWrapper.firstChild.nodeValue = textArr.join(this.delimiterChar);\n if (this.viewWrapper.firstChild.nodeValue === '') {\n this.viewWrapper.removeChild(this.viewWrapper.firstChild);\n }\n remaining++;\n wrapperleng = this.viewWrapper.offsetWidth;\n }\n var totalWidth = overAllContainer - downIconWidth;\n this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, remainContent, totalContent, totalWidth);\n }\n };\n MultiSelect.prototype.getOverflowVal = function (index) {\n var temp;\n if (this.mainData && this.mainData.length) {\n if (this.mode === 'CheckBox') {\n var newTemp = this.listData;\n this.listData = this.mainData;\n temp = this.getTextByValue(this.value[index]);\n this.listData = newTemp;\n }\n else {\n temp = this.getTextByValue(this.value[index]);\n }\n }\n else {\n temp = this.value[index];\n }\n return temp;\n };\n MultiSelect.prototype.unWireEvent = function () {\n EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);\n EventHandler.remove(window, 'resize', this.windowResize);\n EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);\n EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);\n if (this.mode !== 'CheckBox') {\n EventHandler.remove(this.inputElement, 'input', this.onInput);\n }\n EventHandler.remove(this.inputElement, 'keyup', this.keyUp);\n var formElement = closest(this.inputElement, 'form');\n if (formElement) {\n EventHandler.remove(formElement, 'reset', this.resetValueHandler);\n }\n EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);\n EventHandler.remove(this.componentWrapper, 'mousemove', this.mouseIn);\n EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);\n EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);\n EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);\n };\n MultiSelect.prototype.selectAllItem = function (state, event, list) {\n var li;\n li = this.list.querySelectorAll(state ?\n 'li.e-list-item:not([aria-selected=\"true\"]):not(.e-reorder-hide)' :\n 'li.e-list-item[aria-selected=\"true\"]:not(.e-reorder-hide)');\n if (this.value && this.value.length && event && event.target\n && closest(event.target, '.e-close-hooker') && this.allowFiltering) {\n li = this.mainList.querySelectorAll(state ?\n 'li.e-list-item:not([aria-selected=\"true\"]):not(.e-reorder-hide)' :\n 'li.e-list-item[aria-selected=\"true\"]:not(.e-reorder-hide)');\n }\n if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {\n var target = (event ? event.target : null);\n target = (event && event.keyCode === 32) ? list : target;\n target = (target && target.classList.contains('e-frame')) ? target.parentElement.parentElement : target;\n if (target && target.classList.contains('e-list-group-item')) {\n var listElement = target.nextElementSibling;\n if (isNullOrUndefined(listElement)) {\n return;\n }\n while (listElement.classList.contains('e-list-item')) {\n if (state) {\n if (!listElement.firstElementChild.lastElementChild.classList.contains('e-check')) {\n var selectionLimit = this.value && this.value.length ? this.value.length : 0;\n if (listElement.classList.contains('e-active')) {\n selectionLimit -= 1;\n }\n if (selectionLimit < this.maximumSelectionLength) {\n this.updateListSelection(listElement, event);\n }\n }\n }\n else {\n if (listElement.firstElementChild.lastElementChild.classList.contains('e-check')) {\n this.updateListSelection(listElement, event);\n }\n }\n listElement = listElement.nextElementSibling;\n if (listElement == null) {\n break;\n }\n }\n if (target.classList.contains('e-list-group-item')) {\n var focusedElement = this.list.getElementsByClassName('e-item-focus')[0];\n if (focusedElement) {\n focusedElement.classList.remove('e-item-focus');\n }\n if (state) {\n target.classList.add('e-active');\n }\n else {\n target.classList.remove('e-active');\n }\n target.classList.add('e-item-focus');\n }\n this.textboxValueUpdate();\n this.checkPlaceholderSize();\n if (!this.changeOnBlur && event) {\n this.updateValueState(event, this.value, this.tempValues);\n }\n }\n else {\n this.updateValue(event, li, state);\n }\n }\n else {\n this.updateValue(event, li, state);\n }\n };\n MultiSelect.prototype.updateValue = function (event, li, state) {\n var _this = this;\n var length = li.length;\n var beforeSelectArgs = {\n event: event,\n items: state ? li : [],\n itemData: state ? this.listData : [],\n isInteracted: event ? true : false,\n isChecked: state,\n preventSelectEvent: false\n };\n this.trigger('beforeSelectAll', beforeSelectArgs);\n if (li && li.length) {\n var index_1 = 0;\n var count_1 = 0;\n if (this.enableGroupCheckBox) {\n count_1 = state ? this.maximumSelectionLength - (this.value ? this.value.length : 0) : li.length;\n }\n else {\n count_1 = state ? this.maximumSelectionLength - (this.value ? this.value.length : 0) : this.maximumSelectionLength;\n }\n if (!beforeSelectArgs.preventSelectEvent) {\n while (index_1 < length && index_1 <= 50 && index_1 < count_1) {\n this.updateListSelection(li[index_1], event, length - index_1);\n if (this.enableGroupCheckBox) {\n this.findGroupStart(li[index_1]);\n }\n index_1++;\n }\n if (length > 50) {\n setTimeout(function () {\n while (index_1 < length && index_1 < count_1) {\n _this.updateListSelection(li[index_1], event, length - index_1);\n if (_this.enableGroupCheckBox) {\n _this.findGroupStart(li[index_1]);\n }\n index_1++;\n }\n _this.updatedataValueItems(event);\n if (!_this.changeOnBlur) {\n _this.updateValueState(event, _this.value, _this.tempValues);\n _this.isSelectAll = _this.isSelectAll ? !_this.isSelectAll : _this.isSelectAll;\n }\n _this.updateHiddenElement();\n }, 0);\n }\n }\n else {\n for (var i = 0; i < li.length && i < count_1; i++) {\n this.removeHover();\n var customVal = li[i].getAttribute('data-value');\n var value = this.getFormattedValue(customVal);\n var mainElement = this.mainList ? this.mainList.querySelectorAll(state ?\n 'li.e-list-item:not([aria-selected=\"true\"]):not(.e-reorder-hide)' :\n 'li.e-list-item[aria-selected=\"true\"]:not(.e-reorder-hide)')[i] : null;\n if (state) {\n this.value = !this.value ? [] : this.value;\n if (this.value.indexOf(value) < 0) {\n this.setProperties({ value: [].concat([], this.value, [value]) }, true);\n }\n this.removeFocus();\n this.addListSelection(li[i], mainElement);\n this.updateChipStatus();\n this.checkMaxSelection();\n }\n else {\n this.removeAllItems(value, event, false, li[i], mainElement);\n }\n if (this.enableGroupCheckBox) {\n this.findGroupStart(li[i]);\n }\n }\n if (!state) {\n var limit = this.value && this.value.length ? this.value.length : 0;\n if (limit < this.maximumSelectionLength) {\n var collection = this.list.querySelectorAll('li.'\n + dropDownBaseClasses.li + ':not(.e-active)');\n removeClass(collection, 'e-disable');\n }\n }\n var args = {\n event: event,\n items: state ? li : [],\n itemData: state ? this.listData : [],\n isInteracted: event ? true : false,\n isChecked: state\n };\n this.trigger('selectedAll', args);\n }\n }\n this.updatedataValueItems(event);\n this.checkPlaceholderSize();\n if (length <= 50 && !beforeSelectArgs.preventSelectEvent) {\n if (!this.changeOnBlur) {\n this.updateValueState(event, this.value, this.tempValues);\n this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;\n }\n this.updateHiddenElement();\n }\n };\n MultiSelect.prototype.updateHiddenElement = function () {\n var _this = this;\n var hiddenValue = '';\n var wrapperText = '';\n var data = '';\n var text = [];\n if (this.mode === 'CheckBox') {\n this.value.map(function (value, index) {\n hiddenValue += '
';\n if (_this.listData) {\n data = _this.getTextByValue(value);\n }\n else {\n data = value;\n }\n wrapperText += data + _this.delimiterChar + ' ';\n text.push(data);\n });\n this.hiddenElement.innerHTML = hiddenValue;\n this.updateWrapperText(this.delimiterWrapper, wrapperText);\n this.delimiterWrapper.setAttribute('id', getUniqueID('delim_val'));\n this.inputElement.setAttribute('aria-describedby', this.delimiterWrapper.id);\n this.inputElement.setAttribute('aria-labelledby', this.delimiterWrapper.id);\n this.setProperties({ text: text.toString() }, true);\n this.refreshInputHight();\n this.refreshPlaceHolder();\n }\n };\n MultiSelect.prototype.updatedataValueItems = function (event) {\n this.deselectHeader();\n this.textboxValueUpdate(event);\n };\n MultiSelect.prototype.textboxValueUpdate = function (event) {\n var isRemoveAll = event && event.target && (closest(event.target, '.e-selectall-parent')\n || closest(event.target, '.e-close-hooker'));\n if (this.mode !== 'Box' && !this.isPopupOpen() && !(this.mode === 'CheckBox' && (this.isSelectAll || isRemoveAll))) {\n this.updateDelimView();\n }\n else {\n this.searchWrapper.classList.remove(ZERO_SIZE);\n }\n if (this.mode === 'CheckBox') {\n this.updateDelimView();\n if (!(isRemoveAll || this.isSelectAll)) {\n this.updateDelimeter(this.delimiterChar, event);\n }\n this.refreshInputHight();\n }\n else {\n this.updateDelimeter(this.delimiterChar, event);\n }\n this.refreshPlaceHolder();\n };\n MultiSelect.prototype.setZIndex = function () {\n if (this.popupObj) {\n this.popupObj.setProperties({ 'zIndex': this.zIndex });\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n MultiSelect.prototype.updateDataSource = function (prop) {\n if (isNullOrUndefined(this.list)) {\n this.renderPopup();\n }\n else {\n this.resetList(this.dataSource);\n }\n if (this.value && this.value.length) {\n this.setProperties({ 'value': this.value });\n this.refreshSelection();\n }\n };\n MultiSelect.prototype.onLoadSelect = function () {\n this.setDynValue = true;\n this.renderPopup();\n };\n MultiSelect.prototype.selectAllItems = function (state, event) {\n var _this = this;\n if (isNullOrUndefined(this.list)) {\n this.selectAllAction = function () {\n if (_this.mode === 'CheckBox' && _this.showSelectAll) {\n var args = {\n module: 'CheckBoxSelection',\n enable: _this.mode === 'CheckBox',\n value: state ? 'check' : 'uncheck'\n };\n _this.notify('checkSelectAll', args);\n }\n _this.selectAllItem(state, event);\n _this.selectAllAction = null;\n };\n _super.prototype.render.call(this);\n }\n else {\n this.selectAllAction = null;\n if (this.mode === 'CheckBox' && this.showSelectAll) {\n var args = {\n value: state ? 'check' : 'uncheck',\n enable: this.mode === 'CheckBox',\n module: 'CheckBoxSelection'\n };\n this.notify('checkSelectAll', args);\n }\n this.selectAllItem(state, event);\n }\n };\n /**\n * Get the properties to be maintained in the persisted state.\n *\n * @returns {string} Returns the persisted data of the component.\n */\n MultiSelect.prototype.getPersistData = function () {\n return this.addOnPersist(['value']);\n };\n /**\n * Dynamically change the value of properties.\n *\n * @param {MultiSelectModel} newProp - Returns the dynamic property value of the component.\n * @param {MultiSelectModel} oldProp - Returns the previous property value of the component.\n * @private\n * @returns {void}\n */\n MultiSelect.prototype.onPropertyChanged = function (newProp, oldProp) {\n if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))\n || newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {\n this.mainList = null;\n this.mainData = null;\n this.isFirstClick = false;\n this.isDynamicDataChange = true;\n }\n if (this.getModuleName() === 'multiselect') {\n this.filterAction = false;\n this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);\n }\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'query':\n case 'dataSource':\n if (this.mode === 'CheckBox' && this.showSelectAll) {\n if (!isNullOrUndefined(this.popupObj)) {\n this.popupObj.destroy();\n this.popupObj = null;\n }\n this.renderPopup();\n }\n break;\n case 'htmlAttributes':\n this.updateHTMLAttribute();\n break;\n case 'showClearButton':\n this.updateClearButton(newProp.showClearButton);\n break;\n case 'text':\n this.updateVal(this.value, this.value, 'text');\n break;\n case 'value':\n this.updateVal(this.value, oldProp.value, 'value');\n this.addValidInputClass();\n if (!this.closePopupOnSelect && this.isPopupOpen()) {\n this.refreshPopup();\n }\n this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;\n break;\n case 'width':\n this.setWidth(newProp.width);\n this.popupObj.setProperties({ width: this.calcPopupWidth() });\n break;\n case 'placeholder':\n this.refreshPlaceHolder();\n break;\n case 'filterBarPlaceholder':\n if (this.allowFiltering) {\n this.notify('filterBarPlaceholder', { filterBarPlaceholder: newProp.filterBarPlaceholder });\n }\n break;\n case 'delimiterChar':\n if (this.mode !== 'Box') {\n this.updateDelimView();\n }\n this.updateData(newProp.delimiterChar);\n break;\n case 'cssClass':\n this.updateOldPropCssClass(oldProp.cssClass);\n this.updateCssClass();\n break;\n case 'enableRtl':\n this.enableRTL(newProp.enableRtl);\n _super.prototype.onPropertyChanged.call(this, newProp, oldProp);\n break;\n case 'readonly':\n this.updateReadonly(newProp.readonly);\n this.hidePopup();\n break;\n case 'enabled':\n this.hidePopup();\n this.enable(newProp.enabled);\n break;\n case 'showSelectAll':\n if (this.popupObj) {\n this.popupObj.destroy();\n this.popupObj = null;\n }\n this.renderPopup();\n break;\n case 'showDropDownIcon':\n this.dropDownIcon();\n break;\n case 'floatLabelType':\n this.setFloatLabelType();\n this.addValidInputClass();\n break;\n case 'enableSelectionOrder':\n break;\n case 'selectAllText':\n this.notify('selectAllText', false);\n break;\n case 'popupHeight':\n case 'headerTemplate':\n case 'footerTemplate':\n this.reInitializePoup();\n break;\n case 'allowFiltering':\n if (this.mode === 'CheckBox' && this.popupObj) {\n this.reInitializePoup();\n }\n this.updateSelectElementData(this.allowFiltering);\n break;\n default:\n {\n // eslint-disable-next-line max-len\n var msProps = this.getPropObject(prop, newProp, oldProp);\n _super.prototype.onPropertyChanged.call(this, msProps.newProperty, msProps.oldProperty);\n }\n break;\n }\n }\n };\n MultiSelect.prototype.reInitializePoup = function () {\n if (this.popupObj) {\n this.popupObj.destroy();\n this.popupObj = null;\n }\n this.renderPopup();\n };\n MultiSelect.prototype.updateVal = function (newProp, oldProp, prop) {\n if (!this.list) {\n this.onLoadSelect();\n }\n else if ((this.dataSource instanceof DataManager) && (!this.listData || !(this.mainList && this.mainData))) {\n this.onLoadSelect();\n }\n else {\n if (prop === 'text') {\n this.initialTextUpdate();\n newProp = this.value;\n }\n if (isNullOrUndefined(this.value) || this.value.length === 0) {\n this.tempValues = oldProp;\n }\n // eslint-disable-next-line\n if (this.allowCustomValue && (this.mode === 'Default' || this.mode === 'Box') && this.isReact && this.inputFocus\n && this.isPopupOpen() && this.mainData !== this.listData) {\n var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;\n this.onActionComplete(list, this.mainData);\n }\n this.initialValueUpdate();\n if (this.mode !== 'Box' && !this.inputFocus) {\n this.updateDelimView();\n }\n if (!this.inputFocus) {\n this.refreshInputHight();\n }\n this.refreshPlaceHolder();\n if (this.mode !== 'CheckBox' && this.changeOnBlur) {\n this.updateValueState(null, newProp, oldProp);\n }\n this.checkPlaceholderSize();\n }\n if (!this.changeOnBlur) {\n this.updateValueState(null, newProp, oldProp);\n }\n };\n /**\n * Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,\n * but you can insert based on the index parameter.\n *\n * @param { Object[] } items - Specifies an array of JSON data or a JSON data.\n * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.\n * @returns {void}\n */\n MultiSelect.prototype.addItem = function (items, itemIndex) {\n _super.prototype.addItem.call(this, items, itemIndex);\n };\n /**\n * Hides the popup, if the popup in a open state.\n *\n * @returns {void}\n */\n MultiSelect.prototype.hidePopup = function () {\n var _this = this;\n var delay = 100;\n if (this.isPopupOpen()) {\n var animModel = {\n name: 'FadeOut',\n duration: 100,\n delay: delay ? delay : 0\n };\n var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };\n this.trigger('close', eventArgs, function (eventArgs) {\n if (!eventArgs.cancel) {\n if (_this.fields.groupBy && _this.mode !== 'CheckBox' && _this.fixedHeaderElement) {\n remove(_this.fixedHeaderElement);\n _this.fixedHeaderElement = null;\n }\n _this.beforePopupOpen = false;\n _this.overAllWrapper.classList.remove(iconAnimation);\n _this.popupObj.hide(new Animation(eventArgs.animation));\n attributes(_this.inputElement, { 'aria-expanded': 'false' });\n if (_this.allowFiltering) {\n _this.notify('inputFocus', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'clear' });\n }\n _this.popupObj.hide();\n removeClass([document.body, _this.popupObj.element], 'e-popup-full-page');\n EventHandler.remove(_this.list, 'keydown', _this.onKeyDown);\n }\n });\n }\n };\n /**\n * Shows the popup, if the popup in a closed state.\n *\n * @returns {void}\n */\n MultiSelect.prototype.showPopup = function () {\n var _this = this;\n if (!this.enabled) {\n return;\n }\n var args = { cancel: false };\n this.trigger('beforeOpen', args, function (args) {\n if (!args.cancel) {\n if (!_this.ulElement) {\n _this.beforePopupOpen = true;\n _super.prototype.render.call(_this);\n if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering) {\n _this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });\n }\n return;\n }\n if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering) {\n _this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });\n }\n var mainLiLength = _this.ulElement.querySelectorAll('li.' + 'e-list-item').length;\n var liLength = _this.ulElement.querySelectorAll('li.'\n + dropDownBaseClasses.li + '.' + HIDE_LIST).length;\n if (mainLiLength > 0 && (mainLiLength === liLength) && (liLength === _this.mainData.length)) {\n _this.beforePopupOpen = false;\n return;\n }\n _this.onPopupShown();\n }\n });\n };\n /**\n * Based on the state parameter, entire list item will be selected/deselected.\n * parameter\n * `true` - Selects entire list items.\n * `false` - Un Selects entire list items.\n *\n * @param {boolean} state - if it’s true then Selects the entire list items. If it’s false the Unselects entire list items.\n * @returns {void}\n */\n MultiSelect.prototype.selectAll = function (state) {\n this.isSelectAll = true;\n this.selectAllItems(state);\n };\n /**\n * Return the module name of this component.\n *\n * @private\n * @returns {string} Return the module name of this component.\n */\n MultiSelect.prototype.getModuleName = function () {\n return 'multiselect';\n };\n /**\n * Allows you to clear the selected values from the Multiselect component.\n *\n * @returns {void}\n */\n MultiSelect.prototype.clear = function () {\n var _this = this;\n this.selectAll(false);\n if (this.value && this.value.length) {\n setTimeout(function () {\n _this.setProperties({ value: null }, true);\n }, 0);\n }\n else {\n this.setProperties({ value: null }, true);\n }\n };\n /**\n * To Initialize the control rendering\n *\n * @private\n * @returns {void}\n */\n MultiSelect.prototype.render = function () {\n this.setDynValue = this.initStatus = false;\n this.isSelectAll = false;\n this.searchWrapper = this.createElement('span', { className: SEARCHBOX_WRAPPER + ' ' + ((this.mode === 'Box') ? BOX_ELEMENT : '') });\n this.viewWrapper = this.createElement('span', { className: DELIMITER_VIEW + ' ' + DELIMITER_WRAPPER, styles: 'display:none;' });\n this.overAllClear = this.createElement('span', {\n className: CLOSEICON_CLASS, styles: 'display:none;'\n });\n this.componentWrapper = this.createElement('div', { className: ELEMENT_WRAPPER });\n this.overAllWrapper = this.createElement('div', { className: OVER_ALL_WRAPPER });\n if (this.mode === 'CheckBox') {\n addClass([this.overAllWrapper], 'e-checkbox');\n }\n if (Browser.isDevice) {\n this.componentWrapper.classList.add(ELEMENT_MOBILE_WRAPPER);\n }\n this.setWidth(this.width);\n this.overAllWrapper.appendChild(this.componentWrapper);\n this.popupWrapper = this.createElement('div', { id: this.element.id + '_popup', className: POPUP_WRAPPER });\n if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {\n this.delimiterWrapper = this.createElement('span', { className: DELIMITER_WRAPPER, styles: 'display:none' });\n this.componentWrapper.appendChild(this.delimiterWrapper);\n }\n else {\n this.chipCollectionWrapper = this.createElement('span', {\n className: CHIP_WRAPPER,\n styles: 'display:none'\n });\n if (this.mode === 'Default') {\n this.chipCollectionWrapper.setAttribute('id', getUniqueID('chip_default'));\n }\n else if (this.mode === 'Box') {\n this.chipCollectionWrapper.setAttribute('id', getUniqueID('chip_box'));\n }\n this.componentWrapper.appendChild(this.chipCollectionWrapper);\n }\n if (this.mode !== 'Box') {\n this.componentWrapper.appendChild(this.viewWrapper);\n }\n this.componentWrapper.appendChild(this.searchWrapper);\n if (this.showClearButton && !Browser.isDevice) {\n this.componentWrapper.appendChild(this.overAllClear);\n }\n else {\n this.componentWrapper.classList.add(CLOSE_ICON_HIDE);\n }\n this.dropDownIcon();\n this.inputElement = this.createElement('input', {\n className: INPUT_ELEMENT,\n attrs: {\n spellcheck: 'false',\n type: 'text',\n autocomplete: 'off',\n tabindex: '0'\n }\n });\n if (this.mode === 'Default' || this.mode === 'Box') {\n this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);\n this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);\n }\n if (this.element.tagName !== this.getNgDirective()) {\n this.element.style.display = 'none';\n }\n if (this.element.tagName === this.getNgDirective()) {\n this.element.appendChild(this.overAllWrapper);\n this.searchWrapper.appendChild(this.inputElement);\n }\n else {\n this.element.parentElement.insertBefore(this.overAllWrapper, this.element);\n this.searchWrapper.appendChild(this.inputElement);\n this.searchWrapper.appendChild(this.element);\n this.element.removeAttribute('tabindex');\n }\n if (this.floatLabelType !== 'Never') {\n createFloatLabel(this.overAllWrapper, this.searchWrapper, this.element, this.inputElement, this.value, this.floatLabelType, this.placeholder);\n }\n else if (this.floatLabelType === 'Never') {\n this.refreshPlaceHolder();\n }\n this.addValidInputClass();\n this.element.style.opacity = '';\n var id = this.element.getAttribute('id') ? this.element.getAttribute('id') : getUniqueID('ej2_dropdownlist');\n this.element.id = id;\n this.hiddenElement = this.createElement('select', {\n attrs: { 'aria-hidden': 'true', 'class': HIDDEN_ELEMENT, 'tabindex': '-1', 'multiple': '' }\n });\n this.componentWrapper.appendChild(this.hiddenElement);\n this.validationAttribute(this.element, this.hiddenElement);\n if (this.mode !== 'CheckBox') {\n this.hideOverAllClear();\n }\n this.wireEvent();\n this.enable(this.enabled);\n this.enableRTL(this.enableRtl);\n this.checkInitialValue();\n if (this.element.hasAttribute('data-val')) {\n this.element.setAttribute('data-val', 'false');\n }\n this.renderComplete();\n };\n MultiSelect.prototype.checkInitialValue = function () {\n var _this = this;\n var isData = this.dataSource instanceof Array ? (this.dataSource.length > 0)\n : !isNullOrUndefined(this.dataSource);\n if (!(this.value && this.value.length) &&\n isNullOrUndefined(this.text) &&\n !isData &&\n this.element.tagName === 'SELECT' &&\n this.element.options.length > 0) {\n var optionsElement = this.element.options;\n var valueCol = [];\n var textCol = '';\n for (var index = 0, optionsLen = optionsElement.length; index < optionsLen; index++) {\n var opt = optionsElement[index];\n if (!isNullOrUndefined(opt.getAttribute('selected'))) {\n if (opt.getAttribute('value')) {\n valueCol.push(opt.getAttribute('value'));\n }\n else {\n textCol += (opt.text + this.delimiterChar);\n }\n }\n }\n if (valueCol.length > 0) {\n this.setProperties({ value: valueCol }, true);\n }\n else if (textCol !== '') {\n this.setProperties({ text: textCol }, true);\n }\n if (valueCol.length > 0 || textCol !== '') {\n this.refreshInputHight();\n this.refreshPlaceHolder();\n }\n }\n if ((this.value && this.value.length) || !isNullOrUndefined(this.text)) {\n if (!this.list) {\n _super.prototype.render.call(this);\n }\n }\n if (!isNullOrUndefined(this.text) && (isNullOrUndefined(this.value) || this.value.length === 0)) {\n this.initialTextUpdate();\n }\n if (this.value && this.value.length) {\n if (!(this.dataSource instanceof DataManager)) {\n this.initialValueUpdate();\n this.initialUpdate();\n }\n else {\n this.setInitialValue = function () {\n _this.initStatus = false;\n _this.initialValueUpdate();\n _this.initialUpdate();\n _this.setInitialValue = null;\n _this.initStatus = true;\n };\n }\n this.updateTempValue();\n }\n else {\n this.initialUpdate();\n }\n this.initStatus = true;\n this.checkAutoFocus();\n if (!isNullOrUndefined(this.text)) {\n this.element.setAttribute('data-initial-value', this.text);\n }\n };\n MultiSelect.prototype.checkAutoFocus = function () {\n if (this.element.hasAttribute('autofocus')) {\n this.inputElement.focus();\n }\n };\n MultiSelect.prototype.setFloatLabelType = function () {\n removeFloating(this.overAllWrapper, this.componentWrapper, this.searchWrapper, this.inputElement, this.value, this.floatLabelType, this.placeholder);\n if (this.floatLabelType !== 'Never') {\n createFloatLabel(this.overAllWrapper, this.searchWrapper, this.element, this.inputElement, this.value, this.floatLabelType, this.placeholder);\n }\n };\n MultiSelect.prototype.addValidInputClass = function () {\n if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {\n addClass([this.overAllWrapper], 'e-valid-input');\n }\n else {\n removeClass([this.overAllWrapper], 'e-valid-input');\n }\n };\n MultiSelect.prototype.dropDownIcon = function () {\n if (this.showDropDownIcon) {\n this.dropIcon = this.createElement('span', { className: dropdownIcon });\n this.componentWrapper.appendChild(this.dropIcon);\n addClass([this.componentWrapper], ['e-down-icon']);\n }\n else {\n if (!isNullOrUndefined(this.dropIcon)) {\n this.dropIcon.parentElement.removeChild(this.dropIcon);\n removeClass([this.componentWrapper], ['e-down-icon']);\n }\n }\n };\n MultiSelect.prototype.initialUpdate = function () {\n if (this.mode !== 'Box' && !(this.setDynValue && this.mode === 'Default' && this.inputFocus)) {\n this.updateDelimView();\n }\n this.updateCssClass();\n this.updateHTMLAttribute();\n this.updateReadonly(this.readonly);\n this.refreshInputHight();\n this.checkPlaceholderSize();\n };\n /**\n * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.\n *\n * @method destroy\n * @returns {void}\n */\n MultiSelect.prototype.destroy = function () {\n // eslint-disable-next-line\n if (this.isReact) {\n this.clearTemplate();\n }\n if (this.popupObj) {\n this.popupObj.hide();\n }\n this.notify(destroy, {});\n this.unwireListEvents();\n this.unWireEvent();\n this.list = null;\n this.popupObj = null;\n this.mainList = null;\n this.mainData = null;\n this.filterParent = null;\n this.ulElement = null;\n _super.prototype.destroy.call(this);\n var temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];\n var length = temp.length;\n while (length > 0) {\n this.inputElement.removeAttribute(temp[length - 1]);\n length--;\n }\n this.element.removeAttribute('data-initial-value');\n this.element.style.display = 'block';\n if (this.overAllWrapper.parentElement) {\n if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {\n remove(this.overAllWrapper);\n }\n else {\n this.overAllWrapper.parentElement.insertBefore(this.element, this.overAllWrapper);\n remove(this.overAllWrapper);\n }\n }\n };\n __decorate([\n Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)\n ], MultiSelect.prototype, \"fields\", void 0);\n __decorate([\n Property(false)\n ], MultiSelect.prototype, \"enablePersistence\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"groupTemplate\", void 0);\n __decorate([\n Property('No records found')\n ], MultiSelect.prototype, \"noRecordsTemplate\", void 0);\n __decorate([\n Property('Request failed')\n ], MultiSelect.prototype, \"actionFailureTemplate\", void 0);\n __decorate([\n Property('None')\n ], MultiSelect.prototype, \"sortOrder\", void 0);\n __decorate([\n Property(true)\n ], MultiSelect.prototype, \"enabled\", void 0);\n __decorate([\n Property(false)\n ], MultiSelect.prototype, \"enableHtmlSanitizer\", void 0);\n __decorate([\n Property([])\n ], MultiSelect.prototype, \"dataSource\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"query\", void 0);\n __decorate([\n Property('StartsWith')\n ], MultiSelect.prototype, \"filterType\", void 0);\n __decorate([\n Property(1000)\n ], MultiSelect.prototype, \"zIndex\", void 0);\n __decorate([\n Property(false)\n ], MultiSelect.prototype, \"ignoreAccent\", void 0);\n __decorate([\n Property()\n ], MultiSelect.prototype, \"locale\", void 0);\n __decorate([\n Property(false)\n ], MultiSelect.prototype, \"enableGroupCheckBox\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"cssClass\", void 0);\n __decorate([\n Property('100%')\n ], MultiSelect.prototype, \"width\", void 0);\n __decorate([\n Property('300px')\n ], MultiSelect.prototype, \"popupHeight\", void 0);\n __decorate([\n Property('100%')\n ], MultiSelect.prototype, \"popupWidth\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"placeholder\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"filterBarPlaceholder\", void 0);\n __decorate([\n Property({})\n ], MultiSelect.prototype, \"htmlAttributes\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"valueTemplate\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"headerTemplate\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"footerTemplate\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"itemTemplate\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"allowFiltering\", void 0);\n __decorate([\n Property(true)\n ], MultiSelect.prototype, \"changeOnBlur\", void 0);\n __decorate([\n Property(false)\n ], MultiSelect.prototype, \"allowCustomValue\", void 0);\n __decorate([\n Property(true)\n ], MultiSelect.prototype, \"showClearButton\", void 0);\n __decorate([\n Property(1000)\n ], MultiSelect.prototype, \"maximumSelectionLength\", void 0);\n __decorate([\n Property(false)\n ], MultiSelect.prototype, \"readonly\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"text\", void 0);\n __decorate([\n Property(null)\n ], MultiSelect.prototype, \"value\", void 0);\n __decorate([\n Property(true)\n ], MultiSelect.prototype, \"hideSelectedItem\", void 0);\n __decorate([\n Property(true)\n ], MultiSelect.prototype, \"closePopupOnSelect\", void 0);\n __decorate([\n Property('Default')\n ], MultiSelect.prototype, \"mode\", void 0);\n __decorate([\n Property(',')\n ], MultiSelect.prototype, \"delimiterChar\", void 0);\n __decorate([\n Property(true)\n ], MultiSelect.prototype, \"ignoreCase\", void 0);\n __decorate([\n Property(false)\n ], MultiSelect.prototype, \"showDropDownIcon\", void 0);\n __decorate([\n Property('Never')\n ], MultiSelect.prototype, \"floatLabelType\", void 0);\n __decorate([\n Property(false)\n ], MultiSelect.prototype, \"showSelectAll\", void 0);\n __decorate([\n Property('Select All')\n ], MultiSelect.prototype, \"selectAllText\", void 0);\n __decorate([\n Property('Unselect All')\n ], MultiSelect.prototype, \"unSelectAllText\", void 0);\n __decorate([\n Property(true)\n ], MultiSelect.prototype, \"enableSelectionOrder\", void 0);\n __decorate([\n Property(true)\n ], MultiSelect.prototype, \"openOnClick\", void 0);\n __decorate([\n Property(false)\n ], MultiSelect.prototype, \"addTagOnBlur\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"change\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"removing\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"removed\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"beforeSelectAll\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"selectedAll\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"beforeOpen\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"open\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"close\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"blur\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"focus\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"chipSelection\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"filtering\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"tagging\", void 0);\n __decorate([\n Event()\n ], MultiSelect.prototype, \"customValueSelection\", void 0);\n MultiSelect = __decorate([\n NotifyPropertyChanges\n ], MultiSelect);\n return MultiSelect;\n}(DropDownBase));\nexport { MultiSelect };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar ViewsDirective = /** @class */ (function (_super) {\n __extends(ViewsDirective, _super);\n function ViewsDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ViewsDirective.prototype.render = function () {\n return;\n };\n ViewsDirective.prototype.getTag = function () {\n return 'e-views';\n };\n ViewsDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], ViewsDirective);\n return ViewsDirective;\n}(vueImport));\nexport { ViewsDirective };\nexport var ViewsPlugin = {\n name: 'e-views',\n install: function (Vue) {\n Vue.component(ViewsPlugin.name, ViewsDirective);\n }\n};\n/**\n * `e-views` directive represent a view of the VueJS Schedule.\n * It must be contained in a Schedule component(`ejs-schedule`).\n * ```vue\n *
\n * \n * \n * \n * \n * \n * ```\n */\nvar ViewDirective = /** @class */ (function (_super) {\n __extends(ViewDirective, _super);\n function ViewDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ViewDirective.prototype.render = function () {\n return;\n };\n ViewDirective.prototype.getTag = function () {\n return 'e-view';\n };\n ViewDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], ViewDirective);\n return ViewDirective;\n}(vueImport));\nexport { ViewDirective };\nexport var ViewPlugin = {\n name: 'e-view',\n install: function (Vue) {\n Vue.component(ViewPlugin.name, ViewDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n///
\nimport { EventHandler, Property, Event, compile, KeyboardEvents, append, select } from '@syncfusion/ej2-base';\nimport { attributes, isNullOrUndefined, getUniqueID, formatUnit, isUndefined, getValue } from '@syncfusion/ej2-base';\nimport { Animation, Browser, NotifyPropertyChanges } from '@syncfusion/ej2-base';\nimport { addClass, removeClass, closest, prepend, detach, classList } from '@syncfusion/ej2-base';\nimport { Popup, isCollide, createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';\nimport { Input } from '@syncfusion/ej2-inputs';\nimport { incrementalSearch, resetIncrementalSearchValues } from '../common/incremental-search';\nimport { DropDownBase, dropDownBaseClasses } from '../drop-down-base/drop-down-base';\nimport { DataManager, Query, Predicate } from '@syncfusion/ej2-data';\n// don't use space in classnames\nexport var dropDownListClasses = {\n root: 'e-dropdownlist',\n hover: dropDownBaseClasses.hover,\n selected: dropDownBaseClasses.selected,\n rtl: dropDownBaseClasses.rtl,\n li: dropDownBaseClasses.li,\n disable: dropDownBaseClasses.disabled,\n base: dropDownBaseClasses.root,\n focus: dropDownBaseClasses.focus,\n input: 'e-input-group',\n inputFocus: 'e-input-focus',\n icon: 'e-input-group-icon e-ddl-icon',\n iconAnimation: 'e-icon-anim',\n value: 'e-input-value',\n device: 'e-ddl-device',\n backIcon: 'e-input-group-icon e-back-icon e-icons',\n filterBarClearIcon: 'e-input-group-icon e-clear-icon e-icons',\n filterInput: 'e-input-filter',\n filterParent: 'e-filter-parent',\n mobileFilter: 'e-ddl-device-filter',\n footer: 'e-ddl-footer',\n header: 'e-ddl-header',\n clearIcon: 'e-clear-icon',\n clearIconHide: 'e-clear-icon-hide',\n popupFullScreen: 'e-popup-full-page',\n disableIcon: 'e-ddl-disable-icon',\n hiddenElement: 'e-ddl-hidden'\n};\nvar inputObject = {\n container: null,\n buttons: []\n};\n/**\n * The DropDownList component contains a list of predefined values from which you can\n * choose a single value.\n * ```html\n *
\n * ```\n * ```typescript\n * let dropDownListObj:DropDownList = new DropDownList();\n * dropDownListObj.appendTo(\"#list\");\n * ```\n */\nvar DropDownList = /** @class */ (function (_super) {\n __extends(DropDownList, _super);\n /**\n * * Constructor for creating the DropDownList component.\n *\n * @param {DropDownListModel} options - Specifies the DropDownList model.\n * @param {string | HTMLElement} element - Specifies the element to render as component.\n * @private\n */\n function DropDownList(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.isListSearched = false;\n _this.preventChange = false;\n _this.isAngular = false;\n return _this;\n }\n /**\n * Initialize the event handler.\n *\n * @private\n * @returns {void}\n */\n DropDownList.prototype.preRender = function () {\n this.valueTempElement = null;\n this.element.style.opacity = '0';\n this.initializeData();\n _super.prototype.preRender.call(this);\n this.activeIndex = this.index;\n this.queryString = '';\n };\n DropDownList.prototype.initializeData = function () {\n this.isPopupOpen = false;\n this.isDocumentClick = false;\n this.isInteracted = false;\n this.isFilterFocus = false;\n this.beforePopupOpen = false;\n this.initial = true;\n this.initRemoteRender = false;\n this.isNotSearchList = false;\n this.isTyped = false;\n this.isSelected = false;\n this.preventFocus = false;\n this.preventAutoFill = false;\n this.isValidKey = false;\n this.typedString = '';\n this.isEscapeKey = false;\n this.isPreventBlur = false;\n this.isTabKey = false;\n this.actionCompleteData = { isUpdated: false };\n this.actionData = { isUpdated: false };\n this.prevSelectPoints = {};\n this.isSelectCustom = false;\n this.isDropDownClick = false;\n this.preventAltUp = false;\n this.isCustomFilter = false;\n this.isSecondClick = false;\n this.previousValue = null;\n this.keyConfigure = {\n tab: 'tab',\n enter: '13',\n escape: '27',\n end: '35',\n home: '36',\n down: '40',\n up: '38',\n pageUp: '33',\n pageDown: '34',\n open: 'alt+40',\n close: 'shift+tab',\n hide: 'alt+38',\n space: '32'\n };\n };\n DropDownList.prototype.setZIndex = function () {\n if (this.popupObj) {\n this.popupObj.setProperties({ 'zIndex': this.zIndex });\n }\n };\n DropDownList.prototype.renderList = function (isEmptyData) {\n _super.prototype.render.call(this, isEmptyData);\n this.unWireListEvents();\n this.wireListEvents();\n };\n DropDownList.prototype.floatLabelChange = function () {\n if (this.getModuleName() === 'dropdownlist' && this.floatLabelType === 'Auto') {\n var floatElement = this.inputWrapper.container.querySelector('.e-float-text');\n if (this.inputElement.value !== '' || this.isInteracted) {\n classList(floatElement, ['e-label-top'], ['e-label-bottom']);\n }\n else {\n classList(floatElement, ['e-label-bottom'], ['e-label-top']);\n }\n }\n };\n DropDownList.prototype.resetHandler = function (e) {\n e.preventDefault();\n this.clearAll(e);\n };\n DropDownList.prototype.resetFocusElement = function () {\n this.removeHover();\n this.removeSelection();\n this.removeFocus();\n this.list.scrollTop = 0;\n if (this.getModuleName() !== 'autocomplete' && !isNullOrUndefined(this.ulElement)) {\n var li = this.ulElement.querySelector('.' + dropDownListClasses.li);\n if (li) {\n li.classList.add(dropDownListClasses.focus);\n }\n }\n };\n DropDownList.prototype.clearAll = function (e, properties) {\n if (isNullOrUndefined(properties) || (!isNullOrUndefined(properties) &&\n (isNullOrUndefined(properties.dataSource) ||\n (!(properties.dataSource instanceof DataManager) && properties.dataSource.length === 0)))) {\n this.isActive = true;\n this.resetSelection(properties);\n }\n var dataItem = this.getItemData();\n if (this.previousValue === dataItem.value) {\n return;\n }\n this.onChangeEvent(e);\n };\n DropDownList.prototype.resetSelection = function (properties) {\n if (this.list) {\n if ((!isNullOrUndefined(properties) &&\n (isNullOrUndefined(properties.dataSource) ||\n (!(properties.dataSource instanceof DataManager) && properties.dataSource.length === 0)))) {\n this.selectedLI = null;\n this.actionCompleteData.isUpdated = false;\n this.actionCompleteData.ulElement = null;\n this.actionCompleteData.list = null;\n this.resetList(properties.dataSource);\n }\n else {\n if (this.allowFiltering && this.getModuleName() !== 'autocomplete'\n && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {\n this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(true), this.actionCompleteData.list);\n }\n this.resetFocusElement();\n }\n }\n this.hiddenElement.innerHTML = '';\n this.inputElement.value = '';\n this.value = null;\n this.itemData = null;\n this.text = null;\n this.index = null;\n this.activeIndex = null;\n this.item = null;\n this.queryString = '';\n if (this.valueTempElement) {\n detach(this.valueTempElement);\n this.inputElement.style.display = 'block';\n this.valueTempElement = null;\n }\n this.setSelection(null, null);\n this.isSelectCustom = false;\n this.updateIconState();\n this.cloneElements();\n };\n DropDownList.prototype.setHTMLAttributes = function () {\n if (Object.keys(this.htmlAttributes).length) {\n for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {\n var htmlAttr = _a[_i];\n if (htmlAttr === 'class') {\n var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\\s+/g, ' ')).trim();\n if (updatedClassValue !== '') {\n addClass([this.inputWrapper.container], updatedClassValue.split(' '));\n }\n }\n else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {\n this.enabled = false;\n this.setEnable();\n }\n else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {\n this.readonly = true;\n this.dataBind();\n }\n else if (htmlAttr === 'style') {\n this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);\n }\n else {\n var defaultAttr = ['title', 'id', 'placeholder', 'aria-placeholder',\n 'role', 'autocorrect', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];\n var validateAttr = ['name', 'required'];\n if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {\n defaultAttr.push('tabindex');\n }\n if (validateAttr.indexOf(htmlAttr) > -1 || htmlAttr.indexOf('data') === 0) {\n this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);\n }\n else if (defaultAttr.indexOf(htmlAttr) > -1) {\n if (htmlAttr === 'placeholder') {\n Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputElement);\n }\n else {\n this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);\n }\n }\n else {\n this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);\n }\n }\n }\n }\n if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {\n this.inputWrapper.container.removeAttribute('tabindex');\n }\n };\n DropDownList.prototype.getAriaAttributes = function () {\n return {\n 'aria-disabled': 'false',\n 'aria-owns': this.element.id + '_options',\n 'role': 'listbox',\n 'aria-haspopup': 'true',\n 'aria-expanded': 'false',\n 'aria-activedescendant': 'null',\n 'aria-live': 'polite',\n 'aria-labelledby': this.hiddenElement.id\n };\n };\n DropDownList.prototype.setEnableRtl = function () {\n Input.setEnableRtl(this.enableRtl, [this.inputElement.parentElement]);\n if (this.popupObj) {\n this.popupObj.enableRtl = this.enableRtl;\n this.popupObj.dataBind();\n }\n };\n DropDownList.prototype.setEnable = function () {\n Input.setEnabled(this.enabled, this.inputElement);\n if (this.enabled) {\n removeClass([this.inputWrapper.container], dropDownListClasses.disable);\n this.inputElement.setAttribute('aria-disabled', 'false');\n this.targetElement().setAttribute('tabindex', this.tabIndex);\n }\n else {\n this.hidePopup();\n addClass([this.inputWrapper.container], dropDownListClasses.disable);\n this.inputElement.setAttribute('aria-disabled', 'true');\n this.targetElement().tabIndex = -1;\n }\n };\n /**\n * Get the properties to be maintained in the persisted state.\n *\n * @returns {string} Returns the persisted data of the component.\n */\n DropDownList.prototype.getPersistData = function () {\n return this.addOnPersist(['value']);\n };\n DropDownList.prototype.getLocaleName = function () {\n return 'drop-down-list';\n };\n DropDownList.prototype.preventTabIndex = function (element) {\n if (this.getModuleName() === 'dropdownlist') {\n element.tabIndex = -1;\n }\n };\n DropDownList.prototype.targetElement = function () {\n return this.inputWrapper.container;\n };\n DropDownList.prototype.getNgDirective = function () {\n return 'EJS-DROPDOWNLIST';\n };\n DropDownList.prototype.getElementByText = function (text) {\n return this.getElementByValue(this.getValueByText(text));\n };\n DropDownList.prototype.getElementByValue = function (value) {\n var item;\n var listItems = this.getItems();\n for (var _i = 0, listItems_1 = listItems; _i < listItems_1.length; _i++) {\n var liItem = listItems_1[_i];\n if (this.getFormattedValue(liItem.getAttribute('data-value')) === value) {\n item = liItem;\n break;\n }\n }\n return item;\n };\n DropDownList.prototype.initValue = function () {\n this.renderList();\n if (this.dataSource instanceof DataManager) {\n this.initRemoteRender = true;\n }\n else {\n this.updateValues();\n }\n };\n DropDownList.prototype.updateValues = function () {\n if (!isNullOrUndefined(this.value)) {\n this.setSelection(this.getElementByValue(this.value), null);\n }\n else if (this.text && isNullOrUndefined(this.value)) {\n var element = this.getElementByText(this.text);\n if (isNullOrUndefined(element)) {\n this.setProperties({ text: null });\n return;\n }\n else {\n this.setSelection(element, null);\n }\n }\n else {\n this.setSelection(this.liCollections[this.activeIndex], null);\n }\n this.setHiddenValue();\n Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);\n };\n DropDownList.prototype.onBlurHandler = function (e) {\n if (!this.enabled) {\n return;\n }\n var target = e.relatedTarget;\n var currentTarget = e.target;\n var isPreventBlur = this.isPreventBlur;\n this.isPreventBlur = false;\n //IE 11 - issue\n if (isPreventBlur && !this.isDocumentClick && this.isPopupOpen && (!isNullOrUndefined(currentTarget) ||\n !this.isFilterLayout() && isNullOrUndefined(target))) {\n if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.isPopupOpen) {\n this.filterInput.focus();\n }\n else {\n this.targetElement().focus();\n }\n return;\n }\n if (this.isDocumentClick || (!isNullOrUndefined(this.popupObj)\n && document.body.contains(this.popupObj.element) &&\n this.popupObj.element.classList.contains(dropDownListClasses.mobileFilter))) {\n if (!this.beforePopupOpen) {\n this.isDocumentClick = false;\n }\n return;\n }\n if (((this.getModuleName() === 'dropdownlist' && !this.isFilterFocus && target !== this.inputElement)\n && (document.activeElement !== target || (document.activeElement === target &&\n currentTarget.classList.contains(dropDownListClasses.inputFocus)))) ||\n (isNullOrUndefined(target) && this.getModuleName() === 'dropdownlist' && this.allowFiltering &&\n currentTarget !== this.inputWrapper.container) || this.getModuleName() !== 'dropdownlist' &&\n !this.inputWrapper.container.contains(target) || this.isTabKey) {\n this.isDocumentClick = this.isPopupOpen ? true : false;\n this.focusOutAction(e);\n this.isTabKey = false;\n }\n if (this.isRequested && !this.isPopupOpen && !this.isPreventBlur) {\n this.isActive = false;\n this.beforePopupOpen = false;\n }\n };\n DropDownList.prototype.focusOutAction = function (e) {\n this.isInteracted = false;\n this.focusOut(e);\n this.onFocusOut();\n };\n DropDownList.prototype.onFocusOut = function () {\n if (!this.enabled) {\n return;\n }\n if (this.isSelected) {\n this.isSelectCustom = false;\n this.onChangeEvent(null);\n }\n this.floatLabelChange();\n this.dispatchEvent(this.hiddenElement, 'change');\n if (this.getModuleName() === 'dropdownlist' && this.element.tagName !== 'INPUT') {\n this.dispatchEvent(this.inputElement, 'blur');\n }\n if (this.inputWrapper.clearButton) {\n addClass([this.inputWrapper.clearButton], dropDownListClasses.clearIconHide);\n }\n this.trigger('blur');\n };\n DropDownList.prototype.onFocus = function (e) {\n if (!this.isInteracted) {\n this.isInteracted = true;\n var args = { isInteracted: e ? true : false, event: e };\n this.trigger('focus', args);\n }\n this.updateIconState();\n };\n DropDownList.prototype.resetValueHandler = function (e) {\n var formElement = closest(this.inputElement, 'form');\n if (formElement && e.target === formElement) {\n var val = (this.element.tagName === this.getNgDirective()) ? null : this.inputElement.getAttribute('value');\n this.text = val;\n }\n };\n DropDownList.prototype.wireEvent = function () {\n EventHandler.add(this.inputWrapper.container, 'mousedown', this.dropDownClick, this);\n EventHandler.add(this.inputWrapper.container, 'focus', this.focusIn, this);\n EventHandler.add(this.inputWrapper.container, 'keypress', this.onSearch, this);\n this.bindCommonEvent();\n };\n DropDownList.prototype.bindCommonEvent = function () {\n EventHandler.add(this.targetElement(), 'blur', this.onBlurHandler, this);\n var formElement = closest(this.inputElement, 'form');\n if (formElement) {\n EventHandler.add(formElement, 'reset', this.resetValueHandler, this);\n }\n if (!Browser.isDevice) {\n this.keyboardModule = new KeyboardEvents(this.targetElement(), {\n keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'\n });\n }\n else {\n this.keyboardModule = new KeyboardEvents(this.targetElement(), {\n keyAction: this.mobileKeyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'\n });\n }\n this.bindClearEvent();\n };\n DropDownList.prototype.bindClearEvent = function () {\n if (this.showClearButton) {\n EventHandler.add(this.inputWrapper.clearButton, 'mousedown', this.resetHandler, this);\n }\n };\n DropDownList.prototype.unBindCommonEvent = function () {\n if (this.targetElement()) {\n EventHandler.remove(this.targetElement(), 'blur', this.onBlurHandler);\n }\n var formElement = this.inputElement && closest(this.inputElement, 'form');\n if (formElement) {\n EventHandler.remove(formElement, 'reset', this.resetValueHandler);\n }\n if (!Browser.isDevice) {\n this.keyboardModule.destroy();\n }\n if (this.showClearButton) {\n EventHandler.remove(this.inputWrapper.clearButton, 'mousedown', this.resetHandler);\n }\n };\n DropDownList.prototype.updateIconState = function () {\n if (this.showClearButton) {\n if (this.inputElement.value !== '' && !this.readonly) {\n removeClass([this.inputWrapper.clearButton], dropDownListClasses.clearIconHide);\n }\n else {\n addClass([this.inputWrapper.clearButton], dropDownListClasses.clearIconHide);\n }\n }\n };\n /**\n * Event binding for list\n *\n * @returns {void}\n */\n DropDownList.prototype.wireListEvents = function () {\n EventHandler.add(this.list, 'click', this.onMouseClick, this);\n EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);\n EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);\n };\n DropDownList.prototype.onSearch = function (e) {\n if (e.charCode !== 32 && e.charCode !== 13) {\n if (this.list === undefined) {\n this.renderList();\n }\n this.searchKeyEvent = e;\n this.onServerIncrementalSearch(e);\n }\n };\n DropDownList.prototype.onServerIncrementalSearch = function (e) {\n if (!this.isRequested && !isNullOrUndefined(this.list) &&\n !isNullOrUndefined(this.list.querySelector('li')) && this.enabled && !this.readonly) {\n this.incrementalSearch(e);\n }\n };\n DropDownList.prototype.onMouseClick = function (e) {\n var target = e.target;\n var li = closest(target, '.' + dropDownBaseClasses.li);\n if (!this.isValidLI(li)) {\n return;\n }\n this.setSelection(li, e);\n if (Browser.isDevice && this.isFilterLayout()) {\n history.back();\n }\n else {\n var delay = 100;\n this.closePopup(delay);\n }\n };\n DropDownList.prototype.onMouseOver = function (e) {\n var currentLi = closest(e.target, '.' + dropDownBaseClasses.li);\n this.setHover(currentLi);\n };\n DropDownList.prototype.setHover = function (li) {\n if (this.enabled && this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {\n this.removeHover();\n addClass([li], dropDownBaseClasses.hover);\n }\n };\n DropDownList.prototype.onMouseLeave = function () {\n this.removeHover();\n };\n DropDownList.prototype.removeHover = function () {\n if (this.list) {\n var hoveredItem = this.list.querySelectorAll('.' + dropDownBaseClasses.hover);\n if (hoveredItem && hoveredItem.length) {\n removeClass(hoveredItem, dropDownBaseClasses.hover);\n }\n }\n };\n DropDownList.prototype.isValidLI = function (li) {\n return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');\n };\n DropDownList.prototype.incrementalSearch = function (e) {\n if (this.liCollections.length > 0) {\n var li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);\n if (!isNullOrUndefined(li)) {\n this.setSelection(li, e);\n this.setScrollPosition();\n }\n }\n };\n /**\n * Hides the spinner loader.\n *\n * @returns {void}\n */\n DropDownList.prototype.hideSpinner = function () {\n if (!isNullOrUndefined(this.spinnerElement)) {\n hideSpinner(this.spinnerElement);\n removeClass([this.spinnerElement], dropDownListClasses.disableIcon);\n this.spinnerElement.innerHTML = '';\n this.spinnerElement = null;\n }\n };\n /**\n * Shows the spinner loader.\n *\n * @returns {void}\n */\n DropDownList.prototype.showSpinner = function () {\n if (isNullOrUndefined(this.spinnerElement)) {\n this.spinnerElement = Browser.isDevice && !isNullOrUndefined(this.filterInputObj) && this.filterInputObj.buttons[1] ||\n !isNullOrUndefined(this.filterInputObj) && this.filterInputObj.buttons[0] || this.inputWrapper.buttons[0];\n addClass([this.spinnerElement], dropDownListClasses.disableIcon);\n createSpinner({\n target: this.spinnerElement,\n width: Browser.isDevice ? '16px' : '14px'\n }, this.createElement);\n showSpinner(this.spinnerElement);\n }\n };\n DropDownList.prototype.keyActionHandler = function (e) {\n if (!this.enabled) {\n return;\n }\n var preventAction = e.action === 'pageUp' || e.action === 'pageDown';\n var preventHomeEnd = this.getModuleName() !== 'dropdownlist' && (e.action === 'home' || e.action === 'end');\n this.isEscapeKey = e.action === 'escape';\n this.isTabKey = !this.isPopupOpen && e.action === 'tab';\n var isNavAction = e.action === 'down' || e.action === 'up' || e.action === 'home' || e.action === 'end';\n var isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'\n || e.action === 'home' || e.action === 'end');\n if ((this.isEditTextBox() || preventAction || preventHomeEnd) && !this.isPopupOpen) {\n return;\n }\n if (!this.readonly) {\n var isTabAction = e.action === 'tab' || e.action === 'close';\n if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {\n this.searchKeyEvent = e;\n this.renderList();\n }\n if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&\n isNavigation && this.liCollections.length === 0) || this.isRequested) {\n return;\n }\n if ((isTabAction && this.getModuleName() !== 'autocomplete') && this.isPopupOpen\n || e.action === 'escape') {\n e.preventDefault();\n }\n this.isSelected = e.action === 'escape' ? false : this.isSelected;\n this.isTyped = (isNavigation || e.action === 'escape') ? false : this.isTyped;\n switch (e.action) {\n case 'down':\n case 'up':\n this.updateUpDownAction(e);\n break;\n case 'pageUp':\n this.pageUpSelection(this.activeIndex - this.getPageCount(), e);\n e.preventDefault();\n break;\n case 'pageDown':\n this.pageDownSelection(this.activeIndex + this.getPageCount(), e);\n e.preventDefault();\n break;\n case 'home':\n this.updateHomeEndAction(e);\n break;\n case 'end':\n this.updateHomeEndAction(e);\n break;\n case 'space':\n if (this.getModuleName() === 'dropdownlist') {\n if (!this.beforePopupOpen) {\n this.showPopup();\n }\n }\n break;\n case 'open':\n this.showPopup();\n break;\n case 'hide':\n this.preventAltUp = this.isPopupOpen;\n this.hidePopup(e);\n this.focusDropDown(e);\n break;\n case 'enter':\n this.selectCurrentItem(e);\n break;\n case 'tab':\n this.selectCurrentValueOnTab(e);\n break;\n case 'escape':\n case 'close':\n if (this.isPopupOpen) {\n this.hidePopup(e);\n this.focusDropDown(e);\n }\n break;\n }\n }\n };\n DropDownList.prototype.updateUpDownAction = function (e) {\n var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);\n if (this.isSelectFocusItem(focusEle)) {\n this.setSelection(focusEle, e);\n }\n else if (!isNullOrUndefined(this.liCollections)) {\n var index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;\n var startIndex = 0;\n if (this.getModuleName() === 'autocomplete') {\n startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;\n index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;\n }\n var nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex] : this.liCollections[index];\n if (!isNullOrUndefined(nextItem)) {\n this.setSelection(nextItem, e);\n }\n }\n e.preventDefault();\n };\n DropDownList.prototype.updateHomeEndAction = function (e) {\n if (this.getModuleName() === 'dropdownlist') {\n var findLi = 0;\n if (e.action === 'home') {\n findLi = 0;\n }\n else {\n findLi = this.getItems().length - 1;\n }\n e.preventDefault();\n if (this.activeIndex === findLi) {\n return;\n }\n this.setSelection(this.liCollections[findLi], e);\n }\n };\n DropDownList.prototype.selectCurrentValueOnTab = function (e) {\n if (this.getModuleName() === 'autocomplete') {\n this.selectCurrentItem(e);\n }\n else {\n if (this.isPopupOpen) {\n this.hidePopup(e);\n this.focusDropDown(e);\n }\n }\n };\n DropDownList.prototype.mobileKeyActionHandler = function (e) {\n if (!this.enabled) {\n return;\n }\n if ((this.isEditTextBox()) && !this.isPopupOpen) {\n return;\n }\n if (!this.readonly) {\n if (this.list === undefined && !this.isRequested) {\n this.searchKeyEvent = e;\n this.renderList();\n }\n if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&\n this.liCollections.length === 0) || this.isRequested) {\n return;\n }\n if (e.action === 'enter') {\n this.selectCurrentItem(e);\n }\n }\n };\n DropDownList.prototype.selectCurrentItem = function (e) {\n if (this.isPopupOpen) {\n var li = this.list.querySelector('.' + dropDownListClasses.focus);\n if (li) {\n this.setSelection(li, e);\n this.isTyped = false;\n }\n if (this.isSelected) {\n this.isSelectCustom = false;\n this.onChangeEvent(e);\n }\n this.hidePopup();\n this.focusDropDown(e);\n }\n else {\n this.showPopup();\n }\n };\n DropDownList.prototype.isSelectFocusItem = function (element) {\n return !isNullOrUndefined(element);\n };\n DropDownList.prototype.getPageCount = function () {\n var liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :\n getComputedStyle(this.getItems()[0], null).getPropertyValue('height');\n return Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));\n };\n DropDownList.prototype.pageUpSelection = function (steps, event) {\n var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];\n this.setSelection(previousItem, event);\n };\n DropDownList.prototype.pageDownSelection = function (steps, event) {\n var list = this.getItems();\n var previousItem = steps <= list.length ? this.liCollections[steps - 1] : this.liCollections[list.length - 1];\n this.setSelection(previousItem, event);\n };\n DropDownList.prototype.unWireEvent = function () {\n EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);\n EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);\n EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);\n this.unBindCommonEvent();\n };\n /**\n * Event un binding for list items.\n *\n * @returns {void}\n */\n DropDownList.prototype.unWireListEvents = function () {\n EventHandler.remove(this.list, 'click', this.onMouseClick);\n EventHandler.remove(this.list, 'mouseover', this.onMouseOver);\n EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);\n };\n DropDownList.prototype.checkSelector = function (id) {\n return '[id=\"' + id.replace(/(:|\\.|\\[|\\]|,|=|@|\\\\|\\/|#)/g, '\\\\$1') + '\"]';\n };\n DropDownList.prototype.onDocumentClick = function (e) {\n var target = e.target;\n if (!(!isNullOrUndefined(this.popupObj) && closest(target, this.checkSelector(this.popupObj.element.id))) &&\n !this.inputWrapper.container.contains(e.target)) {\n if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {\n this.isDocumentClick = true;\n var isActive = this.isRequested;\n this.isInteracted = false;\n this.hidePopup(e);\n if (!isActive) {\n this.onFocusOut();\n this.inputWrapper.container.classList.remove(dropDownListClasses.inputFocus);\n }\n }\n }\n else if (target !== this.inputElement && !(this.allowFiltering && target === this.filterInput)\n && !(this.getModuleName() === 'combobox' &&\n !this.allowFiltering && Browser.isDevice && target === this.inputWrapper.buttons[0])) {\n this.isPreventBlur = (Browser.isIE || Browser.info.name === 'edge') && (document.activeElement === this.targetElement() ||\n document.activeElement === this.filterInput);\n e.preventDefault();\n }\n };\n DropDownList.prototype.activeStateChange = function () {\n if (this.isDocumentClick) {\n this.hidePopup();\n this.onFocusOut();\n this.inputWrapper.container.classList.remove(dropDownListClasses.inputFocus);\n }\n };\n DropDownList.prototype.focusDropDown = function (e) {\n if (!this.initial && this.isFilterLayout()) {\n this.focusIn(e);\n }\n };\n DropDownList.prototype.dropDownClick = function (e) {\n if (e.which === 3 || e.button === 2) {\n return;\n }\n if (this.targetElement().classList.contains(dropDownListClasses.disable) || this.inputWrapper.clearButton === e.target) {\n return;\n }\n var target = e.target;\n if (target !== this.inputElement && !(this.allowFiltering && target === this.filterInput) && this.getModuleName() !== 'combobox') {\n e.preventDefault();\n }\n if (!this.readonly) {\n if (this.isPopupOpen) {\n this.hidePopup();\n if (this.isFilterLayout()) {\n this.focusDropDown(e);\n }\n }\n else {\n this.focusIn(e);\n this.floatLabelChange();\n this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;\n this.isDropDownClick = true;\n this.showPopup();\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var proxy_1 = this;\n // eslint-disable-next-line max-len\n var duration = (this.element.tagName === this.getNgDirective() && this.itemTemplate) ? 500 : 100;\n if (!this.isSecondClick) {\n setTimeout(function () {\n proxy_1.cloneElements();\n proxy_1.isSecondClick = true;\n }, duration);\n }\n }\n else {\n this.focusIn(e);\n }\n };\n DropDownList.prototype.cloneElements = function () {\n if (this.list) {\n var ulElement = this.list.querySelector('ul');\n if (ulElement) {\n ulElement = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;\n this.actionCompleteData.ulElement = ulElement;\n }\n }\n };\n DropDownList.prototype.updateSelectedItem = function (li, e, preventSelect, isSelection) {\n var _this = this;\n this.removeSelection();\n li.classList.add(dropDownBaseClasses.selected);\n this.removeHover();\n var value = this.getFormattedValue(li.getAttribute('data-value'));\n var selectedData = this.getDataByValue(value);\n if (!this.initial && !preventSelect && !isNullOrUndefined(e)) {\n var items = this.detachChanges(selectedData);\n this.isSelected = true;\n var eventArgs = {\n e: e,\n item: li,\n itemData: items,\n isInteracted: e ? true : false,\n cancel: false\n };\n this.trigger('select', eventArgs, function (eventArgs) {\n if (eventArgs.cancel) {\n li.classList.remove(dropDownBaseClasses.selected);\n }\n else {\n _this.selectEventCallback(li, e, preventSelect, selectedData, value);\n if (isSelection) {\n _this.setSelectOptions(li, e);\n }\n }\n });\n }\n else {\n this.selectEventCallback(li, e, preventSelect, selectedData, value);\n if (isSelection) {\n this.setSelectOptions(li, e);\n }\n }\n };\n DropDownList.prototype.selectEventCallback = function (li, e, preventSelect, selectedData, value) {\n this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;\n this.item = li;\n this.itemData = selectedData;\n var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);\n if (focusedItem) {\n removeClass([focusedItem], dropDownBaseClasses.focus);\n }\n li.setAttribute('aria-selected', 'true');\n this.activeIndex = this.getIndexByValue(value);\n };\n DropDownList.prototype.activeItem = function (li) {\n if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.selected)) {\n this.removeSelection();\n li.classList.add(dropDownBaseClasses.selected);\n this.removeHover();\n li.setAttribute('aria-selected', 'true');\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DropDownList.prototype.setValue = function (e) {\n var dataItem = this.getItemData();\n if (dataItem.value === null) {\n Input.setValue(null, this.inputElement, this.floatLabelType, this.showClearButton);\n }\n else {\n Input.setValue(dataItem.text, this.inputElement, this.floatLabelType, this.showClearButton);\n }\n if (this.valueTemplate && this.itemData !== null) {\n this.setValueTemplate();\n }\n else if (!isNullOrUndefined(this.valueTempElement) && this.inputElement.previousSibling === this.valueTempElement) {\n detach(this.valueTempElement);\n this.inputElement.style.display = 'block';\n }\n var clearIcon = dropDownListClasses.clearIcon;\n var isFilterElement = this.isFiltering() && this.filterInput && (this.getModuleName() === 'combobox');\n var clearElement = isFilterElement && this.filterInput.parentElement.querySelector('.' + clearIcon);\n if (this.isFiltering() && clearElement) {\n clearElement.style.removeProperty('visibility');\n }\n if (this.previousValue === dataItem.value) {\n this.isSelected = false;\n return true;\n }\n else {\n this.isSelected = !this.initial ? true : false;\n this.isSelectCustom = false;\n if (this.getModuleName() === 'dropdownlist') {\n this.updateIconState();\n }\n return false;\n }\n };\n DropDownList.prototype.setSelection = function (li, e) {\n if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected\n && li.classList.contains(dropDownBaseClasses.selected)))) {\n this.updateSelectedItem(li, e, false, true);\n }\n else {\n this.setSelectOptions(li, e);\n }\n };\n DropDownList.prototype.setSelectOptions = function (li, e) {\n if (this.list) {\n this.removeHover();\n }\n this.previousSelectedLI = (!isNullOrUndefined(this.selectedLI)) ? this.selectedLI : null;\n this.selectedLI = li;\n if (this.setValue(e)) {\n return;\n }\n if (this.isPopupOpen) {\n attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });\n if (this.isFilterLayout() && this.filterInput) {\n attributes(this.filterInput, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });\n }\n }\n if ((!this.isPopupOpen && !isNullOrUndefined(li)) || (this.isPopupOpen && !isNullOrUndefined(e) &&\n (e.type !== 'keydown' || e.type === 'keydown' && e.action === 'enter'))) {\n this.isSelectCustom = false;\n this.onChangeEvent(e);\n }\n if (this.isPopupOpen && !isNullOrUndefined(this.selectedLI) && this.itemData !== null && (!e || e.type !== 'click')) {\n this.setScrollPosition(e);\n }\n if (Browser.info.name !== 'mozilla') {\n attributes(this.inputElement, { 'aria-label': this.inputElement.value });\n attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id });\n this.targetElement().removeAttribute('aria-live');\n }\n };\n DropDownList.prototype.dropdownCompiler = function (dropdownTemplate) {\n var checkTemplate = false;\n if (dropdownTemplate) {\n try {\n checkTemplate = (document.querySelectorAll(dropdownTemplate).length) ? true : false;\n }\n catch (exception) {\n checkTemplate = false;\n }\n }\n return checkTemplate;\n };\n DropDownList.prototype.setValueTemplate = function () {\n var compiledString;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (this.isReact) {\n this.clearTemplate(['valueTemplate']);\n }\n if (!this.valueTempElement) {\n this.valueTempElement = this.createElement('span', { className: dropDownListClasses.value });\n this.inputElement.parentElement.insertBefore(this.valueTempElement, this.inputElement);\n this.inputElement.style.display = 'none';\n }\n this.valueTempElement.innerHTML = '';\n var valuecheck = this.dropdownCompiler(this.valueTemplate);\n if (valuecheck) {\n compiledString = compile(document.querySelector(this.valueTemplate).innerHTML.trim());\n }\n else {\n compiledString = compile(this.valueTemplate);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var valueCompTemp = compiledString(this.itemData, this, 'valueTemplate', this.valueTemplateId, this.isStringTemplate, null, this.valueTempElement);\n if (valueCompTemp && valueCompTemp.length > 0) {\n for (var i = 0; i < valueCompTemp.length; i++) {\n this.valueTempElement.appendChild(valueCompTemp[i]);\n }\n }\n this.renderReactTemplates();\n };\n DropDownList.prototype.removeSelection = function () {\n if (this.list) {\n var selectedItems = this.list.querySelectorAll('.' + dropDownBaseClasses.selected);\n if (selectedItems.length) {\n removeClass(selectedItems, dropDownBaseClasses.selected);\n selectedItems[0].removeAttribute('aria-selected');\n }\n }\n };\n DropDownList.prototype.getItemData = function () {\n var fields = this.fields;\n var dataItem = null;\n dataItem = this.itemData;\n var dataValue;\n var dataText;\n if (!isNullOrUndefined(dataItem)) {\n dataValue = getValue(fields.value, dataItem);\n dataText = getValue(fields.text, dataItem);\n }\n var value = (!isNullOrUndefined(dataItem) &&\n !isUndefined(dataValue) ? dataValue : dataItem);\n var text = (!isNullOrUndefined(dataItem) &&\n !isUndefined(dataValue) ? dataText : dataItem);\n return { value: value, text: text };\n };\n /**\n * To trigger the change event for list.\n *\n * @param {MouseEvent | KeyboardEvent | TouchEvent} eve - Specifies the event arguments.\n * @returns {void}\n */\n DropDownList.prototype.onChangeEvent = function (eve) {\n var dataItem = this.getItemData();\n var index = this.isSelectCustom ? null : this.activeIndex;\n this.setProperties({ 'index': index, 'text': dataItem.text, 'value': dataItem.value }, true);\n this.detachChangeEvent(eve);\n };\n DropDownList.prototype.detachChanges = function (value) {\n var items;\n if (typeof value === 'string' ||\n typeof value === 'boolean' ||\n typeof value === 'number') {\n items = Object.defineProperties({}, {\n value: {\n value: value,\n enumerable: true\n },\n text: {\n value: value,\n enumerable: true\n }\n });\n }\n else {\n items = value;\n }\n return items;\n };\n DropDownList.prototype.detachChangeEvent = function (eve) {\n this.isSelected = false;\n this.previousValue = this.value;\n this.activeIndex = this.index;\n this.typedString = !isNullOrUndefined(this.text) ? this.text : '';\n if (!this.initial) {\n var items = this.detachChanges(this.itemData);\n var preItems = void 0;\n if (typeof this.previousItemData === 'string' ||\n typeof this.previousItemData === 'boolean' ||\n typeof this.previousItemData === 'number') {\n preItems = Object.defineProperties({}, {\n value: {\n value: this.previousItemData,\n enumerable: true\n },\n text: {\n value: this.previousItemData,\n enumerable: true\n }\n });\n }\n else {\n preItems = this.previousItemData;\n }\n this.setHiddenValue();\n var eventArgs = {\n e: eve,\n item: this.item,\n itemData: items,\n previousItem: this.previousSelectedLI,\n previousItemData: preItems,\n isInteracted: eve ? true : false,\n value: this.value,\n element: this.element,\n event: eve\n };\n if (this.isAngular && this.preventChange) {\n this.preventChange = false;\n }\n else {\n this.trigger('change', eventArgs);\n }\n }\n if ((isNullOrUndefined(this.value) || this.value === '') && this.floatLabelType !== 'Always') {\n removeClass([this.inputWrapper.container], 'e-valid-input');\n }\n };\n DropDownList.prototype.setHiddenValue = function () {\n if (!isNullOrUndefined(this.value)) {\n if (this.hiddenElement.querySelector('option')) {\n var selectedElement = this.hiddenElement.querySelector('option');\n selectedElement.textContent = this.text;\n selectedElement.setAttribute('value', this.value.toString());\n }\n else {\n this.hiddenElement.innerHTML = '
';\n var selectedElement = this.hiddenElement.querySelector('option');\n selectedElement.setAttribute('value', this.value.toString());\n }\n }\n else {\n this.hiddenElement.innerHTML = '';\n }\n };\n /**\n * Filter bar implementation\n *\n * @param {KeyboardEventArgs} e - Specifies the event arguments.\n * @returns {void}\n */\n DropDownList.prototype.onFilterUp = function (e) {\n if (!(e.ctrlKey && e.keyCode === 86) && (this.isValidKey || e.keyCode === 40 || e.keyCode === 38)) {\n this.isValidKey = false;\n switch (e.keyCode) {\n case 38: //up arrow\n case 40: //down arrow\n if (this.getModuleName() === 'autocomplete' && !this.isPopupOpen && !this.preventAltUp && !this.isRequested) {\n this.preventAutoFill = true;\n this.searchLists(e);\n }\n else {\n this.preventAutoFill = false;\n }\n this.preventAltUp = false;\n e.preventDefault();\n break;\n case 46: //delete\n case 8: //backspace\n this.typedString = this.filterInput.value;\n if (!this.isPopupOpen && this.typedString !== '' || this.isPopupOpen && this.queryString.length > 0) {\n this.preventAutoFill = true;\n this.searchLists(e);\n }\n else if (this.typedString === '' && this.queryString === '' && this.getModuleName() !== 'autocomplete') {\n this.preventAutoFill = true;\n this.searchLists(e);\n }\n else if (this.typedString === '') {\n if (this.list) {\n this.resetFocusElement();\n }\n this.activeIndex = null;\n if (this.getModuleName() !== 'dropdownlist') {\n this.preventAutoFill = true;\n this.searchLists(e);\n if (this.getModuleName() === 'autocomplete') {\n this.hidePopup();\n }\n }\n }\n e.preventDefault();\n break;\n default:\n this.typedString = this.filterInput.value;\n this.preventAutoFill = false;\n this.searchLists(e);\n break;\n }\n }\n else {\n this.isValidKey = false;\n }\n };\n DropDownList.prototype.onFilterDown = function (e) {\n switch (e.keyCode) {\n case 13: //enter\n break;\n case 40: //down arrow\n case 38: //up arrow\n this.queryString = this.filterInput.value;\n e.preventDefault();\n break;\n case 9: //tab\n if (this.isPopupOpen && this.getModuleName() !== 'autocomplete') {\n e.preventDefault();\n }\n break;\n default:\n this.prevSelectPoints = this.getSelectionPoints();\n this.queryString = this.filterInput.value;\n break;\n }\n };\n DropDownList.prototype.removeFillSelection = function () {\n if (this.isInteracted) {\n var selection = this.getSelectionPoints();\n this.inputElement.setSelectionRange(selection.end, selection.end);\n }\n };\n DropDownList.prototype.getQuery = function (query) {\n var filterQuery;\n if (!this.isCustomFilter && this.allowFiltering && this.filterInput) {\n filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();\n var filterType = this.typedString === '' ? 'contains' : this.filterType;\n var dataType = this.typeOfData(this.dataSource).typeof;\n if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {\n filterQuery.where('', filterType, this.typedString, this.ignoreCase, this.ignoreAccent);\n }\n else {\n var fields = (this.fields.text) ? this.fields.text : '';\n filterQuery.where(fields, filterType, this.typedString, this.ignoreCase, this.ignoreAccent);\n }\n }\n else {\n filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();\n }\n return filterQuery;\n };\n DropDownList.prototype.getSelectionPoints = function () {\n var input = this.inputElement;\n return { start: Math.abs(input.selectionStart), end: Math.abs(input.selectionEnd) };\n };\n DropDownList.prototype.searchLists = function (e) {\n var _this = this;\n this.isTyped = true;\n this.activeIndex = null;\n this.isListSearched = true;\n if (this.filterInput.parentElement.querySelector('.' + dropDownListClasses.clearIcon)) {\n var clearElement = this.filterInput.parentElement.querySelector('.' + dropDownListClasses.clearIcon);\n clearElement.style.visibility = this.filterInput.value === '' ? 'hidden' : 'visible';\n }\n this.isDataFetched = false;\n if (this.isFiltering()) {\n var eventArgs_1 = {\n preventDefaultAction: false,\n text: this.filterInput.value,\n updateData: function (dataSource, query, fields) {\n if (eventArgs_1.cancel) {\n return;\n }\n _this.isCustomFilter = true;\n _this.filteringAction(dataSource, query, fields);\n },\n baseEventArgs: e,\n cancel: false\n };\n this.trigger('filtering', eventArgs_1, function (eventArgs) {\n if (!eventArgs.cancel && !_this.isCustomFilter && !eventArgs.preventDefaultAction) {\n _this.filteringAction(_this.dataSource, null, _this.fields);\n }\n });\n }\n };\n /**\n * To filter the data from given data source by using query\n *\n * @param {Object[] | DataManager } dataSource - Set the data source to filter.\n * @param {Query} query - Specify the query to filter the data.\n * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.\n * @returns {void}\n\n */\n DropDownList.prototype.filter = function (dataSource, query, fields) {\n this.isCustomFilter = true;\n this.filteringAction(dataSource, query, fields);\n };\n DropDownList.prototype.filteringAction = function (dataSource, query, fields) {\n if (!isNullOrUndefined(this.filterInput)) {\n this.beforePopupOpen = (!this.isPopupOpen && this.getModuleName() === 'combobox' && this.filterInput.value === '') ?\n false : true;\n if (this.filterInput.value.trim() === '' && !this.itemTemplate) {\n this.actionCompleteData.isUpdated = false;\n this.isTyped = false;\n if (!isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {\n this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list);\n }\n this.isTyped = true;\n if (!isNullOrUndefined(this.itemData) && this.getModuleName() === 'dropdownlist') {\n this.focusIndexItem();\n this.setScrollPosition();\n }\n this.isNotSearchList = true;\n }\n else {\n this.isNotSearchList = false;\n query = (this.filterInput.value.trim() === '') ? null : query;\n this.resetList(dataSource, fields, query);\n }\n this.renderReactTemplates();\n }\n };\n DropDownList.prototype.setSearchBox = function (popupElement) {\n if (this.isFiltering()) {\n var parentElement = popupElement.querySelector('.' + dropDownListClasses.filterParent) ?\n popupElement.querySelector('.' + dropDownListClasses.filterParent) : this.createElement('span', {\n className: dropDownListClasses.filterParent\n });\n this.filterInput = this.createElement('input', {\n attrs: { type: 'text' },\n className: dropDownListClasses.filterInput\n });\n this.element.parentNode.insertBefore(this.filterInput, this.element);\n var backIcon = false;\n if (Browser.isDevice) {\n backIcon = true;\n }\n this.filterInputObj = Input.createInput({\n element: this.filterInput,\n buttons: backIcon ?\n [dropDownListClasses.backIcon, dropDownListClasses.filterBarClearIcon] : [dropDownListClasses.filterBarClearIcon],\n properties: { placeholder: this.filterBarPlaceholder }\n }, this.createElement);\n if (!isNullOrUndefined(this.cssClass)) {\n if (this.cssClass.split(' ').indexOf('e-outline') !== -1) {\n addClass([this.filterInputObj.container], 'e-outline');\n }\n else if (this.cssClass.split(' ').indexOf('e-filled') !== -1) {\n addClass([this.filterInputObj.container], 'e-filled');\n }\n }\n append([this.filterInputObj.container], parentElement);\n prepend([parentElement], popupElement);\n attributes(this.filterInput, {\n 'aria-disabled': 'false',\n 'aria-owns': this.element.id + '_options',\n 'role': 'listbox',\n 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null,\n 'autocomplete': 'off',\n 'autocorrect': 'off',\n 'autocapitalize': 'off',\n 'spellcheck': 'false'\n });\n this.clearIconElement = this.filterInput.parentElement.querySelector('.' + dropDownListClasses.clearIcon);\n if (!Browser.isDevice && this.clearIconElement) {\n EventHandler.add(this.clearIconElement, 'click', this.clearText, this);\n this.clearIconElement.style.visibility = 'hidden';\n }\n if (!Browser.isDevice) {\n this.searchKeyModule = new KeyboardEvents(this.filterInput, {\n keyAction: this.keyActionHandler.bind(this),\n keyConfigs: this.keyConfigure,\n eventName: 'keydown'\n });\n }\n else {\n this.searchKeyModule = new KeyboardEvents(this.filterInput, {\n keyAction: this.mobileKeyActionHandler.bind(this),\n keyConfigs: this.keyConfigure,\n eventName: 'keydown'\n });\n }\n EventHandler.add(this.filterInput, 'input', this.onInput, this);\n EventHandler.add(this.filterInput, 'keyup', this.onFilterUp, this);\n EventHandler.add(this.filterInput, 'keydown', this.onFilterDown, this);\n EventHandler.add(this.filterInput, 'blur', this.onBlurHandler, this);\n EventHandler.add(this.filterInput, 'paste', this.pasteHandler, this);\n return this.filterInputObj;\n }\n else {\n return inputObject;\n }\n };\n DropDownList.prototype.onInput = function (e) {\n this.isValidKey = true;\n // For filtering works in mobile firefox.\n if (Browser.isDevice && Browser.info.name === 'mozilla') {\n this.typedString = this.filterInput.value;\n this.preventAutoFill = true;\n this.searchLists(e);\n }\n };\n DropDownList.prototype.pasteHandler = function (e) {\n var _this = this;\n setTimeout(function () {\n _this.typedString = _this.filterInput.value;\n _this.searchLists(e);\n });\n };\n DropDownList.prototype.onActionFailure = function (e) {\n _super.prototype.onActionFailure.call(this, e);\n if (this.beforePopupOpen) {\n this.renderPopup();\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {\n var _this = this;\n if (this.isNotSearchList) {\n this.isNotSearchList = false;\n return;\n }\n if (this.isActive) {\n var selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;\n _super.prototype.onActionComplete.call(this, ulElement, list, e);\n this.updateSelectElementData(this.allowFiltering);\n if (this.isRequested && !isNullOrUndefined(this.searchKeyEvent) && this.searchKeyEvent.type === 'keydown') {\n this.isRequested = false;\n this.keyActionHandler(this.searchKeyEvent);\n this.searchKeyEvent = null;\n }\n if (this.isRequested && !isNullOrUndefined(this.searchKeyEvent)) {\n this.incrementalSearch(this.searchKeyEvent);\n this.searchKeyEvent = null;\n }\n this.list.scrollTop = 0;\n if (!isNullOrUndefined(ulElement)) {\n attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });\n }\n if (this.initRemoteRender) {\n this.initial = true;\n this.activeIndex = this.index;\n this.updateValues();\n this.initRemoteRender = false;\n this.initial = false;\n if (this.value && this.dataSource instanceof DataManager) {\n var checkField_1 = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;\n var checkVal = list.some(function (x) { return x[checkField_1] === _this.value; });\n if (!checkVal) {\n this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField_1, 'equal', this.value)))\n .then(function (e) {\n if (e.result.length > 0) {\n _this.addItem(e.result, list.length);\n _this.updateValues();\n }\n });\n }\n }\n }\n if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {\n if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter\n && !this.isFilterFocus) || (isNullOrUndefined(this.itemData) && this.allowFiltering)\n && ((this.dataSource instanceof DataManager)\n || (!isNullOrUndefined(this.dataSource) && !isNullOrUndefined(this.dataSource.length) &&\n this.dataSource.length !== 0)))) {\n if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {\n setTimeout(function () {\n _this.updateActionCompleteDataValues(ulElement, list);\n }, 0);\n }\n else {\n this.updateActionCompleteDataValues(ulElement, list);\n }\n }\n this.addNewItem(list, selectedItem);\n if (!isNullOrUndefined(this.itemData)) {\n this.focusIndexItem();\n }\n }\n if (this.beforePopupOpen) {\n this.renderPopup();\n }\n }\n };\n DropDownList.prototype.updateActionCompleteDataValues = function (ulElement, list) {\n this.actionCompleteData = { ulElement: ulElement.cloneNode(true), list: list, isUpdated: true };\n if (isNullOrUndefined(this.actionData.ulElement) && isNullOrUndefined(this.actionData.list)) {\n this.actionData = this.actionCompleteData;\n }\n };\n DropDownList.prototype.addNewItem = function (listData, newElement) {\n var _this = this;\n if (!isNullOrUndefined(this.itemData) && !isNullOrUndefined(newElement)) {\n var value_1 = this.getItemData().value;\n var isExist = listData.some(function (data) {\n return (((typeof data === 'string' || typeof data === 'number') && data === value_1) ||\n (getValue(_this.fields.value, data) === value_1));\n });\n if (!isExist) {\n this.addItem(this.itemData);\n }\n }\n };\n DropDownList.prototype.updateActionCompleteData = function (li, item, index) {\n var _this = this;\n if (this.getModuleName() !== 'autocomplete' && this.actionCompleteData.ulElement) {\n if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {\n setTimeout(function () {\n _this.actionCompleteDataUpdate(li, item, index);\n }, 0);\n }\n else {\n this.actionCompleteDataUpdate(li, item, index);\n }\n }\n };\n DropDownList.prototype.actionCompleteDataUpdate = function (li, item, index) {\n if (index != null) {\n this.actionCompleteData.ulElement.insertBefore(li.cloneNode(true), this.actionCompleteData.ulElement.childNodes[index]);\n }\n else {\n this.actionCompleteData.ulElement.appendChild(li.cloneNode(true));\n }\n if (this.isFiltering() && this.actionCompleteData.list.indexOf(item) < 0) {\n this.actionCompleteData.list.push(item);\n }\n };\n DropDownList.prototype.focusIndexItem = function () {\n var value = this.getItemData().value;\n this.activeIndex = this.getIndexByValue(value);\n var element = this.findListElement(this.list, 'li', 'data-value', value);\n this.selectedLI = element;\n this.activeItem(element);\n this.removeFocus();\n };\n DropDownList.prototype.updateSelection = function () {\n var selectedItem = this.list.querySelector('.' + dropDownBaseClasses.selected);\n if (selectedItem) {\n this.setProperties({ 'index': this.getIndexByValue(selectedItem.getAttribute('data-value')) });\n this.activeIndex = this.index;\n }\n else {\n this.removeFocus();\n this.list.querySelector('.' + dropDownBaseClasses.li).classList.add(dropDownListClasses.focus);\n }\n };\n DropDownList.prototype.removeFocus = function () {\n var highlightedItem = this.list.querySelectorAll('.' + dropDownListClasses.focus);\n if (highlightedItem && highlightedItem.length) {\n removeClass(highlightedItem, dropDownListClasses.focus);\n }\n };\n DropDownList.prototype.renderPopup = function () {\n var _this = this;\n if (this.popupObj && document.body.contains(this.popupObj.element)) {\n this.refreshPopup();\n return;\n }\n var args = { cancel: false };\n this.trigger('beforeOpen', args, function (args) {\n if (!args.cancel) {\n var popupEle = _this.createElement('div', {\n id: _this.element.id + '_popup', className: 'e-ddl e-popup ' + (_this.cssClass != null ? _this.cssClass : '')\n });\n var searchBox = _this.setSearchBox(popupEle);\n _this.listHeight = formatUnit(_this.popupHeight);\n if (_this.headerTemplate) {\n _this.setHeaderTemplate(popupEle);\n }\n append([_this.list], popupEle);\n if (_this.footerTemplate) {\n _this.setFooterTemplate(popupEle);\n }\n document.body.appendChild(popupEle);\n popupEle.style.visibility = 'hidden';\n if (_this.popupHeight !== 'auto') {\n _this.searchBoxHeight = 0;\n if (!isNullOrUndefined(searchBox.container)) {\n _this.searchBoxHeight = (searchBox.container.parentElement).getBoundingClientRect().height;\n _this.listHeight = (parseInt(_this.listHeight, 10) - (_this.searchBoxHeight)).toString() + 'px';\n }\n if (_this.headerTemplate) {\n _this.header = _this.header ? _this.header : popupEle.querySelector('.e-ddl-header');\n var height = Math.round(_this.header.getBoundingClientRect().height);\n _this.listHeight = (parseInt(_this.listHeight, 10) - (height + _this.searchBoxHeight)).toString() + 'px';\n }\n if (_this.footerTemplate) {\n _this.footer = _this.footer ? _this.footer : popupEle.querySelector('.e-ddl-footer');\n var height = Math.round(_this.footer.getBoundingClientRect().height);\n _this.listHeight = (parseInt(_this.listHeight, 10) - (height + _this.searchBoxHeight)).toString() + 'px';\n }\n _this.list.style.maxHeight = (parseInt(_this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property\n popupEle.style.maxHeight = formatUnit(_this.popupHeight);\n }\n else {\n popupEle.style.height = 'auto';\n }\n var offsetValue = 0;\n var left = void 0;\n if (!isNullOrUndefined(_this.selectedLI) && (!isNullOrUndefined(_this.activeIndex) && _this.activeIndex >= 0)) {\n _this.setScrollPosition();\n }\n else {\n _this.list.scrollTop = 0;\n }\n if (Browser.isDevice && (!_this.allowFiltering && (_this.getModuleName() === 'dropdownlist' ||\n (_this.isDropDownClick && _this.getModuleName() === 'combobox')))) {\n offsetValue = _this.getOffsetValue(popupEle);\n var firstItem = _this.isEmptyList() ? _this.list : _this.liCollections[0];\n left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -\n parseInt(getComputedStyle(_this.inputElement).paddingLeft, 10) +\n parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));\n }\n _this.getFocusElement();\n _this.createPopup(popupEle, offsetValue, left);\n _this.checkCollision(popupEle);\n if (Browser.isDevice) {\n _this.popupObj.element.classList.add(dropDownListClasses.device);\n if (_this.getModuleName() === 'dropdownlist' || (_this.getModuleName() === 'combobox'\n && !_this.allowFiltering && _this.isDropDownClick)) {\n _this.popupObj.collision = { X: 'fit', Y: 'fit' };\n }\n if (_this.isFilterLayout()) {\n _this.popupObj.element.classList.add(dropDownListClasses.mobileFilter);\n _this.popupObj.position = { X: 0, Y: 0 };\n _this.popupObj.dataBind();\n attributes(_this.popupObj.element, { style: 'left:0px;right:0px;top:0px;bottom:0px;' });\n addClass([document.body, _this.popupObj.element], dropDownListClasses.popupFullScreen);\n _this.setSearchBoxPosition();\n _this.backIconElement = searchBox.container.querySelector('.e-back-icon');\n _this.clearIconElement = searchBox.container.querySelector('.' + dropDownListClasses.clearIcon);\n EventHandler.add(_this.backIconElement, 'click', _this.clickOnBackIcon, _this);\n EventHandler.add(_this.clearIconElement, 'click', _this.clearText, _this);\n }\n }\n popupEle.style.visibility = 'visible';\n addClass([popupEle], 'e-popup-close');\n var scrollParentElements = _this.popupObj.getScrollableParent(_this.inputWrapper.container);\n for (var _i = 0, scrollParentElements_1 = scrollParentElements; _i < scrollParentElements_1.length; _i++) {\n var element = scrollParentElements_1[_i];\n EventHandler.add(element, 'scroll', _this.scrollHandler, _this);\n }\n if (Browser.isDevice && _this.isFilterLayout()) {\n EventHandler.add(_this.list, 'scroll', _this.listScroll, _this);\n }\n if (!isNullOrUndefined(_this.list)) {\n _this.unWireListEvents();\n _this.wireListEvents();\n }\n attributes(_this.targetElement(), { 'aria-expanded': 'true' });\n var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;\n addClass([inputParent], [dropDownListClasses.inputFocus]);\n var animModel = { name: 'FadeIn', duration: 100 };\n _this.beforePopupOpen = true;\n var popupInstance = _this.popupObj;\n var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };\n _this.trigger('open', eventArgs, function (eventArgs) {\n if (!eventArgs.cancel) {\n addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);\n _this.renderReactTemplates();\n _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);\n }\n else {\n _this.beforePopupOpen = false;\n _this.destroyPopup();\n }\n });\n }\n else {\n _this.beforePopupOpen = false;\n }\n });\n };\n DropDownList.prototype.checkCollision = function (popupEle) {\n if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'dropdownlist' || this.isDropDownClick))) {\n var collision = isCollide(popupEle);\n if (collision.length > 0) {\n popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';\n }\n this.popupObj.resolveCollision();\n }\n };\n DropDownList.prototype.getOffsetValue = function (popupEle) {\n var popupStyles = getComputedStyle(popupEle);\n var borderTop = parseInt(popupStyles.borderTopWidth, 10);\n var borderBottom = parseInt(popupStyles.borderBottomWidth, 10);\n return this.setPopupPosition(borderTop + borderBottom);\n };\n DropDownList.prototype.createPopup = function (element, offsetValue, left) {\n var _this = this;\n this.popupObj = new Popup(element, {\n width: this.setWidth(), targetType: 'relative',\n relateTo: this.inputWrapper.container, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,\n enableRtl: this.enableRtl, offsetX: left, position: { X: 'left', Y: 'bottom' },\n zIndex: this.zIndex,\n close: function () {\n if (!_this.isDocumentClick) {\n _this.focusDropDown();\n }\n // eslint-disable-next-line\n if (_this.isReact) {\n _this.clearTemplate(['headerTemplate', 'footerTemplate']);\n }\n var isResetItem = (_this.getModuleName() === 'autocomplete') ? true : false;\n _this.isNotSearchList = false;\n _this.isDocumentClick = false;\n _this.destroyPopup();\n if (_this.isFiltering() && _this.actionCompleteData.list && _this.actionCompleteData.list[0]) {\n _this.isActive = true;\n _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);\n }\n },\n open: function () {\n EventHandler.add(document, 'mousedown', _this.onDocumentClick, _this);\n _this.isPopupOpen = true;\n var actionList = _this.actionCompleteData && _this.actionCompleteData.ulElement &&\n _this.actionCompleteData.ulElement.querySelector('li');\n var ulElement = _this.list.querySelector('ul li');\n if (_this.isFiltering() && _this.itemTemplate && (_this.element.tagName === _this.getNgDirective()) &&\n (actionList && ulElement && actionList.textContent !== ulElement.textContent) &&\n _this.element.tagName !== 'EJS-COMBOBOX') {\n _this.cloneElements();\n }\n if (_this.isFilterLayout()) {\n removeClass([_this.inputWrapper.container], [dropDownListClasses.inputFocus]);\n _this.isFilterFocus = true;\n _this.filterInput.focus();\n if (_this.inputWrapper.clearButton) {\n addClass([_this.inputWrapper.clearButton], dropDownListClasses.clearIconHide);\n }\n }\n _this.activeStateChange();\n },\n targetExitViewport: function () {\n if (!Browser.isDevice) {\n _this.hidePopup();\n }\n }\n });\n };\n DropDownList.prototype.isEmptyList = function () {\n return !isNullOrUndefined(this.liCollections) && this.liCollections.length === 0;\n };\n DropDownList.prototype.getFocusElement = function () {\n // combo-box used this method\n };\n DropDownList.prototype.isFilterLayout = function () {\n return this.getModuleName() === 'dropdownlist' && this.allowFiltering;\n };\n DropDownList.prototype.scrollHandler = function () {\n if (Browser.isDevice && ((this.getModuleName() === 'dropdownlist' &&\n !this.isFilterLayout()) || (this.getModuleName() === 'combobox' && !this.allowFiltering && this.isDropDownClick))) {\n this.hidePopup();\n }\n };\n DropDownList.prototype.setSearchBoxPosition = function () {\n var searchBoxHeight = this.filterInput.parentElement.getBoundingClientRect().height;\n this.popupObj.element.style.maxHeight = '100%';\n this.popupObj.element.style.width = '100%';\n this.list.style.maxHeight = (window.innerHeight - searchBoxHeight) + 'px';\n this.list.style.height = (window.innerHeight - searchBoxHeight) + 'px';\n var clearElement = this.filterInput.parentElement.querySelector('.' + dropDownListClasses.clearIcon);\n detach(this.filterInput);\n clearElement.parentElement.insertBefore(this.filterInput, clearElement);\n };\n DropDownList.prototype.setPopupPosition = function (border) {\n var offsetValue;\n var popupOffset = border;\n var selectedLI = this.list.querySelector('.' + dropDownListClasses.focus) || this.selectedLI;\n var firstItem = this.isEmptyList() ? this.list : this.liCollections[0];\n var lastItem = this.isEmptyList() ? this.list : this.liCollections[this.getItems().length - 1];\n var liHeight = firstItem.getBoundingClientRect().height;\n var listHeight = this.list.offsetHeight / 2;\n var height = isNullOrUndefined(selectedLI) ? firstItem.offsetTop : selectedLI.offsetTop;\n var lastItemOffsetValue = lastItem.offsetTop;\n if (lastItemOffsetValue - listHeight < height && !isNullOrUndefined(this.liCollections) &&\n this.liCollections.length > 0 && !isNullOrUndefined(selectedLI)) {\n var count = this.list.offsetHeight / liHeight;\n var paddingBottom = parseInt(getComputedStyle(this.list).paddingBottom, 10);\n offsetValue = (count - (this.liCollections.length - this.activeIndex)) * liHeight - popupOffset + paddingBottom;\n this.list.scrollTop = selectedLI.offsetTop;\n }\n else if (height > listHeight) {\n offsetValue = listHeight - liHeight / 2;\n this.list.scrollTop = height - listHeight + liHeight / 2;\n }\n else {\n offsetValue = height;\n }\n var inputHeight = this.inputWrapper.container.offsetHeight;\n offsetValue = offsetValue + liHeight + popupOffset - ((liHeight - inputHeight) / 2);\n return -offsetValue;\n };\n DropDownList.prototype.setWidth = function () {\n var width = formatUnit(this.popupWidth);\n if (width.indexOf('%') > -1) {\n var inputWidth = this.inputWrapper.container.offsetWidth * parseFloat(width) / 100;\n width = inputWidth.toString() + 'px';\n }\n if (Browser.isDevice && (!this.allowFiltering && (this.getModuleName() === 'dropdownlist' ||\n (this.isDropDownClick && this.getModuleName() === 'combobox')))) {\n var firstItem = this.isEmptyList() ? this.list : this.liCollections[0];\n width = (parseInt(width, 10) + (parseInt(getComputedStyle(firstItem).textIndent, 10) -\n parseInt(getComputedStyle(this.inputElement).paddingLeft, 10) +\n parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10)) * 2) + 'px';\n }\n return width;\n };\n DropDownList.prototype.scrollBottom = function (isInitial) {\n if (!isNullOrUndefined(this.selectedLI)) {\n var currentOffset = this.list.offsetHeight;\n var nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;\n var nextOffset = this.list.scrollTop + nextBottom - currentOffset;\n nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;\n var boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;\n boxRange = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?\n boxRange - this.fixedHeaderElement.offsetHeight : boxRange;\n if (this.activeIndex === 0) {\n this.list.scrollTop = 0;\n }\n else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {\n this.list.scrollTop = nextOffset;\n }\n }\n };\n DropDownList.prototype.scrollTop = function () {\n if (!isNullOrUndefined(this.selectedLI)) {\n var nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;\n nextOffset = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?\n nextOffset - this.fixedHeaderElement.offsetHeight : nextOffset;\n var boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);\n if (this.activeIndex === 0) {\n this.list.scrollTop = 0;\n }\n else if (nextOffset < 0) {\n this.list.scrollTop = this.list.scrollTop + nextOffset;\n }\n else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {\n this.list.scrollTop = this.selectedLI.offsetTop - (this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?\n this.fixedHeaderElement.offsetHeight : 0);\n }\n }\n };\n DropDownList.prototype.isEditTextBox = function () {\n return false;\n };\n DropDownList.prototype.isFiltering = function () {\n return this.allowFiltering;\n };\n DropDownList.prototype.isPopupButton = function () {\n return true;\n };\n DropDownList.prototype.setScrollPosition = function (e) {\n if (!isNullOrUndefined(e)) {\n switch (e.action) {\n case 'pageDown':\n case 'down':\n case 'end':\n this.scrollBottom();\n break;\n default:\n this.scrollTop();\n break;\n }\n }\n else {\n this.scrollBottom(true);\n }\n };\n DropDownList.prototype.clearText = function () {\n this.filterInput.value = this.typedString = '';\n this.searchLists(null);\n };\n DropDownList.prototype.listScroll = function () {\n this.filterInput.blur();\n };\n DropDownList.prototype.setEleWidth = function (width) {\n if (!isNullOrUndefined(width)) {\n if (typeof width === 'number') {\n this.inputWrapper.container.style.width = formatUnit(width);\n }\n else if (typeof width === 'string') {\n this.inputWrapper.container.style.width = (width.match(/px|%|em/)) ? (width) : (formatUnit(width));\n }\n }\n };\n DropDownList.prototype.closePopup = function (delay) {\n var _this = this;\n this.isTyped = false;\n if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {\n return;\n }\n EventHandler.remove(document, 'mousedown', this.onDocumentClick);\n this.isActive = false;\n this.filterInputObj = null;\n this.isDropDownClick = false;\n this.preventAutoFill = false;\n var scrollableParentElements = this.popupObj.getScrollableParent(this.inputWrapper.container);\n for (var _i = 0, scrollableParentElements_1 = scrollableParentElements; _i < scrollableParentElements_1.length; _i++) {\n var element = scrollableParentElements_1[_i];\n EventHandler.remove(element, 'scroll', this.scrollHandler);\n }\n if (Browser.isDevice && this.isFilterLayout()) {\n removeClass([document.body, this.popupObj.element], dropDownListClasses.popupFullScreen);\n EventHandler.remove(this.list, 'scroll', this.listScroll);\n }\n if (this.isFilterLayout()) {\n if (!Browser.isDevice) {\n this.searchKeyModule.destroy();\n if (this.clearIconElement) {\n EventHandler.remove(this.clearIconElement, 'click', this.clearText);\n }\n }\n if (this.backIconElement) {\n EventHandler.remove(this.backIconElement, 'click', this.clickOnBackIcon);\n EventHandler.remove(this.clearIconElement, 'click', this.clearText);\n }\n EventHandler.remove(this.filterInput, 'input', this.onInput);\n EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);\n EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);\n EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);\n EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);\n this.filterInput = null;\n }\n attributes(this.targetElement(), { 'aria-expanded': 'false', 'aria-activedescendant': null });\n this.inputWrapper.container.classList.remove(dropDownListClasses.iconAnimation);\n if (this.isFiltering()) {\n this.actionCompleteData.isUpdated = false;\n }\n this.beforePopupOpen = false;\n var animModel = {\n name: 'FadeOut',\n duration: 100,\n delay: delay ? delay : 0\n };\n var popupInstance = this.popupObj;\n var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };\n this.trigger('close', eventArgs, function (eventArgs) {\n if (!isNullOrUndefined(_this.popupObj) &&\n !isNullOrUndefined(_this.popupObj.element.querySelector('.e-fixed-head'))) {\n var fixedHeader = _this.popupObj.element.querySelector('.e-fixed-head');\n fixedHeader.parentNode.removeChild(fixedHeader);\n _this.fixedHeaderElement = null;\n }\n if (!eventArgs.cancel) {\n if (_this.getModuleName() === 'autocomplete') {\n _this.rippleFun();\n }\n if (_this.isPopupOpen) {\n _this.popupObj.hide(new Animation(eventArgs.animation));\n }\n else {\n _this.destroyPopup();\n }\n }\n });\n };\n DropDownList.prototype.destroyPopup = function () {\n this.isPopupOpen = false;\n this.isFilterFocus = false;\n this.popupObj.destroy();\n detach(this.popupObj.element);\n };\n DropDownList.prototype.clickOnBackIcon = function () {\n this.hidePopup();\n this.focusIn();\n };\n /**\n * To Initialize the control rendering\n *\n * @private\n * @returns {void}\n */\n DropDownList.prototype.render = function () {\n if (this.element.tagName === 'INPUT') {\n this.inputElement = this.element;\n if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {\n this.inputElement.setAttribute('role', 'textbox');\n }\n if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {\n this.inputElement.setAttribute('type', 'text');\n }\n }\n else {\n this.inputElement = this.createElement('input', { attrs: { role: 'textbox', type: 'text' } });\n if (this.element.tagName !== this.getNgDirective()) {\n this.element.style.display = 'none';\n }\n this.element.parentElement.insertBefore(this.inputElement, this.element);\n this.preventTabIndex(this.inputElement);\n }\n var updatedCssClassValues = this.cssClass;\n if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {\n updatedCssClassValues = (this.cssClass.replace(/\\s+/g, ' ')).trim();\n }\n this.inputWrapper = Input.createInput({\n element: this.inputElement,\n buttons: this.isPopupButton() ? [dropDownListClasses.icon] : null,\n floatLabelType: this.floatLabelType,\n properties: {\n readonly: this.getModuleName() === 'dropdownlist' ? true : this.readonly,\n placeholder: this.placeholder,\n cssClass: updatedCssClassValues,\n enabled: this.enabled,\n enableRtl: this.enableRtl,\n showClearButton: this.showClearButton\n }\n }, this.createElement);\n if (this.element.tagName === this.getNgDirective()) {\n this.element.appendChild(this.inputWrapper.container);\n }\n else {\n this.inputElement.parentElement.insertBefore(this.element, this.inputElement);\n }\n this.hiddenElement = this.createElement('select', {\n attrs: { 'aria-hidden': 'true', 'tabindex': '-1', 'class': dropDownListClasses.hiddenElement }\n });\n prepend([this.hiddenElement], this.inputWrapper.container);\n this.validationAttribute(this.element, this.hiddenElement);\n this.setReadOnly();\n this.setFields();\n this.inputWrapper.container.style.width = formatUnit(this.width);\n this.inputWrapper.container.classList.add('e-ddl');\n this.wireEvent();\n this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';\n this.element.removeAttribute('tabindex');\n var id = this.element.getAttribute('id') ? this.element.getAttribute('id') : getUniqueID('ej2_dropdownlist');\n this.element.id = id;\n this.hiddenElement.id = id + '_hidden';\n this.targetElement().setAttribute('tabindex', this.tabIndex);\n attributes(this.targetElement(), this.getAriaAttributes());\n this.updateDataAttribute(this.htmlAttributes);\n this.setHTMLAttributes();\n if (this.value !== null || this.activeIndex !== null || this.text !== null) {\n this.initValue();\n }\n else if (this.element.tagName === 'SELECT' && this.element.options[0]) {\n var selectElement = this.element;\n this.value = selectElement.options[selectElement.selectedIndex].value;\n this.text = isNullOrUndefined(this.value) ? null : selectElement.options[selectElement.selectedIndex].textContent;\n this.initValue();\n }\n this.preventTabIndex(this.element);\n if (!this.enabled) {\n this.targetElement().tabIndex = -1;\n }\n this.initial = false;\n this.element.style.opacity = '';\n this.inputElement.onselect = function (e) {\n e.stopImmediatePropagation();\n };\n this.inputElement.onchange = function (e) {\n e.stopImmediatePropagation();\n };\n if (this.element.hasAttribute('autofocus')) {\n this.focusIn();\n }\n if (!isNullOrUndefined(this.text)) {\n this.inputElement.setAttribute('value', this.text);\n }\n if (this.element.hasAttribute('data-val')) {\n this.element.setAttribute('data-val', 'false');\n }\n this.renderComplete();\n };\n DropDownList.prototype.setFooterTemplate = function (popupEle) {\n var compiledString;\n if (this.footer) {\n this.footer.innerHTML = '';\n }\n else {\n this.footer = this.createElement('div');\n addClass([this.footer], dropDownListClasses.footer);\n }\n var footercheck = this.dropdownCompiler(this.footerTemplate);\n if (footercheck) {\n compiledString = compile(select(this.footerTemplate, document).innerHTML.trim());\n }\n else {\n compiledString = compile(this.footerTemplate);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var footerCompTemp = compiledString({}, this, 'footerTemplate', this.footerTemplateId, this.isStringTemplate, null, this.footer);\n if (footerCompTemp && footerCompTemp.length > 0) {\n for (var i = 0; i < footerCompTemp.length; i++) {\n this.footer.appendChild(footerCompTemp[i]);\n }\n }\n append([this.footer], popupEle);\n };\n DropDownList.prototype.setHeaderTemplate = function (popupEle) {\n var compiledString;\n if (this.header) {\n this.header.innerHTML = '';\n }\n else {\n this.header = this.createElement('div');\n addClass([this.header], dropDownListClasses.header);\n }\n var headercheck = this.dropdownCompiler(this.headerTemplate);\n if (headercheck) {\n compiledString = compile(select(this.headerTemplate, document).innerHTML.trim());\n }\n else {\n compiledString = compile(this.headerTemplate);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var headerCompTemp = compiledString({}, this, 'headerTemplate', this.headerTemplateId, this.isStringTemplate, null, this.header);\n if (headerCompTemp && headerCompTemp.length) {\n for (var i = 0; i < headerCompTemp.length; i++) {\n this.header.appendChild(headerCompTemp[i]);\n }\n }\n var contentEle = popupEle.querySelector('div.e-content');\n popupEle.insertBefore(this.header, contentEle);\n };\n DropDownList.prototype.setOldText = function (text) {\n this.text = text;\n };\n DropDownList.prototype.setOldValue = function (value) {\n this.value = value;\n };\n DropDownList.prototype.refreshPopup = function () {\n if (!isNullOrUndefined(this.popupObj) && document.body.contains(this.popupObj.element) &&\n ((this.allowFiltering && !(Browser.isDevice && this.isFilterLayout())) || this.getModuleName() === 'autocomplete')) {\n removeClass([this.popupObj.element], 'e-popup-close');\n this.popupObj.refreshPosition(this.inputWrapper.container);\n this.popupObj.resolveCollision();\n }\n };\n DropDownList.prototype.checkData = function (newProp) {\n if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource)) && this.itemTemplate && this.allowFiltering &&\n !(this.isListSearched && (newProp.dataSource instanceof DataManager))) {\n this.list = null;\n this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };\n }\n this.isListSearched = false;\n var isChangeValue = Object.keys(newProp).indexOf('value') !== -1 && isNullOrUndefined(newProp.value);\n var isChangeText = Object.keys(newProp).indexOf('text') !== -1 && isNullOrUndefined(newProp.text);\n if (this.getModuleName() !== 'autocomplete' && this.allowFiltering && (isChangeValue || isChangeText)) {\n this.itemData = null;\n }\n if (this.allowFiltering && newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))) {\n this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };\n this.actionData = this.actionCompleteData;\n }\n else if (this.allowFiltering && newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {\n this.actionCompleteData = this.getModuleName() === 'combobox' ?\n { ulElement: null, list: null, isUpdated: false } : this.actionCompleteData;\n this.actionData = this.actionCompleteData;\n }\n };\n DropDownList.prototype.updateDataSource = function (props) {\n if (this.inputElement.value !== '' || (!isNullOrUndefined(props) && (isNullOrUndefined(props.dataSource)\n || (!(props.dataSource instanceof DataManager) && props.dataSource.length === 0)))) {\n this.clearAll(null, props);\n }\n if ((this.fields.groupBy && props.fields) && !this.isGroupChecking) {\n EventHandler.remove(this.list, 'scroll', this.setFloatingHeader);\n EventHandler.add(this.list, 'scroll', this.setFloatingHeader, this);\n }\n if (!(!isNullOrUndefined(props) && (isNullOrUndefined(props.dataSource)\n || (!(props.dataSource instanceof DataManager) && props.dataSource.length === 0))) || !(props.dataSource === [])) {\n this.typedString = '';\n this.resetList(this.dataSource);\n }\n if (!this.isCustomFilter && !this.isFilterFocus && document.activeElement !== this.filterInput) {\n this.checkCustomValue();\n }\n };\n DropDownList.prototype.checkCustomValue = function () {\n this.itemData = this.getDataByValue(this.value);\n var dataItem = this.getItemData();\n this.setProperties({ 'value': dataItem.value, 'text': dataItem.text });\n };\n DropDownList.prototype.updateInputFields = function () {\n if (this.getModuleName() === 'dropdownlist') {\n Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);\n }\n };\n /**\n * Dynamically change the value of properties.\n *\n * @private\n * @param {DropDownListModel} newProp - Returns the dynamic property value of the component.\n * @param {DropDownListModel} oldProp - Returns the previous previous value of the component.\n * @returns {void}\n */\n DropDownList.prototype.onPropertyChanged = function (newProp, oldProp) {\n if (this.getModuleName() === 'dropdownlist') {\n this.checkData(newProp);\n this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);\n }\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'query':\n case 'dataSource': break;\n case 'htmlAttributes':\n this.setHTMLAttributes();\n break;\n case 'width':\n this.setEleWidth(newProp.width);\n break;\n case 'placeholder':\n Input.setPlaceholder(newProp.placeholder, this.inputElement);\n break;\n case 'filterBarPlaceholder':\n if (this.filterInput) {\n Input.setPlaceholder(newProp.filterBarPlaceholder, this.filterInput);\n }\n break;\n case 'readonly':\n if (this.getModuleName() !== 'dropdownlist') {\n Input.setReadonly(newProp.readonly, this.inputElement);\n }\n this.setReadOnly();\n break;\n case 'cssClass':\n this.setCssClass(newProp.cssClass, oldProp.cssClass);\n break;\n case 'enableRtl':\n this.setEnableRtl();\n break;\n case 'enabled':\n this.setEnable();\n break;\n case 'text':\n if (newProp.text === null) {\n this.clearAll();\n break;\n }\n if (!this.list) {\n if (this.dataSource instanceof DataManager) {\n this.initRemoteRender = true;\n }\n this.renderList();\n }\n if (!this.initRemoteRender) {\n var li = this.getElementByText(newProp.text);\n if (!this.checkValidLi(li)) {\n if (this.liCollections && this.liCollections.length === 100 &&\n this.getModuleName() === 'autocomplete' && this.listData.length > 100) {\n this.setSelectionData(newProp.text, oldProp.text, 'text');\n }\n else {\n this.setOldText(oldProp.text);\n }\n }\n this.updateInputFields();\n }\n break;\n case 'value':\n if (newProp.value === null) {\n this.clearAll();\n break;\n }\n this.notify('beforeValueChange', { newProp: newProp }); // gird component value type change\n if (!this.list) {\n if (this.dataSource instanceof DataManager) {\n this.initRemoteRender = true;\n }\n this.renderList();\n }\n if (!this.initRemoteRender) {\n var item = this.getElementByValue(newProp.value);\n if (!this.checkValidLi(item)) {\n if (this.liCollections && this.liCollections.length === 100 &&\n this.getModuleName() === 'autocomplete' && this.listData.length > 100) {\n this.setSelectionData(newProp.value, oldProp.value, 'value');\n }\n else {\n this.setOldValue(oldProp.value);\n }\n }\n this.updateInputFields();\n this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;\n }\n break;\n case 'index':\n if (newProp.index === null) {\n this.clearAll();\n break;\n }\n if (!this.list) {\n if (this.dataSource instanceof DataManager) {\n this.initRemoteRender = true;\n }\n this.renderList();\n }\n if (!this.initRemoteRender && this.liCollections) {\n var element = this.liCollections[newProp.index];\n if (!this.checkValidLi(element)) {\n if (this.liCollections && this.liCollections.length === 100 &&\n this.getModuleName() === 'autocomplete' && this.listData.length > 100) {\n this.setSelectionData(newProp.index, oldProp.index, 'index');\n }\n else {\n this.index = oldProp.index;\n }\n }\n this.updateInputFields();\n }\n break;\n case 'footerTemplate':\n if (this.popupObj) {\n this.setFooterTemplate(this.popupObj.element);\n }\n break;\n case 'headerTemplate':\n if (this.popupObj) {\n this.setHeaderTemplate(this.popupObj.element);\n }\n break;\n case 'valueTemplate':\n if (!isNullOrUndefined(this.itemData) && this.valueTemplate != null) {\n this.setValueTemplate();\n }\n break;\n case 'allowFiltering':\n if (this.allowFiltering) {\n this.actionCompleteData = { ulElement: this.ulElement,\n list: this.listData, isUpdated: true };\n this.actionData = this.actionCompleteData;\n this.updateSelectElementData(this.allowFiltering);\n }\n break;\n case 'floatLabelType':\n Input.removeFloating(this.inputWrapper);\n Input.addFloating(this.inputElement, newProp.floatLabelType, this.placeholder, this.createElement);\n break;\n case 'showClearButton':\n Input.setClearButton(newProp.showClearButton, this.inputElement, this.inputWrapper, null, this.createElement);\n this.bindClearEvent();\n break;\n default:\n {\n // eslint-disable-next-line max-len\n var ddlProps = this.getPropObject(prop, newProp, oldProp);\n _super.prototype.onPropertyChanged.call(this, ddlProps.newProperty, ddlProps.oldProperty);\n }\n break;\n }\n }\n };\n DropDownList.prototype.checkValidLi = function (element) {\n if (this.isValidLI(element)) {\n this.setSelection(element, null);\n return true;\n }\n return false;\n };\n DropDownList.prototype.setSelectionData = function (newProp, oldProp, prop) {\n var _this = this;\n var li;\n this.updateListValues = function () {\n if (prop === 'text') {\n li = _this.getElementByText(newProp);\n if (!_this.checkValidLi(li)) {\n _this.setOldText(oldProp);\n }\n }\n else if (prop === 'value') {\n li = _this.getElementByValue(newProp);\n if (!_this.checkValidLi(li)) {\n _this.setOldValue(oldProp);\n }\n }\n else if (prop === 'index') {\n li = _this.liCollections[newProp];\n if (!_this.checkValidLi(li)) {\n _this.index = oldProp;\n }\n }\n };\n };\n DropDownList.prototype.setReadOnly = function () {\n if (this.readonly) {\n addClass([this.inputWrapper.container], ['e-readonly']);\n }\n else {\n removeClass([this.inputWrapper.container], ['e-readonly']);\n }\n };\n DropDownList.prototype.setCssClass = function (newClass, oldClass) {\n if (!isNullOrUndefined(oldClass)) {\n oldClass = (oldClass.replace(/\\s+/g, ' ')).trim();\n }\n if (!isNullOrUndefined(newClass)) {\n newClass = (newClass.replace(/\\s+/g, ' ')).trim();\n }\n Input.setCssClass(newClass, [this.inputWrapper.container], oldClass);\n if (this.popupObj) {\n Input.setCssClass(newClass, [this.popupObj.element], oldClass);\n }\n };\n /**\n * Return the module name of this component.\n *\n * @private\n * @returns {string} Return the module name of this component.\n */\n DropDownList.prototype.getModuleName = function () {\n return 'dropdownlist';\n };\n /**\n * Opens the popup that displays the list of items.\n *\n * @returns {void}\n */\n DropDownList.prototype.showPopup = function () {\n if (!this.enabled) {\n return;\n }\n if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list != this.actionCompleteData.list) &&\n this.actionData.list && this.actionData.ulElement) {\n this.actionCompleteData = this.actionData;\n this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);\n }\n if (this.beforePopupOpen) {\n this.refreshPopup();\n return;\n }\n this.beforePopupOpen = true;\n if (this.isFiltering() && !this.isActive && this.actionCompleteData.list && this.actionCompleteData.list[0]) {\n this.isActive = true;\n this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);\n }\n else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||\n this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {\n this.renderList();\n }\n this.invokeRenderPopup();\n };\n DropDownList.prototype.invokeRenderPopup = function () {\n if (Browser.isDevice && this.isFilterLayout()) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var proxy_2 = this;\n window.onpopstate = function () {\n proxy_2.hidePopup();\n };\n history.pushState({}, '');\n }\n if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {\n this.renderPopup();\n }\n attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });\n };\n DropDownList.prototype.renderHightSearch = function () {\n // update high light search\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-param */\n /**\n * Hides the popup if it is in an open state.\n *\n * @returns {void}\n */\n DropDownList.prototype.hidePopup = function (e) {\n /* eslint-enable valid-jsdoc, jsdoc/require-param */\n if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {\n Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);\n this.isEscapeKey = false;\n if (!isNullOrUndefined(this.index)) {\n var element = this.findListElement(this.ulElement, 'li', 'data-value', this.value);\n this.selectedLI = this.liCollections[this.index] || element;\n if (this.selectedLI) {\n this.updateSelectedItem(this.selectedLI, null, true);\n if (this.valueTemplate && this.itemData !== null) {\n this.setValueTemplate();\n }\n }\n }\n else {\n this.resetSelection();\n }\n }\n this.closePopup();\n var dataItem = this.getItemData();\n var isSelectVal = !isNullOrUndefined(this.selectedLI);\n if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||\n isSelectVal && this.inputElement.value !== dataItem.text)) {\n this.isSelectCustom = false;\n this.clearAll(e);\n }\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-param */\n /**\n * Sets the focus on the component for interaction.\n *\n * @returns {void}\n */\n DropDownList.prototype.focusIn = function (e) {\n if (!this.enabled) {\n return;\n }\n if (this.targetElement().classList.contains(dropDownListClasses.disable)) {\n return;\n }\n var isFocused = false;\n if (this.preventFocus && Browser.isDevice) {\n this.inputWrapper.container.tabIndex = 1;\n this.inputWrapper.container.focus();\n this.preventFocus = false;\n isFocused = true;\n }\n if (!isFocused) {\n this.targetElement().focus();\n }\n addClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);\n this.onFocus(e);\n };\n /**\n * Moves the focus from the component if the component is already focused.\n *\n * @returns {void}\n */\n DropDownList.prototype.focusOut = function (e) {\n /* eslint-enable valid-jsdoc, jsdoc/require-param */\n if (!this.enabled) {\n return;\n }\n this.isTyped = true;\n this.hidePopup(e);\n if (this.targetElement()) {\n this.targetElement().blur();\n }\n removeClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);\n };\n /**\n * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.\n *\n * @method destroy\n * @returns {void}\n */\n DropDownList.prototype.destroy = function () {\n this.isActive = false;\n resetIncrementalSearchValues(this.element.id);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (this.isReact) {\n this.clearTemplate();\n }\n this.hidePopup();\n this.unWireEvent();\n if (this.list) {\n this.unWireListEvents();\n }\n if (this.element && !this.element.classList.contains('e-' + this.getModuleName())) {\n return;\n }\n if (this.inputElement) {\n var attrArray = ['readonly', 'aria-disabled', 'aria-placeholder',\n 'placeholder', 'aria-owns', 'aria-labelledby', 'aria-haspopup', 'aria-expanded',\n 'aria-activedescendant', 'autocomplete', 'aria-readonly', 'autocorrect',\n 'autocapitalize', 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];\n for (var i = 0; i < attrArray.length; i++) {\n this.inputElement.removeAttribute(attrArray[i]);\n }\n this.inputElement.setAttribute('tabindex', this.tabIndex);\n this.inputElement.classList.remove('e-input');\n Input.setValue('', this.inputElement, this.floatLabelType, this.showClearButton);\n }\n this.element.style.display = 'block';\n if (this.inputWrapper.container.parentElement.tagName === this.getNgDirective()) {\n detach(this.inputWrapper.container);\n }\n else {\n this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);\n detach(this.inputWrapper.container);\n }\n _super.prototype.destroy.call(this);\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Gets all the list items bound on this component.\n *\n * @returns {Element[]}\n */\n DropDownList.prototype.getItems = function () {\n if (!this.list) {\n if (this.dataSource instanceof DataManager) {\n this.initRemoteRender = true;\n }\n this.renderList();\n }\n return this.ulElement ? _super.prototype.getItems.call(this) : [];\n };\n /**\n * Gets the data Object that matches the given value.\n *\n * @param { string | number } value - Specifies the value of the list item.\n * @returns {Object}\n */\n DropDownList.prototype.getDataByValue = function (value) {\n return _super.prototype.getDataByValue.call(this, value);\n };\n /* eslint-enable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Allows you to clear the selected values from the component.\n *\n * @returns {void}\n */\n DropDownList.prototype.clear = function () {\n this.value = null;\n };\n __decorate([\n Property(null)\n ], DropDownList.prototype, \"cssClass\", void 0);\n __decorate([\n Property('100%')\n ], DropDownList.prototype, \"width\", void 0);\n __decorate([\n Property('300px')\n ], DropDownList.prototype, \"popupHeight\", void 0);\n __decorate([\n Property('100%')\n ], DropDownList.prototype, \"popupWidth\", void 0);\n __decorate([\n Property(null)\n ], DropDownList.prototype, \"placeholder\", void 0);\n __decorate([\n Property(null)\n ], DropDownList.prototype, \"filterBarPlaceholder\", void 0);\n __decorate([\n Property({})\n ], DropDownList.prototype, \"htmlAttributes\", void 0);\n __decorate([\n Property(null)\n ], DropDownList.prototype, \"query\", void 0);\n __decorate([\n Property(null)\n ], DropDownList.prototype, \"valueTemplate\", void 0);\n __decorate([\n Property(null)\n ], DropDownList.prototype, \"headerTemplate\", void 0);\n __decorate([\n Property(null)\n ], DropDownList.prototype, \"footerTemplate\", void 0);\n __decorate([\n Property(false)\n ], DropDownList.prototype, \"allowFiltering\", void 0);\n __decorate([\n Property(false)\n ], DropDownList.prototype, \"readonly\", void 0);\n __decorate([\n Property(null)\n ], DropDownList.prototype, \"text\", void 0);\n __decorate([\n Property(null)\n ], DropDownList.prototype, \"value\", void 0);\n __decorate([\n Property(null)\n ], DropDownList.prototype, \"index\", void 0);\n __decorate([\n Property('Never')\n ], DropDownList.prototype, \"floatLabelType\", void 0);\n __decorate([\n Property(false)\n ], DropDownList.prototype, \"showClearButton\", void 0);\n __decorate([\n Event()\n ], DropDownList.prototype, \"filtering\", void 0);\n __decorate([\n Event()\n ], DropDownList.prototype, \"change\", void 0);\n __decorate([\n Event()\n ], DropDownList.prototype, \"beforeOpen\", void 0);\n __decorate([\n Event()\n ], DropDownList.prototype, \"open\", void 0);\n __decorate([\n Event()\n ], DropDownList.prototype, \"close\", void 0);\n __decorate([\n Event()\n ], DropDownList.prototype, \"blur\", void 0);\n __decorate([\n Event()\n ], DropDownList.prototype, \"focus\", void 0);\n DropDownList = __decorate([\n NotifyPropertyChanges\n ], DropDownList);\n return DropDownList;\n}(DropDownBase));\nexport { DropDownList };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, EventHandler, Property, Event, Browser, L10n } from '@syncfusion/ej2-base';\nimport { NotifyPropertyChanges } from '@syncfusion/ej2-base';\nimport { attributes, addClass, removeClass, detach, closest } from '@syncfusion/ej2-base';\nimport { isNullOrUndefined, getValue, formatUnit, setValue, merge } from '@syncfusion/ej2-base';\nimport { Internationalization, getNumericObject } from '@syncfusion/ej2-base';\nimport { Input } from '../input/input';\nvar ROOT = 'e-control-wrapper e-numeric';\nvar SPINICON = 'e-input-group-icon';\nvar SPINUP = 'e-spin-up';\nvar SPINDOWN = 'e-spin-down';\nvar ERROR = 'e-error';\nvar INCREMENT = 'increment';\nvar DECREMENT = 'decrement';\nvar INTREGEXP = new RegExp('^(-)?(\\\\d*)$');\nvar DECIMALSEPARATOR = '.';\nvar COMPONENT = 'e-numerictextbox';\nvar CONTROL = 'e-control';\nvar NUMERIC_FOCUS = 'e-input-focus';\nvar HIDDENELEMENT = 'e-numeric-hidden';\nvar wrapperAttributes = ['title', 'style', 'class'];\n/**\n * Represents the NumericTextBox component that allows the user to enter only numeric values.\n * ```html\n *
\n * ```\n * ```typescript\n * \n * ```\n */\nvar NumericTextBox = /** @class */ (function (_super) {\n __extends(NumericTextBox, _super);\n /**\n *\n * @param {NumericTextBoxModel} options - Specifies the NumericTextBox model.\n * @param {string | HTMLInputElement} element - Specifies the element to render as component.\n * @private\n */\n function NumericTextBox(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.isVue = false;\n _this.preventChange = false;\n _this.isAngular = false;\n _this.isDynamicChange = false;\n _this.numericOptions = options;\n return _this;\n }\n NumericTextBox.prototype.preRender = function () {\n this.isPrevFocused = false;\n this.decimalSeparator = '.';\n // eslint-disable-next-line no-useless-escape\n this.intRegExp = new RegExp('/^(-)?(\\d*)$/');\n this.isCalled = false;\n var ejInstance = getValue('ej2_instances', this.element);\n this.cloneElement = this.element.cloneNode(true);\n removeClass([this.cloneElement], [CONTROL, COMPONENT, 'e-lib']);\n this.angularTagName = null;\n this.formEle = closest(this.element, 'form');\n if (this.element.tagName === 'EJS-NUMERICTEXTBOX') {\n this.angularTagName = this.element.tagName;\n var input = this.createElement('input');\n var index = 0;\n for (index; index < this.element.attributes.length; index++) {\n var attributeName = this.element.attributes[index].nodeName;\n if (attributeName !== 'id') {\n input.setAttribute(this.element.attributes[index].nodeName, this.element.attributes[index].nodeValue);\n input.innerHTML = this.element.innerHTML;\n }\n }\n if (this.element.hasAttribute('name')) {\n this.element.removeAttribute('name');\n }\n this.element.classList.remove('e-control', 'e-numerictextbox');\n this.element.appendChild(input);\n this.element = input;\n setValue('ej2_instances', ejInstance, this.element);\n }\n attributes(this.element, { 'role': 'spinbutton', 'tabindex': '0', 'autocomplete': 'off', 'aria-live': 'assertive' });\n var localeText = {\n incrementTitle: 'Increment value', decrementTitle: 'Decrement value', placeholder: this.placeholder\n };\n this.l10n = new L10n('numerictextbox', localeText, this.locale);\n if (this.l10n.getConstant('placeholder') !== '') {\n this.setProperties({ placeholder: this.placeholder || this.l10n.getConstant('placeholder') }, true);\n }\n this.isValidState = true;\n this.inputStyle = null;\n this.inputName = null;\n this.cultureInfo = {};\n this.initCultureInfo();\n this.initCultureFunc();\n this.prevValue = this.value;\n this.updateHTMLAttrToElement();\n this.checkAttributes(false);\n if (this.formEle) {\n this.inputEleValue = this.value;\n }\n this.validateMinMax();\n this.validateStep();\n if (this.placeholder === null) {\n this.updatePlaceholder();\n }\n };\n /**\n * To Initialize the control rendering\n *\n * @returns {void}\n * @private\n */\n NumericTextBox.prototype.render = function () {\n if (this.element.tagName.toLowerCase() === 'input') {\n this.createWrapper();\n if (this.showSpinButton) {\n this.spinBtnCreation();\n }\n this.setElementWidth(this.width);\n if (!this.container.classList.contains('e-input-group')) {\n this.container.classList.add('e-input-group');\n }\n this.changeValue(this.value === null || isNaN(this.value) ?\n null : this.strictMode ? this.trimValue(this.value) : this.value);\n this.wireEvents();\n if (this.value !== null && !isNaN(this.value)) {\n if (this.decimals) {\n this.setProperties({ value: this.roundNumber(this.value, this.decimals) }, true);\n }\n }\n if (this.element.getAttribute('value') || this.value) {\n this.element.setAttribute('value', this.element.value);\n this.hiddenInput.setAttribute('value', this.hiddenInput.value);\n }\n this.elementPrevValue = this.element.value;\n if (this.element.hasAttribute('data-val')) {\n this.element.setAttribute('data-val', 'false');\n }\n this.renderComplete();\n }\n };\n NumericTextBox.prototype.checkAttributes = function (isDynamic) {\n var attributes = isDynamic ? isNullOrUndefined(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :\n ['value', 'min', 'max', 'step', 'disabled', 'readonly', 'style', 'name', 'placeholder'];\n for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {\n var prop = attributes_1[_i];\n if (!isNullOrUndefined(this.element.getAttribute(prop))) {\n switch (prop) {\n case 'disabled':\n if ((isNullOrUndefined(this.numericOptions) || (this.numericOptions['enabled'] === undefined)) || isDynamic) {\n var enabled = this.element.getAttribute(prop) === 'disabled' || this.element.getAttribute(prop) === ''\n || this.element.getAttribute(prop) === 'true' ? false : true;\n this.setProperties({ enabled: enabled }, !isDynamic);\n }\n break;\n case 'readonly':\n if ((isNullOrUndefined(this.numericOptions) || (this.numericOptions['readonly'] === undefined)) || isDynamic) {\n var readonly = this.element.getAttribute(prop) === 'readonly' || this.element.getAttribute(prop) === ''\n || this.element.getAttribute(prop) === 'true' ? true : false;\n this.setProperties({ readonly: readonly }, !isDynamic);\n }\n break;\n case 'placeholder':\n if ((isNullOrUndefined(this.numericOptions) || (this.numericOptions['placeholder'] === undefined)) || isDynamic) {\n this.setProperties({ placeholder: this.element.placeholder }, !isDynamic);\n }\n break;\n case 'value':\n if ((isNullOrUndefined(this.numericOptions) || (this.numericOptions['value'] === undefined)) || isDynamic) {\n var setNumber = this.instance.getNumberParser({ format: 'n' })(this.element.getAttribute(prop));\n this.setProperties(setValue(prop, setNumber, {}), !isDynamic);\n }\n break;\n case 'min':\n if ((isNullOrUndefined(this.numericOptions) || (this.numericOptions['min'] === undefined)) || isDynamic) {\n var minValue = this.instance.getNumberParser({ format: 'n' })(this.element.getAttribute(prop));\n if (minValue !== null && !isNaN(minValue)) {\n this.setProperties(setValue(prop, minValue, {}), !isDynamic);\n }\n }\n break;\n case 'max':\n if ((isNullOrUndefined(this.numericOptions) || (this.numericOptions['max'] === undefined)) || isDynamic) {\n var maxValue = this.instance.getNumberParser({ format: 'n' })(this.element.getAttribute(prop));\n if (maxValue !== null && !isNaN(maxValue)) {\n this.setProperties(setValue(prop, maxValue, {}), !isDynamic);\n }\n }\n break;\n case 'step':\n if ((isNullOrUndefined(this.numericOptions) || (this.numericOptions['step'] === undefined)) || isDynamic) {\n var stepValue = this.instance.getNumberParser({ format: 'n' })(this.element.getAttribute(prop));\n if (stepValue !== null && !isNaN(stepValue)) {\n this.setProperties(setValue(prop, stepValue, {}), !isDynamic);\n }\n }\n break;\n case 'style':\n this.inputStyle = this.element.getAttribute(prop);\n break;\n case 'name':\n this.inputName = this.element.getAttribute(prop);\n break;\n default:\n {\n var value = this.instance.getNumberParser({ format: 'n' })(this.element.getAttribute(prop));\n if ((value !== null && !isNaN(value)) || (prop === 'value')) {\n this.setProperties(setValue(prop, value, {}), true);\n }\n }\n break;\n }\n }\n }\n };\n NumericTextBox.prototype.updatePlaceholder = function () {\n this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);\n };\n NumericTextBox.prototype.initCultureFunc = function () {\n this.instance = new Internationalization(this.locale);\n };\n NumericTextBox.prototype.initCultureInfo = function () {\n this.cultureInfo.format = this.format;\n if (getValue('currency', this) !== null) {\n setValue('currency', this.currency, this.cultureInfo);\n this.setProperties({ currencyCode: this.currency }, true);\n }\n };\n /* Wrapper creation */\n NumericTextBox.prototype.createWrapper = function () {\n var updatedCssClassValue = this.cssClass;\n if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {\n updatedCssClassValue = this.getNumericValidClassList(this.cssClass);\n }\n var inputObj = Input.createInput({\n element: this.element,\n floatLabelType: this.floatLabelType,\n properties: {\n readonly: this.readonly,\n placeholder: this.placeholder,\n cssClass: updatedCssClassValue,\n enableRtl: this.enableRtl,\n showClearButton: this.showClearButton,\n enabled: this.enabled\n }\n }, this.createElement);\n this.inputWrapper = inputObj;\n this.container = inputObj.container;\n this.container.setAttribute('class', ROOT + ' ' + this.container.getAttribute('class'));\n this.updateHTMLAttrToWrapper();\n if (this.readonly) {\n attributes(this.element, { 'aria-readonly': 'true' });\n }\n this.hiddenInput = (this.createElement('input', { attrs: { type: 'text',\n 'validateHidden': 'true', 'class': HIDDENELEMENT } }));\n this.inputName = this.inputName !== null ? this.inputName : this.element.id;\n this.element.removeAttribute('name');\n attributes(this.hiddenInput, { 'name': this.inputName });\n this.container.insertBefore(this.hiddenInput, this.container.childNodes[1]);\n this.updateDataAttribute(false);\n if (this.inputStyle !== null) {\n attributes(this.container, { 'style': this.inputStyle });\n }\n };\n NumericTextBox.prototype.updateDataAttribute = function (isDynamic) {\n var attr = {};\n if (!isDynamic) {\n for (var a = 0; a < this.element.attributes.length; a++) {\n attr[this.element.attributes[a].name] = this.element.getAttribute(this.element.attributes[a].name);\n }\n }\n else {\n attr = this.htmlAttributes;\n }\n for (var _i = 0, _a = Object.keys(attr); _i < _a.length; _i++) {\n var key = _a[_i];\n if (key.indexOf('data') === 0) {\n this.hiddenInput.setAttribute(key, attr[key]);\n }\n }\n };\n NumericTextBox.prototype.updateHTMLAttrToElement = function () {\n if (!isNullOrUndefined(this.htmlAttributes)) {\n for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {\n var pro = _a[_i];\n if (wrapperAttributes.indexOf(pro) < 0) {\n this.element.setAttribute(pro, this.htmlAttributes[pro]);\n }\n }\n }\n };\n NumericTextBox.prototype.updateCssClass = function (newClass, oldClass) {\n Input.setCssClass(this.getNumericValidClassList(newClass), [this.container], this.getNumericValidClassList(oldClass));\n };\n NumericTextBox.prototype.getNumericValidClassList = function (numericClassName) {\n var result = numericClassName;\n if (!isNullOrUndefined(numericClassName) && numericClassName !== '') {\n result = (numericClassName.replace(/\\s+/g, ' ')).trim();\n }\n return result;\n };\n NumericTextBox.prototype.updateHTMLAttrToWrapper = function () {\n if (!isNullOrUndefined(this.htmlAttributes)) {\n for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {\n var pro = _a[_i];\n if (wrapperAttributes.indexOf(pro) > -1) {\n if (pro === 'class') {\n var updatedClassValue = this.getNumericValidClassList(this.htmlAttributes[pro]);\n if (updatedClassValue !== '') {\n addClass([this.container], updatedClassValue.split(' '));\n }\n }\n else if (pro === 'style') {\n var numericStyle = this.container.getAttribute(pro);\n numericStyle = !isNullOrUndefined(numericStyle) ? (numericStyle + this.htmlAttributes[pro]) :\n this.htmlAttributes[pro];\n this.container.setAttribute(pro, numericStyle);\n }\n else {\n this.container.setAttribute(pro, this.htmlAttributes[pro]);\n }\n }\n }\n }\n };\n NumericTextBox.prototype.setElementWidth = function (width) {\n if (!isNullOrUndefined(width)) {\n if (typeof width === 'number') {\n this.container.style.width = formatUnit(width);\n }\n else if (typeof width === 'string') {\n this.container.style.width = (width.match(/px|%|em/)) ? (width) : (formatUnit(width));\n }\n }\n };\n /* Spinner creation */\n NumericTextBox.prototype.spinBtnCreation = function () {\n this.spinDown = Input.appendSpan(SPINICON + ' ' + SPINDOWN, this.container, this.createElement);\n attributes(this.spinDown, {\n 'title': this.l10n.getConstant('decrementTitle'),\n 'aria-label': this.l10n.getConstant('decrementTitle')\n });\n this.spinUp = Input.appendSpan(SPINICON + ' ' + SPINUP, this.container, this.createElement);\n attributes(this.spinUp, {\n 'title': this.l10n.getConstant('incrementTitle'),\n 'aria-label': this.l10n.getConstant('incrementTitle')\n });\n this.wireSpinBtnEvents();\n };\n NumericTextBox.prototype.validateMinMax = function () {\n if (!(typeof (this.min) === 'number' && !isNaN(this.min))) {\n this.setProperties({ min: -(Number.MAX_VALUE) }, true);\n }\n if (!(typeof (this.max) === 'number' && !isNaN(this.max))) {\n this.setProperties({ max: Number.MAX_VALUE }, true);\n }\n if (this.decimals !== null) {\n if (this.min !== -(Number.MAX_VALUE)) {\n this.setProperties({ min: this.instance.getNumberParser({ format: 'n' })(this.formattedValue(this.decimals, this.min)) }, true);\n }\n if (this.max !== (Number.MAX_VALUE)) {\n this.setProperties({ max: this.instance.getNumberParser({ format: 'n' })(this.formattedValue(this.decimals, this.max)) }, true);\n }\n }\n this.setProperties({ min: this.min > this.max ? this.max : this.min }, true);\n attributes(this.element, { 'aria-valuemin': this.min.toString(), 'aria-valuemax': this.max.toString() });\n };\n NumericTextBox.prototype.formattedValue = function (decimals, value) {\n return this.instance.getNumberFormat({\n maximumFractionDigits: decimals,\n minimumFractionDigits: decimals, useGrouping: false\n })(value);\n };\n NumericTextBox.prototype.validateStep = function () {\n if (this.decimals !== null) {\n this.setProperties({ step: this.instance.getNumberParser({ format: 'n' })(this.formattedValue(this.decimals, this.step)) }, true);\n }\n };\n NumericTextBox.prototype.action = function (operation, event) {\n this.isInteract = true;\n var value = this.isFocused ? this.instance.getNumberParser({ format: 'n' })(this.element.value) : this.value;\n this.changeValue(this.performAction(value, this.step, operation));\n this.raiseChangeEvent(event);\n };\n NumericTextBox.prototype.checkErrorClass = function () {\n if (this.isValidState) {\n removeClass([this.container], ERROR);\n }\n else {\n addClass([this.container], ERROR);\n }\n attributes(this.element, { 'aria-invalid': this.isValidState ? 'false' : 'true' });\n };\n NumericTextBox.prototype.bindClearEvent = function () {\n if (this.showClearButton) {\n EventHandler.add(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler, this);\n }\n };\n NumericTextBox.prototype.resetHandler = function (e) {\n e.preventDefault();\n if (!(this.inputWrapper.clearButton.classList.contains('e-clear-icon-hide')) || this.inputWrapper.container.classList.contains('e-static-clear')) {\n this.clear(e);\n }\n this.isInteract = true;\n this.raiseChangeEvent(e);\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n NumericTextBox.prototype.clear = function (event) {\n this.setProperties({ value: null }, true);\n this.setElementValue('');\n this.hiddenInput.value = '';\n var formElement = closest(this.element, 'form');\n if (formElement) {\n var element = this.element.nextElementSibling;\n var keyupEvent = document.createEvent('KeyboardEvent');\n keyupEvent.initEvent('keyup', false, true);\n element.dispatchEvent(keyupEvent);\n }\n };\n NumericTextBox.prototype.resetFormHandler = function () {\n if (this.element.tagName === 'EJS-NUMERICTEXTBOX') {\n this.updateValue(null);\n }\n else {\n this.updateValue(this.inputEleValue);\n }\n };\n NumericTextBox.prototype.setSpinButton = function () {\n if (!isNullOrUndefined(this.spinDown)) {\n attributes(this.spinDown, {\n 'title': this.l10n.getConstant('decrementTitle'),\n 'aria-label': this.l10n.getConstant('decrementTitle')\n });\n }\n if (!isNullOrUndefined(this.spinUp)) {\n attributes(this.spinUp, {\n 'title': this.l10n.getConstant('incrementTitle'),\n 'aria-label': this.l10n.getConstant('incrementTitle')\n });\n }\n };\n NumericTextBox.prototype.wireEvents = function () {\n EventHandler.add(this.element, 'focus', this.focusHandler, this);\n EventHandler.add(this.element, 'blur', this.focusOutHandler, this);\n EventHandler.add(this.element, 'keydown', this.keyDownHandler, this);\n EventHandler.add(this.element, 'keyup', this.keyUpHandler, this);\n EventHandler.add(this.element, 'input', this.inputHandler, this);\n EventHandler.add(this.element, 'keypress', this.keyPressHandler, this);\n EventHandler.add(this.element, 'change', this.changeHandler, this);\n EventHandler.add(this.element, 'paste', this.pasteHandler, this);\n if (this.enabled) {\n this.bindClearEvent();\n if (this.formEle) {\n EventHandler.add(this.formEle, 'reset', this.resetFormHandler, this);\n }\n }\n };\n NumericTextBox.prototype.wireSpinBtnEvents = function () {\n /* bind spin button events */\n EventHandler.add(this.spinUp, Browser.touchStartEvent, this.mouseDownOnSpinner, this);\n EventHandler.add(this.spinDown, Browser.touchStartEvent, this.mouseDownOnSpinner, this);\n EventHandler.add(this.spinUp, Browser.touchEndEvent, this.mouseUpOnSpinner, this);\n EventHandler.add(this.spinDown, Browser.touchEndEvent, this.mouseUpOnSpinner, this);\n EventHandler.add(this.spinUp, Browser.touchMoveEvent, this.touchMoveOnSpinner, this);\n EventHandler.add(this.spinDown, Browser.touchMoveEvent, this.touchMoveOnSpinner, this);\n };\n NumericTextBox.prototype.unwireEvents = function () {\n EventHandler.remove(this.element, 'focus', this.focusHandler);\n EventHandler.remove(this.element, 'blur', this.focusOutHandler);\n EventHandler.remove(this.element, 'keyup', this.keyUpHandler);\n EventHandler.remove(this.element, 'input', this.inputHandler);\n EventHandler.remove(this.element, 'keydown', this.keyDownHandler);\n EventHandler.remove(this.element, 'keypress', this.keyPressHandler);\n EventHandler.remove(this.element, 'change', this.changeHandler);\n EventHandler.remove(this.element, 'paste', this.pasteHandler);\n if (this.formEle) {\n EventHandler.remove(this.formEle, 'reset', this.resetFormHandler);\n }\n };\n NumericTextBox.prototype.unwireSpinBtnEvents = function () {\n /* unbind spin button events */\n EventHandler.remove(this.spinUp, Browser.touchStartEvent, this.mouseDownOnSpinner);\n EventHandler.remove(this.spinDown, Browser.touchStartEvent, this.mouseDownOnSpinner);\n EventHandler.remove(this.spinUp, Browser.touchEndEvent, this.mouseUpOnSpinner);\n EventHandler.remove(this.spinDown, Browser.touchEndEvent, this.mouseUpOnSpinner);\n EventHandler.remove(this.spinUp, Browser.touchMoveEvent, this.touchMoveOnSpinner);\n EventHandler.remove(this.spinDown, Browser.touchMoveEvent, this.touchMoveOnSpinner);\n };\n NumericTextBox.prototype.changeHandler = function (event) {\n event.stopPropagation();\n if (!this.element.value.length) {\n this.setProperties({ value: null }, true);\n }\n var parsedInput = this.instance.getNumberParser({ format: 'n' })(this.element.value);\n this.updateValue(parsedInput, event);\n };\n NumericTextBox.prototype.raiseChangeEvent = function (event) {\n if (this.prevValue !== this.value) {\n var eventArgs = {};\n this.changeEventArgs = { value: this.value, previousValue: this.prevValue, isInteracted: this.isInteract,\n isInteraction: this.isInteract, event: event };\n if (event) {\n this.changeEventArgs.event = event;\n }\n if (this.changeEventArgs.event === undefined) {\n this.changeEventArgs.isInteracted = false;\n this.changeEventArgs.isInteraction = false;\n }\n merge(eventArgs, this.changeEventArgs);\n this.prevValue = this.value;\n this.isInteract = false;\n this.elementPrevValue = this.element.value;\n this.preventChange = false;\n this.trigger('change', eventArgs);\n }\n };\n NumericTextBox.prototype.pasteHandler = function () {\n var _this = this;\n if (!this.enabled || this.readonly) {\n return;\n }\n var beforeUpdate = this.element.value;\n setTimeout(function () {\n if (!_this.numericRegex().test(_this.element.value)) {\n _this.setElementValue(beforeUpdate);\n }\n });\n };\n NumericTextBox.prototype.preventHandler = function () {\n var _this = this;\n var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);\n setTimeout(function () {\n if (_this.element.selectionStart > 0) {\n var currentPos = _this.element.selectionStart;\n var prevPos = _this.element.selectionStart - 1;\n var start = 0;\n var valArray = _this.element.value.split('');\n var numericObject = getNumericObject(_this.locale);\n var decimalSeparator = getValue('decimal', numericObject);\n var ignoreKeyCode = decimalSeparator.charCodeAt(0);\n if (_this.element.value[prevPos] === ' ' && _this.element.selectionStart > 0 && !iOS) {\n if (isNullOrUndefined(_this.prevVal)) {\n _this.element.value = _this.element.value.trim();\n }\n else if (prevPos !== 0) {\n _this.element.value = _this.prevVal;\n }\n else if (prevPos === 0) {\n _this.element.value = _this.element.value.trim();\n }\n _this.element.setSelectionRange(prevPos, prevPos);\n }\n else if (isNaN(parseFloat(_this.element.value[_this.element.selectionStart - 1])) &&\n _this.element.value[_this.element.selectionStart - 1].charCodeAt(0) !== 45) {\n if ((valArray.indexOf(_this.element.value[_this.element.selectionStart - 1]) !==\n valArray.lastIndexOf(_this.element.value[_this.element.selectionStart - 1]) &&\n _this.element.value[_this.element.selectionStart - 1].charCodeAt(0) === ignoreKeyCode) ||\n _this.element.value[_this.element.selectionStart - 1].charCodeAt(0) !== ignoreKeyCode) {\n _this.element.value = _this.element.value.substring(0, prevPos) +\n _this.element.value.substring(currentPos, _this.element.value.length);\n _this.element.setSelectionRange(prevPos, prevPos);\n if (isNaN(parseFloat(_this.element.value[_this.element.selectionStart - 1])) && _this.element.selectionStart > 0\n && _this.element.value.length) {\n _this.preventHandler();\n }\n }\n }\n else if (isNaN(parseFloat(_this.element.value[_this.element.selectionStart - 2])) && _this.element.selectionStart > 1 &&\n _this.element.value[_this.element.selectionStart - 2].charCodeAt(0) !== 45) {\n if ((valArray.indexOf(_this.element.value[_this.element.selectionStart - 2]) !==\n valArray.lastIndexOf(_this.element.value[_this.element.selectionStart - 2]) &&\n _this.element.value[_this.element.selectionStart - 2].charCodeAt(0) === ignoreKeyCode) ||\n _this.element.value[_this.element.selectionStart - 2].charCodeAt(0) !== ignoreKeyCode) {\n _this.element.setSelectionRange(prevPos, prevPos);\n _this.nextEle = _this.element.value[_this.element.selectionStart];\n _this.cursorPosChanged = true;\n _this.preventHandler();\n }\n }\n if (_this.cursorPosChanged === true && _this.element.value[_this.element.selectionStart] === _this.nextEle &&\n isNaN(parseFloat(_this.element.value[_this.element.selectionStart - 1]))) {\n _this.element.setSelectionRange(_this.element.selectionStart + 1, _this.element.selectionStart + 1);\n _this.cursorPosChanged = false;\n _this.nextEle = null;\n }\n if (_this.element.value.trim() === '') {\n _this.element.setSelectionRange(start, start);\n }\n if (_this.element.selectionStart > 0) {\n if ((_this.element.value[_this.element.selectionStart - 1].charCodeAt(0) === 45) && _this.element.selectionStart > 1) {\n if (isNullOrUndefined(_this.prevVal)) {\n // eslint-disable-next-line no-self-assign\n _this.element.value = _this.element.value;\n }\n else {\n _this.element.value = _this.prevVal;\n }\n _this.element.setSelectionRange(_this.element.selectionStart, _this.element.selectionStart);\n }\n }\n _this.prevVal = _this.element.value;\n }\n });\n };\n NumericTextBox.prototype.keyUpHandler = function () {\n if (!this.enabled || this.readonly) {\n return;\n }\n var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);\n if (!iOS && Browser.isDevice) {\n this.preventHandler();\n }\n var parseValue = this.instance.getNumberParser({ format: 'n' })(this.element.value);\n parseValue = parseValue === null || isNaN(parseValue) ? null : parseValue;\n this.hiddenInput.value = parseValue || parseValue === 0 ? parseValue.toString() : null;\n var formElement = closest(this.element, 'form');\n if (formElement) {\n var element = this.element.nextElementSibling;\n var keyupEvent = document.createEvent('KeyboardEvent');\n keyupEvent.initEvent('keyup', false, true);\n element.dispatchEvent(keyupEvent);\n }\n };\n NumericTextBox.prototype.inputHandler = function (event) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-this-alias\n var numerictextboxObj = this;\n if (!this.enabled || this.readonly) {\n return;\n }\n var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);\n var fireFox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n if ((fireFox || iOS) && Browser.isDevice) {\n this.preventHandler();\n }\n /* istanbul ignore next */\n if (this.isAngular\n && this.element.value !== getValue('decimal', getNumericObject(this.locale))\n && this.element.value !== getValue('minusSign', getNumericObject(this.locale))) {\n var parsedValue = this.instance.getNumberParser({ format: 'n' })(this.element.value);\n parsedValue = isNaN(parsedValue) ? null : parsedValue;\n numerictextboxObj.localChange({ value: parsedValue });\n this.preventChange = true;\n }\n if (this.isVue) {\n var current = this.instance.getNumberParser({ format: 'n' })(this.element.value);\n var previous = this.instance.getNumberParser({ format: 'n' })(this.elementPrevValue);\n var eventArgs = {\n event: event,\n value: (current === null || isNaN(current) ? null : current),\n previousValue: (previous === null || isNaN(previous) ? null : previous)\n };\n this.preventChange = true;\n this.elementPrevValue = this.element.value;\n this.trigger('input', eventArgs);\n }\n };\n NumericTextBox.prototype.keyDownHandler = function (event) {\n if (!this.readonly) {\n switch (event.keyCode) {\n case 38:\n event.preventDefault();\n this.action(INCREMENT, event);\n break;\n case 40:\n event.preventDefault();\n this.action(DECREMENT, event);\n break;\n default: break;\n }\n }\n };\n NumericTextBox.prototype.performAction = function (value, step, operation) {\n if (value === null || isNaN(value)) {\n value = 0;\n }\n var updatedValue = operation === INCREMENT ? value + step : value - step;\n updatedValue = this.correctRounding(value, step, updatedValue);\n return this.strictMode ? this.trimValue(updatedValue) : updatedValue;\n };\n NumericTextBox.prototype.correctRounding = function (value, step, result) {\n var floatExp = new RegExp('[,.](.*)');\n var floatValue = floatExp.test(value.toString());\n var floatStep = floatExp.test(step.toString());\n if (floatValue || floatStep) {\n var valueCount = floatValue ? floatExp.exec(value.toString())[0].length : 0;\n var stepCount = floatStep ? floatExp.exec(step.toString())[0].length : 0;\n var max = Math.max(valueCount, stepCount);\n return value = this.roundValue(result, max);\n }\n return result;\n };\n NumericTextBox.prototype.roundValue = function (result, precision) {\n precision = precision || 0;\n var divide = Math.pow(10, precision);\n return result *= divide, result = Math.round(result) / divide;\n };\n NumericTextBox.prototype.updateValue = function (value, event) {\n if (event) {\n this.isInteract = true;\n }\n if (value !== null && !isNaN(value)) {\n if (this.decimals) {\n value = this.roundNumber(value, this.decimals);\n }\n }\n this.changeValue(value === null || isNaN(value) ? null : this.strictMode ? this.trimValue(value) : value);\n /* istanbul ignore next */\n if (!this.isDynamicChange) {\n this.raiseChangeEvent(event);\n }\n };\n NumericTextBox.prototype.updateCurrency = function (prop, propVal) {\n setValue(prop, propVal, this.cultureInfo);\n this.updateValue(this.value);\n };\n NumericTextBox.prototype.changeValue = function (value) {\n if (!(value || value === 0)) {\n value = null;\n this.setProperties({ value: value }, true);\n }\n else {\n var numberOfDecimals = this.getNumberOfDecimals(value);\n this.setProperties({ value: this.roundNumber(value, numberOfDecimals) }, true);\n }\n this.modifyText();\n if (!this.strictMode) {\n this.validateState();\n }\n };\n NumericTextBox.prototype.modifyText = function () {\n if (this.value || this.value === 0) {\n var value = this.formatNumber();\n var elementValue = this.isFocused ? value : this.instance.getNumberFormat(this.cultureInfo)(this.value);\n this.setElementValue(elementValue);\n attributes(this.element, { 'aria-valuenow': value });\n this.hiddenInput.value = this.value.toString();\n if (this.value !== null && this.serverDecimalSeparator) {\n this.hiddenInput.value = this.hiddenInput.value.replace('.', this.serverDecimalSeparator);\n }\n }\n else {\n this.setElementValue('');\n this.element.removeAttribute('aria-valuenow');\n this.hiddenInput.value = null;\n }\n };\n NumericTextBox.prototype.setElementValue = function (val, element) {\n Input.setValue(val, (element ? element : this.element), this.floatLabelType, this.showClearButton);\n };\n NumericTextBox.prototype.validateState = function () {\n this.isValidState = true;\n if (this.value || this.value === 0) {\n this.isValidState = !(this.value > this.max || this.value < this.min);\n }\n this.checkErrorClass();\n };\n NumericTextBox.prototype.getNumberOfDecimals = function (value) {\n var numberOfDecimals;\n // eslint-disable-next-line no-useless-escape\n var EXPREGEXP = new RegExp('[eE][\\-+]?([0-9]+)');\n var valueString = value.toString();\n if (EXPREGEXP.test(valueString)) {\n var result = EXPREGEXP.exec(valueString);\n if (!isNullOrUndefined(result)) {\n valueString = value.toFixed(Math.min(parseInt(result[1], 10), 20));\n }\n }\n var decimalPart = valueString.split('.')[1];\n numberOfDecimals = !decimalPart || !decimalPart.length ? 0 : decimalPart.length;\n if (this.decimals !== null) {\n numberOfDecimals = numberOfDecimals < this.decimals ? numberOfDecimals : this.decimals;\n }\n return numberOfDecimals;\n };\n NumericTextBox.prototype.formatNumber = function () {\n var numberOfDecimals = this.getNumberOfDecimals(this.value);\n return this.instance.getNumberFormat({\n maximumFractionDigits: numberOfDecimals,\n minimumFractionDigits: numberOfDecimals, useGrouping: false\n })(this.value);\n };\n NumericTextBox.prototype.trimValue = function (value) {\n if (value > this.max) {\n return this.max;\n }\n if (value < this.min) {\n return this.min;\n }\n return value;\n };\n NumericTextBox.prototype.roundNumber = function (value, precision) {\n var result = value;\n var decimals = precision || 0;\n var result1 = result.toString().split('e');\n result = Math.round(Number(result1[0] + 'e' + (result1[1] ? (Number(result1[1]) + decimals) : decimals)));\n var result2 = result.toString().split('e');\n result = Number(result2[0] + 'e' + (result2[1] ? (Number(result2[1]) - decimals) : -decimals));\n return Number(result.toFixed(decimals));\n };\n NumericTextBox.prototype.cancelEvent = function (event) {\n event.preventDefault();\n return false;\n };\n NumericTextBox.prototype.keyPressHandler = function (event) {\n if (!this.enabled || this.readonly) {\n return true;\n }\n if (!Browser.isDevice && Browser.info.version === '11.0' && event.keyCode === 13) {\n var parsedInput = this.instance.getNumberParser({ format: 'n' })(this.element.value);\n this.updateValue(parsedInput, event);\n return true;\n }\n if (event.which === 0 || event.metaKey || event.ctrlKey || event.keyCode === 8 || event.keyCode === 13) {\n return true;\n }\n var currentChar = String.fromCharCode(event.which);\n var text = this.element.value;\n text = text.substring(0, this.element.selectionStart) + currentChar + text.substring(this.element.selectionEnd);\n if (!this.numericRegex().test(text)) {\n event.preventDefault();\n event.stopPropagation();\n return false;\n }\n else {\n return true;\n }\n };\n NumericTextBox.prototype.numericRegex = function () {\n var numericObject = getNumericObject(this.locale);\n var decimalSeparator = getValue('decimal', numericObject);\n var fractionRule = '*';\n if (decimalSeparator === DECIMALSEPARATOR) {\n decimalSeparator = '\\\\' + decimalSeparator;\n }\n if (this.decimals === 0 && this.validateDecimalOnType) {\n return INTREGEXP;\n }\n if (this.decimals && this.validateDecimalOnType) {\n fractionRule = '{0,' + this.decimals + '}';\n }\n return new RegExp('^(-)?(((\\\\d+(' + decimalSeparator + '\\\\d' + fractionRule +\n ')?)|(' + decimalSeparator + '\\\\d' + fractionRule + ')))?$');\n };\n NumericTextBox.prototype.mouseWheel = function (event) {\n event.preventDefault();\n var delta;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var rawEvent = event;\n if (rawEvent.wheelDelta) {\n delta = rawEvent.wheelDelta / 120;\n }\n else if (rawEvent.detail) {\n delta = -rawEvent.detail / 3;\n }\n if (delta > 0) {\n this.action(INCREMENT, event);\n }\n else if (delta < 0) {\n this.action(DECREMENT, event);\n }\n this.cancelEvent(event);\n };\n NumericTextBox.prototype.focusHandler = function (event) {\n var _this = this;\n this.focusEventArgs = { event: event, value: this.value, container: this.container };\n this.trigger('focus', this.focusEventArgs);\n if (!this.enabled || this.readonly) {\n return;\n }\n this.isFocused = true;\n removeClass([this.container], ERROR);\n this.prevValue = this.value;\n if ((this.value || this.value === 0)) {\n var formatValue_1 = this.formatNumber();\n this.setElementValue(formatValue_1);\n if (!this.isPrevFocused) {\n if (!Browser.isDevice && Browser.info.version === '11.0') {\n this.element.setSelectionRange(0, formatValue_1.length);\n }\n else {\n var delay = (Browser.isDevice && Browser.isIos) ? 600 : 0;\n setTimeout(function () {\n _this.element.setSelectionRange(0, formatValue_1.length);\n }, delay);\n }\n }\n }\n if (!Browser.isDevice) {\n EventHandler.add(this.element, 'mousewheel DOMMouseScroll', this.mouseWheel, this);\n }\n };\n NumericTextBox.prototype.focusOutHandler = function (event) {\n var _this = this;\n this.blurEventArgs = { event: event, value: this.value, container: this.container };\n this.trigger('blur', this.blurEventArgs);\n if (!this.enabled || this.readonly) {\n return;\n }\n if (this.isPrevFocused) {\n event.preventDefault();\n if (Browser.isDevice) {\n var value_1 = this.element.value;\n this.element.focus();\n this.isPrevFocused = false;\n var ele_1 = this.element;\n setTimeout(function () {\n _this.setElementValue(value_1, ele_1);\n }, 200);\n }\n }\n else {\n this.isFocused = false;\n if (!this.element.value.length) {\n this.setProperties({ value: null }, true);\n }\n var parsedInput = this.instance.getNumberParser({ format: 'n' })(this.element.value);\n this.updateValue(parsedInput);\n if (!Browser.isDevice) {\n EventHandler.remove(this.element, 'mousewheel DOMMouseScroll', this.mouseWheel);\n }\n }\n var formElement = closest(this.element, 'form');\n if (formElement) {\n var element = this.element.nextElementSibling;\n var focusEvent = document.createEvent('FocusEvent');\n focusEvent.initEvent('focusout', false, true);\n element.dispatchEvent(focusEvent);\n }\n };\n NumericTextBox.prototype.mouseDownOnSpinner = function (event) {\n var _this = this;\n if (this.isFocused) {\n this.isPrevFocused = true;\n event.preventDefault();\n }\n if (!this.getElementData(event)) {\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var result = this.getElementData(event);\n var target = event.currentTarget;\n var action = (target.classList.contains(SPINUP)) ? INCREMENT : DECREMENT;\n EventHandler.add(target, 'mouseleave', this.mouseUpClick, this);\n this.timeOut = setInterval(function () {\n _this.isCalled = true;\n _this.action(action, event);\n }, 150);\n EventHandler.add(document, 'mouseup', this.mouseUpClick, this);\n };\n NumericTextBox.prototype.touchMoveOnSpinner = function (event) {\n var target;\n if (event.type === \"touchmove\") {\n var touchEvent = event.touches;\n target = touchEvent.length && document.elementFromPoint(touchEvent[0].pageX, touchEvent[0].pageY);\n }\n else {\n target = document.elementFromPoint(event.clientX, event.clientY);\n }\n if (!(target.classList.contains(SPINICON))) {\n clearInterval(this.timeOut);\n }\n };\n NumericTextBox.prototype.mouseUpOnSpinner = function (event) {\n if (this.isPrevFocused) {\n this.element.focus();\n if (!Browser.isDevice) {\n this.isPrevFocused = false;\n }\n }\n if (!Browser.isDevice) {\n event.preventDefault();\n }\n if (!this.getElementData(event)) {\n return;\n }\n var target = event.currentTarget;\n var action = (target.classList.contains(SPINUP)) ? INCREMENT : DECREMENT;\n EventHandler.remove(target, 'mouseleave', this.mouseUpClick);\n if (!this.isCalled) {\n this.action(action, event);\n }\n this.isCalled = false;\n EventHandler.remove(document, 'mouseup', this.mouseUpClick);\n var formElement = closest(this.element, 'form');\n if (formElement) {\n var element = this.element.nextElementSibling;\n var keyupEvent = document.createEvent('KeyboardEvent');\n keyupEvent.initEvent('keyup', false, true);\n element.dispatchEvent(keyupEvent);\n }\n };\n NumericTextBox.prototype.getElementData = function (event) {\n if ((event.which && event.which === 3) || (event.button && event.button === 2)\n || !this.enabled || this.readonly) {\n return false;\n }\n clearInterval(this.timeOut);\n return true;\n };\n NumericTextBox.prototype.floatLabelTypeUpdate = function () {\n Input.removeFloating(this.inputWrapper);\n var hiddenInput = this.hiddenInput;\n this.hiddenInput.remove();\n Input.addFloating(this.element, this.floatLabelType, this.placeholder, this.createElement);\n this.container.insertBefore(hiddenInput, this.container.childNodes[1]);\n };\n NumericTextBox.prototype.mouseUpClick = function (event) {\n event.stopPropagation();\n clearInterval(this.timeOut);\n this.isCalled = false;\n EventHandler.remove(this.spinUp, 'mouseleave', this.mouseUpClick);\n EventHandler.remove(this.spinDown, 'mouseleave', this.mouseUpClick);\n };\n /**\n * Increments the NumericTextBox value with the specified step value.\n *\n * @param {number} step - Specifies the value used to increment the NumericTextBox value.\n * if its not given then numeric value will be incremented based on the step property value.\n * @returns {void}\n */\n NumericTextBox.prototype.increment = function (step) {\n if (step === void 0) { step = this.step; }\n this.isInteract = false;\n this.changeValue(this.performAction(this.value, step, INCREMENT));\n this.raiseChangeEvent();\n };\n /**\n * Decrements the NumericTextBox value with specified step value.\n *\n * @param {number} step - Specifies the value used to decrement the NumericTextBox value.\n * if its not given then numeric value will be decremented based on the step property value.\n * @returns {void}\n */\n NumericTextBox.prototype.decrement = function (step) {\n if (step === void 0) { step = this.step; }\n this.isInteract = false;\n this.changeValue(this.performAction(this.value, step, DECREMENT));\n this.raiseChangeEvent();\n };\n /**\n * Removes the component from the DOM and detaches all its related event handlers.\n * Also it maintains the initial input element from the DOM.\n *\n * @method destroy\n * @returns {void}\n */\n NumericTextBox.prototype.destroy = function () {\n this.unwireEvents();\n detach(this.hiddenInput);\n if (this.showSpinButton) {\n this.unwireSpinBtnEvents();\n detach(this.spinUp);\n detach(this.spinDown);\n }\n var attrArray = ['aria-labelledby', 'role', 'autocomplete', 'aria-readonly',\n 'autocorrect', 'aria-disabled', 'aria-placeholder', 'autocapitalize',\n 'spellcheck', 'aria-autocomplete', 'tabindex', 'aria-valuemin',\n 'aria-valuemax', 'aria-live', 'aria-valuenow', 'aria-invalid'];\n for (var i = 0; i < attrArray.length; i++) {\n this.element.removeAttribute(attrArray[i]);\n }\n this.element.classList.remove('e-input');\n this.container.insertAdjacentElement('afterend', this.element);\n detach(this.container);\n _super.prototype.destroy.call(this);\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-returns */\n /**\n * Returns the value of NumericTextBox with the format applied to the NumericTextBox.\n *\n */\n NumericTextBox.prototype.getText = function () {\n return this.element.value;\n };\n /* eslint-enable valid-jsdoc, jsdoc/require-returns */\n /**\n * Sets the focus to widget for interaction.\n *\n * @returns {void}\n */\n NumericTextBox.prototype.focusIn = function () {\n if (document.activeElement !== this.element && this.enabled) {\n this.element.focus();\n addClass([this.container], [NUMERIC_FOCUS]);\n }\n };\n /**\n * Remove the focus from widget, if the widget is in focus state.\n *\n * @returns {void}\n */\n NumericTextBox.prototype.focusOut = function () {\n if (document.activeElement === this.element && this.enabled) {\n this.element.blur();\n removeClass([this.container], [NUMERIC_FOCUS]);\n }\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Gets the properties to be maintained in the persisted state.\n *\n * @returns {string}\n */\n NumericTextBox.prototype.getPersistData = function () {\n var keyEntity = ['value'];\n return this.addOnPersist(keyEntity);\n };\n /* eslint-enable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Calls internally if any of the property value is changed.\n *\n * @param {NumericTextBoxModel} newProp - Returns the dynamic property value of the component.\n * @param {NumericTextBoxModel} oldProp - Returns the previous property value of the component.\n * @returns {void}\n * @private\n */\n NumericTextBox.prototype.onPropertyChanged = function (newProp, oldProp) {\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'width':\n this.setElementWidth(newProp.width);\n break;\n case 'cssClass':\n this.updateCssClass(newProp.cssClass, oldProp.cssClass);\n break;\n case 'enabled':\n Input.setEnabled(newProp.enabled, this.element);\n break;\n case 'enableRtl':\n Input.setEnableRtl(newProp.enableRtl, [this.container]);\n break;\n case 'readonly':\n Input.setReadonly(newProp.readonly, this.element);\n if (this.readonly) {\n attributes(this.element, { 'aria-readonly': 'true' });\n }\n else {\n this.element.removeAttribute('aria-readonly');\n }\n break;\n case 'htmlAttributes':\n this.updateHTMLAttrToElement();\n this.updateHTMLAttrToWrapper();\n this.updateDataAttribute(true);\n this.checkAttributes(true);\n Input.validateInputType(this.container, this.element);\n break;\n case 'placeholder':\n Input.setPlaceholder(newProp.placeholder, this.element);\n break;\n case 'step':\n this.step = newProp.step;\n this.validateStep();\n break;\n case 'showSpinButton':\n this.updateSpinButton(newProp);\n break;\n case 'showClearButton':\n this.updateClearButton(newProp);\n break;\n case 'floatLabelType':\n this.floatLabelType = newProp.floatLabelType;\n this.floatLabelTypeUpdate();\n break;\n case 'value':\n this.isDynamicChange = (this.isAngular || this.isVue) && this.preventChange;\n this.updateValue(newProp.value);\n if (this.isDynamicChange) {\n this.preventChange = false;\n this.isDynamicChange = false;\n }\n break;\n case 'min':\n case 'max':\n setValue(prop, getValue(prop, newProp), this);\n this.validateMinMax();\n this.updateValue(this.value);\n break;\n case 'strictMode':\n this.strictMode = newProp.strictMode;\n this.updateValue(this.value);\n this.validateState();\n break;\n case 'locale':\n this.initCultureFunc();\n this.l10n.setLocale(this.locale);\n this.setSpinButton();\n this.updatePlaceholder();\n Input.setPlaceholder(this.placeholder, this.element);\n this.updateValue(this.value);\n break;\n case 'currency':\n {\n var propVal = getValue(prop, newProp);\n this.setProperties({ currencyCode: propVal }, true);\n this.updateCurrency(prop, propVal);\n }\n break;\n case 'currencyCode':\n {\n var propValue = getValue(prop, newProp);\n this.setProperties({ currency: propValue }, true);\n this.updateCurrency('currency', propValue);\n }\n break;\n case 'format':\n setValue(prop, getValue(prop, newProp), this);\n this.initCultureInfo();\n this.updateValue(this.value);\n break;\n case 'decimals':\n this.decimals = newProp.decimals;\n this.updateValue(this.value);\n }\n }\n };\n NumericTextBox.prototype.updateClearButton = function (newProp) {\n Input.setClearButton(newProp.showClearButton, this.element, this.inputWrapper, undefined, this.createElement);\n this.bindClearEvent();\n };\n NumericTextBox.prototype.updateSpinButton = function (newProp) {\n if (newProp.showSpinButton) {\n this.spinBtnCreation();\n }\n else {\n detach(this.spinUp);\n detach(this.spinDown);\n }\n };\n /**\n * Gets the component name\n *\n * @returns {string} Returns the component name.\n * @private\n */\n NumericTextBox.prototype.getModuleName = function () {\n return 'numerictextbox';\n };\n __decorate([\n Property('')\n ], NumericTextBox.prototype, \"cssClass\", void 0);\n __decorate([\n Property(null)\n ], NumericTextBox.prototype, \"value\", void 0);\n __decorate([\n Property(-(Number.MAX_VALUE))\n ], NumericTextBox.prototype, \"min\", void 0);\n __decorate([\n Property(Number.MAX_VALUE)\n ], NumericTextBox.prototype, \"max\", void 0);\n __decorate([\n Property(1)\n ], NumericTextBox.prototype, \"step\", void 0);\n __decorate([\n Property(null)\n ], NumericTextBox.prototype, \"width\", void 0);\n __decorate([\n Property(null)\n ], NumericTextBox.prototype, \"placeholder\", void 0);\n __decorate([\n Property({})\n ], NumericTextBox.prototype, \"htmlAttributes\", void 0);\n __decorate([\n Property(true)\n ], NumericTextBox.prototype, \"showSpinButton\", void 0);\n __decorate([\n Property(false)\n ], NumericTextBox.prototype, \"readonly\", void 0);\n __decorate([\n Property(true)\n ], NumericTextBox.prototype, \"enabled\", void 0);\n __decorate([\n Property(false)\n ], NumericTextBox.prototype, \"showClearButton\", void 0);\n __decorate([\n Property(false)\n ], NumericTextBox.prototype, \"enablePersistence\", void 0);\n __decorate([\n Property('n2')\n ], NumericTextBox.prototype, \"format\", void 0);\n __decorate([\n Property(null)\n ], NumericTextBox.prototype, \"decimals\", void 0);\n __decorate([\n Property(null)\n ], NumericTextBox.prototype, \"currency\", void 0);\n __decorate([\n Property(null)\n ], NumericTextBox.prototype, \"currencyCode\", void 0);\n __decorate([\n Property(true)\n ], NumericTextBox.prototype, \"strictMode\", void 0);\n __decorate([\n Property(false)\n ], NumericTextBox.prototype, \"validateDecimalOnType\", void 0);\n __decorate([\n Property('Never')\n ], NumericTextBox.prototype, \"floatLabelType\", void 0);\n __decorate([\n Event()\n ], NumericTextBox.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], NumericTextBox.prototype, \"destroyed\", void 0);\n __decorate([\n Event()\n ], NumericTextBox.prototype, \"change\", void 0);\n __decorate([\n Event()\n ], NumericTextBox.prototype, \"focus\", void 0);\n __decorate([\n Event()\n ], NumericTextBox.prototype, \"blur\", void 0);\n NumericTextBox = __decorate([\n NotifyPropertyChanges\n ], NumericTextBox);\n return NumericTextBox;\n}(Component));\nexport { NumericTextBox };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, rippleEffect, NotifyPropertyChanges, Property, closest } from '@syncfusion/ej2-base';\nimport { addClass, getInstance, getUniqueID, isRippleEnabled, removeClass, attributes, isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { detach, Event, EventHandler, SanitizeHtmlHelper } from '@syncfusion/ej2-base';\nimport { wrapperInitialize, rippleMouseHandler } from './../common/common';\nvar LABEL = 'e-label';\nvar RIPPLE = 'e-ripple-container';\nvar RTL = 'e-rtl';\nvar WRAPPER = 'e-radio-wrapper';\nvar ATTRIBUTES = ['title', 'class', 'style', 'disabled', 'readonly', 'name', 'value'];\n/**\n * The RadioButton is a graphical user interface element that allows you to select one option from the choices.\n * It contains checked and unchecked states.\n * ```html\n *
\n * \n * ```\n */\nvar RadioButton = /** @class */ (function (_super) {\n __extends(RadioButton, _super);\n /**\n * Constructor for creating the widget\n *\n * @private\n * @param {RadioButtonModel} options - Specifies Radio button model\n * @param {string | HTMLInputElement} element - Specifies target element\n */\n function RadioButton(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.isFocused = false;\n return _this;\n }\n RadioButton_1 = RadioButton;\n RadioButton.prototype.changeHandler = function (event) {\n this.checked = true;\n this.dataBind();\n var value = this.element.getAttribute('value');\n value = this.isVue && value ? this.element.value : this.value;\n this.trigger('change', { value: value, event: event });\n if (this.tagName === 'EJS-RADIOBUTTON') {\n event.stopPropagation();\n }\n };\n RadioButton.prototype.updateChange = function () {\n var input;\n var instance;\n var radioGrp = this.getRadioGroup();\n for (var i = 0; i < radioGrp.length; i++) {\n input = radioGrp[i];\n if (input !== this.element) {\n instance = getInstance(input, RadioButton_1);\n instance.checked = false;\n if (this.tagName === 'EJS-RADIOBUTTON') {\n instance.angularValue = this.value;\n }\n }\n }\n };\n /**\n * Destroys the widget.\n *\n * @returns {void}\n */\n RadioButton.prototype.destroy = function () {\n var _this = this;\n var radioWrap = this.element.parentElement;\n _super.prototype.destroy.call(this);\n if (!this.disabled) {\n this.unWireEvents();\n }\n if (this.tagName === 'INPUT') {\n if (radioWrap.parentNode) {\n radioWrap.parentNode.insertBefore(this.element, radioWrap);\n }\n detach(radioWrap);\n this.element.checked = false;\n ['name', 'value', 'disabled'].forEach(function (key) {\n _this.element.removeAttribute(key);\n });\n }\n else {\n ['role', 'aria-checked', 'class'].forEach(function (key) {\n radioWrap.removeAttribute(key);\n });\n radioWrap.innerHTML = '';\n }\n };\n RadioButton.prototype.focusHandler = function () {\n this.isFocused = true;\n };\n RadioButton.prototype.focusOutHandler = function () {\n var label = this.getLabel();\n if (label) {\n label.classList.remove('e-focus');\n }\n };\n RadioButton.prototype.getModuleName = function () {\n return 'radio';\n };\n /**\n * To get the value of selected radio button in a group.\n *\n * @method getSelectedValue\n * @returns {string} - Selected Value\n */\n RadioButton.prototype.getSelectedValue = function () {\n var input;\n var radioGrp = this.getRadioGroup();\n for (var i = 0, len = radioGrp.length; i < len; i++) {\n input = radioGrp[i];\n if (input.checked) {\n return input.value;\n }\n }\n return '';\n };\n RadioButton.prototype.getRadioGroup = function () {\n return document.querySelectorAll('input.e-radio[name=\"' + this.element.getAttribute('name') + '\"]');\n };\n /**\n * Gets the properties to be maintained in the persistence state.\n *\n * @private\n * @returns {string} - Persist Data\n */\n RadioButton.prototype.getPersistData = function () {\n return this.addOnPersist(['checked']);\n };\n RadioButton.prototype.getWrapper = function () {\n if (this.element) {\n return this.element.parentElement;\n }\n else {\n return null;\n }\n };\n RadioButton.prototype.getLabel = function () {\n if (this.element) {\n return this.element.nextElementSibling;\n }\n else {\n return null;\n }\n };\n RadioButton.prototype.initialize = function () {\n if (isNullOrUndefined(this.initialCheckedValue)) {\n this.initialCheckedValue = this.checked;\n }\n this.initWrapper();\n this.updateHtmlAttribute();\n if (this.name) {\n this.element.setAttribute('name', this.name);\n }\n var value = this.element.getAttribute('value');\n if (this.isVue && value && value === this.value) {\n this.checked = true;\n }\n if (this.isVue ? this.value && !value : this.value) {\n this.element.setAttribute('value', this.value);\n }\n if (this.checked) {\n this.element.checked = true;\n }\n if (this.disabled) {\n this.setDisabled();\n }\n };\n RadioButton.prototype.initWrapper = function () {\n var rippleSpan;\n var wrapper = this.element.parentElement;\n if (!wrapper.classList.contains(WRAPPER)) {\n wrapper = this.createElement('div', { className: WRAPPER });\n this.element.parentNode.insertBefore(wrapper, this.element);\n }\n var label = this.createElement('label', { attrs: { for: this.element.id } });\n wrapper.appendChild(this.element);\n wrapper.appendChild(label);\n if (isRippleEnabled) {\n rippleSpan = this.createElement('span', { className: (RIPPLE) });\n label.appendChild(rippleSpan);\n rippleEffect(rippleSpan, {\n duration: 400,\n isCenterRipple: true\n });\n }\n wrapper.classList.add('e-wrapper');\n if (this.enableRtl) {\n label.classList.add(RTL);\n }\n if (this.cssClass) {\n addClass([wrapper], this.cssClass.split(' '));\n }\n if (this.label) {\n this.setText(this.label);\n }\n };\n RadioButton.prototype.keyUpHandler = function () {\n if (this.isFocused) {\n this.getLabel().classList.add('e-focus');\n }\n };\n RadioButton.prototype.labelRippleHandler = function (e) {\n var ripple = this.getLabel().getElementsByClassName(RIPPLE)[0];\n rippleMouseHandler(e, ripple);\n };\n RadioButton.prototype.formResetHandler = function () {\n this.checked = this.initialCheckedValue;\n if (this.initialCheckedValue) {\n attributes(this.element, { 'checked': 'true' });\n }\n };\n /**\n * Called internally if any of the property value changes.\n *\n * @private\n * @param {RadioButtonModel} newProp - Specifies New Properties\n * @param {RadioButtonModel} oldProp - Specifies Old Properties\n * @returns {void}\n */\n RadioButton.prototype.onPropertyChanged = function (newProp, oldProp) {\n var wrap = this.getWrapper();\n var label = this.getLabel();\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'checked':\n if (newProp.checked) {\n this.updateChange();\n }\n this.element.checked = newProp.checked;\n break;\n case 'disabled':\n if (newProp.disabled) {\n this.setDisabled();\n this.unWireEvents();\n }\n else {\n this.element.disabled = false;\n this.wireEvents();\n }\n break;\n case 'cssClass':\n if (oldProp.cssClass) {\n removeClass([wrap], oldProp.cssClass.split(' '));\n }\n if (newProp.cssClass) {\n addClass([wrap], newProp.cssClass.split(' '));\n }\n break;\n case 'enableRtl':\n if (newProp.enableRtl) {\n label.classList.add(RTL);\n }\n else {\n label.classList.remove(RTL);\n }\n break;\n case 'label':\n this.setText(newProp.label);\n break;\n case 'labelPosition':\n if (newProp.labelPosition === 'Before') {\n label.classList.add('e-right');\n }\n else {\n label.classList.remove('e-right');\n }\n break;\n case 'name':\n this.element.setAttribute('name', newProp.name);\n break;\n case 'value':\n if (!isNullOrUndefined(this.htmlAttributes) && this.htmlAttributes.value) {\n break;\n }\n this.element.setAttribute('value', newProp.value);\n break;\n case 'htmlAttributes':\n this.updateHtmlAttribute();\n break;\n }\n }\n };\n /**\n * Initialize checked Property, Angular and React and Unique ID support.\n *\n * @private\n * @returns {void}\n */\n RadioButton.prototype.preRender = function () {\n var element = this.element;\n this.formElement = closest(this.element, 'form');\n this.tagName = this.element.tagName;\n element = wrapperInitialize(this.createElement, 'EJS-RADIOBUTTON', 'radio', element, WRAPPER, 'radio');\n this.element = element;\n if (this.element.getAttribute('type') !== 'radio') {\n this.element.setAttribute('type', 'radio');\n }\n if (!this.element.id) {\n this.element.id = getUniqueID('e-' + this.getModuleName());\n }\n if (this.tagName === 'EJS-RADIOBUTTON') {\n var formControlName = this.element.getAttribute('formcontrolname');\n if (formControlName) {\n this.setProperties({ 'name': formControlName }, true);\n this.element.setAttribute('name', formControlName);\n }\n }\n };\n /**\n * Initialize the control rendering\n *\n * @private\n * @returns {void}\n */\n RadioButton.prototype.render = function () {\n this.initialize();\n if (!this.disabled) {\n this.wireEvents();\n }\n this.renderComplete();\n };\n RadioButton.prototype.setDisabled = function () {\n this.element.disabled = true;\n };\n RadioButton.prototype.setText = function (text) {\n var label = this.getLabel();\n var textLabel = label.getElementsByClassName(LABEL)[0];\n if (textLabel) {\n textLabel.textContent = text;\n }\n else {\n text = (this.enableHtmlSanitizer) ? SanitizeHtmlHelper.sanitize(text) : text;\n textLabel = this.createElement('span', { className: LABEL, innerHTML: text });\n label.appendChild(textLabel);\n }\n if (this.labelPosition === 'Before') {\n this.getLabel().classList.add('e-right');\n }\n else {\n this.getLabel().classList.remove('e-right');\n }\n };\n RadioButton.prototype.updateHtmlAttribute = function () {\n if (!isNullOrUndefined(this.htmlAttributes)) {\n for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {\n var key = _a[_i];\n if (ATTRIBUTES.indexOf(key) > -1) {\n var wrapper = this.element.parentElement;\n if (key === 'class') {\n addClass([wrapper], this.htmlAttributes[key].split(' '));\n }\n else if (key === 'title' || key === 'style') {\n wrapper.setAttribute(key, this.htmlAttributes[key]);\n }\n else {\n this.element.setAttribute(key, this.htmlAttributes[key]);\n }\n }\n }\n }\n };\n RadioButton.prototype.unWireEvents = function () {\n var label = this.getLabel();\n EventHandler.remove(this.element, 'change', this.changeHandler);\n EventHandler.remove(this.element, 'focus', this.focusHandler);\n EventHandler.remove(this.element, 'focusout', this.focusOutHandler);\n EventHandler.remove(this.element, 'keyup', this.keyUpHandler);\n var rippleLabel = label.getElementsByClassName(LABEL)[0];\n if (rippleLabel) {\n EventHandler.remove(rippleLabel, 'mousedown', this.labelRippleHandler);\n EventHandler.remove(rippleLabel, 'mouseup', this.labelRippleHandler);\n }\n if (this.formElement) {\n EventHandler.remove(this.formElement, 'reset', this.formResetHandler);\n }\n };\n RadioButton.prototype.wireEvents = function () {\n var label = this.getLabel();\n EventHandler.add(this.element, 'change', this.changeHandler, this);\n EventHandler.add(this.element, 'keyup', this.keyUpHandler, this);\n EventHandler.add(this.element, 'focus', this.focusHandler, this);\n EventHandler.add(this.element, 'focusout', this.focusOutHandler, this);\n var rippleLabel = label.getElementsByClassName(LABEL)[0];\n if (rippleLabel) {\n EventHandler.add(rippleLabel, 'mousedown', this.labelRippleHandler, this);\n EventHandler.add(rippleLabel, 'mouseup', this.labelRippleHandler, this);\n }\n if (this.formElement) {\n EventHandler.add(this.formElement, 'reset', this.formResetHandler, this);\n }\n };\n /**\n * Click the RadioButton element\n * its native method\n *\n * @public\n * @returns {void}\n */\n RadioButton.prototype.click = function () {\n this.element.click();\n };\n /**\n * Sets the focus to RadioButton\n * its native method\n *\n * @public\n * @returns {void}\n */\n RadioButton.prototype.focusIn = function () {\n this.element.focus();\n };\n var RadioButton_1;\n __decorate([\n Event()\n ], RadioButton.prototype, \"change\", void 0);\n __decorate([\n Event()\n ], RadioButton.prototype, \"created\", void 0);\n __decorate([\n Property(false)\n ], RadioButton.prototype, \"checked\", void 0);\n __decorate([\n Property('')\n ], RadioButton.prototype, \"cssClass\", void 0);\n __decorate([\n Property(false)\n ], RadioButton.prototype, \"disabled\", void 0);\n __decorate([\n Property('')\n ], RadioButton.prototype, \"label\", void 0);\n __decorate([\n Property('After')\n ], RadioButton.prototype, \"labelPosition\", void 0);\n __decorate([\n Property('')\n ], RadioButton.prototype, \"name\", void 0);\n __decorate([\n Property('')\n ], RadioButton.prototype, \"value\", void 0);\n __decorate([\n Property(false)\n ], RadioButton.prototype, \"enableHtmlSanitizer\", void 0);\n __decorate([\n Property({})\n ], RadioButton.prototype, \"htmlAttributes\", void 0);\n RadioButton = RadioButton_1 = __decorate([\n NotifyPropertyChanges\n ], RadioButton);\n return RadioButton;\n}(Component));\nexport { RadioButton };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, Property, NotifyPropertyChanges, Event, Browser } from '@syncfusion/ej2-base';\nimport { getDefaultDateObject, getValue, cldrData, L10n, isNullOrUndefined, removeClass, addClass } from '@syncfusion/ej2-base';\nimport { DropDownList } from '@syncfusion/ej2-dropdowns';\nimport { NumericTextBox } from '@syncfusion/ej2-inputs';\nimport { DatePicker } from '@syncfusion/ej2-calendars';\nimport { Button, RadioButton } from '@syncfusion/ej2-buttons';\nimport { EventHandler, classList } from '@syncfusion/ej2-base';\nimport { extractObjectFromRule, generate, generateSummary, getRecurrenceStringFromDate, getCalendarUtil } from './date-generator';\nimport { capitalizeFirstWord } from '../schedule/base/util';\nvar HEADER = 'e-editor';\nvar INPUTWARAPPER = 'e-input-wrapper';\nvar INPUTWARAPPERSIDE = 'e-input-wrapper-side';\nvar REPEATELEMENT = 'e-repeat-element';\nvar REPEATINTERVAL = 'e-repeat-interval';\nvar INTERVALCLASS = 'e-interval';\nvar DAYWRAPPER = 'e-days';\nvar WEEKWRAPPER = 'e-non-week';\nvar WEEKPOSITION = 'e-week-position';\nvar YEAREXPANDERWRAPPER = 'e-year-expander';\nvar YEAREXPANDERELEMENT = 'e-year-expander-element';\nvar MONETHEXPANDERWRAPPER = 'e-month-expander';\nvar MONETHEXPANDWRAPPER = 'e-month-expand-wrapper';\nvar MONTHEXPANDERELEMENT = 'e-month-expander-element';\nvar MONTHEXPANDERCHECKBOXWRAPPER = 'e-month-expander-checkbox-wrapper';\nvar FORMLEFT = 'e-form-left';\nvar FORMRIGHT = 'e-form-right';\nvar MONTHDAYWRAPPER = 'e-month-day';\nvar MONTHEXPANNDERELEM = 'e-month-expander-wrapper';\nvar MONTHPOS = 'e-month-pos';\nvar MONTHWEEK = 'e-month-week';\nvar ENDON = 'e-end-on';\nvar MONTHEXPANDERLABEL = 'e-month-expander-label';\nvar WEEKEXPANDERLABEL = 'e-week-expander-label';\nvar ENDONLABEL = 'e-end-on-label';\nvar ENDONLEFT = 'e-end-on-left';\nvar MONTHDAYELEMENT = 'e-monthday-element';\nvar ENDONELEMENT = 'e-end-on-element';\nvar ENDONDATE = 'e-end-on-date';\nvar UNTILDATE = 'e-until-date';\nvar ENDONCOUNTWRAPPER = 'e-end-on-count';\nvar ENDONCOUNT = 'e-recurrence-count';\nvar HIDEWRAPPER = 'e-hide-recurrence-element';\nvar RTLCLASS = 'e-rtl';\nvar PRIMARY = 'e-primary';\nvar ACTIVE = 'e-active';\nvar RECURRENCETABLE = 'e-recurrence-table';\nvar REPEATCONTENT = 'e-repeat-content';\nvar REPEATCONTENTWRAPPER = 'e-repeat-content-wrapper';\nvar NONE = 'none';\nvar DAILY = 'daily';\nvar WEEKLY = 'weekly';\nvar MONTHLY = 'monthly';\nvar YEARLY = 'yearly';\nvar NEVER = 'never';\nvar UNTIL = 'until';\nvar COUNT = 'count';\nvar TEXTFIELD = 'text';\nvar VALUEFIELD = 'value';\nvar LAST = 'last';\nvar REPEAT = 'repeat';\nvar REPEATEVERY = 'repeatEvery';\nvar ON = 'on';\nvar END = 'end';\nvar RADIOLABEL = 'onDay';\nvar RULEUNTIL = 'UNTIL';\nvar RULEBYDAY = 'BYDAY';\nvar RULEBYMONTHDAY = 'BYMONTHDAY';\nvar RULEBYMONTH = 'BYMONTH';\nvar RULEINTERVAL = 'INTERVAL';\nvar RULECOUNT = 'COUNT';\nvar RULESETPOS = 'BYSETPOS';\nvar RULEFREQ = 'FREQ';\nvar RULEDAILY = 'DAILY';\nvar RULEWEEKLY = 'WEEKLY';\nvar RULEMONTHLY = 'MONTHLY';\nvar RULEYEARLY = 'YEARLY';\nvar RULESUNDAY = 'SU';\nvar RULEMONDAY = 'MO';\nvar RULETUESDAY = 'TU';\nvar RULEWEDNESDAY = 'WE';\nvar RULETHURSDAY = 'TH';\nvar RULEFRIDAY = 'FR';\nvar RULESATURDAY = 'SA';\nvar KEYSUNDAY = 'sun';\nvar KEYMONDAY = 'mon';\nvar KEYTUESDAY = 'tue';\nvar KEYWEDNESDAY = 'wed';\nvar KEYTHURSDAY = 'thu';\nvar KEYFRIDAY = 'fri';\nvar KEYSATURDAY = 'sat';\nvar EQUAL = '=';\nvar SEMICOLON = ';';\nvar COMMA = ',';\nvar FIRST = 'first';\nvar SECOND = 'second';\nvar THIRD = 'third';\nvar FOURTH = 'fourth';\nvar contentType = {\n none: '',\n daily: 'days',\n weekly: 'weeks',\n monthly: 'months',\n yearly: 'years'\n};\nvar valueData = {\n 'sun': RULESUNDAY,\n 'mon': RULEMONDAY,\n 'tue': RULETUESDAY,\n 'wed': RULEWEDNESDAY,\n 'thu': RULETHURSDAY,\n 'fri': RULEFRIDAY,\n 'sat': RULESATURDAY\n};\nvar neverClassList = [DAYWRAPPER, WEEKWRAPPER, ENDON, INTERVALCLASS, YEAREXPANDERWRAPPER, MONETHEXPANDERWRAPPER];\nvar weekClassList = [WEEKWRAPPER];\nvar monthClassList = [DAYWRAPPER, YEAREXPANDERWRAPPER];\nvar yearClassList = [DAYWRAPPER];\nvar dailyClassList = [DAYWRAPPER, WEEKWRAPPER, YEAREXPANDERWRAPPER, MONETHEXPANDERWRAPPER];\nvar noEndClassList = [ENDONDATE, ENDONCOUNTWRAPPER];\nvar endOnCountClassList = [ENDONDATE];\nvar endOnDateClassList = [ENDONCOUNTWRAPPER];\n/**\n * Represents the RecurrenceEditor component.\n * ```html\n *
\n * ```\n * ```typescript\n * \n * ```\n */\nvar RecurrenceEditor = /** @class */ (function (_super) {\n __extends(RecurrenceEditor, _super);\n /**\n * Constructor for creating the widget\n *\n * @param {RecurrenceEditorModel} options Accepts the recurrence editor model properties to initiate the rendering\n * @param {string | HTMLElement} element Accepts the DOM element reference\n */\n function RecurrenceEditor(options, element) {\n var _this = _super.call(this, options, element) || this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _this.defaultLocale = {\n none: 'None',\n daily: 'Daily',\n weekly: 'Weekly',\n monthly: 'Monthly',\n month: 'Month',\n yearly: 'Yearly',\n never: 'Never',\n until: 'Until',\n count: 'Count',\n first: 'First',\n second: 'Second',\n third: 'Third',\n fourth: 'Fourth',\n last: 'Last',\n repeat: 'Repeat',\n repeatEvery: 'Repeat every',\n on: 'Repeat On',\n end: 'End',\n onDay: 'Day',\n days: 'Day(s)',\n weeks: 'Week(s)',\n months: 'Month(s)',\n years: 'Year(s)',\n every: 'every',\n summaryTimes: 'time(s)',\n summaryOn: 'on',\n summaryUntil: 'until',\n summaryRepeat: 'Repeats',\n summaryDay: 'day(s)',\n summaryWeek: 'week(s)',\n summaryMonth: 'month(s)',\n summaryYear: 'year(s)',\n monthWeek: 'Month Week',\n monthPosition: 'Month Position',\n monthExpander: 'Month Expander',\n yearExpander: 'Year Expander',\n repeatInterval: 'Repeat Interval'\n };\n _this.renderStatus = false;\n _this.dayButtons = [];\n _this.monthButtons = [];\n return _this;\n }\n RecurrenceEditor.prototype.startState = function (freq, endOn, startDate) {\n this.showFormElement();\n this.updateForm(freq);\n this.freshOnEndForm();\n this.updateEndOnForm(endOn);\n this.selectMonthDay(startDate);\n this.updateUntilDate(startDate);\n this.onMonthDay.setProperties({ checked: true });\n };\n RecurrenceEditor.prototype.preRender = function () {\n this.localeObj = new L10n(this.getModuleName(), this.defaultLocale, this.locale);\n this.calendarUtil = getCalendarUtil(this.calendarMode);\n };\n RecurrenceEditor.prototype.applyCustomClass = function (cssClass) {\n if (cssClass) {\n addClass([this.element], cssClass.split(' '));\n }\n };\n RecurrenceEditor.prototype.initialize = function () {\n addClass([this.element], 'e-' + this.getModuleName());\n this.renderComponent();\n if (!isNullOrUndefined(this.value) && this.value !== '') {\n this.setRecurrenceRule(this.value);\n }\n else {\n if (!isNullOrUndefined(this.repeatType.value)) {\n this.startState(this.repeatType.value.toString().toUpperCase(), NEVER, this.startDate);\n this.updateForm(this.repeatType.value.toString());\n }\n if (this.selectedType > 0) {\n this.setProperties({ value: this.getRecurrenceRule() }, false);\n }\n }\n this.applyCustomClass(this.cssClass);\n };\n RecurrenceEditor.prototype.triggerChangeEvent = function () {\n var _this = this;\n if (this.renderStatus) {\n var value = this.getRecurrenceRule();\n this.trigger('change', { value: value }, function (args) { return _this.setProperties({ value: args.value }, false); });\n }\n };\n RecurrenceEditor.prototype.resetDayButton = function () {\n var elements = [].slice.call(this.element.querySelectorAll('.' + DAYWRAPPER + ' button'));\n elements.forEach(function (element) { return removeClass([element], [ACTIVE, PRIMARY]); });\n };\n RecurrenceEditor.prototype.daySelection = function (dayIndex) {\n this.resetDayButton();\n var days = [0, 1, 2, 3, 4, 5, 6];\n this.rotateArray(days, this.firstDayOfWeek);\n var element = this.element.querySelector('.' + DAYWRAPPER + ' button[data-index=\"' + days.indexOf(dayIndex) + '\"]');\n if (element) {\n addClass([element], [ACTIVE, PRIMARY]);\n }\n };\n RecurrenceEditor.prototype.rtlClass = function (status) {\n if (status) {\n addClass([this.element], RTLCLASS);\n }\n else {\n removeClass([this.element], RTLCLASS);\n }\n };\n RecurrenceEditor.prototype.updateUntilDate = function (date) {\n var tempDate = new Date(date.getTime());\n tempDate.setDate(tempDate.getDate() + 60);\n this.untilDateObj.setProperties({ value: tempDate });\n };\n RecurrenceEditor.prototype.selectMonthDay = function (date) {\n var weekday = [KEYSUNDAY, KEYMONDAY, KEYTUESDAY, KEYWEDNESDAY, KEYTHURSDAY, KEYFRIDAY, KEYSATURDAY];\n this.monthDate.setProperties({ value: this.calendarUtil.getDate(date) });\n this.monthWeekDays.setProperties({ value: valueData[weekday[date.getDay()]] });\n this.monthValue.setProperties({ value: '' + this.calendarUtil.getMonth(date) });\n this.monthWeekPos.setProperties({ value: this.getDayPosition(date) });\n this.daySelection(date.getDay());\n };\n RecurrenceEditor.prototype.updateForm = function (state) {\n var _this = this;\n this.repeatType.setProperties({ value: state });\n var end = this.element.querySelector('.' + ENDON);\n if (state === DAILY) {\n classList(end, [FORMLEFT], [FORMRIGHT]);\n }\n else {\n classList(end, [FORMRIGHT], [FORMLEFT]);\n }\n switch (state) {\n case NONE:\n neverClassList.forEach(function (className) { return addClass([_this.element.querySelector('.' + className)], HIDEWRAPPER); });\n break;\n case WEEKLY:\n weekClassList.forEach(function (className) { return addClass([_this.element.querySelector('.' + className)], HIDEWRAPPER); });\n break;\n case MONTHLY:\n monthClassList.forEach(function (className) { return addClass([_this.element.querySelector('.' + className)], HIDEWRAPPER); });\n break;\n case YEARLY:\n yearClassList.forEach(function (className) { return addClass([_this.element.querySelector('.' + className)], HIDEWRAPPER); });\n break;\n case DAILY:\n dailyClassList.forEach(function (className) { return addClass([_this.element.querySelector('.' + className)], HIDEWRAPPER); });\n break;\n }\n };\n RecurrenceEditor.prototype.updateEndOnForm = function (state) {\n var _this = this;\n this.endType.setProperties({ value: state });\n switch (state) {\n case NEVER:\n noEndClassList.forEach(function (className) { return addClass([_this.element.querySelector('.' + className)], HIDEWRAPPER); });\n break;\n case UNTIL:\n endOnDateClassList.forEach(function (className) { return addClass([_this.element.querySelector('.' + className)], HIDEWRAPPER); });\n break;\n case COUNT:\n endOnCountClassList.forEach(function (className) { return addClass([_this.element.querySelector('.' + className)], HIDEWRAPPER); });\n break;\n }\n };\n RecurrenceEditor.prototype.freshOnEndForm = function () {\n var _this = this;\n noEndClassList.forEach(function (className) {\n var element = _this.element.querySelector('.' + className);\n if (element) {\n removeClass([element], HIDEWRAPPER);\n }\n });\n };\n RecurrenceEditor.prototype.showFormElement = function () {\n var _this = this;\n neverClassList.forEach(function (className) {\n var hideElement = _this.element.querySelector('.' + className);\n if (hideElement) {\n removeClass([hideElement], HIDEWRAPPER);\n }\n });\n };\n RecurrenceEditor.prototype.renderDropdowns = function () {\n var _this = this;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var self = this;\n this.repeatType = new DropDownList({\n //set the data to dataSource property\n dataSource: this.getRepeatData(),\n floatLabelType: 'Always',\n enableRtl: this.enableRtl,\n index: this.selectedType,\n fields: {\n text: TEXTFIELD,\n value: VALUEFIELD\n },\n placeholder: this.localeObj.getConstant(REPEAT),\n htmlAttributes: { 'title': this.localeObj.getConstant(REPEAT) },\n change: function (args) {\n self.setProperties({ selectedType: _this.frequencies.indexOf(args.value) }, false);\n self.element.querySelector('.' + REPEATCONTENT).innerHTML =\n self.localeObj.getConstant(contentType[args.value]);\n self.showFormElement();\n self.updateForm(args.value);\n self.resetFormValues();\n self.triggerChangeEvent();\n }\n });\n // set placeholder to DropDownList input element\n this.repeatType.appendTo(this.element.querySelector('.' + REPEATELEMENT));\n this.endType = new DropDownList({\n dataSource: this.getEndData(),\n popupWidth: this.getPopupWidth(),\n enableRtl: this.enableRtl,\n index: 1,\n fields: {\n text: TEXTFIELD,\n value: VALUEFIELD\n },\n change: function (args) {\n self.freshOnEndForm();\n self.updateEndOnForm(args.value);\n self.resetFormValues();\n self.triggerChangeEvent();\n }\n });\n this.endType.appendTo(this.element.querySelector('.' + ENDONELEMENT));\n // eslint-disable-next-line @typescript-eslint/ban-types\n var renderDropDownList = function (dropDownData) {\n return new DropDownList({\n dataSource: dropDownData,\n popupWidth: _this.getPopupWidth(),\n enableRtl: _this.enableRtl,\n fields: {\n text: TEXTFIELD,\n value: VALUEFIELD\n },\n index: 1,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n change: function (args) {\n self.onWeekDay.setProperties({ checked: true });\n self.resetFormValues();\n self.triggerChangeEvent();\n }\n });\n };\n this.monthWeekPos = renderDropDownList(this.getMonthPosData());\n this.monthWeekPos.appendTo(this.element.querySelector('.' + MONTHPOS));\n this.monthWeekDays = renderDropDownList(this.getDayData('wide'));\n this.monthWeekDays.appendTo(this.element.querySelector('.' + MONTHWEEK));\n this.monthValue = new DropDownList({\n dataSource: this.getMonthData(),\n fields: {\n text: TEXTFIELD,\n value: VALUEFIELD\n },\n enableRtl: this.enableRtl,\n index: 7,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n change: function (args) {\n self.resetFormValues();\n self.triggerChangeEvent();\n }\n });\n this.monthValue.appendTo(this.element.querySelector('.' + YEAREXPANDERELEMENT));\n };\n RecurrenceEditor.prototype.setDefaultValue = function () {\n var formelement = [].slice.call(this.element.querySelectorAll('.e-control .e-numerictextbox'));\n for (var _i = 0, formelement_1 = formelement; _i < formelement_1.length; _i++) {\n var element = formelement_1[_i];\n var instance = element.ej2_instances[0];\n if (instance.element.classList.contains(REPEATINTERVAL)) {\n instance.value = 1;\n instance.dataBind();\n }\n else if (instance.element.classList.contains(ENDONCOUNT)) {\n instance.value = 10;\n instance.dataBind();\n }\n }\n };\n RecurrenceEditor.prototype.resetFormValues = function () {\n var recurreneElement = [].slice.call(this.element.querySelectorAll('.e-control [type=\"text\"]'));\n for (var _i = 0, recurreneElement_1 = recurreneElement; _i < recurreneElement_1.length; _i++) {\n var element = recurreneElement_1[_i];\n var instance = void 0;\n if (element.classList.contains('e-datepicker')) {\n instance = element.ej2_instances[0];\n if (instance.value) {\n // eslint-disable-next-line no-self-assign\n instance.value = instance.value;\n instance.dataBind();\n }\n else {\n this.updateUntilDate(this.startDate);\n }\n }\n else if (element.classList.contains('e-dropdownlist')) {\n instance = element.ej2_instances[0];\n instance.index = instance.index || 0;\n instance.dataBind();\n }\n else if (element.classList.contains('e-numerictextbox')) {\n instance = element.ej2_instances[0];\n var value = void 0;\n if (instance.element.classList.contains(REPEATINTERVAL)) {\n value = 1;\n }\n else if (instance.element.classList.contains(ENDONCOUNT)) {\n value = 10;\n }\n else {\n value = this.startDate.getDate();\n }\n instance.value = instance.value || value;\n instance.dataBind();\n }\n }\n };\n RecurrenceEditor.prototype.getPopupWidth = function () {\n return Browser.isDevice ? '100%' : 'auto';\n };\n RecurrenceEditor.prototype.renderDatePickers = function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var self = this;\n this.untilDateObj = new DatePicker({\n firstDayOfWeek: this.firstDayOfWeek,\n enableRtl: this.enableRtl,\n locale: this.locale,\n min: this.minDate,\n max: this.maxDate,\n format: (isNullOrUndefined(this.dateFormat) ? this.getFormat('dateFormats') : this.dateFormat),\n change: function (args) {\n if (args.value) {\n self.triggerChangeEvent();\n }\n }\n });\n this.untilDateObj.appendTo(this.element.querySelector('.' + UNTILDATE));\n };\n RecurrenceEditor.prototype.getFormat = function (formatType) {\n var format;\n if (this.locale === 'en' || this.locale === 'en-US') {\n format = getValue(formatType + '.short', getDefaultDateObject(this.getCalendarMode()));\n }\n else {\n format = getValue('main.' + '' + this.locale + '.dates.calendars.' + this.getCalendarMode() + '.' + formatType + '.short', cldrData);\n }\n return format;\n };\n RecurrenceEditor.prototype.dayButtonRender = function () {\n var _this = this;\n var btns = [].slice.call(this.element.querySelectorAll('.' + DAYWRAPPER + ' button'));\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var self = this;\n for (var _i = 0, btns_1 = btns; _i < btns_1.length; _i++) {\n var btn = btns_1[_i];\n var button = new Button({ isToggle: true, enableRtl: this.enableRtl }, btn);\n this.dayButtons.push(button);\n EventHandler.add(btn, 'click', function (args) {\n var btns = [].slice.call(_this.element.querySelectorAll('.' + DAYWRAPPER + ' button.' + PRIMARY));\n var element = args.target;\n if (!element.classList.contains(PRIMARY)) {\n addClass([element], PRIMARY);\n self.triggerChangeEvent();\n }\n else if (btns.length > 1) {\n removeClass([element], PRIMARY);\n self.triggerChangeEvent();\n }\n });\n }\n };\n RecurrenceEditor.prototype.radioButtonRender = function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var self = this;\n this.onMonthDay = new RadioButton({\n label: this.localeObj.getConstant(RADIOLABEL),\n enableRtl: this.enableRtl,\n name: 'monthType',\n value: 'day',\n change: function () {\n self.resetFormValues();\n self.triggerChangeEvent();\n }\n });\n this.onMonthDay.appendTo(this.element.querySelector('.' + MONTHEXPANDERELEMENT));\n this.monthButtons.push(this.onMonthDay);\n this.onWeekDay = new RadioButton({\n label: this.localeObj.getConstant('monthExpander'),\n cssClass: 'e-month-type',\n name: 'monthType',\n enableRtl: this.enableRtl,\n value: 'daypos',\n change: function () {\n self.resetFormValues();\n self.triggerChangeEvent();\n }\n });\n this.onWeekDay.appendTo(this.element.querySelector('.' + MONTHEXPANNDERELEM));\n this.monthButtons.push(this.onWeekDay);\n };\n RecurrenceEditor.prototype.numericTextboxRender = function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var self = this;\n this.recurrenceCount = new NumericTextBox({\n value: 10,\n format: '#',\n enableRtl: this.enableRtl,\n min: 1,\n max: 999,\n change: function () {\n self.triggerChangeEvent();\n }\n });\n this.recurrenceCount.appendTo(this.element.querySelector('.' + ENDONCOUNT));\n this.monthDate = new NumericTextBox({\n value: 1,\n format: '#',\n enableRtl: this.enableRtl,\n min: 1,\n max: 31,\n change: function () {\n self.onMonthDay.setProperties({ checked: true });\n self.triggerChangeEvent();\n }\n });\n this.monthDate.appendTo(this.element.querySelector('.' + MONTHDAYWRAPPER));\n this.repeatInterval = new NumericTextBox({\n value: 1,\n format: '#',\n min: 1,\n max: 999,\n enableRtl: this.enableRtl,\n floatLabelType: 'Always',\n placeholder: this.localeObj.getConstant(REPEATEVERY),\n change: function () {\n self.triggerChangeEvent();\n }\n });\n this.repeatInterval.appendTo(this.element.querySelector('.' + REPEATINTERVAL));\n };\n RecurrenceEditor.prototype.renderComponent = function () {\n this.setTemplate();\n this.renderDropdowns();\n this.renderDatePickers();\n this.dayButtonRender();\n this.radioButtonRender();\n this.numericTextboxRender();\n };\n RecurrenceEditor.prototype.rotateArray = function (data, count) {\n var temp;\n for (var index = 0; index < count; index++) {\n temp = data.shift();\n data.push(temp);\n }\n };\n RecurrenceEditor.prototype.getEndData = function () {\n var endData = [NEVER, UNTIL, COUNT];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var self = this;\n var dataSource = [];\n endData.forEach(function (data) {\n dataSource.push({ text: self.localeObj.getConstant(data), value: data });\n });\n return dataSource;\n };\n RecurrenceEditor.prototype.getDayPosition = function (date) {\n var temp = new Date(date.getTime());\n var endDate = new Date(date.getTime());\n var day = date.getDay();\n var positionCollection = [];\n temp = this.calendarUtil.getMonthStartDate(temp);\n endDate = this.calendarUtil.getMonthEndDate(endDate);\n while (temp < endDate) {\n if (temp.getDay() === day) {\n positionCollection.push(temp.getTime());\n }\n temp.setDate(temp.getDate() + 1);\n }\n if (positionCollection.indexOf(date.getTime()) === positionCollection.length - 1) {\n return -1;\n }\n return (positionCollection.indexOf(date.getTime()) + 1);\n };\n RecurrenceEditor.prototype.getRepeatData = function () {\n var data = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var self = this;\n this.frequencies.forEach(function (element) {\n var textValue = (element === NONE) ? NEVER : element;\n data.push({ text: self.localeObj.getConstant(textValue), value: element });\n });\n return data;\n };\n RecurrenceEditor.prototype.getMonthPosData = function () {\n var monthpos = [FIRST, SECOND, THIRD, FOURTH, LAST];\n var monthposValue = {\n first: 1,\n second: 2,\n third: 3,\n fourth: 4,\n last: -1\n };\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var self = this;\n var dataSource = [];\n monthpos.forEach(function (data) {\n dataSource.push({ text: self.localeObj.getConstant(data), value: monthposValue[data] });\n });\n return dataSource;\n };\n RecurrenceEditor.prototype.getDayData = function (format) {\n var weekday = [KEYSUNDAY, KEYMONDAY, KEYTUESDAY, KEYWEDNESDAY, KEYTHURSDAY, KEYFRIDAY, KEYSATURDAY];\n var dayData = [];\n var cldrObj;\n this.rotateArray(weekday, this.firstDayOfWeek);\n if (this.locale === 'en' || this.locale === 'en-US') {\n var nameSpaceString = 'days.stand-alone.';\n cldrObj = (getValue(nameSpaceString + format, getDefaultDateObject(this.getCalendarMode())));\n }\n else {\n var nameSpaceString = 'main.' + '' + this.locale + '.dates.calendars.' + this.getCalendarMode() + '.days.stand-alone.' + format;\n cldrObj = (getValue(nameSpaceString, cldrData));\n }\n for (var _i = 0, weekday_1 = weekday; _i < weekday_1.length; _i++) {\n var obj = weekday_1[_i];\n var day = getValue(obj, cldrObj);\n dayData.push({ text: format === 'narrow' ? day : capitalizeFirstWord(day, 'single'), value: valueData[obj] });\n }\n return dayData;\n };\n RecurrenceEditor.prototype.getMonthData = function () {\n var monthData = [];\n var cldrObj;\n if (this.locale === 'en' || this.locale === 'en-US') {\n var nameSpaceString = 'months.stand-alone.wide';\n cldrObj = (getValue(nameSpaceString, getDefaultDateObject(this.getCalendarMode())));\n }\n else {\n var nameSpaceString = 'main.' + '' + this.locale + '.dates.calendars.' + this.getCalendarMode() + '.months.stand-alone.wide';\n cldrObj = (getValue(nameSpaceString, cldrData));\n }\n for (var _i = 0, _a = Object.keys(cldrObj); _i < _a.length; _i++) {\n var obj = _a[_i];\n monthData.push({\n text: capitalizeFirstWord(getValue(obj, cldrObj), 'single'),\n value: obj\n });\n }\n return monthData;\n };\n RecurrenceEditor.prototype.setTemplate = function () {\n var dayData = this.getDayData('narrow');\n var fullDay = this.getDayData('wide');\n this.element.innerHTML = '
' +\n '
' +\n '' +\n '
' +\n '
' + this.localeObj.getConstant(ON) + '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' + this.localeObj.getConstant(ON) + '
' +\n '
' +\n '' +\n '
' +\n '
' +\n '
' +\n '
';\n };\n RecurrenceEditor.prototype.getSelectedDaysData = function () {\n var ruleData = RULEBYDAY + EQUAL;\n var elements = [].slice.call(this.element.querySelectorAll('.' + DAYWRAPPER + ' button.' + PRIMARY));\n var weekday = [RULESUNDAY, RULEMONDAY, RULETUESDAY, RULEWEDNESDAY, RULETHURSDAY, RULEFRIDAY, RULESATURDAY];\n this.rotateArray(weekday, this.firstDayOfWeek);\n for (var index = 0; index < elements.length; index++) {\n ruleData += weekday[parseInt(elements[index].getAttribute('data-index'), 10)] + (index === (elements.length - 1) ? '' : COMMA);\n }\n return ruleData + SEMICOLON;\n };\n RecurrenceEditor.prototype.getSelectedMonthData = function () {\n var ruleData;\n if (this.onWeekDay.checked) {\n ruleData = RULEBYDAY + EQUAL + this.monthWeekDays.value + SEMICOLON\n + RULESETPOS + EQUAL + this.monthWeekPos.value + SEMICOLON;\n }\n else {\n ruleData = RULEBYMONTHDAY + EQUAL + this.monthDate.value + SEMICOLON;\n }\n return ruleData;\n };\n RecurrenceEditor.prototype.getIntervalData = function () {\n return RULEINTERVAL + EQUAL + this.repeatInterval.value + SEMICOLON;\n };\n RecurrenceEditor.prototype.getEndOnCount = function () {\n return RULECOUNT + EQUAL + this.recurrenceCount.value + SEMICOLON;\n };\n RecurrenceEditor.prototype.getYearMonthRuleData = function () {\n return RULEBYMONTH + EQUAL + this.monthValue.value + SEMICOLON;\n };\n RecurrenceEditor.prototype.updateWeekButton = function (keys) {\n var weekday = [RULESUNDAY, RULEMONDAY, RULETUESDAY, RULEWEDNESDAY, RULETHURSDAY, RULEFRIDAY, RULESATURDAY];\n this.rotateArray(weekday, this.firstDayOfWeek);\n for (var _i = 0, _a = this.dayButtons; _i < _a.length; _i++) {\n var obj = _a[_i];\n var index = parseInt(obj.element.getAttribute('data-index'), 10);\n if (keys.indexOf(weekday[index]) !== -1) {\n obj.setProperties({ isPrimary: true });\n }\n else {\n obj.setProperties({ isPrimary: false });\n }\n }\n };\n RecurrenceEditor.prototype.updateMonthUI = function () {\n if (this.ruleObject.monthDay.length) {\n this.monthDate.setProperties({ value: this.ruleObject.monthDay[0] });\n this.onMonthDay.setProperties({ checked: true });\n }\n else {\n this.onWeekDay.setProperties({ checked: true });\n this.monthWeekPos.setProperties({ value: this.ruleObject.setPosition });\n for (var _i = 0, _a = Object.keys(valueData); _i < _a.length; _i++) {\n var key = _a[_i];\n if (valueData[key] === this.ruleObject.day[0]) {\n this.monthWeekDays.setProperties({ value: this.ruleObject.day[0] });\n break;\n }\n }\n }\n };\n RecurrenceEditor.prototype.updateUI = function (repeat, state) {\n this.repeatInterval.setProperties({ value: this.ruleObject.interval });\n switch (state) {\n case UNTIL:\n this.untilDateObj.setProperties({ value: this.ruleObject.until });\n break;\n case COUNT:\n this.recurrenceCount.setProperties({ value: this.ruleObject.count });\n break;\n }\n switch (repeat) {\n case WEEKLY:\n this.updateWeekButton(this.ruleObject.day);\n break;\n case YEARLY:\n this.monthValue.setProperties({ index: (this.ruleObject.month[0] - 1) });\n this.updateMonthUI();\n break;\n case MONTHLY:\n this.updateMonthUI();\n break;\n }\n };\n RecurrenceEditor.prototype.getUntilData = function () {\n if (!this.untilDateObj.value) {\n return '';\n }\n var tempStr = getRecurrenceStringFromDate(this.untilDateObj.value);\n return RULEUNTIL + EQUAL + tempStr + SEMICOLON;\n };\n RecurrenceEditor.prototype.destroyComponents = function () {\n if (!this.recurrenceCount.isDestroyed) {\n this.recurrenceCount.destroy();\n }\n if (!this.monthDate.isDestroyed) {\n this.monthDate.destroy();\n }\n if (!this.repeatInterval.isDestroyed) {\n this.repeatInterval.destroy();\n }\n if (!this.untilDateObj.isDestroyed) {\n this.untilDateObj.destroy();\n }\n if (!this.repeatType.isDestroyed) {\n this.repeatType.destroy();\n }\n if (!this.endType.isDestroyed) {\n this.endType.destroy();\n }\n if (!this.monthWeekPos.isDestroyed) {\n this.monthWeekPos.destroy();\n }\n if (!this.monthWeekDays.isDestroyed) {\n this.monthWeekDays.destroy();\n }\n if (!this.monthValue.isDestroyed) {\n this.monthValue.destroy();\n }\n this.dayButtons.forEach(function (element) {\n if (!element.isDestroyed) {\n element.destroy();\n }\n });\n this.dayButtons = [];\n this.monthButtons.forEach(function (element) {\n if (!element.isDestroyed) {\n element.destroy();\n }\n });\n this.monthButtons = [];\n };\n RecurrenceEditor.prototype.resetFields = function () {\n this.startState(NONE, NEVER, this.startDate);\n this.setDefaultValue();\n };\n RecurrenceEditor.prototype.updateRuleUntilDate = function (startDate) {\n if (this.untilDateObj.value && startDate) {\n var untilDate = this.untilDateObj.value;\n var newUntilDate = new Date(untilDate.getFullYear(), untilDate.getMonth(), untilDate.getDate(), startDate.getHours(), startDate.getMinutes(), startDate.getMilliseconds());\n this.untilDateObj.setProperties({ value: newUntilDate });\n }\n };\n RecurrenceEditor.prototype.getCalendarMode = function () {\n return this.calendarMode.toLowerCase();\n };\n RecurrenceEditor.prototype.getRuleSummary = function (rule) {\n if (rule === void 0) { rule = this.getRecurrenceRule(); }\n return generateSummary(rule, this.localeObj, this.locale, this.calendarMode);\n };\n RecurrenceEditor.prototype.getRecurrenceDates = function (startDate, rule, excludeDate, maximumCount, viewDate) {\n viewDate = isNullOrUndefined(viewDate) ? this.startDate : viewDate;\n return generate(startDate, rule, excludeDate, this.firstDayOfWeek, maximumCount, viewDate, this.calendarMode);\n };\n RecurrenceEditor.prototype.getRecurrenceRule = function () {\n var ruleData = RULEFREQ + EQUAL;\n switch (this.repeatType.value) {\n case DAILY:\n ruleData += RULEDAILY + SEMICOLON;\n break;\n case WEEKLY:\n ruleData += RULEWEEKLY + SEMICOLON + this.getSelectedDaysData();\n break;\n case MONTHLY:\n ruleData += RULEMONTHLY + SEMICOLON + this.getSelectedMonthData();\n break;\n case YEARLY:\n ruleData += RULEYEARLY + SEMICOLON + this.getSelectedMonthData() + this.getYearMonthRuleData();\n break;\n case NONE:\n return '';\n }\n ruleData += this.getIntervalData();\n switch (this.endType.value) {\n case UNTIL:\n ruleData += this.getUntilData();\n break;\n case COUNT:\n ruleData += this.getEndOnCount();\n break;\n }\n return ruleData;\n };\n RecurrenceEditor.prototype.setRecurrenceRule = function (rule, startDate) {\n if (startDate === void 0) { startDate = this.startDate; }\n if (!rule) {\n this.repeatType.setProperties({ value: NONE });\n return;\n }\n this.renderStatus = false;\n this.ruleObject = extractObjectFromRule(rule);\n var endon = this.ruleObject.count ? COUNT : (this.ruleObject.until ? UNTIL : NEVER);\n switch (this.ruleObject.freq) {\n case RULEDAILY:\n this.startState(DAILY, endon, startDate);\n this.updateUI(DAILY, endon);\n break;\n case RULEWEEKLY:\n this.startState(WEEKLY, endon, startDate);\n this.updateUI(WEEKLY, endon);\n break;\n case RULEMONTHLY:\n this.startState(MONTHLY, endon, startDate);\n this.updateUI(MONTHLY, endon);\n break;\n case RULEYEARLY:\n this.startState(YEARLY, endon, startDate);\n this.updateUI(YEARLY, endon);\n break;\n }\n this.renderStatus = true;\n this.triggerChangeEvent();\n };\n /**\n * Destroys the widget.\n *\n * @returns {void}\n */\n RecurrenceEditor.prototype.destroy = function () {\n this.destroyComponents();\n _super.prototype.destroy.call(this);\n var removeClasses = ['e-' + this.getModuleName()];\n if (this.cssClass) {\n removeClasses = removeClasses.concat(this.cssClass.split(' '));\n }\n removeClass([this.element], removeClasses);\n while (this.element.firstElementChild) {\n this.element.removeChild(this.element.firstElementChild);\n }\n };\n /**\n * Get component name.\n *\n * @returns {string} Returns the module name\n * @private\n */\n RecurrenceEditor.prototype.getModuleName = function () {\n return 'recurrenceeditor';\n };\n /**\n * Get the properties to be maintained in the persisted state.\n *\n * @returns {string} Returns the persisted state\n */\n RecurrenceEditor.prototype.getPersistData = function () {\n return this.addOnPersist([]);\n };\n /**\n * Initialize the control rendering\n *\n * @returns {void}\n * @private\n */\n RecurrenceEditor.prototype.render = function () {\n this.initialize();\n this.rtlClass(this.enableRtl);\n this.renderStatus = true;\n this.renderComplete();\n };\n /**\n * Called internally, if any of the property value changed.\n *\n * @param {RecurrenceEditorModel} newProp Accepts the changed properties new values\n * @param {RecurrenceEditorModel} oldProp Accepts the changed properties old values\n * @returns {void}\n * @private\n */\n RecurrenceEditor.prototype.onPropertyChanged = function (newProp, oldProp) {\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'startDate':\n this.selectMonthDay(newProp.startDate);\n this.updateUntilDate(newProp.startDate);\n this.endType.setProperties({ index: 0 });\n break;\n case 'enableRtl':\n this.rtlClass(newProp.enableRtl);\n break;\n case 'cssClass':\n if (oldProp.cssClass) {\n removeClass([this.element], oldProp.cssClass.split(' '));\n }\n if (newProp.cssClass) {\n addClass([this.element], newProp.cssClass.split(' '));\n }\n break;\n case 'selectedType':\n this.repeatType.setProperties({ index: this.selectedType });\n break;\n case 'minDate':\n this.untilDateObj.setProperties({ minDate: this.minDate });\n break;\n case 'maxDate':\n this.untilDateObj.setProperties({ maxDate: this.maxDate });\n break;\n case 'value':\n if (this.getRecurrenceRule() !== this.value) {\n this.setRecurrenceRule(this.value);\n }\n break;\n case 'calendarMode':\n this.calendarMode = newProp.calendarMode;\n this.calendarUtil = getCalendarUtil(newProp.calendarMode);\n break;\n case 'locale':\n case 'frequencies':\n case 'firstDayOfWeek':\n this.refresh();\n break;\n case 'dateFormat':\n this.untilDateObj.setProperties({ format: newProp.dateFormat });\n break;\n }\n }\n };\n __decorate([\n Property(['none', 'daily', 'weekly', 'monthly', 'yearly'])\n ], RecurrenceEditor.prototype, \"frequencies\", void 0);\n __decorate([\n Property(0)\n ], RecurrenceEditor.prototype, \"firstDayOfWeek\", void 0);\n __decorate([\n Property(new Date())\n ], RecurrenceEditor.prototype, \"startDate\", void 0);\n __decorate([\n Property()\n ], RecurrenceEditor.prototype, \"dateFormat\", void 0);\n __decorate([\n Property('Gregorian')\n ], RecurrenceEditor.prototype, \"calendarMode\", void 0);\n __decorate([\n Property()\n ], RecurrenceEditor.prototype, \"cssClass\", void 0);\n __decorate([\n Property()\n ], RecurrenceEditor.prototype, \"value\", void 0);\n __decorate([\n Property(new Date(1900, 0, 1))\n ], RecurrenceEditor.prototype, \"minDate\", void 0);\n __decorate([\n Property(new Date(2099, 11, 31))\n ], RecurrenceEditor.prototype, \"maxDate\", void 0);\n __decorate([\n Property(0)\n ], RecurrenceEditor.prototype, \"selectedType\", void 0);\n __decorate([\n Event()\n ], RecurrenceEditor.prototype, \"change\", void 0);\n RecurrenceEditor = __decorate([\n NotifyPropertyChanges\n ], RecurrenceEditor);\n return RecurrenceEditor;\n}(Component));\nexport { RecurrenceEditor };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createElement, isNullOrUndefined, addClass, remove, EventHandler, extend, append } from '@syncfusion/ej2-base';\nimport { cldrData, removeClass, getValue, getDefaultDateObject, closest, SanitizeHtmlHelper } from '@syncfusion/ej2-base';\nimport { Query, Deferred } from '@syncfusion/ej2-data';\nimport { CheckBox, Button } from '@syncfusion/ej2-buttons';\nimport { Dialog } from '@syncfusion/ej2-popups';\nimport { DropDownList, MultiSelect } from '@syncfusion/ej2-dropdowns';\nimport { Input } from '@syncfusion/ej2-inputs';\nimport { DateTimePicker } from '@syncfusion/ej2-calendars';\nimport { FieldValidator } from './form-validator';\nimport { RecurrenceEditor } from '../../recurrence-editor/recurrence-editor';\nimport * as cls from '../base/css-constant';\nimport * as event from '../base/constant';\nimport * as util from '../base/util';\nvar EVENT_FIELD = 'e-field';\nvar REPEAT_CONTAINER_CLASS = 'e-recurrence-container';\nvar REPEAT_BUTTON_ICON_CLASS = 'e-recurrence-edit';\nvar REPEAT_BUTTON_CLASS = 'e-recurrence-edit-button';\nvar REPEAT_DIALOG_CLASS = 'e-recurrence-dialog';\nvar HIDE_STYLE_CLASS = 'e-hide';\n/**\n * Event editor window\n */\nvar EventWindow = /** @class */ (function () {\n function EventWindow(parent) {\n this.parent = parent;\n this.l10n = this.parent.localeObj;\n this.fields = this.parent.eventFields;\n this.eventWindowTime = { startTime: new Date(), endTime: new Date() };\n this.renderEventWindow();\n }\n EventWindow.prototype.renderEventWindow = function () {\n this.element = createElement('div', { id: this.parent.element.id + '_dialog_wrapper' });\n this.parent.element.appendChild(this.element);\n var dialogModel = {\n animationSettings: { effect: 'Zoom' },\n content: this.getEventWindowContent(),\n cssClass: cls.EVENT_WINDOW_DIALOG_CLASS,\n enableRtl: this.parent.enableRtl,\n height: this.parent.isAdaptive ? '100%' : 'auto',\n minHeight: '300px',\n isModal: true,\n showCloseIcon: this.parent.isAdaptive ? false : true,\n target: document.body,\n visible: false,\n width: '500px',\n beforeOpen: this.onBeforeOpen.bind(this),\n beforeClose: this.onBeforeClose.bind(this)\n };\n if (this.parent.isAdaptive) {\n dialogModel.cssClass = cls.EVENT_WINDOW_DIALOG_CLASS + ' ' + cls.DEVICE_CLASS;\n dialogModel.header = '';\n }\n else {\n dialogModel.buttons = [{\n buttonModel: {\n content: this.l10n.getConstant('deleteButton'), cssClass: cls.DELETE_EVENT_CLASS,\n disabled: !this.parent.eventSettings.allowDeleting || this.parent.readonly\n },\n click: this.eventDelete.bind(this)\n }, {\n buttonModel: {\n content: this.l10n.getConstant('saveButton'), cssClass: 'e-primary ' + cls.EVENT_WINDOW_SAVE_BUTTON_CLASS,\n isPrimary: true, disabled: !this.parent.eventSettings.allowAdding || this.parent.readonly\n },\n click: this.eventSave.bind(this)\n }, {\n buttonModel: { cssClass: cls.EVENT_WINDOW_CANCEL_BUTTON_CLASS, content: this.l10n.getConstant('cancelButton') },\n click: this.dialogClose.bind(this)\n }];\n dialogModel.header = '
' + this.l10n.getConstant('newEvent') + '
';\n }\n this.dialogObject = new Dialog(dialogModel, this.element);\n if (this.dialogObject.element.querySelector('.e-dlg-closeicon-btn')) {\n this.dialogObject.element.querySelector('.e-dlg-closeicon-btn').setAttribute('title', this.l10n.getConstant('close'));\n }\n addClass([this.element.parentElement], cls.EVENT_WINDOW_DIALOG_CLASS + '-container');\n if (this.parent.isAdaptive) {\n EventHandler.add(this.element.querySelector('.' + cls.EVENT_WINDOW_BACK_ICON_CLASS), 'click', this.dialogClose, this);\n EventHandler.add(this.element.querySelector('.' + cls.EVENT_WINDOW_SAVE_ICON_CLASS), 'click', this.eventSave, this);\n }\n EventHandler.add(this.dialogObject.element, 'keydown', this.preventEventSave, this);\n this.applyFormValidation();\n };\n EventWindow.prototype.refresh = function () {\n this.destroy(true);\n this.renderEventWindow();\n };\n EventWindow.prototype.refreshRecurrenceEditor = function () {\n if (this.recurrenceEditor) {\n var recurrenceEditor = this.recurrenceEditor.element;\n this.recurrenceEditor.destroy();\n this.createRecurrenceEditor(recurrenceEditor);\n }\n };\n EventWindow.prototype.setRecurrenceEditor = function (recurrenceEditor) {\n if (this.parent.editorTemplate) {\n this.recurrenceEditor = recurrenceEditor;\n }\n };\n EventWindow.prototype.openEditor = function (data, type, isEventData, repeatType) {\n this.parent.currentAction = type;\n this.parent.removeNewEventElement();\n if (this.parent.quickPopup) {\n this.parent.quickPopup.quickPopupHide(true);\n }\n this.parent.inlineModule.removeInlineAppointmentElement();\n if (type === 'Add') {\n var eventObj = {};\n this.cellClickAction = !isEventData;\n this.parent.activeCellsData = data;\n var event_1 = data;\n if (this.cellClickAction) {\n this.convertToEventData(event_1, eventObj);\n }\n else {\n this.parent.activeCellsData = {\n startTime: (event_1.startTime || event_1[this.fields.startTime]),\n endTime: (event_1.endTime || event_1[this.fields.endTime]),\n isAllDay: (event_1.isAllDay || event_1[this.fields.isAllDay]),\n element: event_1.element,\n groupIndex: event_1.groupIndex\n };\n eventObj = event_1;\n }\n data = eventObj;\n }\n if (!isNullOrUndefined(this.parent.editorTemplate)) {\n this.renderFormElements(this.element.querySelector('.e-schedule-form'), data);\n }\n if (!this.parent.isAdaptive && isNullOrUndefined(this.parent.editorTemplate)) {\n removeClass([this.dialogObject.element.querySelector('.e-recurrenceeditor')], cls.DISABLE_CLASS);\n }\n if (this.recurrenceEditor) {\n this.recurrenceEditor.firstDayOfWeek = this.parent.activeViewOptions.firstDayOfWeek;\n }\n switch (type) {\n case 'Add':\n this.onCellDetailsUpdate(data, repeatType);\n break;\n case 'Save':\n case 'EditOccurrence':\n case 'EditSeries':\n case 'EditFollowingEvents':\n if (type === 'EditOccurrence' && !this.parent.isAdaptive && isNullOrUndefined(this.parent.editorTemplate)) {\n addClass([this.dialogObject.element.querySelector('.e-recurrenceeditor')], cls.DISABLE_CLASS);\n }\n this.cellClickAction = false;\n this.onEventDetailsUpdate(data);\n break;\n }\n };\n EventWindow.prototype.setDialogContent = function () {\n this.dialogObject.content = this.getEventWindowContent();\n this.dialogObject.dataBind();\n };\n EventWindow.prototype.preventEventSave = function (e) {\n if (this.parent && !this.parent.allowKeyboardInteraction && e.code === 'Enter') {\n this.isEnterKey = true;\n }\n };\n EventWindow.prototype.onBeforeOpen = function (args) {\n var _this = this;\n var eventProp = {\n type: 'Editor',\n data: this.eventData,\n cancel: false,\n element: this.element,\n target: (this.cellClickAction ? this.parent.activeCellsData.element : this.parent.activeEventData.element)\n };\n if (this.cellClickAction) {\n eventProp.duration = this.getSlotDuration();\n }\n var saveObj = this.getInstance(cls.EVENT_WINDOW_SAVE_BUTTON_CLASS);\n if (saveObj) {\n saveObj.disabled = !(this.cellClickAction ? this.parent.eventSettings.allowAdding : this.parent.eventSettings.allowEditing);\n saveObj.dataBind();\n }\n var deleteObj = this.getInstance(cls.DELETE_EVENT_CLASS);\n if (deleteObj) {\n deleteObj.disabled = !this.parent.eventSettings.allowDeleting;\n deleteObj.dataBind();\n }\n var callBackPromise = new Deferred();\n this.parent.trigger(event.popupOpen, eventProp, function (popupArgs) {\n args.cancel = popupArgs.cancel;\n _this.duration = _this.cellClickAction ? popupArgs.duration : null;\n _this.refreshDateTimePicker(_this.duration);\n if (_this.cellClickAction && popupArgs.duration !== _this.getSlotDuration() && isNullOrUndefined(_this.parent.editorTemplate)) {\n var startObj = _this.getInstance(cls.EVENT_WINDOW_START_CLASS);\n var endObj = _this.getInstance(cls.EVENT_WINDOW_END_CLASS);\n endObj.value = new Date(startObj.value.getTime() + (util.MS_PER_MINUTE * popupArgs.duration));\n endObj.dataBind();\n }\n if (_this.parent.editorTemplate && _this.element.querySelector('.e-recurrenceeditor') && !_this.recurrenceEditor) {\n _this.recurrenceEditor = _this.getInstance('e-recurrenceeditor');\n }\n callBackPromise.resolve(args);\n });\n return callBackPromise;\n };\n EventWindow.prototype.onBeforeClose = function (args) {\n var _this = this;\n if (args.isInteracted) {\n this.isCrudAction = false;\n }\n var eventProp = {\n type: 'Editor',\n event: args.event || this.dialogEvent,\n data: this.eventCrudData,\n cancel: false,\n element: this.element,\n target: (this.cellClickAction ? this.parent.activeCellsData.element : this.parent.activeEventData.element)\n };\n var callBackPromise = new Deferred();\n this.parent.trigger(event.popupClose, eventProp, function (popupArgs) {\n args.cancel = popupArgs.cancel;\n if (!popupArgs.cancel) {\n if (_this.isCrudAction) {\n args.cancel = _this.processCrudActions(popupArgs.data);\n _this.isCrudAction = args.cancel;\n }\n if (!_this.isCrudAction) {\n _this.resetForm();\n _this.parent.eventBase.focusElement(true);\n _this.eventCrudData = null;\n }\n }\n callBackPromise.resolve(args);\n });\n return callBackPromise;\n };\n EventWindow.prototype.getEventWindowContent = function () {\n var container = createElement('div', { className: cls.FORM_CONTAINER_CLASS });\n var form = createElement('form', {\n id: this.parent.element.id + 'EditForm',\n className: cls.FORM_CLASS,\n attrs: { onsubmit: 'return false;' }\n });\n this.renderFormElements(form);\n container.appendChild(form);\n return container;\n };\n EventWindow.prototype.renderFormElements = function (form, args) {\n if (!isNullOrUndefined(this.parent.editorTemplate)) {\n if (args) {\n if (this.recurrenceEditor) {\n this.recurrenceEditor.destroy();\n this.recurrenceEditor = null;\n }\n this.destroyComponents();\n var formElements = [].slice.call(form.children);\n for (var _i = 0, formElements_1 = formElements; _i < formElements_1.length; _i++) {\n var element = formElements_1[_i];\n remove(element);\n }\n }\n var templateId = this.parent.element.id + '_editorTemplate';\n var tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));\n append(tempEle, form);\n this.parent.renderTemplates();\n }\n else {\n form.appendChild(this.getDefaultEventWindowContent());\n }\n };\n EventWindow.prototype.getDefaultEventWindowContent = function () {\n var parentDiv = this.createDivElement(cls.EVENT_WINDOW_DIALOG_PARENT_CLASS);\n var titleLocationDiv = this.createDivElement(cls.EVENT_WINDOW_TITLE_LOCATION_DIV_CLASS);\n parentDiv.appendChild(titleLocationDiv);\n titleLocationDiv.appendChild(this.renderTextBox(cls.SUBJECT_CLASS));\n titleLocationDiv.querySelector('.' + cls.SUBJECT_CLASS).setAttribute('title', this.parent.editorTitles.subject);\n titleLocationDiv.appendChild(this.renderTextBox(cls.LOCATION_CLASS));\n titleLocationDiv.querySelector('.' + cls.LOCATION_CLASS).setAttribute('title', this.parent.editorTitles.location);\n var startEndDateTimeDiv = this.createDivElement(cls.EVENT_WINDOW_START_END_DIV_CLASS);\n parentDiv.appendChild(startEndDateTimeDiv);\n startEndDateTimeDiv.appendChild(this.renderDateTimePicker(cls.EVENT_WINDOW_START_CLASS, this.onTimeChange.bind(this)));\n startEndDateTimeDiv.querySelector('.' + cls.EVENT_WINDOW_START_CLASS).setAttribute('title', this.parent.editorTitles.startTime);\n startEndDateTimeDiv.appendChild(this.renderDateTimePicker(cls.EVENT_WINDOW_END_CLASS));\n startEndDateTimeDiv.querySelector('.' + cls.EVENT_WINDOW_END_CLASS).setAttribute('title', this.parent.editorTitles.endTime);\n var allDayTimezoneDiv = this.createDivElement(cls.EVENT_WINDOW_ALLDAY_TZ_DIV_CLASS);\n parentDiv.appendChild(allDayTimezoneDiv);\n allDayTimezoneDiv.appendChild(this.renderCheckBox(cls.EVENT_WINDOW_ALL_DAY_CLASS));\n allDayTimezoneDiv.appendChild(this.renderCheckBox(cls.TIME_ZONE_CLASS));\n var timezoneParentDiv = this.createDivElement(cls.EVENT_WINDOW_TIME_ZONE_DIV_CLASS);\n parentDiv.appendChild(timezoneParentDiv);\n timezoneParentDiv.appendChild(this.renderDropDown(cls.EVENT_WINDOW_START_TZ_CLASS));\n timezoneParentDiv.appendChild(this.renderDropDown(cls.EVENT_WINDOW_END_TZ_CLASS));\n var repeatParentDiv = this.createDivElement(cls.EVENT_WINDOW_REPEAT_DIV_CLASS);\n parentDiv.appendChild(repeatParentDiv);\n var repeatDiv = this.renderCheckBox(cls.EVENT_WINDOW_REPEAT_CLASS);\n var repeatEditContainer = createElement('span', { className: REPEAT_CONTAINER_CLASS });\n var button = createElement('button', {\n className: REPEAT_BUTTON_CLASS,\n attrs: { type: 'button', 'title': this.l10n.getConstant('editRecurrence') }\n });\n this.buttonObj = new Button({ iconCss: REPEAT_BUTTON_ICON_CLASS + ' e-icons', cssClass: 'e-medium ' + this.parent.cssClass });\n repeatEditContainer.appendChild(button);\n this.buttonObj.appendTo(button);\n repeatDiv.appendChild(repeatEditContainer);\n repeatParentDiv.appendChild(repeatDiv);\n if (this.parent.isAdaptive) {\n EventHandler.add(button, 'click', this.loadRecurrenceEditor, this);\n }\n else {\n this.createRecurrenceEditor(parentDiv);\n }\n if (this.parent.resourceCollection.length > 0) {\n var resourceParentDiv = this.createDivElement(cls.EVENT_WINDOW_RESOURCES_DIV_CLASS);\n for (var _i = 0, _a = this.parent.resourceBase.resourceCollection; _i < _a.length; _i++) {\n var resource = _a[_i];\n resourceParentDiv.appendChild(this.renderResourceDetails(resource));\n }\n parentDiv.appendChild(resourceParentDiv);\n }\n var description = this.createDivElement(cls.DESCRIPTION_CLASS + '-row');\n description.appendChild(this.renderTextBox(cls.DESCRIPTION_CLASS));\n description.querySelector('.' + cls.DESCRIPTION_CLASS).setAttribute('title', this.parent.editorTitles.description);\n parentDiv.appendChild(description);\n var submit = createElement('button', { attrs: { type: 'hidden', title: 'submit', style: 'display:none' } });\n parentDiv.appendChild(submit);\n return parentDiv;\n };\n EventWindow.prototype.createRecurrenceEditor = function (parentDiv) {\n var recurrenceEditor = this.createDivElement();\n parentDiv.appendChild(recurrenceEditor);\n this.recurrenceEditor = this.renderRecurrenceEditor();\n this.recurrenceEditor.appendTo(recurrenceEditor);\n this.updateMinMaxDateToEditor();\n };\n EventWindow.prototype.createDivElement = function (className) {\n return createElement('div', { className: className });\n };\n EventWindow.prototype.createInputElement = function (className, fieldName, type) {\n return createElement(type || 'input', {\n className: className, attrs: {\n type: 'text', name: fieldName, value: '', id: fieldName,\n title: ((this.l10n.getConstant(fieldName.charAt(0).toLowerCase() + fieldName.slice(1))) === '') ?\n fieldName : this.l10n.getConstant(fieldName.charAt(0).toLowerCase() + fieldName.slice(1))\n }\n });\n };\n EventWindow.prototype.getSlotDuration = function () {\n return this.parent.activeViewOptions.timeScale.interval / this.parent.activeViewOptions.timeScale.slotCount;\n };\n EventWindow.prototype.renderDateTimePicker = function (value, changeEvent) {\n var dateTimeDiv = this.createDivElement(value + '-container');\n var fieldName = this.getFieldName(value);\n var dateTimeInput = this.createInputElement(value + ' ' + EVENT_FIELD, fieldName);\n dateTimeDiv.appendChild(dateTimeInput);\n var dateTimePicker = new DateTimePicker({\n change: changeEvent,\n firstDayOfWeek: this.parent.activeViewOptions.firstDayOfWeek,\n calendarMode: this.parent.calendarMode,\n min: this.parent.minDate,\n max: new Date(new Date(+this.parent.maxDate).setHours(23, 59, 59)),\n cssClass: this.parent.cssClass,\n enableRtl: this.parent.enableRtl,\n locale: this.parent.locale,\n floatLabelType: 'Always',\n timeFormat: this.parent.activeViewOptions.timeFormat,\n format: (isNullOrUndefined(this.parent.dateFormat) ?\n this.getFormat('dateFormats') : this.parent.dateFormat) + ' ' + this.parent.activeViewOptions.timeFormat,\n placeholder: this.getFieldLabel(value),\n step: this.getSlotDuration(),\n width: '100%'\n });\n dateTimePicker.appendTo(dateTimeInput);\n return dateTimeDiv;\n };\n EventWindow.prototype.refreshDateTimePicker = function (duration) {\n var elementSelector = '.' + cls.EVENT_WINDOW_START_CLASS + ',.' + cls.EVENT_WINDOW_END_CLASS;\n var startEndElement = [].slice.call(this.element.querySelectorAll(elementSelector));\n for (var _i = 0, startEndElement_1 = startEndElement; _i < startEndElement_1.length; _i++) {\n var element = startEndElement_1[_i];\n var instance = element.ej2_instances[0];\n instance.firstDayOfWeek = this.parent.activeViewOptions.firstDayOfWeek;\n instance.timeFormat = this.parent.activeViewOptions.timeFormat;\n instance.step = duration || this.getSlotDuration();\n instance.dataBind();\n }\n };\n EventWindow.prototype.onTimeChange = function () {\n var startObj = this.getInstance(cls.EVENT_WINDOW_START_CLASS);\n if (startObj.element.parentElement.classList.contains('e-input-focus')) {\n var endObj = this.getInstance(cls.EVENT_WINDOW_END_CLASS);\n var duration = 0;\n if (this.cellClickAction) {\n duration = util.MS_PER_MINUTE * this.duration;\n this.eventWindowTime.startTime = startObj.value;\n }\n else {\n duration = this.eventData[this.fields.endTime].getTime() - this.eventData[this.fields.startTime].getTime();\n }\n var endDate = (isNullOrUndefined(startObj.value)) ? null : new Date(startObj.value.getTime() + duration);\n if (this.cellClickAction) {\n this.eventWindowTime.endTime = endDate;\n }\n endObj.value = endDate;\n endObj.dataBind();\n }\n if (this.recurrenceEditor) {\n this.recurrenceEditor.updateRuleUntilDate(this.eventWindowTime.startTime);\n }\n };\n EventWindow.prototype.renderResourceDetails = function (resourceData) {\n var fieldName = resourceData.field;\n var value = 'e-' + fieldName;\n var labelValue = resourceData.title;\n var resourceDiv = this.createDivElement(value + '-container' + ' ' + 'e-resources');\n var resourceInput = this.createInputElement(value + ' ' + EVENT_FIELD, fieldName);\n resourceDiv.appendChild(resourceInput);\n var resourceTemplate = '
${' + resourceData.textField + '}
';\n if (resourceData.allowMultiple) {\n var listObj = new MultiSelect({\n cssClass: this.parent.cssClass || '',\n dataSource: resourceData.dataSource,\n change: this.onMultiselectResourceChange.bind(this),\n itemTemplate: resourceTemplate,\n fields: {\n text: resourceData.textField,\n value: resourceData.idField\n },\n htmlAttributes: { 'title': labelValue, 'name': fieldName },\n floatLabelType: 'Always',\n placeholder: labelValue,\n popupHeight: '230px',\n popupWidth: '447px',\n mode: 'Box'\n });\n listObj.appendTo(resourceInput);\n }\n else {\n var dropDownList = new DropDownList({\n cssClass: this.parent.cssClass || '',\n change: this.onDropdownResourceChange.bind(this),\n dataSource: resourceData.dataSource,\n enableRtl: this.parent.enableRtl,\n fields: {\n text: resourceData.textField,\n value: resourceData.idField\n },\n htmlAttributes: { 'title': labelValue, 'name': fieldName },\n floatLabelType: 'Always',\n placeholder: labelValue,\n popupHeight: '230px',\n popupWidth: '447px',\n itemTemplate: resourceTemplate\n });\n dropDownList.appendTo(resourceInput);\n }\n return resourceDiv;\n };\n EventWindow.prototype.renderDropDown = function (value) {\n var _this = this;\n var fieldName = this.getFieldName(value);\n var timezoneDiv = this.createDivElement(value + '-container');\n var timezoneInput = this.createInputElement(value + ' ' + EVENT_FIELD, fieldName);\n timezoneDiv.appendChild(timezoneInput);\n var dropDownList = new DropDownList({\n allowFiltering: true,\n change: this.onTimezoneChange.bind(this),\n cssClass: this.parent.cssClass || '',\n dataSource: this.parent.timezoneDataSource,\n enableRtl: this.parent.enableRtl,\n fields: { text: 'Text', value: 'Value' },\n filterBarPlaceholder: this.parent.localeObj.getConstant('searchTimezone'),\n noRecordsTemplate: this.parent.localeObj.getConstant('noRecords'),\n filtering: function (e) {\n var query = new Query();\n query = (e.text !== '') ? query.where('Text', 'contains', e.text, true) : query;\n e.updateData(_this.parent.timezoneDataSource, query);\n },\n htmlAttributes: { 'title': this.getFieldLabel(value), 'name': fieldName },\n floatLabelType: 'Always',\n placeholder: this.getFieldLabel(value),\n popupHeight: '230px'\n });\n dropDownList.appendTo(timezoneInput);\n return timezoneDiv;\n };\n EventWindow.prototype.onMultiselectResourceChange = function (args) {\n if (!args.value || !this.parent.activeViewOptions.group.byGroupID || this.parent.resourceCollection.length <= 1) {\n return;\n }\n var resourceCollection = this.parent.resourceBase.resourceCollection;\n var fieldName = args.element.getAttribute('name') || this.getColumnName(args.element);\n for (var i = 0; i < resourceCollection.length; i++) {\n if (resourceCollection[i].field === fieldName && i < resourceCollection.length - 1) {\n var resObject = this.createInstance(i);\n var datasource = [];\n var _loop_1 = function (j) {\n var resourceModel = resourceCollection[i + 1];\n // eslint-disable-next-line max-len\n var filter = resourceModel.dataSource.filter(function (data) {\n return data[resourceModel.groupIDField] === args.value[j];\n })[0];\n var groupId = filter[resourceCollection[i + 1].groupIDField];\n var filterRes = this_1.filterDatasource(i, groupId);\n datasource = datasource.concat(filterRes);\n };\n var this_1 = this;\n for (var j = 0; j < args.value.length; j++) {\n _loop_1(j);\n }\n resObject.dataSource = datasource;\n resObject.dataBind();\n }\n }\n };\n EventWindow.prototype.createInstance = function (index) {\n var resourceData = this.parent.resourceBase.resourceCollection[index + 1];\n var resObject = this.element.querySelector('.e-' + resourceData.field).\n ej2_instances[0];\n return resObject;\n };\n EventWindow.prototype.onDropdownResourceChange = function (args) {\n if (!args.value || this.parent.resourceCollection.length <= 1 || !this.parent.activeViewOptions.group.byGroupID) {\n return;\n }\n var fieldName = args.element.getAttribute('name') || this.getColumnName(args.element);\n var resourceCollection = this.parent.resourceBase.resourceCollection;\n for (var i = 0; i < resourceCollection.length; i++) {\n if ((i < resourceCollection.length - 1) && resourceCollection[i].field === fieldName) {\n var resObj = this.createInstance(i);\n var groupId = args.itemData[resourceCollection[i].idField];\n resObj.dataSource = this.filterDatasource(i, groupId);\n resObj.dataBind();\n var resValue = resObj.dataSource[0][resourceCollection[i + 1].idField];\n resObj.value = (resourceCollection[i + 1].allowMultiple) ? [resValue] : resValue;\n resObj.dataBind();\n }\n }\n };\n EventWindow.prototype.filterDatasource = function (index, groupId) {\n var resourceData = this.parent.resourceBase.resourceCollection[index + 1];\n return resourceData.dataSource.filter(function (data) {\n return data[resourceData.groupIDField] === groupId;\n });\n };\n EventWindow.prototype.onTimezoneChange = function (args) {\n var fieldName = args.element.getAttribute('name') || this.getColumnName(args.element);\n if (fieldName === this.parent.eventFields.startTimezone) {\n var startTimezoneObj = this.getInstance(cls.EVENT_WINDOW_START_TZ_CLASS);\n var endTimezoneObj = this.getInstance(cls.EVENT_WINDOW_END_TZ_CLASS);\n endTimezoneObj.value = startTimezoneObj.value;\n endTimezoneObj.dataBind();\n }\n };\n EventWindow.prototype.renderCheckBox = function (value) {\n var checkBoxDiv = this.createDivElement(value + '-container');\n var fieldName = this.getFieldName(value);\n var checkBoxInput = this.createInputElement(value + ' ' + EVENT_FIELD, fieldName);\n checkBoxDiv.appendChild(checkBoxInput);\n var checkBox = new CheckBox({\n change: this.onChange.bind(this),\n cssClass: value + ' ' + this.parent.cssClass,\n enableRtl: this.parent.enableRtl,\n label: this.getFieldLabel(value)\n });\n checkBox.appendTo(checkBoxInput);\n checkBoxInput.setAttribute('name', fieldName);\n if (fieldName === 'Repeat') {\n this.repeatStatus = checkBox;\n }\n return checkBoxDiv;\n };\n EventWindow.prototype.renderTextBox = function (value) {\n var textBoxDiv = this.createDivElement(value + '-container');\n var fieldName = this.getFieldName(value);\n var elementType = (value === cls.DESCRIPTION_CLASS) ? 'textarea' : 'input';\n var textBoxInput = this.createInputElement(value + ' ' + EVENT_FIELD, fieldName, elementType);\n textBoxDiv.appendChild(textBoxInput);\n Input.createInput({\n element: textBoxInput,\n floatLabelType: 'Always',\n properties: {\n enableRtl: this.parent.enableRtl,\n placeholder: this.getFieldLabel(value)\n }\n });\n return textBoxDiv;\n };\n EventWindow.prototype.getFieldName = function (name) {\n var fieldName = '';\n switch (name) {\n case cls.SUBJECT_CLASS:\n fieldName = this.fields.subject;\n break;\n case cls.LOCATION_CLASS:\n fieldName = this.fields.location;\n break;\n case cls.EVENT_WINDOW_START_CLASS:\n fieldName = this.fields.startTime;\n break;\n case cls.EVENT_WINDOW_END_CLASS:\n fieldName = this.fields.endTime;\n break;\n case cls.DESCRIPTION_CLASS:\n fieldName = this.fields.description;\n break;\n case cls.EVENT_WINDOW_ALL_DAY_CLASS:\n fieldName = this.fields.isAllDay;\n break;\n case cls.EVENT_WINDOW_START_TZ_CLASS:\n fieldName = this.fields.startTimezone;\n break;\n case cls.EVENT_WINDOW_END_TZ_CLASS:\n fieldName = this.fields.endTimezone;\n break;\n case cls.TIME_ZONE_CLASS:\n fieldName = 'Timezone';\n break;\n case cls.EVENT_WINDOW_REPEAT_CLASS:\n fieldName = 'Repeat';\n break;\n }\n return fieldName;\n };\n EventWindow.prototype.getFieldLabel = function (fieldName) {\n var labelText = '';\n switch (fieldName) {\n case cls.SUBJECT_CLASS:\n labelText = this.parent.editorTitles.subject;\n break;\n case cls.LOCATION_CLASS:\n labelText = this.parent.editorTitles.location;\n break;\n case cls.DESCRIPTION_CLASS:\n labelText = this.parent.editorTitles.description;\n break;\n case cls.EVENT_WINDOW_START_CLASS:\n labelText = this.parent.editorTitles.startTime;\n break;\n case cls.EVENT_WINDOW_END_CLASS:\n labelText = this.parent.editorTitles.endTime;\n break;\n case cls.EVENT_WINDOW_START_TZ_CLASS:\n labelText = this.parent.editorTitles.startTimezone;\n break;\n case cls.EVENT_WINDOW_END_TZ_CLASS:\n labelText = this.parent.editorTitles.endTimezone;\n break;\n case cls.EVENT_WINDOW_REPEAT_CLASS:\n labelText = this.parent.editorTitles.recurrenceRule;\n break;\n case cls.EVENT_WINDOW_ALL_DAY_CLASS:\n labelText = this.parent.editorTitles.isAllDay;\n break;\n case cls.TIME_ZONE_CLASS:\n labelText = this.l10n.getConstant('timezone');\n break;\n }\n return labelText;\n };\n EventWindow.prototype.onChange = function (args) {\n var target = (args.event.target);\n if (target.classList.contains(cls.EVENT_WINDOW_ALL_DAY_CLASS)) {\n this.onAllDayChange(args.checked);\n }\n else if (target.classList.contains(cls.TIME_ZONE_CLASS)) {\n this.timezoneChangeStyle(args.checked);\n }\n else if (target.classList.contains(cls.EVENT_WINDOW_REPEAT_CLASS)) {\n this.onRepeatChange(args.checked);\n }\n };\n EventWindow.prototype.renderRepeatDialog = function () {\n var element = createElement('div');\n this.repeatDialogObject = new Dialog({\n header: this.l10n.getConstant('recurrence'),\n visible: false,\n content: '
',\n closeOnEscape: true,\n width: '90%',\n buttons: [{\n click: this.repeatSaveDialog.bind(this),\n buttonModel: { content: this.l10n.getConstant('save'), cssClass: 'e-save', isPrimary: true }\n },\n { click: this.repeatCancelDialog.bind(this), buttonModel: { cssClass: 'e-cancel', content: this.l10n.getConstant('cancel') } }],\n target: this.element,\n animationSettings: { effect: 'Zoom' },\n enableRtl: this.parent.enableRtl,\n isModal: true,\n cssClass: REPEAT_DIALOG_CLASS,\n open: this.repeatOpenDialog.bind(this)\n });\n this.element.appendChild(element);\n this.repeatDialogObject.appendTo(element);\n this.createRecurrenceEditor(this.repeatDialogObject.element.querySelector('.e-rec-editor'));\n };\n EventWindow.prototype.loadRecurrenceEditor = function () {\n this.repeatDialogObject.show();\n if (this.recurrenceEditor && this.repeatRule) {\n this.recurrenceEditor.setRecurrenceRule(this.repeatRule);\n }\n };\n EventWindow.prototype.onRepeatChange = function (state) {\n if (state) {\n if (!this.repeatDialogObject) {\n this.renderRepeatDialog();\n }\n this.recurrenceEditor.setProperties({ startDate: this.repeatStartDate, selectedType: 0 });\n this.loadRecurrenceEditor();\n }\n else {\n if (this.repeatDialogObject) {\n this.repeatDialogObject.hide();\n }\n this.repeatRule = '';\n if (this.recurrenceEditor) {\n this.recurrenceEditor.setRecurrenceRule(this.repeatRule);\n this.updateRepeatLabel(this.repeatRule);\n }\n var element = this.element.querySelector('.' + REPEAT_CONTAINER_CLASS);\n addClass([element], HIDE_STYLE_CLASS);\n }\n };\n EventWindow.prototype.repeatSaveDialog = function () {\n this.repeatRule = this.recurrenceEditor.getRecurrenceRule();\n var element = this.element.querySelector('.' + REPEAT_CONTAINER_CLASS);\n if (this.recurrenceEditor.getRecurrenceRule()) {\n removeClass([element], HIDE_STYLE_CLASS);\n }\n else {\n addClass([element], HIDE_STYLE_CLASS);\n this.repeatStatus.setProperties({ checked: false });\n }\n this.updateRepeatLabel(this.repeatRule);\n this.closeRepeatDialog();\n };\n EventWindow.prototype.closeRepeatDialog = function () {\n this.repeatDialogObject.hide();\n };\n EventWindow.prototype.repeatCancelDialog = function () {\n this.closeRepeatDialog();\n if (this.recurrenceEditor) {\n this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule);\n }\n if (!this.repeatTempRule) {\n this.repeatStatus.setProperties({ checked: false });\n }\n };\n EventWindow.prototype.repeatOpenDialog = function () {\n this.repeatTempRule = this.recurrenceEditor.getRecurrenceRule();\n };\n EventWindow.prototype.onCellDetailsUpdate = function (eventObj, repeatType) {\n if (!this.parent.eventSettings.allowAdding) {\n return;\n }\n this.element.querySelector('.' + cls.FORM_CLASS).removeAttribute('data-id');\n this.element.querySelector('.' + cls.EVENT_WINDOW_TITLE_TEXT_CLASS).innerHTML = this.l10n.getConstant('newEvent');\n eventObj.Timezone = false;\n this.repeatStartDate = eventObj[this.fields.startTime];\n this.repeatRule = '';\n if (!isNullOrUndefined(this.parent.eventSettings.fields.subject.default)) {\n eventObj[this.fields.subject] = this.parent.eventSettings.fields.subject.default;\n }\n if (!isNullOrUndefined(this.parent.eventSettings.fields.location.default)) {\n eventObj[this.fields.location] = this.parent.eventSettings.fields.location.default;\n }\n if (!isNullOrUndefined(this.parent.eventSettings.fields.description.default)) {\n eventObj[this.fields.description] = this.parent.eventSettings.fields.description.default;\n }\n this.showDetails(eventObj);\n if (eventObj[this.fields.recurrenceRule] && this.recurrenceEditor) {\n this.recurrenceEditor.setRecurrenceRule(eventObj[this.fields.recurrenceRule], eventObj[this.fields.startTime]);\n this.repeatRule = eventObj[this.fields.recurrenceRule];\n }\n var deleteButton = this.element.querySelector('.' + cls.DELETE_EVENT_CLASS);\n if (deleteButton) {\n addClass([deleteButton], cls.DISABLE_CLASS);\n }\n if (this.recurrenceEditor) {\n this.recurrenceEditor.setProperties({\n startDate: eventObj[this.fields.startTime],\n selectedType: !isNullOrUndefined(repeatType) ? repeatType : !isNullOrUndefined(eventObj[this.fields.recurrenceRule]) ?\n this.recurrenceEditor.selectedType : 0\n });\n }\n if (this.parent.isAdaptive && isNullOrUndefined(this.parent.editorTemplate)) {\n var element = this.element.querySelector('.' + REPEAT_CONTAINER_CLASS);\n addClass([element], HIDE_STYLE_CLASS);\n this.updateRepeatLabel(this.repeatRule);\n }\n else {\n var saveButton = this.element.querySelector('.' + cls.EVENT_WINDOW_SAVE_BUTTON_CLASS);\n this.disableButton(saveButton, false);\n }\n this.dialogObject.show();\n };\n EventWindow.prototype.convertToEventData = function (cellsData, eventObj) {\n if (cellsData.subject) {\n eventObj[this.fields.subject] = cellsData.subject;\n }\n eventObj[this.fields.startTime] = cellsData.startTime;\n eventObj[this.fields.endTime] = cellsData.endTime;\n eventObj[this.fields.isAllDay] = cellsData.isAllDay;\n if (cellsData.RecurrenceRule) {\n eventObj[this.fields.recurrenceRule] = cellsData.RecurrenceRule;\n }\n if (this.parent.resourceCollection.length > 0 || this.parent.activeViewOptions.group.resources.length > 0) {\n this.parent.resourceBase.setResourceValues(eventObj);\n }\n };\n EventWindow.prototype.applyFormValidation = function () {\n var getValidationRule = function (rules) {\n return (rules && Object.keys(rules).length > 0) ? rules : undefined;\n };\n var form = this.element.querySelector('.' + cls.FORM_CLASS);\n var rules = {};\n rules[this.parent.eventSettings.fields.subject.name] = getValidationRule(this.parent.eventSettings.fields.subject.validation);\n rules[this.parent.eventSettings.fields.location.name] = getValidationRule(this.parent.eventSettings.fields.location.validation);\n rules[this.parent.eventSettings.fields.startTime.name] = getValidationRule(this.parent.eventSettings.fields.startTime.validation);\n rules[this.parent.eventSettings.fields.endTime.name] = getValidationRule(this.parent.eventSettings.fields.endTime.validation);\n rules[this.parent.eventSettings.fields.description.name] =\n getValidationRule(this.parent.eventSettings.fields.description.validation);\n this.fieldValidator = new FieldValidator();\n this.fieldValidator.renderFormValidator(form, rules, this.element, this.parent.locale);\n };\n EventWindow.prototype.showDetails = function (eventData) {\n var eventObj = extend({}, eventData, null, true);\n if (eventObj[this.fields.endTime].getHours() === 0 && eventObj[this.fields.endTime].getMinutes() === 0) {\n this.trimAllDay(eventObj);\n }\n this.eventData = eventObj;\n var formElements = this.getFormElements(cls.EVENT_WINDOW_DIALOG_CLASS);\n var keyNames = Object.keys(eventObj);\n for (var _i = 0, formElements_2 = formElements; _i < formElements_2.length; _i++) {\n var curElement = formElements_2[_i];\n var columnName = curElement.name || this.getColumnName(curElement);\n if (!isNullOrUndefined(columnName) && columnName !== '') {\n if (keyNames.indexOf(columnName) !== -1) {\n this.setValueToElement(curElement, eventObj[columnName]);\n }\n else {\n this.setDefaultValueToElement(curElement);\n }\n }\n }\n if (isNullOrUndefined(this.parent.editorTemplate)) {\n this.onAllDayChange(eventObj[this.fields.isAllDay]);\n var timezoneObj = this.getInstance(cls.TIME_ZONE_CLASS + '.' + EVENT_FIELD);\n if (!(isNullOrUndefined(eventObj[this.fields.startTimezone]) && isNullOrUndefined(eventObj[this.fields.endTimezone]))) {\n timezoneObj.checked = true;\n timezoneObj.dataBind();\n }\n this.timezoneChangeStyle(timezoneObj.checked);\n delete eventObj.Timezone;\n }\n };\n EventWindow.prototype.getColumnName = function (element) {\n var attrName = element.getAttribute('data-name') || '';\n if (attrName === '') {\n var isDropDowns = false;\n var fieldSelector = '';\n if (element.classList.contains('e-dropdownlist')) {\n fieldSelector = 'e-ddl';\n isDropDowns = true;\n }\n else if (element.classList.contains('e-multiselect')) {\n fieldSelector = 'e-multiselect';\n isDropDowns = true;\n }\n else if (element.classList.contains('e-datetimepicker')) {\n fieldSelector = 'e-datetimepicker';\n }\n else if (element.classList.contains('e-datepicker')) {\n fieldSelector = 'e-datepicker';\n }\n else if (element.classList.contains('e-checkbox')) {\n fieldSelector = 'e-checkbox';\n }\n var classSelector = isDropDowns ? \".\" + fieldSelector + \":not(.e-control)\" : \".\" + fieldSelector;\n var control = closest(element, classSelector) || element.querySelector(\".\" + fieldSelector);\n if (control) {\n var attrEle = control.querySelector('[name]');\n if (attrEle) {\n attrName = attrEle.name;\n }\n }\n }\n return attrName;\n };\n EventWindow.prototype.onAllDayChange = function (allDayStatus) {\n var startObj = this.getInstance(cls.EVENT_WINDOW_START_CLASS);\n var endObj = this.getInstance(cls.EVENT_WINDOW_END_CLASS);\n var timezoneDiv = this.element.querySelector('.e-time-zone-container');\n var format;\n if (allDayStatus) {\n format = (isNullOrUndefined(this.parent.dateFormat)) ? this.getFormat('dateFormats') : this.parent.dateFormat;\n addClass(this.element.querySelectorAll('.e-time-icon'), cls.EVENT_WINDOW_ICON_DISABLE_CLASS);\n addClass([timezoneDiv], cls.DISABLE_CLASS);\n if (this.element.querySelector('.' + cls.EVENT_WINDOW_TIME_ZONE_DIV_CLASS)) {\n removeClass([this.element.querySelector('.' + cls.EVENT_WINDOW_TIME_ZONE_DIV_CLASS)], cls.ENABLE_CLASS);\n }\n startObj.format = endObj.format = format;\n }\n else {\n format = (isNullOrUndefined(this.parent.dateFormat)) ? this.getFormat('dateFormats') + ' ' +\n this.parent.activeViewOptions.timeFormat : this.parent.dateFormat + ' ' + this.parent.activeViewOptions.timeFormat;\n removeClass(this.element.querySelectorAll('.e-time-icon'), cls.EVENT_WINDOW_ICON_DISABLE_CLASS);\n removeClass([timezoneDiv], cls.DISABLE_CLASS);\n if (this.element.querySelector('.e-checkbox-wrapper .e-time-zone').checked) {\n addClass([this.element.querySelector('.' + cls.EVENT_WINDOW_TIME_ZONE_DIV_CLASS)], cls.ENABLE_CLASS);\n }\n startObj.format = endObj.format = format;\n }\n if (this.cellClickAction) {\n this.updateDateTime(allDayStatus, startObj, endObj);\n }\n startObj.dataBind();\n endObj.dataBind();\n if (!isNullOrUndefined(this.recurrenceEditor)) {\n this.recurrenceEditor.updateRuleUntilDate(startObj.value);\n }\n };\n EventWindow.prototype.updateDateTime = function (allDayStatus, startObj, endObj) {\n var startDate;\n var endDate;\n if (allDayStatus) {\n startDate = util.resetTime(new Date(this.eventWindowTime.startTime.getTime()));\n if (this.parent.activeCellsData.isAllDay) {\n var temp = util.addDays(new Date(this.eventWindowTime.endTime.getTime()), -1).getTime();\n endDate = (+this.eventWindowTime.startTime > temp) ? this.eventWindowTime.endTime : new Date(temp);\n }\n else {\n endDate = util.resetTime(new Date(this.eventWindowTime.endTime.getTime()));\n }\n }\n else {\n var start = this.parent.activeCellsData.startTime;\n startDate = new Date(this.eventWindowTime.startTime.getTime());\n startDate.setHours(start.getHours(), start.getMinutes(), start.getSeconds());\n if (this.parent.activeCellsData.isAllDay) {\n var startHour = this.parent.getStartEndTime(this.parent.workHours.start);\n startDate.setHours(startHour.getHours(), startHour.getMinutes(), startHour.getSeconds());\n endDate = new Date(startDate.getTime());\n endDate.setMilliseconds(util.MS_PER_MINUTE * this.getSlotDuration());\n }\n else {\n endDate = new Date(startDate.getTime());\n endDate.setMilliseconds(this.parent.activeCellsData.endTime.getTime() - this.parent.activeCellsData.startTime.getTime());\n }\n }\n this.eventWindowTime = { startTime: new Date(startDate.getTime()), endTime: new Date(endDate.getTime()) };\n startObj.value = startDate;\n endObj.value = endDate;\n startObj.dataBind();\n endObj.dataBind();\n };\n EventWindow.prototype.getFormat = function (formatType) {\n var format;\n if (this.parent.locale === 'en' || this.parent.locale === 'en-US') {\n format = getValue(formatType + '.short', getDefaultDateObject(this.parent.getCalendarMode()));\n }\n else {\n format = getValue(\"main.\" + this.parent.locale + \".dates.calendars.\" + this.parent.getCalendarMode() + \".\" + formatType + \".short\", cldrData);\n }\n return format;\n };\n EventWindow.prototype.onEventDetailsUpdate = function (eventObj) {\n if (!this.parent.eventSettings.allowEditing) {\n return;\n }\n if (!this.parent.isAdaptive) {\n removeClass([this.element.querySelector('.' + cls.DELETE_EVENT_CLASS)], cls.DISABLE_CLASS);\n }\n this.element.querySelector('.' + cls.EVENT_WINDOW_TITLE_TEXT_CLASS).innerHTML = this.l10n.getConstant('editEvent');\n this.element.querySelector('.' + cls.FORM_CLASS).setAttribute('data-id', eventObj[this.fields.id].toString());\n if (isNullOrUndefined(this.parent.editorTemplate)) {\n eventObj = extend({}, eventObj, null, true);\n var timezoneObj = this.getInstance(cls.TIME_ZONE_CLASS + '.' + EVENT_FIELD);\n var timezoneValue = void 0;\n if (eventObj[this.fields.startTimezone] || eventObj[this.fields.endTimezone]) {\n timezoneValue = true;\n this.parent.eventBase.timezoneConvert(eventObj);\n }\n else {\n timezoneValue = false;\n }\n eventObj.Timezone = timezoneValue;\n timezoneObj.checked = timezoneValue;\n timezoneObj.dataBind();\n }\n this.showDetails(eventObj);\n if (eventObj[this.fields.recurrenceRule] && this.recurrenceEditor) {\n this.recurrenceEditor.setRecurrenceRule(eventObj[this.fields.recurrenceRule], eventObj[this.fields.startTime]);\n }\n else if (!this.parent.isAdaptive && this.recurrenceEditor) {\n this.recurrenceEditor.setProperties({ startDate: eventObj[this.fields.startTime] });\n this.recurrenceEditor.setRecurrenceRule('');\n }\n this.repeatStartDate = eventObj[this.fields.startTime];\n this.repeatRule = '';\n if (eventObj[this.fields.recurrenceRule]) {\n if (this.recurrenceEditor) {\n this.recurrenceEditor.setRecurrenceRule(eventObj[this.fields.recurrenceRule], eventObj[this.fields.startTime]);\n }\n this.repeatRule = eventObj[this.fields.recurrenceRule];\n }\n if (this.parent.isAdaptive && isNullOrUndefined(this.parent.editorTemplate)) {\n var element = this.element.querySelector('.' + REPEAT_CONTAINER_CLASS);\n if (eventObj[this.fields.recurrenceRule]) {\n removeClass([element], HIDE_STYLE_CLASS);\n this.repeatStatus.setProperties({ checked: true });\n }\n else {\n addClass([element], HIDE_STYLE_CLASS);\n this.repeatStatus.setProperties({ checked: false });\n }\n this.updateRepeatLabel(this.repeatRule);\n }\n var isDisable = (this.parent.readonly || eventObj[this.fields.isReadonly]);\n if (!this.parent.isAdaptive) {\n var saveButton = this.element.querySelector('.' + cls.EVENT_WINDOW_SAVE_BUTTON_CLASS);\n var deleteButton = this.element.querySelector('.' + cls.DELETE_EVENT_CLASS);\n this.disableButton(saveButton, isDisable);\n this.disableButton(deleteButton, isDisable);\n }\n else {\n var saveIcon = this.element.querySelector('.' + cls.EVENT_WINDOW_SAVE_ICON_CLASS);\n if (saveIcon) {\n if (isDisable) {\n addClass([saveIcon], cls.ICON_DISABLE_CLASS);\n }\n else {\n removeClass([saveIcon], cls.ICON_DISABLE_CLASS);\n }\n }\n }\n this.dialogObject.show();\n };\n EventWindow.prototype.disableButton = function (element, value) {\n if (element) {\n element.ej2_instances[0].disabled = value;\n }\n };\n EventWindow.prototype.renderRecurrenceEditor = function () {\n return new RecurrenceEditor({\n calendarMode: this.parent.calendarMode,\n cssClass: this.parent.cssClass,\n dateFormat: this.parent.dateFormat,\n enableRtl: this.parent.enableRtl,\n firstDayOfWeek: this.parent.activeViewOptions.firstDayOfWeek,\n locale: this.parent.locale\n });\n };\n EventWindow.prototype.updateMinMaxDateToEditor = function () {\n var startDate = this.element.querySelector('.e-start');\n var endDate = this.element.querySelector('.e-end');\n if (startDate && endDate) {\n var startObj = startDate.ej2_instances[0];\n var endObj = endDate.ej2_instances[0];\n startObj.min = this.parent.minDate;\n startObj.max = this.parent.maxDate;\n endObj.min = this.parent.minDate;\n endObj.max = this.parent.maxDate;\n startObj.dataBind();\n endObj.dataBind();\n }\n if (this.recurrenceEditor) {\n var untilDate = this.recurrenceEditor.element.querySelector('.e-until-date');\n if (untilDate) {\n var untilObj = untilDate.ej2_instances[0];\n untilObj.min = this.parent.minDate;\n untilObj.max = this.parent.maxDate;\n untilObj.dataBind();\n }\n }\n };\n EventWindow.prototype.updateRepeatLabel = function (repeatRule) {\n if (this.parent.isAdaptive && !this.repeatDialogObject) {\n this.renderRepeatDialog();\n }\n var data = repeatRule ?\n (this.l10n.getConstant('repeats') + ' ' + this.recurrenceEditor.getRuleSummary(repeatRule)) : this.l10n.getConstant('repeat');\n this.repeatStatus.setProperties({ label: data });\n };\n EventWindow.prototype.dialogClose = function (event) {\n if (this.isEnterKey) {\n this.isEnterKey = false;\n return;\n }\n this.dialogEvent = event;\n this.isCrudAction = false;\n this.parent.activeEventData = { event: undefined, element: undefined };\n this.parent.currentAction = null;\n this.dialogObject.hide();\n };\n EventWindow.prototype.resetForm = function () {\n this.fieldValidator.destroyToolTip();\n this.resetFormFields();\n if (!this.parent.isAdaptive && this.recurrenceEditor && !this.recurrenceEditor.isDestroyed) {\n this.recurrenceEditor.resetFields();\n }\n };\n EventWindow.prototype.timezoneChangeStyle = function (value) {\n var timezoneDiv = this.element.querySelector('.' + cls.EVENT_WINDOW_TIME_ZONE_DIV_CLASS);\n var localTimezoneName = this.parent.tzModule.getLocalTimezoneName();\n if (value) {\n addClass([timezoneDiv], cls.ENABLE_CLASS);\n var startTimezoneObj = this.getInstance(cls.EVENT_WINDOW_START_TZ_CLASS);\n var endTimezoneObj = this.getInstance(cls.EVENT_WINDOW_END_TZ_CLASS);\n var timezone = startTimezoneObj.dataSource;\n if (!startTimezoneObj.value || !this.parent.timezone) {\n var found = timezone.some(function (tz) { return tz.Value === localTimezoneName; });\n if (!found) {\n timezone.push({ Value: localTimezoneName, Text: localTimezoneName });\n startTimezoneObj.dataSource = timezone;\n endTimezoneObj.dataSource = timezone;\n startTimezoneObj.dataBind();\n endTimezoneObj.dataBind();\n }\n }\n startTimezoneObj.value = startTimezoneObj.value || this.parent.timezone || localTimezoneName;\n endTimezoneObj.value = endTimezoneObj.value || this.parent.timezone || localTimezoneName;\n startTimezoneObj.dataBind();\n endTimezoneObj.dataBind();\n }\n else {\n removeClass([timezoneDiv], cls.ENABLE_CLASS);\n }\n };\n EventWindow.prototype.resetFormFields = function () {\n var formElement = this.getFormElements(cls.EVENT_WINDOW_DIALOG_CLASS);\n for (var _i = 0, formElement_1 = formElement; _i < formElement_1.length; _i++) {\n var currentElement = formElement_1[_i];\n var columnName = currentElement.name || this.getColumnName(currentElement);\n if (!isNullOrUndefined(columnName) && columnName !== '') {\n this.setDefaultValueToElement(currentElement);\n }\n }\n };\n EventWindow.prototype.eventSave = function (event, alert) {\n if (this.isEnterKey) {\n this.isEnterKey = false;\n return;\n }\n var formElement = this.element.querySelector('.' + cls.FORM_CLASS);\n if (formElement && formElement.classList.contains('e-formvalidator') &&\n !formElement.ej2_instances[0].validate()) {\n return;\n }\n var dataCollection = this.getEventDataFromEditor();\n if (this.processEventValidation(dataCollection.tempData, alert)) {\n return;\n }\n this.eventCrudData = dataCollection.eventData;\n this.dialogEvent = event;\n this.isCrudAction = true;\n this.dialogObject.hide();\n };\n EventWindow.prototype.getEventDataFromEditor = function () {\n var eventObj = extend({}, this.getObjectFromFormData(cls.EVENT_WINDOW_DIALOG_CLASS));\n if (!eventObj.Timezone) {\n eventObj[this.fields.startTimezone] = null;\n eventObj[this.fields.endTimezone] = null;\n }\n delete eventObj.Timezone;\n delete eventObj.Repeat;\n this.setDefaultValueToObject(eventObj);\n eventObj[this.fields.recurrenceRule] = this.recurrenceEditor ? this.recurrenceEditor.getRecurrenceRule() || null : undefined;\n var tempObj = extend({}, eventObj, null, true);\n if (eventObj[this.fields.isAllDay]) {\n eventObj[this.fields.startTime] = (isNullOrUndefined(eventObj[this.fields.startTime])) ? null\n : util.resetTime(new Date(eventObj[this.fields.startTime].getTime()));\n eventObj[this.fields.endTime] = (isNullOrUndefined(eventObj[this.fields.endTime])) ? null\n : util.addDays(util.resetTime(new Date(eventObj[this.fields.endTime].getTime())), 1);\n }\n return { eventData: eventObj, tempData: tempObj };\n };\n EventWindow.prototype.processEventValidation = function (eventObj, alert) {\n var alertType;\n if (isNullOrUndefined(this.parent.editorTemplate)) {\n if (!eventObj[this.fields.startTime] || !eventObj[this.fields.endTime]) {\n this.parent.quickPopup.openValidationError('invalidDateError');\n return true;\n }\n if (eventObj[this.fields.startTime] > eventObj[this.fields.endTime]) {\n this.parent.quickPopup.openValidationError('startEndError');\n return true;\n }\n }\n if (this.recurrenceEditor && this.recurrenceEditor.value && this.recurrenceEditor.value !== '') {\n alertType = this.recurrenceValidation(eventObj[this.fields.startTime], eventObj[this.fields.endTime], alert);\n var isShowAlert = true;\n if (alertType === 'seriesChangeAlert' && this.parent.uiStateValues.isIgnoreOccurrence) {\n isShowAlert = false;\n }\n if (!isNullOrUndefined(alertType) && isShowAlert\n && ((!this.parent.enableRecurrenceValidation && alertType === 'wrongPattern') || this.parent.enableRecurrenceValidation)) {\n this.parent.quickPopup.openRecurrenceValidationAlert(alertType);\n return true;\n }\n }\n return false;\n };\n EventWindow.prototype.processCrudActions = function (eventObj) {\n var _this = this;\n this.parent.uiStateValues.isBlock = false;\n var resourceData = this.getResourceData(eventObj);\n var isResourceEventExpand = (this.parent.activeViewOptions.group.resources.length > 0 ||\n this.parent.resourceCollection.length > 0) && !this.parent.activeViewOptions.group.allowGroupEdit\n && !isNullOrUndefined(resourceData);\n var eventId = this.getEventIdFromForm();\n if (!isNullOrUndefined(eventId)) {\n var eveId_1 = this.parent.eventBase.getEventIDType() === 'string' ? eventId : parseInt(eventId, 10);\n var editedData = this.parent.eventsData.filter(function (data) {\n return data[_this.fields.id] === eveId_1;\n })[0];\n if (isNullOrUndefined(editedData)) {\n editedData = this.parent.blockData.filter(function (data) {\n return data[_this.fields.id] === eveId_1;\n })[0];\n }\n eventObj = extend({}, editedData, eventObj);\n if (eventObj[this.fields.isReadonly]) {\n return false;\n }\n var currentAction = void 0;\n if (!isNullOrUndefined(editedData[this.fields.recurrenceRule])) {\n currentAction = this.parent.currentAction;\n eventObj.Guid = this.parent.activeEventData.event.Guid;\n if (this.parent.currentAction === 'EditOccurrence') {\n if (!eventObj[this.fields.recurrenceID]) {\n eventObj[this.fields.id] = this.parent.eventBase.getEventMaxID();\n eventObj.Guid = this.parent.activeEventData.event.Guid;\n }\n else {\n eveId_1 = eventObj[this.fields.recurrenceID];\n currentAction = null;\n }\n if (this.parent.enableRecurrenceValidation && this.editOccurrenceValidation(eveId_1, eventObj)) {\n return true;\n }\n }\n if (this.parent.currentAction === 'EditSeries' || eventObj[this.fields.id] !== editedData[this.fields.id]) {\n eventObj[this.fields.recurrenceID] = editedData[this.fields.id];\n }\n else if (this.parent.currentAction === 'EditFollowingEvents') {\n eventObj[this.fields.id] = this.parent.eventBase.getEventMaxID();\n eventObj[this.fields.followingID] = editedData[this.fields.id];\n }\n }\n if (isResourceEventExpand) {\n this.resourceSaveEvent(eventObj, 'Save', currentAction);\n }\n else {\n this.parent.saveEvent(eventObj, currentAction);\n }\n }\n else {\n this.parent.currentAction = 'Add';\n if (isResourceEventExpand) {\n this.resourceSaveEvent(eventObj, this.parent.currentAction);\n }\n else {\n eventObj[this.fields.id] = this.parent.eventBase.getEventMaxID();\n this.parent.addEvent(eventObj);\n }\n }\n return this.parent.uiStateValues.isBlock;\n };\n EventWindow.prototype.getResourceData = function (eventObj) {\n var resourceData = null;\n if (!isNullOrUndefined(this.parent.resourceBase) && !isNullOrUndefined(this.parent.resourceBase.resourceCollection)\n && this.parent.resourceBase.resourceCollection.length > 0) {\n var lastResourceData = this.parent.resourceBase.resourceCollection.slice(-1)[0];\n resourceData = eventObj[lastResourceData.field];\n }\n return resourceData;\n };\n EventWindow.prototype.getObjectFromFormData = function (className) {\n var formElement = this.getFormElements(className);\n var eventObj = {};\n for (var _i = 0, formElement_2 = formElement; _i < formElement_2.length; _i++) {\n var currentElement = formElement_2[_i];\n var columnName = currentElement.name || this.getColumnName(currentElement);\n if (!isNullOrUndefined(columnName) && columnName !== '') {\n eventObj[columnName] = this.getValueFromElement(currentElement);\n }\n }\n return eventObj;\n };\n EventWindow.prototype.setDefaultValueToObject = function (eventObj) {\n if (!isNullOrUndefined(eventObj[this.fields.subject])) {\n eventObj[this.fields.subject] = eventObj[this.fields.subject] || this.parent.eventSettings.fields.subject.default\n || this.l10n.getConstant('addTitle');\n }\n if (!isNullOrUndefined(eventObj[this.fields.location])) {\n eventObj[this.fields.location] = eventObj[this.fields.location] || this.parent.eventSettings.fields.location.default;\n }\n if (!isNullOrUndefined(eventObj[this.fields.description])) {\n eventObj[this.fields.description] = eventObj[this.fields.description] || this.parent.eventSettings.fields.description.default;\n }\n };\n EventWindow.prototype.recurrenceValidation = function (startDate, endDate, alert) {\n var alertMessage;\n var recEditor = this.recurrenceEditor;\n var interval = this.getInstance('e-repeat-interval.e-numerictextbox').value;\n if (alert !== this.l10n.getConstant('ok')) {\n var activeEvent = this.parent.activeEventData.event;\n var excludedEvents = [];\n if ((this.parent.currentAction === 'EditSeries' || this.parent.currentAction === 'EditFollowingEvents')\n && !isNullOrUndefined(activeEvent)) {\n var eventStartTime = activeEvent[this.parent.eventFields.startTime];\n var seriesEvents = this.parent.eventBase.getSeriesEvents(this.eventData, eventStartTime);\n if (seriesEvents.length > 0) {\n excludedEvents = this.parent.eventBase.getEditedOccurrences(seriesEvents, eventStartTime);\n }\n else {\n var event_2 = this.parent.eventBase.getEventById(activeEvent[this.parent.eventFields.id]);\n excludedEvents = this.parent.eventBase.getEditedOccurrences([event_2], eventStartTime);\n }\n if (this.parent.currentAction === 'EditSeries'\n && !isNullOrUndefined(this.eventData[this.parent.eventFields.recurrenceException])) {\n excludedEvents.push(this.eventData);\n }\n }\n if (excludedEvents.length > 0) {\n alertMessage = 'seriesChangeAlert';\n }\n if (this.getInstance('e-end-on-left .e-ddl .e-dropdownlist').value === 'until' &&\n this.getInstance('e-end-on-date .e-datepicker').value < startDate) {\n alertMessage = 'wrongPattern';\n }\n if (isNullOrUndefined(alertMessage)) {\n var types = recEditor.value.split(';')[1].split('=')[1].split(',');\n var obj = { 'SU': 0, 'MO': 1, 'TU': 2, 'WE': 3, 'TH': 4, 'FR': 5, 'SA': 6 };\n var temp = [];\n var tempDiff = [];\n var tempValue = void 0;\n switch (recEditor.value.split(';')[0].split('=')[1]) {\n case 'DAILY':\n if ((((endDate.getTime() - startDate.getTime()) / (1000 * 3600)) > (interval * 24))) {\n alertMessage = 'createError';\n }\n break;\n case 'WEEKLY':\n types = recEditor.value.split(';')[1].split('=')[1].split(',');\n for (var index = 0; index < types.length * (interval + 1); index++) {\n temp[index] = (types.length > index) ? obj[types[index]] : temp[index - types.length] + (7 * interval);\n }\n tempValue = temp.sort(function (a, b) { return a - b; });\n for (var index = 1; index < tempValue.length; index++) {\n tempDiff.push(tempValue[index] - tempValue[index - 1]);\n }\n if ((((endDate.getTime() - startDate.getTime()) / (1000 * 3600)) >= Math.min.apply(Math, tempDiff) * 24)\n || isNullOrUndefined(interval)) {\n alertMessage = 'createError';\n }\n break;\n case 'MONTHLY':\n if (endDate.getTime() >= new Date(+startDate).setMonth(startDate.getMonth() + interval)) {\n alertMessage = 'createError';\n }\n break;\n case 'YEARLY':\n if (endDate.getTime() >= new Date(+startDate).setFullYear(startDate.getFullYear() + interval)) {\n alertMessage = 'createError';\n }\n break;\n }\n }\n }\n else {\n if (endDate.getTime() >= new Date(+startDate).setMonth(startDate.getMonth() + interval)) {\n alertMessage = 'createError';\n }\n if (isNullOrUndefined(alertMessage)) {\n this.parent.quickPopup.quickDialog.hide();\n }\n }\n if (isNullOrUndefined(interval)) {\n alertMessage = 'createError';\n }\n return alertMessage;\n };\n EventWindow.prototype.getRecurrenceIndex = function (recColl, event) {\n var recIndex;\n for (var index = 0; index < recColl.length; index++) {\n if (event[this.fields.startTime].valueOf() === recColl[index][this.fields.startTime].valueOf()) {\n recIndex = index;\n break;\n }\n }\n return recIndex;\n };\n EventWindow.prototype.trimAllDay = function (data) {\n if (data[this.fields.isAllDay]) {\n var temp = util.addDays(new Date(+data[this.fields.endTime]), -1).getTime();\n data[this.fields.endTime] = (+data[this.fields.startTime] > temp) ? data[this.fields.endTime] : new Date(temp);\n }\n };\n EventWindow.prototype.editOccurrenceValidation = function (eventId, currentData, editData) {\n var _this = this;\n if (editData === void 0) {\n editData = this.eventData;\n }\n var recurColl = this.parent.getOccurrencesByID(eventId);\n var excludedDatas = this.parent.eventsData.filter(function (data) {\n return data[_this.fields.recurrenceID] === eventId;\n });\n excludedDatas.map(function (data) { return recurColl.push(extend({}, data)); });\n currentData = extend({}, currentData);\n this.trimAllDay(currentData);\n for (var _i = 0, recurColl_1 = recurColl; _i < recurColl_1.length; _i++) {\n var data = recurColl_1[_i];\n this.trimAllDay(data);\n }\n this.parent.eventBase.sortByTime(recurColl);\n var index = this.getRecurrenceIndex(recurColl, editData);\n if (isNullOrUndefined(index)) {\n return false;\n }\n if (index === 0) {\n if (!isNullOrUndefined(recurColl[index + 1])) {\n if (!(util.resetTime(new Date(+recurColl[index + 1][this.fields.startTime])).getTime() >\n util.resetTime(new Date(+currentData[this.fields.endTime])).getTime()) &&\n (util.resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() >=\n util.resetTime(new Date(+currentData[this.fields.startTime])).getTime())) {\n this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');\n return true;\n }\n else if (util.resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() <\n util.resetTime(new Date(+currentData[this.fields.startTime])).getTime()) {\n this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');\n return true;\n }\n }\n return false;\n }\n else {\n if (index === recurColl.length - 1) {\n if (!(util.resetTime(new Date(+recurColl[index - 1][this.fields.endTime])).getTime() <\n util.resetTime(new Date(+currentData[this.fields.startTime])).getTime()) &&\n (util.resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.startTime])).getTime() <=\n util.resetTime(new Date(+currentData[this.fields.endTime])).getTime())) {\n this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');\n return true;\n }\n else if (util.resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.endTime])).getTime() >\n util.resetTime(new Date(+currentData[this.fields.startTime])).getTime()) {\n this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');\n return true;\n }\n }\n else if (!(((util.resetTime(new Date(+recurColl[index - 1][this.fields.endTime])).getTime() <\n util.resetTime(new Date(+currentData[this.fields.startTime])).getTime()) ||\n (util.resetTime(new Date(+recurColl[0][this.fields.startTime])).getTime() >\n util.resetTime(new Date(+currentData[this.fields.startTime])).getTime())) &&\n ((util.resetTime(new Date(+recurColl[index + 1][this.fields.startTime])).getTime() >\n util.resetTime(new Date(+currentData[this.fields.endTime])).getTime()) ||\n (util.resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() <\n util.resetTime(new Date(+currentData[this.fields.startTime])).getTime())))) {\n this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');\n return true;\n }\n else if ((util.resetTime(new Date(+recurColl[index + 1][this.fields.endTime])).getTime() <\n util.resetTime(new Date(+currentData[this.fields.startTime])).getTime()) ||\n (util.resetTime(new Date(+recurColl[index - 1][this.fields.startTime])).getTime() >\n util.resetTime(new Date(+currentData[this.fields.endTime])).getTime())) {\n this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');\n return true;\n }\n }\n return false;\n };\n EventWindow.prototype.resourceSaveEvent = function (eventObj, action, currentAction) {\n var _this = this;\n var lastResourceData = this.parent.resourceBase.resourceCollection.slice(-1)[0];\n var resourceData = eventObj[lastResourceData.field];\n resourceData = (resourceData instanceof Array) ? resourceData : [resourceData];\n var lastLevel = this.parent.resourceBase.lastResourceLevel;\n var eventList = [];\n var _loop_2 = function (i) {\n var events = extend({}, eventObj, null, true);\n events[this_2.fields.id] = this_2.parent.eventBase.getEventMaxID();\n var temp = [];\n var addValues = function () {\n if (action === 'Save' && i === resourceData.length - 1) {\n if (temp.length > 0) {\n temp[0][_this.fields.id] = eventObj[_this.fields.id];\n for (var k = 1; k < temp.length; k++) {\n temp[k][_this.fields.id] = _this.parent.eventBase.getEventMaxID(i);\n eventList.push(temp[k]);\n _this.parent.saveEvent(temp[0], currentAction);\n }\n }\n else {\n events[_this.fields.id] = eventObj[_this.fields.id];\n _this.parent.saveEvent(events, currentAction);\n }\n }\n else {\n if (temp.length > 0) {\n for (var j = 0; j < temp.length; j++) {\n temp[j][_this.fields.id] = _this.parent.eventBase.getEventMaxID(j);\n eventList.push(temp[j]);\n }\n }\n else {\n events[_this.fields.id] = _this.parent.eventBase.getEventMaxID(i);\n eventList.push(events);\n }\n }\n };\n if (this_2.parent.activeViewOptions.group.byGroupID && (!isNullOrUndefined(lastLevel))) {\n var lastResource = lastResourceData.dataSource;\n var resCol = this_2.parent.resourceCollection;\n var index = void 0;\n if (resCol.length > 1) {\n index = util.findIndexInData(lastResource, lastResourceData.idField, resourceData[i], events, resCol);\n }\n else {\n index = util.findIndexInData(lastResource, lastResourceData.idField, resourceData[i]);\n }\n if (index < 0) {\n return { value: void 0 };\n }\n var groupId_1 = lastResource[index][lastResourceData.groupIDField];\n var filter = lastLevel.filter(function (obj) { return obj.resourceData[lastResourceData.idField] === resourceData[i]; }).\n filter(function (obj) { return obj.resourceData[lastResourceData.groupIDField] === groupId_1; })[0];\n var groupOrder = filter.groupOrder;\n for (var index_1 = 0; index_1 < this_2.parent.resourceBase.resourceCollection.length; index_1++) {\n var field = this_2.parent.resourceBase.resourceCollection[index_1].field;\n events[field] = (groupOrder[index_1] instanceof Array) ? groupOrder[index_1][0] : groupOrder[index_1];\n }\n addValues();\n }\n else {\n for (var index = 0; index < this_2.parent.resourceBase.resourceCollection.length - 1; index++) {\n var field = this_2.parent.resourceBase.resourceCollection[index].field;\n if (events[field] instanceof Array && events[field].length > 1) {\n for (var k = 0; k < events[field].length; k++) {\n var event_3 = extend({}, events, null, true);\n event_3[field] = eventObj[field][k];\n event_3[lastResourceData.field] = resourceData[i];\n temp.push(event_3);\n }\n }\n else {\n if (temp.length === 0) {\n events[field] = (eventObj[field] instanceof Array) ?\n eventObj[field][0] : eventObj[field];\n events[lastResourceData.field] = resourceData[i];\n }\n else {\n for (var l = 0; l < temp.length; l++) {\n temp[l][field] = (eventObj[field] instanceof Array) ?\n eventObj[field][0] : eventObj[field];\n }\n }\n }\n }\n events[lastResourceData.field] = resourceData[i];\n addValues();\n }\n };\n var this_2 = this;\n for (var i = 0; i < resourceData.length; i++) {\n var state_1 = _loop_2(i);\n if (typeof state_1 === \"object\")\n return state_1.value;\n }\n if (eventList.length > 0) {\n for (var _i = 0, eventList_1 = eventList; _i < eventList_1.length; _i++) {\n var event_4 = eventList_1[_i];\n event_4[this.fields.recurrenceException] = null;\n event_4[this.fields.recurrenceID] = null;\n }\n this.parent.addEvent(eventList);\n }\n };\n EventWindow.prototype.getEventIdFromForm = function () {\n return this.element.querySelector('.' + cls.FORM_CLASS).getAttribute('data-id');\n };\n EventWindow.prototype.getFormElements = function (className) {\n var elements = [];\n if (className === cls.EVENT_WINDOW_DIALOG_CLASS) {\n elements = [].slice.call(this.element.querySelectorAll('.' + EVENT_FIELD));\n }\n else {\n elements = [].slice.call(this.parent.element.querySelectorAll('.' + className + ' .' + EVENT_FIELD));\n }\n return elements;\n };\n EventWindow.prototype.getValueFromElement = function (element) {\n var value;\n if (element.classList.contains('e-datepicker')) {\n value = element.ej2_instances[0].value;\n }\n else if (element.classList.contains('e-datetimepicker')) {\n value = element.ej2_instances[0].value;\n }\n else if (element.classList.contains('e-dropdownlist')) {\n value = element.ej2_instances[0].value;\n }\n else if (element.classList.contains('e-multiselect')) {\n value = element.ej2_instances[0].value;\n }\n else if (element.classList.contains('e-checkbox')) {\n value = element.ej2_instances[0].checked;\n }\n else {\n if (element.type === 'checkbox') {\n value = element.checked;\n }\n else {\n value = SanitizeHtmlHelper.sanitize(element.value);\n }\n }\n return value;\n };\n EventWindow.prototype.setValueToElement = function (element, value) {\n if (element.classList.contains('e-datepicker')) {\n var instance = element.ej2_instances[0];\n instance.value = value;\n instance.dataBind();\n }\n else if (element.classList.contains('e-datetimepicker')) {\n var instance = element.ej2_instances[0];\n if (instance.element.classList.contains(cls.EVENT_WINDOW_START_CLASS)) {\n this.eventWindowTime.startTime = new Date('' + value);\n }\n else {\n this.eventWindowTime.endTime = new Date('' + value);\n }\n instance.value = value;\n instance.dataBind();\n }\n else if (element.classList.contains('e-dropdownlist')) {\n var instance = element.ej2_instances[0];\n instance.value = value;\n instance.dataBind();\n }\n else if (element.classList.contains('e-multiselect')) {\n var instance = element.ej2_instances[0];\n instance.value = [];\n instance.value = ((value instanceof Array) ? value : [value]);\n instance.dataBind();\n }\n else if (element.classList.contains('e-checkbox')) {\n var instance = element.ej2_instances[0];\n instance.checked = value;\n instance.dataBind();\n }\n else {\n if (element.type !== 'checkbox') {\n element.value = value || '';\n }\n else {\n element.checked = value;\n }\n }\n };\n EventWindow.prototype.setDefaultValueToElement = function (element) {\n if (element.classList.contains('e-datepicker')) {\n var instance = element.ej2_instances[0];\n instance.value = this.parent.getCurrentTime();\n instance.dataBind();\n }\n else if (element.classList.contains('e-datetimepicker')) {\n var instance = element.ej2_instances[0];\n var dateValue = this.parent.getCurrentTime();\n this.eventWindowTime = { startTime: dateValue, endTime: dateValue };\n instance.value = dateValue;\n instance.dataBind();\n }\n else if (element.classList.contains('e-dropdownlist')) {\n var instance = element.ej2_instances[0];\n instance.value = null;\n instance.dataBind();\n }\n else if (element.classList.contains('e-multiselect')) {\n var instance = element.ej2_instances[0];\n instance.value = [];\n instance.dataBind();\n }\n else if (element.classList.contains('e-checkbox')) {\n var instance = element.ej2_instances[0];\n instance.checked = false;\n instance.dataBind();\n }\n else {\n if (element.type === 'checkbox') {\n element.checked = false;\n }\n else {\n element.value = '';\n }\n }\n };\n EventWindow.prototype.getInstance = function (className) {\n var element = this.element.querySelector('.' + className);\n return element ? element.ej2_instances[0] : null;\n };\n EventWindow.prototype.eventDelete = function (event) {\n if (this.isEnterKey) {\n this.isEnterKey = false;\n return;\n }\n switch (this.parent.currentAction) {\n case 'EditOccurrence':\n if (!isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])) {\n this.parent.currentAction = 'DeleteOccurrence';\n }\n else {\n this.parent.currentAction = 'Delete';\n }\n break;\n case 'EditSeries':\n this.parent.currentAction = 'DeleteSeries';\n break;\n case 'Save':\n this.parent.currentAction = 'Delete';\n break;\n case 'EditFollowingEvents':\n if (!isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])) {\n this.parent.currentAction = 'DeleteFollowingEvents';\n }\n break;\n }\n this.dialogEvent = event;\n this.isCrudAction = false;\n this.dialogObject.hide();\n this.parent.quickPopup.openDeleteAlert();\n };\n EventWindow.prototype.getRecurrenceEditorInstance = function () {\n if (this.parent.isAdaptive && !this.repeatDialogObject) {\n this.renderRepeatDialog();\n }\n return this.recurrenceEditor;\n };\n EventWindow.prototype.destroyComponents = function () {\n var formElements = this.getFormElements(cls.EVENT_WINDOW_DIALOG_CLASS);\n for (var _i = 0, formElements_3 = formElements; _i < formElements_3.length; _i++) {\n var element = formElements_3[_i];\n var instance = void 0;\n if (element.classList.contains('e-datetimepicker')) {\n instance = element.ej2_instances;\n }\n else if (element.classList.contains('e-datepicker')) {\n instance = element.ej2_instances;\n }\n else if (element.classList.contains('e-checkbox')) {\n instance = element.ej2_instances;\n }\n else if (element.classList.contains('e-dropdownlist')) {\n instance = element.ej2_instances;\n }\n else if (element.classList.contains('e-multiselect')) {\n instance = element.ej2_instances;\n }\n if (instance && instance[0]) {\n instance[0].destroy();\n }\n }\n if (this.buttonObj) {\n this.buttonObj.destroy();\n }\n };\n EventWindow.prototype.destroy = function (isIgnore) {\n if (this.parent && !this.parent.isDestroyed) {\n this.parent.resetTemplates(['editorTemplate']);\n }\n this.destroyComponents();\n if (this.recurrenceEditor) {\n this.recurrenceEditor.destroy();\n this.recurrenceEditor = null;\n }\n if (this.fieldValidator) {\n this.fieldValidator.destroy();\n this.fieldValidator = null;\n }\n if (this.repeatDialogObject) {\n this.repeatDialogObject.destroy();\n this.repeatDialogObject = null;\n }\n if (this.dialogObject) {\n if (this.dialogObject.element) {\n EventHandler.remove(this.dialogObject.element, 'keydown', this.preventEventSave);\n }\n this.dialogObject.destroy();\n this.dialogObject = null;\n }\n if (this.element) {\n remove(this.element);\n this.element = null;\n }\n if (!isIgnore) {\n this.l10n = null;\n this.parent = null;\n this.fields = null;\n this.buttonObj = null;\n this.repeatStatus = null;\n this.eventWindowTime = null;\n }\n };\n return EventWindow;\n}());\nexport { EventWindow };\n","import { append, addClass, remove, isNullOrUndefined, setStyleAttribute, createElement } from '@syncfusion/ej2-base';\nimport * as events from '../base/constant';\nimport * as cls from '../base/css-constant';\nimport * as util from '../base/util';\n/**\n * Virtual Scroll\n */\nvar VirtualScroll = /** @class */ (function () {\n function VirtualScroll(parent) {\n this.translateY = 0;\n this.itemSize = 60;\n this.bufferCount = 3;\n this.renderedLength = 0;\n this.averageRowHeight = 0;\n this.isScrollHeightNull = true;\n this.parent = parent;\n this.addEventListener();\n }\n VirtualScroll.prototype.addEventListener = function () {\n if (!this.parent || this.parent && this.parent.isDestroyed) {\n return;\n }\n this.parent.on(events.virtualScroll, this.virtualScrolling, this);\n };\n VirtualScroll.prototype.removeEventListener = function () {\n if (!this.parent || this.parent && this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.virtualScroll, this.virtualScrolling);\n };\n VirtualScroll.prototype.getRenderedCount = function () {\n this.setItemSize();\n return Math.ceil(this.parent.element.clientHeight / this.itemSize) + this.bufferCount;\n };\n VirtualScroll.prototype.setTranslateValue = function () {\n var resWrap = this.parent.element.querySelector('.' + cls.RESOURCE_COLUMN_WRAP_CLASS);\n var conWrap = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);\n var eventWrap = this.parent.element.querySelector('.' + cls.EVENT_TABLE_CLASS);\n var timeIndicator = this.parent.element.querySelector('.' + cls.CURRENT_TIMELINE_CLASS);\n this.renderVirtualTrackHeight(conWrap, resWrap);\n this.setTranslate(resWrap, conWrap, eventWrap, timeIndicator);\n };\n VirtualScroll.prototype.renderVirtualTrackHeight = function (contentWrap, resourceWrap) {\n this.parent.resourceBase.setExpandedResources();\n if (this.isScrollHeightNull) {\n var wrap = createElement('div', { className: cls.VIRTUAL_TRACK_CLASS });\n var resWrap = [].slice.call((resourceWrap).querySelectorAll('table td'));\n var startIndex_1 = parseInt(resWrap[0].getAttribute('data-group-index'), 10);\n var endIndex_1 = parseInt(resWrap[resWrap.length - 1].getAttribute('data-group-index'), 10);\n this.parent.resourceBase.renderedResources = this.parent.resourceBase.expandedResources.filter(function (resource) {\n return (resource.groupIndex >= startIndex_1 && resource.groupIndex <= endIndex_1);\n });\n this.setItemSize();\n wrap.style.height = (this.parent.resourceBase.expandedResources.length * this.itemSize) + 'px';\n this.isScrollHeightNull = false;\n var virtual = this.parent.element.querySelector('.' + cls.VIRTUAL_TRACK_CLASS);\n if (!isNullOrUndefined(virtual)) {\n remove(virtual);\n }\n contentWrap.appendChild(wrap);\n }\n };\n VirtualScroll.prototype.renderVirtualTrack = function (contentWrap) {\n var wrap = createElement('div', { className: cls.VIRTUAL_TRACK_CLASS });\n wrap.style.height = (this.parent.resourceBase.expandedResources.length * this.itemSize) + 'px';\n contentWrap.appendChild(wrap);\n };\n VirtualScroll.prototype.updateVirtualScrollHeight = function () {\n var virtual = this.parent.element.querySelector('.' + cls.VIRTUAL_TRACK_CLASS);\n var lastResourceIndex = this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].groupIndex;\n var lastRenderIndex = this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length - 1].groupIndex;\n if (lastRenderIndex !== lastResourceIndex) {\n var conTable = this.parent.element.querySelector('.' + cls.CONTENT_TABLE_CLASS);\n this.renderedLength = conTable.querySelector('tbody').children.length;\n virtual.style.height = (conTable.offsetHeight + (this.parent.resourceBase.expandedResources.length - (this.renderedLength)) *\n conTable.offsetHeight / this.renderedLength) + 'px';\n }\n else {\n virtual.style.height = '';\n }\n this.averageRowHeight = virtual.offsetHeight / this.parent.resourceBase.expandedResources.length;\n };\n VirtualScroll.prototype.updateVirtualTrackHeight = function (wrap) {\n var resourceCount = this.parent.resourceBase.renderedResources.length;\n if (resourceCount !== this.getRenderedCount()) {\n wrap.style.height = this.parent.element.querySelector('.e-content-wrap').clientHeight + 'px';\n var resWrap = this.parent.element.querySelector('.' + cls.RESOURCE_COLUMN_WRAP_CLASS);\n var conWrap = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);\n var eventWrap = this.parent.element.querySelector('.' + cls.EVENT_TABLE_CLASS);\n this.translateY = 0;\n this.setTranslate(resWrap, conWrap, eventWrap);\n }\n else {\n var lastRenderIndex = this.parent.resourceBase.renderedResources[resourceCount - 1].groupIndex;\n var lastCollIndex = this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].groupIndex;\n var renderedResCount = resourceCount + (lastCollIndex - lastRenderIndex);\n renderedResCount = (renderedResCount > this.parent.resourceBase.expandedResources.length) ?\n this.parent.resourceBase.expandedResources.length : renderedResCount;\n wrap.style.height = (renderedResCount * this.itemSize) + 'px';\n }\n };\n VirtualScroll.prototype.setItemSize = function () {\n this.itemSize = util.getElementHeightFromClass(this.parent.activeView.element, cls.WORK_CELLS_CLASS) || this.itemSize;\n };\n VirtualScroll.prototype.renderEvents = function () {\n this.setTabIndex();\n this.parent.refreshEvents(false);\n this.parent.notify(events.contentReady, {});\n this.parent.hideSpinner();\n };\n VirtualScroll.prototype.virtualScrolling = function () {\n var _this = this;\n if (this.parent.quickPopup) {\n this.parent.quickPopup.quickPopupHide();\n this.parent.quickPopup.morePopup.hide();\n }\n var resWrap = this.parent.element.querySelector('.' + cls.RESOURCE_COLUMN_WRAP_CLASS);\n var conWrap = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);\n var eventWrap = this.parent.element.querySelector('.' + cls.EVENT_TABLE_CLASS);\n var timeIndicator = this.parent.element.querySelector('.' + cls.CURRENT_TIMELINE_CLASS);\n var conTable = this.parent.element.querySelector('.' + cls.CONTENT_TABLE_CLASS);\n this.renderedLength = resWrap.querySelector('tbody').children.length;\n var firstTDIndex = parseInt(resWrap.querySelector('tbody td').getAttribute('data-group-index'), 10);\n var scrollHeight = this.parent.rowAutoHeight ?\n (conTable.offsetHeight - conWrap.offsetHeight) : this.bufferCount * this.itemSize;\n addClass([conWrap], 'e-transition');\n var resCollection = [];\n if ((conWrap.scrollTop) - this.translateY < 0) {\n resCollection = this.upScroll(conWrap, firstTDIndex);\n }\n else if (conWrap.scrollTop - this.translateY > scrollHeight) {\n resCollection = this.downScroll(conWrap, firstTDIndex);\n }\n if (!isNullOrUndefined(resCollection) && resCollection.length > 0) {\n this.parent.showSpinner();\n var selectedEle = this.parent.getSelectedElements();\n this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;\n this.updateContent(resWrap, conWrap, eventWrap, resCollection);\n this.setTranslate(resWrap, conWrap, eventWrap, timeIndicator);\n if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj.action === 'drag') {\n this.parent.dragAndDropModule.navigationWrapper();\n }\n window.clearTimeout(this.timeValue);\n this.timeValue = window.setTimeout(function () { _this.renderEvents(); }, 250);\n }\n };\n VirtualScroll.prototype.upScroll = function (conWrap, firstTDIndex) {\n var index = 0;\n index = (~~(conWrap.scrollTop / this.itemSize) + Math.ceil(conWrap.clientHeight / this.itemSize)) - this.renderedLength;\n if (this.parent.rowAutoHeight) {\n index = (index > firstTDIndex) ? firstTDIndex - this.bufferCount : index;\n }\n index = (index > 0) ? index : 0;\n var prevSetCollection = this.getBufferCollection(index, index + this.renderedLength);\n this.parent.resourceBase.renderedResources = prevSetCollection;\n if (firstTDIndex === 0) {\n this.translateY = conWrap.scrollTop;\n }\n else {\n var height = (this.parent.rowAutoHeight) ? this.averageRowHeight : this.itemSize;\n height = (height > 0) ? height : this.itemSize;\n this.translateY = (conWrap.scrollTop - (this.bufferCount * height) > 0) ?\n conWrap.scrollTop - (this.bufferCount * height) : 0;\n }\n return prevSetCollection;\n };\n VirtualScroll.prototype.downScroll = function (conWrap, firstTDIndex) {\n var lastResource = this.parent.resourceBase.\n renderedResources[this.parent.resourceBase.renderedResources.length - 1].groupIndex;\n var lastResourceIndex = this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].groupIndex;\n if (lastResource === lastResourceIndex) {\n return null;\n }\n var nextSetResIndex = 0;\n nextSetResIndex = ~~(conWrap.scrollTop / this.itemSize);\n if (this.parent.rowAutoHeight) {\n nextSetResIndex = ~~((conWrap.scrollTop - this.translateY) / this.averageRowHeight) + firstTDIndex;\n nextSetResIndex = (nextSetResIndex > firstTDIndex + this.bufferCount) ? nextSetResIndex : firstTDIndex + this.bufferCount;\n }\n var lastIndex = nextSetResIndex + this.renderedLength;\n lastIndex = (lastIndex > this.parent.resourceBase.expandedResources.length) ?\n nextSetResIndex + (this.parent.resourceBase.expandedResources.length - nextSetResIndex) : lastIndex;\n var nextSetCollection = this.getBufferCollection(lastIndex - this.renderedLength, lastIndex);\n this.translateY = conWrap.scrollTop;\n return nextSetCollection;\n };\n VirtualScroll.prototype.updateContent = function (resWrap, conWrap, eventWrap, resCollection) {\n var renderedLength = resWrap.querySelector('tbody').children.length;\n if (document.activeElement && document.activeElement.classList.contains(cls.RESOURCE_CELLS_CLASS)) {\n this.isResourceCell = true;\n this.parent.element.focus();\n }\n for (var i = 0; i < renderedLength; i++) {\n remove(resWrap.querySelector('tbody tr'));\n remove(conWrap.querySelector('tbody tr'));\n remove(eventWrap.querySelector('div'));\n }\n this.parent.resourceBase.renderedResources = resCollection;\n var resourceRows = this.parent.resourceBase.getContentRows(resCollection, true);\n var contentRows = this.parent.activeView.getContentRows();\n var eventRows = this.parent.activeView.getEventRows(resCollection.length);\n append(resourceRows, resWrap.querySelector('tbody'));\n append(contentRows, conWrap.querySelector('tbody'));\n append(eventRows, eventWrap);\n };\n VirtualScroll.prototype.getBufferCollection = function (startIndex, endIndex) {\n return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);\n };\n VirtualScroll.prototype.setTranslate = function (resWrap, conWrap, eventWrap, timeIndicator) {\n setStyleAttribute(resWrap.querySelector('table'), { transform: \"translateY(\" + this.translateY + \"px)\" });\n setStyleAttribute(conWrap.querySelector('table'), { transform: \"translateY(\" + this.translateY + \"px)\" });\n setStyleAttribute(eventWrap, { transform: \"translateY(\" + this.translateY + \"px)\" });\n if (!isNullOrUndefined(timeIndicator)) {\n setStyleAttribute(timeIndicator, { transform: \"translateY(\" + this.translateY + \"px)\" });\n }\n };\n VirtualScroll.prototype.updateFocusedWorkCell = function () {\n if (this.focusedEle) {\n var date = parseInt(this.focusedEle.getAttribute('data-date'), 10);\n var groupIndex = parseInt(this.focusedEle.getAttribute('data-group-index'), 10);\n var ele = this.parent.element.querySelector(\".\" + cls.WORK_CELLS_CLASS + \"[data-date=\\\"\" + date + \"\\\"][data-group-index=\\\"\" + groupIndex + \"\\\"]\");\n if (ele) {\n this.parent.addSelectedClass([ele], ele, true);\n }\n this.focusedEle = null;\n }\n };\n VirtualScroll.prototype.setTabIndex = function () {\n var resColWrap = this.parent.element.querySelector('.' + cls.RESOURCE_COLUMN_WRAP_CLASS);\n var resCells = [].slice.call(this.parent.element.querySelectorAll('.' + cls.RESOURCE_CELLS_CLASS));\n if (resCells && resColWrap) {\n resCells.forEach(function (element) {\n if (element.getBoundingClientRect().top >= resColWrap.getBoundingClientRect().top) {\n element.setAttribute('tabindex', '0');\n }\n });\n }\n var focusResCell = this.parent.element.querySelector(\".\" + cls.RESOURCE_CELLS_CLASS + \"[tabindex=\\\"\" + 0 + \"\\\"]\");\n if (this.isResourceCell && focusResCell) {\n focusResCell.focus();\n this.isResourceCell = false;\n }\n };\n VirtualScroll.prototype.destroy = function () {\n this.removeEventListener();\n };\n return VirtualScroll;\n}());\nexport { VirtualScroll };\n","import { isNullOrUndefined, addClass, removeClass } from '@syncfusion/ej2-base';\nimport { VirtualScroll } from '../actions/virtual-scroll';\nimport { EventTooltip } from '../popups/event-tooltip';\nimport * as cls from '../base/css-constant';\n/**\n * Schedule DOM rendering\n */\nvar Render = /** @class */ (function () {\n function Render(parent) {\n this.parent = parent;\n }\n Render.prototype.render = function (viewName, isDataRefresh) {\n if (isDataRefresh === void 0) { isDataRefresh = true; }\n this.initializeLayout(viewName);\n if (this.parent.activeView && isDataRefresh) {\n this.parent.crudModule.refreshDataManager();\n }\n };\n Render.prototype.initializeLayout = function (viewName) {\n if (this.parent.activeView) {\n this.parent.resetTemplates();\n this.parent.activeView.removeEventListener();\n this.parent.activeView.destroy();\n }\n switch (viewName) {\n case 'Day':\n this.parent.activeView = this.parent.dayModule;\n break;\n case 'Week':\n this.parent.activeView = this.parent.weekModule;\n break;\n case 'WorkWeek':\n this.parent.activeView = this.parent.workWeekModule;\n break;\n case 'Month':\n this.parent.activeView = this.parent.monthModule;\n break;\n case 'Year':\n this.parent.activeView = this.parent.yearModule;\n break;\n case 'Agenda':\n this.parent.activeView = this.parent.agendaModule;\n break;\n case 'MonthAgenda':\n this.parent.activeView = this.parent.monthAgendaModule;\n break;\n case 'TimelineDay':\n this.parent.activeView = this.parent.timelineViewsModule;\n this.parent.activeView.viewClass = 'e-timeline-day-view';\n break;\n case 'TimelineWorkWeek':\n this.parent.activeView = this.parent.timelineViewsModule;\n this.parent.activeView.viewClass = 'e-timeline-work-week-view';\n break;\n case 'TimelineWeek':\n this.parent.activeView = this.parent.timelineViewsModule;\n this.parent.activeView.viewClass = 'e-timeline-week-view';\n break;\n case 'TimelineMonth':\n this.parent.activeView = this.parent.timelineMonthModule;\n break;\n case 'TimelineYear':\n this.parent.activeView = this.parent.timelineYearModule;\n break;\n }\n if (isNullOrUndefined(this.parent.activeView)) {\n var firstView = this.parent.viewCollections[0].option;\n if (firstView) {\n this.parent.setProperties({ currentView: firstView }, true);\n if (this.parent.headerModule) {\n this.parent.headerModule.updateActiveView();\n this.parent.headerModule.setCalendarView();\n }\n return this.initializeLayout(firstView);\n }\n throw Error('Inject required modules');\n }\n this.parent.activeView.viewIndex = this.parent.viewIndex;\n this.updateLabelText(viewName);\n this.parent.activeView.addEventListener();\n this.parent.activeView.getRenderDates();\n this.parent.uiStateValues.isGroupAdaptive = this.parent.activeViewOptions.group.resources.length > 0 &&\n (this.parent.enableAdaptiveUI && !this.parent.isAdaptive ||\n this.parent.isAdaptive && this.parent.activeViewOptions.group.enableCompactView);\n if (this.parent.virtualScrollModule) {\n this.parent.virtualScrollModule.destroy();\n this.parent.virtualScrollModule = null;\n }\n if (this.parent.currentView.indexOf('Timeline') !== -1 && this.parent.currentView.indexOf('Year') === -1\n && this.parent.activeViewOptions.allowVirtualScrolling\n && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {\n this.parent.virtualScrollModule = new VirtualScroll(this.parent);\n this.parent.uiStateValues.top = 0;\n }\n this.updateHeader();\n this.parent.activeView.renderLayout(cls.CURRENT_PANEL_CLASS);\n this.parent.renderTemplates();\n if (this.parent.eventTooltip) {\n this.parent.eventTooltip.destroy();\n this.parent.eventTooltip = null;\n }\n if (this.parent.eventSettings.enableTooltip || (this.parent.activeViewOptions.group.resources.length > 0\n && this.parent.activeViewOptions.group.headerTooltipTemplate)) {\n this.parent.eventTooltip = new EventTooltip(this.parent);\n }\n };\n Render.prototype.updateHeader = function () {\n if (this.parent.headerModule) {\n this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek);\n if (this.parent.activeViewOptions.readonly) {\n addClass([this.parent.element], cls.READ_ONLY);\n }\n else if (this.parent.element.classList.contains(cls.READ_ONLY)) {\n removeClass([this.parent.element], cls.READ_ONLY);\n }\n this.parent.headerModule.updateDateRange(this.parent.activeView.getDateRangeText());\n this.parent.headerModule.updateHeaderItems('remove');\n }\n };\n Render.prototype.updateLabelText = function (view) {\n var content = this.parent.activeView.getLabelText(view);\n this.parent.element.setAttribute('role', 'main');\n this.parent.element.setAttribute('aria-label', content);\n };\n return Render;\n}());\nexport { Render };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * A class that represents the configuration of working hours related options of scheduler.\n */\nvar WorkHours = /** @class */ (function (_super) {\n __extends(WorkHours, _super);\n function WorkHours() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(true)\n ], WorkHours.prototype, \"highlight\", void 0);\n __decorate([\n Property('09:00')\n ], WorkHours.prototype, \"start\", void 0);\n __decorate([\n Property('18:00')\n ], WorkHours.prototype, \"end\", void 0);\n return WorkHours;\n}(ChildProperty));\nexport { WorkHours };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * A class that represents the configuration of options related to timescale on scheduler.\n */\nvar TimeScale = /** @class */ (function (_super) {\n __extends(TimeScale, _super);\n function TimeScale() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(true)\n ], TimeScale.prototype, \"enable\", void 0);\n __decorate([\n Property(60)\n ], TimeScale.prototype, \"interval\", void 0);\n __decorate([\n Property(2)\n ], TimeScale.prototype, \"slotCount\", void 0);\n __decorate([\n Property()\n ], TimeScale.prototype, \"minorSlotTemplate\", void 0);\n __decorate([\n Property()\n ], TimeScale.prototype, \"majorSlotTemplate\", void 0);\n return TimeScale;\n}(ChildProperty));\nexport { TimeScale };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * A class that defines the template options available to customize the quick popup of scheduler.\n */\nvar QuickInfoTemplates = /** @class */ (function (_super) {\n __extends(QuickInfoTemplates, _super);\n function QuickInfoTemplates() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('Both')\n ], QuickInfoTemplates.prototype, \"templateType\", void 0);\n __decorate([\n Property()\n ], QuickInfoTemplates.prototype, \"header\", void 0);\n __decorate([\n Property()\n ], QuickInfoTemplates.prototype, \"content\", void 0);\n __decorate([\n Property()\n ], QuickInfoTemplates.prototype, \"footer\", void 0);\n return QuickInfoTemplates;\n}(ChildProperty));\nexport { QuickInfoTemplates };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * A class that represents the header rows related configurations on timeline views.\n */\nvar HeaderRows = /** @class */ (function (_super) {\n __extends(HeaderRows, _super);\n function HeaderRows() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], HeaderRows.prototype, \"option\", void 0);\n __decorate([\n Property()\n ], HeaderRows.prototype, \"template\", void 0);\n return HeaderRows;\n}(ChildProperty));\nexport { HeaderRows };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-len */\nimport { isNullOrUndefined, extend } from '@syncfusion/ej2-base';\nimport { getRecurrenceStringFromDate, generate } from '../../recurrence-editor/date-generator';\nimport * as events from '../base/constant';\nimport * as util from '../base/util';\n/**\n * Schedule CRUD operations\n */\nvar Crud = /** @class */ (function () {\n function Crud(parent) {\n this.parent = parent;\n this.crudObj = { sourceEvent: null, targetEvent: null, isCrudAction: false };\n }\n Crud.prototype.getQuery = function () {\n var start = this.parent.activeView.startDate();\n var end = this.parent.activeView.endDate();\n return this.parent.dataModule.generateQuery(start, end);\n };\n Crud.prototype.getTable = function () {\n if (this.parent.eventSettings.query) {\n var query = this.parent.eventSettings.query.clone();\n return query.fromTable;\n }\n return null;\n };\n Crud.prototype.refreshDataManager = function () {\n var _this = this;\n if (!this.parent.activeView) {\n return;\n }\n var start = this.parent.activeView.startDate();\n var end = this.parent.activeView.endDate();\n var dataManager = this.parent.dataModule.getData(this.parent.dataModule.generateQuery(start, end));\n dataManager.then(function (e) { return _this.dataManagerSuccess(e); }).catch(function (e) { return _this.dataManagerFailure(e); });\n };\n Crud.prototype.dataManagerSuccess = function (e) {\n var _this = this;\n if (!this.parent || this.parent && this.parent.isDestroyed) {\n return;\n }\n this.parent.trigger(events.dataBinding, e, function (args) {\n var resultData = extend([], args.result, null, true);\n _this.parent.eventsData = resultData.filter(function (data) { return !data[_this.parent.eventFields.isBlock]; });\n _this.parent.blockData = resultData.filter(function (data) { return data[_this.parent.eventFields.isBlock]; });\n _this.parent.refreshEvents(false);\n if (_this.parent.dragAndDropModule && _this.parent.dragAndDropModule.actionObj.action === 'drag') {\n _this.parent.dragAndDropModule.navigationWrapper();\n }\n _this.parent.trigger(events.dataBound, null, function () {\n _this.parent.hideSpinner();\n if (_this.parent.isPrinting) {\n _this.parent.notify(events.print, {});\n }\n });\n });\n };\n Crud.prototype.dataManagerFailure = function (e) {\n var _this = this;\n if (!this.parent || this.parent && this.parent.isDestroyed) {\n return;\n }\n this.parent.trigger(events.actionFailure, { error: e }, function () { return _this.parent.hideSpinner(); });\n };\n Crud.prototype.refreshData = function (args) {\n var _this = this;\n var actionArgs = {\n requestType: args.requestType, cancel: false, data: args.data,\n addedRecords: args.editParams.addedRecords, changedRecords: args.editParams.changedRecords,\n deletedRecords: args.editParams.deletedRecords\n };\n if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj && this.parent.dragAndDropModule.actionObj.element) {\n this.parent.dragAndDropModule.actionObj.element.style.display = 'none';\n }\n if (this.parent.resizeModule && this.parent.resizeModule.actionObj && this.parent.resizeModule.actionObj.element) {\n this.parent.resizeModule.actionObj.element.style.display = 'none';\n }\n if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.activeViewOptions.group.allowGroupEdit\n && !this.parent.rowAutoHeight && !this.parent.virtualScrollModule && this.parent.activeViewOptions.group.byGroupID) {\n if (args.requestType === 'eventCreated' || args.requestType === 'eventRemoved') {\n this.crudObj.isCrudAction = true;\n this.crudObj.sourceEvent = [];\n var crudData = args.data instanceof Array ? (args.data.length === 0 &&\n args.requestType === 'eventRemoved' ? args.editParams.deletedRecords : args.data) :\n ((typeof args.data === 'string' || typeof args.data === 'number') && args.requestType === 'eventRemoved') ?\n args.editParams.deletedRecords : [args.data];\n var _loop_1 = function (data) {\n this_1.crudObj.isCrudAction = !(args.requestType === 'eventRemoved' && !isNullOrUndefined(data.parent));\n var groupIndex = this_1.parent.eventBase.getGroupIndexFromEvent(data);\n if (groupIndex > -1 && this_1.parent.crudModule.crudObj.sourceEvent.filter(function (tdData) { return tdData.groupIndex === groupIndex; }).length === 0\n && this_1.crudObj.isCrudAction) {\n this_1.crudObj.sourceEvent.push(this_1.parent.resourceBase.lastResourceLevel[groupIndex]);\n }\n };\n var this_1 = this;\n for (var _i = 0, crudData_1 = crudData; _i < crudData_1.length; _i++) {\n var data = crudData_1[_i];\n _loop_1(data);\n }\n this.crudObj.targetEvent = this.crudObj.sourceEvent;\n }\n }\n if (this.parent.dataModule.dataManager.dataSource.offline) {\n this.parent.trigger(events.actionComplete, actionArgs, function (offlineArgs) {\n if (!offlineArgs.cancel) {\n _this.refreshDataManager();\n }\n });\n }\n else {\n args.promise.then(function () {\n if (!_this.parent || _this.parent && _this.parent.isDestroyed) {\n return;\n }\n _this.parent.trigger(events.actionComplete, actionArgs, function (onlineArgs) {\n if (!onlineArgs.cancel) {\n _this.refreshDataManager();\n }\n });\n }).catch(function (e) {\n if (!_this.parent || _this.parent && _this.parent.isDestroyed) {\n return;\n }\n _this.parent.trigger(events.actionFailure, { error: e });\n });\n }\n };\n Crud.prototype.addEvent = function (eventData) {\n var _this = this;\n if (this.parent.eventSettings.allowAdding && !this.parent.activeViewOptions.readonly) {\n if (!this.isBlockEvent(eventData) && this.parent.eventBase.isBlockRange(eventData)) {\n this.parent.quickPopup.openValidationError('blockAlert', eventData);\n return;\n }\n var addEvents = (eventData instanceof Array) ? eventData : [eventData];\n var args = {\n requestType: 'eventCreate', cancel: false, data: addEvents,\n addedRecords: addEvents, changedRecords: [], deletedRecords: []\n };\n this.parent.trigger(events.actionBegin, args, function (addArgs) {\n if (!addArgs.cancel) {\n var fields = _this.parent.eventFields;\n var editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };\n var promise = void 0;\n if (addArgs.addedRecords instanceof Array) {\n for (var _i = 0, _a = addArgs.addedRecords; _i < _a.length; _i++) {\n var event_1 = _a[_i];\n event_1 = _this.parent.eventBase.updateEventDateTime(event_1);\n var eventData_1 = extend({}, _this.parent.eventBase.processTimezone(event_1, true), null, true);\n editParams.addedRecords.push(eventData_1);\n }\n promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, _this.getTable(), _this.getQuery());\n }\n else {\n var event_2 = _this.parent.eventBase.processTimezone(addArgs.addedRecords, true);\n editParams.addedRecords.push(event_2);\n promise = _this.parent.dataModule.dataManager.insert(event_2, _this.getTable(), _this.getQuery());\n }\n var crudArgs = {\n requestType: 'eventCreated', cancel: false, data: addArgs.addedRecords, promise: promise, editParams: editParams\n };\n _this.refreshData(crudArgs);\n }\n });\n }\n };\n Crud.prototype.saveEvent = function (eventData, action) {\n var _this = this;\n if (this.parent.eventSettings.allowEditing && !this.parent.activeViewOptions.readonly) {\n if (this.parent.currentAction !== 'EditFollowingEvents' && !this.isBlockEvent(eventData)\n && this.parent.eventBase.isBlockRange(eventData)) {\n this.parent.quickPopup.openValidationError('blockAlert', eventData);\n return;\n }\n this.parent.currentAction = action;\n if (action) {\n switch (action) {\n case 'Save':\n this.processSave(eventData);\n break;\n case 'EditOccurrence':\n this.processOccurrences(eventData, action);\n break;\n case 'EditFollowingEvents':\n this.processFollowSeries(eventData, action);\n break;\n case 'EditSeries':\n this.processEntireSeries(eventData, action);\n break;\n }\n }\n else {\n var updateEvents = (eventData instanceof Array) ? eventData : [eventData];\n var args = {\n requestType: 'eventChange', cancel: false, data: eventData,\n addedRecords: [], changedRecords: updateEvents, deletedRecords: []\n };\n this.parent.trigger(events.actionBegin, args, function (saveArgs) {\n if (!saveArgs.cancel) {\n var promise = void 0;\n var fields = _this.parent.eventFields;\n var editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };\n if (saveArgs.changedRecords instanceof Array) {\n for (var _i = 0, _a = saveArgs.changedRecords; _i < _a.length; _i++) {\n var event_3 = _a[_i];\n event_3 = _this.parent.eventBase.updateEventDateTime(event_3);\n var eventData_2 = extend({}, _this.parent.eventBase.processTimezone(event_3, true), null, true);\n editParams.changedRecords.push(eventData_2);\n }\n promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, _this.getTable(), _this.getQuery());\n }\n else {\n var event_4 = _this.parent.eventBase.processTimezone(saveArgs.changedRecords, true);\n editParams.changedRecords.push(event_4);\n promise = _this.parent.dataModule.dataManager.update(fields.id, event_4, _this.getTable(), _this.getQuery());\n }\n var crudArgs = {\n requestType: 'eventChanged', cancel: false,\n data: saveArgs.changedRecords, promise: promise, editParams: editParams\n };\n _this.refreshData(crudArgs);\n }\n });\n }\n }\n };\n Crud.prototype.deleteEvent = function (eventData, action) {\n var _this = this;\n if (this.parent.eventSettings.allowDeleting && !this.parent.activeViewOptions.readonly) {\n this.parent.currentAction = action;\n var deleteEvents = [];\n if (typeof eventData === 'string' || typeof eventData === 'number') {\n deleteEvents = this.parent.eventsData.filter(function (eventObj) {\n return eventObj[_this.parent.eventFields.id] === eventData;\n });\n }\n else {\n deleteEvents = (eventData instanceof Array ? eventData : [eventData]);\n }\n if (action) {\n switch (action) {\n case 'Delete':\n this.processDelete(deleteEvents);\n break;\n case 'DeleteOccurrence':\n this.processOccurrences(deleteEvents, action);\n break;\n case 'DeleteFollowingEvents':\n this.processFollowSeries(deleteEvents, action);\n break;\n case 'DeleteSeries':\n this.processEntireSeries(deleteEvents, action);\n break;\n }\n }\n else {\n var args = {\n requestType: 'eventRemove', cancel: false, data: eventData,\n addedRecords: [], changedRecords: [], deletedRecords: deleteEvents\n };\n this.parent.trigger(events.actionBegin, args, function (deleteArgs) {\n if (!deleteArgs.cancel) {\n var promise = void 0;\n var fields = _this.parent.eventFields;\n var editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };\n if (deleteArgs.deletedRecords.length > 1) {\n editParams.deletedRecords = editParams.deletedRecords.concat(deleteArgs.deletedRecords);\n promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, _this.getTable(), _this.getQuery());\n }\n else {\n editParams.deletedRecords.push(deleteArgs.deletedRecords[0]);\n promise = _this.parent.dataModule.dataManager.remove(fields.id, deleteArgs.deletedRecords[0], _this.getTable(), _this.getQuery());\n }\n _this.parent.eventBase.selectWorkCellByTime(deleteArgs.deletedRecords);\n var crudArgs = {\n requestType: 'eventRemoved', cancel: false,\n data: deleteArgs.deletedRecords, promise: promise, editParams: editParams\n };\n _this.refreshData(crudArgs);\n }\n });\n }\n }\n };\n Crud.prototype.processOccurrences = function (eventData, action) {\n var _this = this;\n var occurrenceData = [];\n var isDeletedRecords = false;\n if (eventData instanceof Array) {\n for (var _i = 0, eventData_3 = eventData; _i < eventData_3.length; _i++) {\n var event_5 = eventData_3[_i];\n occurrenceData.push({ occurrence: event_5, parent: this.getParentEvent(event_5) });\n }\n }\n else {\n occurrenceData = { occurrence: eventData, parent: this.getParentEvent(eventData) };\n }\n var updateEvents = (eventData instanceof Array) ? eventData : [eventData];\n var args = {\n requestType: action === 'EditOccurrence' ? 'eventChange' : 'eventRemove', cancel: false,\n addedRecords: [], changedRecords: updateEvents, deletedRecords: []\n };\n args.data = occurrenceData;\n this.parent.trigger(events.actionBegin, args, function (occurrenceArgs) {\n if (!occurrenceArgs.cancel) {\n var fields = _this.parent.eventFields;\n var editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };\n var occurrenceEvents = (occurrenceData instanceof Array ? occurrenceData : [occurrenceData]);\n var _loop_2 = function (a, count) {\n var childEvent = occurrenceArgs.changedRecords[a];\n var parentEvent = occurrenceEvents[a].parent;\n var parentException = parentEvent[fields.recurrenceException];\n var editedData = void 0;\n var exceptionDate = void 0;\n switch (action) {\n case 'EditOccurrence':\n editedData = _this.parent.eventsProcessed.filter(function (event) { return event.Guid === childEvent.Guid; })[0];\n exceptionDate = _this.excludeDateCheck(editedData[fields.startTime], parentException);\n if (exceptionDate !== parentEvent[fields.recurrenceException]) {\n parentEvent[fields.recurrenceException] = exceptionDate;\n childEvent[fields.recurrenceException] = getRecurrenceStringFromDate(editedData[fields.startTime]);\n childEvent[fields.recurrenceID] = parentEvent[fields.id];\n childEvent[fields.followingID] = null;\n editParams.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent, true));\n editParams.addedRecords.push(_this.parent.eventBase.processTimezone(childEvent, true));\n }\n else {\n editParams.changedRecords.push(_this.parent.eventBase.processTimezone(childEvent, true));\n }\n break;\n case 'DeleteOccurrence':\n if (!childEvent[fields.recurrenceException]) {\n parentEvent[fields.recurrenceException] =\n _this.excludeDateCheck(childEvent[fields.startTime], parentException);\n editParams.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent, true));\n }\n if (childEvent[fields.id] !== parentEvent[fields.id]) {\n editParams.deletedRecords.push(childEvent);\n isDeletedRecords = true;\n }\n break;\n }\n };\n for (var a = 0, count = occurrenceArgs.changedRecords.length; a < count; a++) {\n _loop_2(a, count);\n }\n var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, _this.getTable(), _this.getQuery());\n _this.parent.eventBase.selectWorkCellByTime(occurrenceArgs.changedRecords);\n var crudArgs = {\n requestType: action === 'EditOccurrence' ? 'eventChanged' : 'eventRemoved',\n cancel: false, data: isDeletedRecords ? occurrenceArgs.deletedRecords : occurrenceArgs.changedRecords,\n promise: promise, editParams: editParams\n };\n _this.refreshData(crudArgs);\n }\n });\n };\n Crud.prototype.processFollowSeries = function (eventData, action) {\n var _this = this;\n var followData = [];\n if (eventData instanceof Array) {\n for (var _i = 0, eventData_4 = eventData; _i < eventData_4.length; _i++) {\n var event_6 = eventData_4[_i];\n followData.push({ occurrence: event_6, parent: this.getParentEvent(event_6) });\n }\n }\n else {\n followData = { occurrence: eventData, parent: this.getParentEvent(eventData) };\n }\n var updateFollowEvents = (eventData instanceof Array) ? eventData : [eventData];\n var args = {\n requestType: action === 'EditFollowingEvents' ? 'eventChange' : 'eventRemove', cancel: false,\n addedRecords: [], changedRecords: updateFollowEvents, deletedRecords: []\n };\n args.data = followData;\n this.parent.trigger(events.actionBegin, args, function (followArgs) {\n if (!followArgs.cancel) {\n var fields_1 = _this.parent.eventFields;\n var editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };\n var followEvents = followData instanceof Array ? followData : [followData];\n var _loop_3 = function (a, count) {\n var childEvent = followArgs.changedRecords[a];\n var parentEvent = followEvents[a].parent;\n var followData_1 = _this.parent.eventBase.getEventCollections(parentEvent, childEvent);\n var isSpanned = void 0;\n switch (action) {\n case 'EditFollowingEvents':\n _this.processRecurrenceRule(parentEvent, childEvent);\n isSpanned = !_this.parent.eventBase.isFollowingEvent(parentEvent, childEvent);\n childEvent[fields_1.followingID] = isSpanned ? null : parentEvent[fields_1.id];\n childEvent[fields_1.recurrenceID] = null;\n editParams.addedRecords.push(_this.parent.eventBase.processTimezone(childEvent, true));\n editParams.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent, true));\n if (!_this.parent.uiStateValues.isIgnoreOccurrence) {\n childEvent[fields_1.recurrenceException] = null;\n if (followData_1.occurrence.length > 0) {\n var rule = followData_1.occurrence.slice(-1)[0][fields_1.recurrenceRule];\n if (rule.indexOf('COUNT') === -1) {\n childEvent[fields_1.recurrenceRule] = rule;\n }\n }\n if (followData_1.follow.length > 0) {\n childEvent[fields_1.recurrenceRule] = followData_1.follow.slice(-1)[0][fields_1.recurrenceRule];\n editParams.deletedRecords = editParams.deletedRecords.concat(followData_1.follow);\n }\n if (isSpanned) {\n followData_1.occurrence = followData_1.occurrence.filter(function (eventObj) {\n return eventObj[fields_1.recurrenceID] === childEvent[fields_1.id];\n });\n }\n editParams.deletedRecords = editParams.deletedRecords.concat(followData_1.occurrence);\n }\n break;\n case 'DeleteFollowingEvents':\n _this.processRecurrenceRule(parentEvent, childEvent[fields_1.startTime]);\n editParams.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent, true));\n editParams.deletedRecords = editParams.deletedRecords.concat(followData_1.occurrence).concat(followData_1.follow);\n break;\n }\n };\n for (var a = 0, count = followArgs.changedRecords.length; a < count; a++) {\n _loop_3(a, count);\n }\n var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields_1.id, _this.getTable(), _this.getQuery());\n _this.parent.eventBase.selectWorkCellByTime(followArgs.changedRecords);\n var crudArgs = {\n requestType: action === 'EditFollowingEvents' ? 'eventChanged' : 'eventRemoved',\n cancel: false, data: followArgs.changedRecords, promise: promise, editParams: editParams\n };\n _this.refreshData(crudArgs);\n }\n });\n };\n Crud.prototype.processEntireSeries = function (eventData, action) {\n var _this = this;\n var seriesData = [];\n var isDeletedRecords = false;\n if (eventData instanceof Array) {\n for (var _i = 0, eventData_5 = eventData; _i < eventData_5.length; _i++) {\n var event_7 = eventData_5[_i];\n seriesData.push(this.getParentEvent(event_7, true));\n }\n }\n else {\n seriesData = this.getParentEvent(eventData, true);\n }\n var updateSeriesEvents = (eventData instanceof Array) ? eventData : [eventData];\n var args = {\n requestType: action === 'EditSeries' ? 'eventChange' : 'eventRemove', cancel: false,\n addedRecords: [], changedRecords: updateSeriesEvents, deletedRecords: []\n };\n args.data = seriesData;\n this.parent.trigger(events.actionBegin, args, function (seriesArgs) {\n if (!seriesArgs.cancel) {\n var fields_2 = _this.parent.eventFields;\n var editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };\n var seriesEvents = seriesData instanceof Array ? seriesData : [seriesData];\n var _loop_4 = function (a, count) {\n var childEvent = seriesArgs.changedRecords[a];\n var parentEvent = seriesEvents[a];\n var eventCollections = _this.parent.eventBase.getEventCollections(parentEvent);\n var deletedEvents = eventCollections.follow.concat(eventCollections.occurrence);\n switch (action) {\n case 'EditSeries':\n if ((childEvent[fields_2.startTime] > parentEvent[fields_2.startTime]) && childEvent[fields_2.recurrenceRule]) {\n _this.processRecurrenceRule(parentEvent, childEvent);\n }\n childEvent[fields_2.id] = parentEvent[fields_2.id];\n childEvent[fields_2.recurrenceID] = null;\n childEvent[fields_2.followingID] = null;\n if (_this.parent.uiStateValues.isIgnoreOccurrence && childEvent[fields_2.recurrenceException]) {\n var originalParent = _this.parent.eventsData.filter(function (eventObj) {\n return eventObj[fields_2.id] === childEvent[fields_2.id];\n });\n if (originalParent.length > 0) {\n childEvent[fields_2.recurrenceRule] = originalParent[0][fields_2.recurrenceRule];\n }\n }\n else {\n childEvent[fields_2.recurrenceException] = null;\n editParams.deletedRecords = editParams.deletedRecords.concat(deletedEvents);\n }\n editParams.changedRecords.push(_this.parent.eventBase.processTimezone(childEvent, true));\n _this.parent.uiStateValues.isIgnoreOccurrence = false;\n break;\n case 'DeleteSeries':\n editParams.deletedRecords = editParams.deletedRecords.concat(deletedEvents.concat(parentEvent));\n isDeletedRecords = true;\n break;\n }\n };\n for (var a = 0, count = seriesArgs.changedRecords.length; a < count; a++) {\n _loop_4(a, count);\n }\n var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields_2.id, _this.getTable(), _this.getQuery());\n _this.parent.eventBase.selectWorkCellByTime(seriesArgs.changedRecords);\n var crudArgs = {\n requestType: action === 'EditSeries' ? 'eventChanged' : 'eventRemoved',\n cancel: false, data: isDeletedRecords ? seriesArgs.deletedRecords : seriesArgs.changedRecords,\n promise: promise, editParams: editParams\n };\n _this.refreshData(crudArgs);\n }\n });\n };\n Crud.prototype.processDelete = function (eventData) {\n var _this = this;\n var deleteData = [];\n for (var _i = 0, eventData_6 = eventData; _i < eventData_6.length; _i++) {\n var eventObj = eventData_6[_i];\n if (eventObj[this.parent.eventFields.recurrenceRule]) {\n deleteData.push({ occurrence: eventObj, parent: this.getParentEvent(eventObj) });\n }\n else {\n deleteData.push(eventObj);\n }\n }\n var args = {\n requestType: 'eventRemove', cancel: false,\n addedRecords: [], changedRecords: [], deletedRecords: eventData\n };\n args.data = deleteData;\n this.parent.trigger(events.actionBegin, args, function (deleteArgs) {\n if (!deleteArgs.cancel) {\n var fields_3 = _this.parent.eventFields;\n var editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };\n var _loop_5 = function (a, count) {\n var isDelete = isNullOrUndefined(deleteArgs.deletedRecords[a][_this.parent.eventFields.recurrenceRule]);\n if (!isDelete) {\n var parentEvent_1 = deleteData[a].parent;\n var isEdited = editParams.changedRecords.filter(function (obj) {\n return obj[fields_3.id] === parentEvent_1[fields_3.id];\n });\n var editedDate = deleteArgs.deletedRecords[a][fields_3.startTime];\n if (isEdited.length > 0) {\n var editedData = isEdited[0];\n editedData[fields_3.recurrenceException] =\n _this.excludeDateCheck(editedDate, editedData[fields_3.recurrenceException]);\n }\n else {\n parentEvent_1[fields_3.recurrenceException] =\n _this.excludeDateCheck(editedDate, parentEvent_1[fields_3.recurrenceException]);\n }\n if (isEdited.length === 0) {\n editParams.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent_1, true));\n }\n isDelete = deleteArgs.deletedRecords[a][fields_3.id] !== parentEvent_1[fields_3.id];\n }\n if (isDelete) {\n editParams.deletedRecords.push(deleteArgs.deletedRecords[a]);\n }\n };\n for (var a = 0, count = deleteArgs.deletedRecords.length; a < count; a++) {\n _loop_5(a, count);\n }\n var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields_3.id, _this.getTable(), _this.getQuery());\n var crudArgs = {\n requestType: 'eventRemoved', cancel: false, data: deleteArgs.deletedRecords, promise: promise, editParams: editParams\n };\n _this.refreshData(crudArgs);\n }\n });\n };\n Crud.prototype.processSave = function (data) {\n var _this = this;\n var eventData = (data instanceof Array) ? data : [data];\n var editData = [];\n for (var _i = 0, eventData_7 = eventData; _i < eventData_7.length; _i++) {\n var eventObj = eventData_7[_i];\n if (eventObj[this.parent.eventFields.recurrenceRule]) {\n editData.push({ occurrence: eventObj, parent: this.getParentEvent(eventObj) });\n }\n else {\n editData.push(eventObj);\n }\n }\n var args = { requestType: 'eventChange', cancel: false, addedRecords: [], changedRecords: eventData, deletedRecords: [] };\n args.data = editData;\n this.parent.trigger(events.actionBegin, args, function (editArgs) {\n if (!editArgs.cancel) {\n var fields = _this.parent.eventFields;\n var editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };\n for (var _i = 0, _a = editArgs.changedRecords; _i < _a.length; _i++) {\n var record = _a[_i];\n if (!isNullOrUndefined(record[fields.recurrenceRule]) && isNullOrUndefined(record[fields.recurrenceException])) {\n var exceptionString = getRecurrenceStringFromDate(record[fields.startTime]);\n var parentEle = _this.getParentEvent(record);\n parentEle[fields.recurrenceException] = isNullOrUndefined(parentEle[fields.recurrenceException]) ?\n exceptionString : parentEle[fields.recurrenceException].concat(',' + exceptionString);\n record[fields.id] = _this.parent.getEventMaxID();\n record[fields.recurrenceException] = exceptionString;\n editParams.addedRecords.push(_this.parent.eventBase.processTimezone(record, true));\n editParams.changedRecords.push(_this.parent.eventBase.processTimezone(parentEle, true));\n }\n else {\n editParams.changedRecords.push(_this.parent.eventBase.processTimezone(record, true));\n }\n }\n var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, _this.getTable(), _this.getQuery());\n var crudArgs = { requestType: 'eventChanged', cancel: false, data: editArgs.changedRecords, promise: promise, editParams: editParams };\n _this.refreshData(crudArgs);\n }\n });\n };\n Crud.prototype.getParentEvent = function (event, isParent) {\n if (isParent === void 0) { isParent = false; }\n var parentEvent = this.parent.eventBase.getParentEvent(event, isParent) || event;\n if (parentEvent[this.parent.eventFields.startTimezone] || parentEvent[this.parent.eventFields.endTimezone]) {\n this.parent.eventBase.timezoneConvert(parentEvent);\n }\n return parentEvent;\n };\n Crud.prototype.excludeDateCheck = function (eventStartTime, exceptionDateList) {\n var exDate = getRecurrenceStringFromDate(eventStartTime);\n if (!isNullOrUndefined(exceptionDateList)) {\n if (exceptionDateList.indexOf(exDate) === -1) {\n exceptionDateList = !(isNullOrUndefined(exceptionDateList)) ? exceptionDateList + ',' + exDate : exDate;\n }\n }\n else {\n exceptionDateList = exDate;\n }\n return exceptionDateList;\n };\n Crud.prototype.processRecurrenceRule = function (parentEvent, followEvent) {\n var fields = this.parent.eventFields;\n var recurrenceRule = parentEvent[fields.recurrenceRule];\n var endDate;\n if (followEvent instanceof Date) {\n endDate = new Date(+followEvent);\n }\n else {\n endDate = new Date(+followEvent[fields.startTime]);\n var newRecurrenceRule = followEvent[fields.recurrenceRule];\n var startDate = parentEvent[fields.startTime];\n var ruleException = (this.parent.currentAction === 'DeleteFollowingEvents') ? followEvent[fields.recurrenceException] : null;\n var dateCollection = generate(startDate, newRecurrenceRule, ruleException, this.parent.activeViewOptions.firstDayOfWeek);\n var untilDate = new Date(dateCollection.slice(-1)[0]);\n untilDate.setHours(endDate.getHours(), endDate.getMinutes(), endDate.getSeconds());\n endDate.setHours(startDate.getHours(), startDate.getMinutes(), startDate.getSeconds());\n followEvent[fields.recurrenceRule] = this.getUpdatedRecurrenceRule(newRecurrenceRule, new Date(+untilDate), false);\n }\n parentEvent[fields.recurrenceRule] = this.getUpdatedRecurrenceRule(recurrenceRule, util.addDays(new Date(endDate.getTime()), -1), true);\n };\n Crud.prototype.getUpdatedRecurrenceRule = function (recurrenceRule, untilDate, isParent) {\n var splitRule = recurrenceRule.split(';');\n var updatedRule = '';\n for (var _i = 0, splitRule_1 = splitRule; _i < splitRule_1.length; _i++) {\n var rule = splitRule_1[_i];\n if (rule !== '') {\n var ruleKey = rule.split('=')[0];\n var ruleValue = rule.split('=')[1];\n if (ruleKey === 'COUNT' || ruleKey === 'UNTIL') {\n ruleValue = getRecurrenceStringFromDate(untilDate);\n rule = rule.replace(rule, 'UNTIL=' + ruleValue);\n }\n updatedRule += rule + ';';\n }\n }\n if (isParent && updatedRule.indexOf('UNTIL') === -1) {\n updatedRule += 'UNTIL=' + getRecurrenceStringFromDate(untilDate);\n }\n return updatedRule;\n };\n Crud.prototype.isBlockEvent = function (eventData) {\n var eventCollection = (eventData instanceof Array) ? eventData : [eventData];\n var value = false;\n for (var _i = 0, eventCollection_1 = eventCollection; _i < eventCollection_1.length; _i++) {\n var event_8 = eventCollection_1[_i];\n value = event_8[this.parent.eventFields.isBlock] || false;\n }\n return value;\n };\n /**\n * To destroy the crud module.\n *\n * @returns {void}\n * @private\n */\n Crud.prototype.destroy = function () {\n this.crudObj = null;\n this.parent = null;\n };\n return Crud;\n}());\nexport { Crud };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { extend, closest, isNullOrUndefined, EventHandler } from '@syncfusion/ej2-base';\nimport * as event from '../base/constant';\nimport * as cls from '../base/css-constant';\n/**\n * Work cell interactions\n */\nvar WorkCellInteraction = /** @class */ (function () {\n function WorkCellInteraction(parent) {\n this.parent = parent;\n EventHandler.add(this.parent.element, 'mouseover', this.onHover, this);\n }\n WorkCellInteraction.prototype.cellMouseDown = function (e) {\n if (this.isPreventAction(e)) {\n return;\n }\n this.parent.notify(event.cellMouseDown, { event: e });\n };\n WorkCellInteraction.prototype.cellClick = function (e) {\n var _this = this;\n if (this.isPreventAction(e)) {\n return;\n }\n var queryStr = '.' + cls.WORK_CELLS_CLASS + ',.' + cls.ALLDAY_CELLS_CLASS + ',.' + cls.HEADER_CELLS_CLASS;\n var target = closest(e.target, queryStr);\n if (isNullOrUndefined(target)) {\n return;\n }\n if (!isNullOrUndefined(closest(e.target, '.' + cls.NEW_EVENT_CLASS))) {\n this.parent.eventWindow.openEditor(this.parent.activeCellsData, 'Add');\n return;\n }\n var navigateEle = closest(e.target, '.' + cls.NAVIGATE_CLASS);\n var navigateView = this.parent.getNavigateView();\n var sameView = this.parent.currentView === navigateView;\n if (isNullOrUndefined(navigateEle) || sameView ||\n isNullOrUndefined(this.parent.viewOptions[navigateView.charAt(0).toLowerCase() + navigateView.slice(1)])) {\n if (this.parent.activeViewOptions.readonly && this.parent.currentView !== 'MonthAgenda') {\n if (this.parent.quickPopup) {\n this.parent.quickPopup.quickPopupHide();\n }\n return;\n }\n if (this.parent.isAdaptive && (e.target.classList.contains(cls.MORE_INDICATOR_CLASS) ||\n closest(e.target, '.' + cls.MORE_INDICATOR_CLASS))) {\n return;\n }\n var isWorkCell_1 = target.classList.contains(cls.WORK_CELLS_CLASS) ||\n target.classList.contains(cls.ALLDAY_CELLS_CLASS);\n if (isWorkCell_1 && e.shiftKey && e.which === 1 && this.parent.keyboardInteractionModule) {\n this.parent.keyboardInteractionModule.onMouseSelection(e);\n return;\n }\n this.parent.activeCellsData = this.parent.getCellDetails(target);\n var args = extend(this.parent.activeCellsData, { cancel: false, event: e, name: 'cellClick' });\n this.parent.trigger(event.cellClick, args, function (clickArgs) {\n if (!clickArgs.cancel) {\n if (isWorkCell_1) {\n _this.parent.selectCell(target);\n }\n if (_this.parent.allowInline) {\n var inlineArgs = {\n element: clickArgs.element,\n groupIndex: clickArgs.groupIndex, type: 'Cell'\n };\n _this.parent.notify(event.inlineClick, inlineArgs);\n }\n else {\n _this.parent.notify(event.cellClick, clickArgs);\n }\n }\n else {\n if (_this.parent.quickPopup) {\n _this.parent.quickPopup.quickPopupHide();\n }\n }\n });\n }\n else {\n var date = this.parent.getDateFromElement(target);\n if (!isNullOrUndefined(date) && !this.parent.isAdaptive && this.parent.isMinMaxDate(date)) {\n this.parent.setProperties({ selectedDate: date }, true);\n this.parent.changeView(this.parent.getNavigateView(), e);\n }\n }\n };\n WorkCellInteraction.prototype.cellDblClick = function (e) {\n var _this = this;\n var queryStr = '.' + cls.WORK_CELLS_CLASS + ',.' + cls.ALLDAY_CELLS_CLASS + ',.' + cls.HEADER_CELLS_CLASS;\n var target = closest(e.target, queryStr);\n if (this.parent.activeViewOptions.readonly || this.isPreventAction(e) || isNullOrUndefined(target)) {\n return;\n }\n var args = extend(this.parent.activeCellsData, { cancel: false, event: e, name: 'cellDoubleClick' });\n this.parent.trigger(event.cellDoubleClick, args, function (clickArgs) {\n var date = new Date(clickArgs.startTime.getTime());\n if (!_this.parent.isMinMaxDate(new Date(date.setHours(0, 0, 0, 0)))) {\n return;\n }\n if (!clickArgs.cancel) {\n _this.parent.eventWindow.openEditor(_this.parent.activeCellsData, 'Add');\n }\n });\n };\n WorkCellInteraction.prototype.onHover = function (e) {\n var targetSelector = '.' + cls.WORK_CELLS_CLASS + ',.' + cls.TIME_SLOT_CLASS + ',.' + cls.ALLDAY_CELLS_CLASS + ',.' +\n cls.HEADER_CELLS_CLASS + ',.' + cls.RESOURCE_CELLS_CLASS + ',.' + cls.APPOINTMENT_CLASS + ',.' + cls.WEEK_NUMBER_CLASS +\n ',.' + cls.MONTH_HEADER_CLASS;\n var hoverTarget = closest(e.target, targetSelector);\n if (hoverTarget) {\n var hoverArgs = { element: hoverTarget, event: e };\n this.parent.trigger(event.hover, hoverArgs);\n }\n };\n WorkCellInteraction.prototype.isPreventAction = function (e) {\n if (closest(e.target, '.' + cls.NAVIGATE_CLASS)) {\n return false;\n }\n if (closest(e.target, '.' + cls.APPOINTMENT_WRAPPER_CLASS) &&\n !closest(e.target, '.' + cls.MORE_INDICATOR_CLASS)) {\n return true;\n }\n var target = closest(e.target, '.' + cls.APPOINTMENT_CLASS + ',.' + cls.RESOURCE_GROUP_CELLS_CLASS);\n if (!isNullOrUndefined(target)) {\n return true;\n }\n target = closest(e.target, '.' + cls.HEADER_CELLS_CLASS);\n if (this.parent.activeView.isTimelineView() && !isNullOrUndefined(target)) {\n return true;\n }\n return false;\n };\n WorkCellInteraction.prototype.destroy = function () {\n EventHandler.remove(this.parent.element, 'mouseover', this.onHover);\n };\n return WorkCellInteraction;\n}());\nexport { WorkCellInteraction };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configuration that applies on each appointment field options of scheduler.\n */\nvar FieldOptions = /** @class */ (function (_super) {\n __extends(FieldOptions, _super);\n function FieldOptions() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], FieldOptions.prototype, \"name\", void 0);\n __decorate([\n Property()\n ], FieldOptions.prototype, \"default\", void 0);\n __decorate([\n Property()\n ], FieldOptions.prototype, \"title\", void 0);\n __decorate([\n Property({})\n ], FieldOptions.prototype, \"validation\", void 0);\n return FieldOptions;\n}(ChildProperty));\nexport { FieldOptions };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty, Complex } from '@syncfusion/ej2-base';\nimport { FieldOptions } from './field-options';\n/**\n * A Class that holds the collection of event fields that requires to be mapped with the dataSource\n * fields along with its available configuration settings. Each field in it accepts both string and Object\n * data type. When each of the field is assigned with simple `string` value, it is assumed that the dataSource field\n * name is mapped with it. If the `object` type is defined on each fields, then the validation related settings and mapping of\n * those fields with dataSource can be given altogether within it.\n */\nvar Field = /** @class */ (function (_super) {\n __extends(Field, _super);\n function Field() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('Id')\n ], Field.prototype, \"id\", void 0);\n __decorate([\n Property('IsBlock')\n ], Field.prototype, \"isBlock\", void 0);\n __decorate([\n Complex({ name: 'Subject' }, FieldOptions)\n ], Field.prototype, \"subject\", void 0);\n __decorate([\n Complex({ name: 'StartTime' }, FieldOptions)\n ], Field.prototype, \"startTime\", void 0);\n __decorate([\n Complex({ name: 'EndTime' }, FieldOptions)\n ], Field.prototype, \"endTime\", void 0);\n __decorate([\n Complex({ name: 'StartTimezone' }, FieldOptions)\n ], Field.prototype, \"startTimezone\", void 0);\n __decorate([\n Complex({ name: 'EndTimezone' }, FieldOptions)\n ], Field.prototype, \"endTimezone\", void 0);\n __decorate([\n Complex({ name: 'Location' }, FieldOptions)\n ], Field.prototype, \"location\", void 0);\n __decorate([\n Complex({ name: 'Description' }, FieldOptions)\n ], Field.prototype, \"description\", void 0);\n __decorate([\n Complex({ name: 'IsAllDay' }, FieldOptions)\n ], Field.prototype, \"isAllDay\", void 0);\n __decorate([\n Complex({ name: 'RecurrenceID' }, FieldOptions)\n ], Field.prototype, \"recurrenceID\", void 0);\n __decorate([\n Complex({ name: 'RecurrenceRule' }, FieldOptions)\n ], Field.prototype, \"recurrenceRule\", void 0);\n __decorate([\n Complex({ name: 'RecurrenceException' }, FieldOptions)\n ], Field.prototype, \"recurrenceException\", void 0);\n __decorate([\n Property('IsReadonly')\n ], Field.prototype, \"isReadonly\", void 0);\n __decorate([\n Property('FollowingID')\n ], Field.prototype, \"followingID\", void 0);\n return Field;\n}(ChildProperty));\nexport { Field };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Property, ChildProperty, Complex } from '@syncfusion/ej2-base';\nimport { Field } from './fields';\n/**\n * Holds the configuration of event related options and dataSource binding to Schedule.\n */\nvar EventSettings = /** @class */ (function (_super) {\n __extends(EventSettings, _super);\n function EventSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], EventSettings.prototype, \"template\", void 0);\n __decorate([\n Property([])\n ], EventSettings.prototype, \"dataSource\", void 0);\n __decorate([\n Property()\n ], EventSettings.prototype, \"query\", void 0);\n __decorate([\n Complex({}, Field)\n ], EventSettings.prototype, \"fields\", void 0);\n __decorate([\n Property(false)\n ], EventSettings.prototype, \"enableTooltip\", void 0);\n __decorate([\n Property()\n ], EventSettings.prototype, \"tooltipTemplate\", void 0);\n __decorate([\n Property('AllDayRow')\n ], EventSettings.prototype, \"spannedEventPlacement\", void 0);\n __decorate([\n Property()\n ], EventSettings.prototype, \"resourceColorField\", void 0);\n __decorate([\n Property(false)\n ], EventSettings.prototype, \"editFollowingEvents\", void 0);\n __decorate([\n Property(true)\n ], EventSettings.prototype, \"allowAdding\", void 0);\n __decorate([\n Property(true)\n ], EventSettings.prototype, \"allowEditing\", void 0);\n __decorate([\n Property(true)\n ], EventSettings.prototype, \"allowDeleting\", void 0);\n __decorate([\n Property(false)\n ], EventSettings.prototype, \"enableMaxHeight\", void 0);\n __decorate([\n Property(false)\n ], EventSettings.prototype, \"enableIndicator\", void 0);\n __decorate([\n Property(false)\n ], EventSettings.prototype, \"ignoreWhitespace\", void 0);\n __decorate([\n Property()\n ], EventSettings.prototype, \"sortComparer\", void 0);\n return EventSettings;\n}(ChildProperty));\nexport { EventSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * A class that holds the resource grouping related configurations on Schedule.\n */\nvar Group = /** @class */ (function (_super) {\n __extends(Group, _super);\n function Group() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(false)\n ], Group.prototype, \"byDate\", void 0);\n __decorate([\n Property(true)\n ], Group.prototype, \"byGroupID\", void 0);\n __decorate([\n Property(false)\n ], Group.prototype, \"allowGroupEdit\", void 0);\n __decorate([\n Property([])\n ], Group.prototype, \"resources\", void 0);\n __decorate([\n Property(true)\n ], Group.prototype, \"enableCompactView\", void 0);\n __decorate([\n Property()\n ], Group.prototype, \"headerTooltipTemplate\", void 0);\n return Group;\n}(ChildProperty));\nexport { Group };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * A class that represents the resource related configurations and its data binding options.\n */\nvar Resources = /** @class */ (function (_super) {\n __extends(Resources, _super);\n function Resources() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], Resources.prototype, \"field\", void 0);\n __decorate([\n Property()\n ], Resources.prototype, \"title\", void 0);\n __decorate([\n Property()\n ], Resources.prototype, \"name\", void 0);\n __decorate([\n Property(false)\n ], Resources.prototype, \"allowMultiple\", void 0);\n __decorate([\n Property([])\n ], Resources.prototype, \"dataSource\", void 0);\n __decorate([\n Property()\n ], Resources.prototype, \"query\", void 0);\n __decorate([\n Property('Id')\n ], Resources.prototype, \"idField\", void 0);\n __decorate([\n Property('Text')\n ], Resources.prototype, \"textField\", void 0);\n __decorate([\n Property('Expanded')\n ], Resources.prototype, \"expandedField\", void 0);\n __decorate([\n Property('GroupID')\n ], Resources.prototype, \"groupIDField\", void 0);\n __decorate([\n Property('Color')\n ], Resources.prototype, \"colorField\", void 0);\n __decorate([\n Property('StartHour')\n ], Resources.prototype, \"startHourField\", void 0);\n __decorate([\n Property('EndHour')\n ], Resources.prototype, \"endHourField\", void 0);\n __decorate([\n Property('WorkDays')\n ], Resources.prototype, \"workDaysField\", void 0);\n __decorate([\n Property('CssClass')\n ], Resources.prototype, \"cssClassField\", void 0);\n return Resources;\n}(ChildProperty));\nexport { Resources };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, isUndefined, Browser, compile, isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { Property, NotifyPropertyChanges, ChildProperty, Complex } from '@syncfusion/ej2-base';\nimport { Event, EventHandler, KeyboardEvents } from '@syncfusion/ej2-base';\nimport { rippleEffect, Animation, remove } from '@syncfusion/ej2-base';\nimport { Draggable, Droppable } from '@syncfusion/ej2-base';\nimport { getElement } from '@syncfusion/ej2-base';\nimport { addClass, removeClass, closest, matches, detach, select, selectAll, isVisible, append } from '@syncfusion/ej2-base';\nimport { DataManager, Query } from '@syncfusion/ej2-data';\nimport { isNullOrUndefined as isNOU, Touch, getValue, setValue, extend, merge, attributes } from '@syncfusion/ej2-base';\nimport { ListBase } from '@syncfusion/ej2-lists';\nimport { createCheckBox, rippleMouseHandler } from '@syncfusion/ej2-buttons';\nimport { Input } from '@syncfusion/ej2-inputs';\nimport { createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';\nvar ROOT = 'e-treeview';\nvar CONTROL = 'e-control';\nvar COLLAPSIBLE = 'e-icon-collapsible';\nvar EXPANDABLE = 'e-icon-expandable';\nvar LISTITEM = 'e-list-item';\nvar LISTTEXT = 'e-list-text';\nvar PARENTITEM = 'e-list-parent';\nvar HOVER = 'e-hover';\nvar ACTIVE = 'e-active';\nvar LOAD = 'e-icons-spinner';\nvar PROCESS = 'e-process';\nvar ICON = 'e-icons';\nvar TEXTWRAP = 'e-text-content';\nvar INPUT = 'e-input';\nvar INPUTGROUP = 'e-input-group';\nvar TREEINPUT = 'e-tree-input';\nvar EDITING = 'e-editing';\nvar RTL = 'e-rtl';\nvar INTERACTION = 'e-interaction';\nvar DRAGITEM = 'e-drag-item';\nvar DROPPABLE = 'e-droppable';\nvar DRAGGING = 'e-dragging';\nvar SIBLING = 'e-sibling';\nvar DROPIN = 'e-drop-in';\nvar DROPNEXT = 'e-drop-next';\nvar DROPOUT = 'e-drop-out';\nvar NODROP = 'e-no-drop';\nvar FULLROWWRAP = 'e-fullrow-wrap';\nvar FULLROW = 'e-fullrow';\nvar SELECTED = 'e-selected';\nvar EXPANDED = 'e-expanded';\nvar NODECOLLAPSED = 'e-node-collapsed';\nvar DISABLE = 'e-disable';\nvar DROPCOUNT = 'e-drop-count';\nvar CHECK = 'e-check';\nvar INDETERMINATE = 'e-stop';\nvar CHECKBOXWRAP = 'e-checkbox-wrapper';\nvar CHECKBOXFRAME = 'e-frame';\nvar CHECKBOXRIPPLE = 'e-ripple-container';\nvar RIPPLE = 'e-ripple';\nvar RIPPLEELMENT = 'e-ripple-element';\nvar FOCUS = 'e-node-focus';\nvar IMAGE = 'e-list-img';\nvar BIGGER = 'e-bigger';\nvar SMALL = 'e-small';\nvar CHILD = 'e-has-child';\nvar ITEM_ANIMATION_ACTIVE = 'e-animation-active';\nvar DISABLED = 'e-disabled';\nvar treeAriaAttr = {\n treeRole: 'tree',\n itemRole: 'treeitem',\n listRole: 'group',\n itemText: '',\n wrapperRole: ''\n};\n/**\n * Configures the fields to bind to the properties of node in the TreeView component.\n */\nvar FieldsSettings = /** @class */ (function (_super) {\n __extends(FieldsSettings, _super);\n function FieldsSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('child')\n ], FieldsSettings.prototype, \"child\", void 0);\n __decorate([\n Property([])\n ], FieldsSettings.prototype, \"dataSource\", void 0);\n __decorate([\n Property('expanded')\n ], FieldsSettings.prototype, \"expanded\", void 0);\n __decorate([\n Property('hasChildren')\n ], FieldsSettings.prototype, \"hasChildren\", void 0);\n __decorate([\n Property('htmlAttributes')\n ], FieldsSettings.prototype, \"htmlAttributes\", void 0);\n __decorate([\n Property('iconCss')\n ], FieldsSettings.prototype, \"iconCss\", void 0);\n __decorate([\n Property('id')\n ], FieldsSettings.prototype, \"id\", void 0);\n __decorate([\n Property('imageUrl')\n ], FieldsSettings.prototype, \"imageUrl\", void 0);\n __decorate([\n Property('isChecked')\n ], FieldsSettings.prototype, \"isChecked\", void 0);\n __decorate([\n Property('parentID')\n ], FieldsSettings.prototype, \"parentID\", void 0);\n __decorate([\n Property(null)\n ], FieldsSettings.prototype, \"query\", void 0);\n __decorate([\n Property('selected')\n ], FieldsSettings.prototype, \"selected\", void 0);\n __decorate([\n Property(null)\n ], FieldsSettings.prototype, \"tableName\", void 0);\n __decorate([\n Property('text')\n ], FieldsSettings.prototype, \"text\", void 0);\n __decorate([\n Property('tooltip')\n ], FieldsSettings.prototype, \"tooltip\", void 0);\n __decorate([\n Property('navigateUrl')\n ], FieldsSettings.prototype, \"navigateUrl\", void 0);\n return FieldsSettings;\n}(ChildProperty));\nexport { FieldsSettings };\n/**\n * Configures animation settings for the TreeView component.\n */\nvar ActionSettings = /** @class */ (function (_super) {\n __extends(ActionSettings, _super);\n function ActionSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('SlideDown')\n ], ActionSettings.prototype, \"effect\", void 0);\n __decorate([\n Property(400)\n ], ActionSettings.prototype, \"duration\", void 0);\n __decorate([\n Property('linear')\n ], ActionSettings.prototype, \"easing\", void 0);\n return ActionSettings;\n}(ChildProperty));\nexport { ActionSettings };\n/**\n * Configures the animation settings for expanding and collapsing nodes in TreeView.\n */\nvar NodeAnimationSettings = /** @class */ (function (_super) {\n __extends(NodeAnimationSettings, _super);\n function NodeAnimationSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Complex({ effect: 'SlideUp', duration: 400, easing: 'linear' }, ActionSettings)\n ], NodeAnimationSettings.prototype, \"collapse\", void 0);\n __decorate([\n Complex({ effect: 'SlideDown', duration: 400, easing: 'linear' }, ActionSettings)\n ], NodeAnimationSettings.prototype, \"expand\", void 0);\n return NodeAnimationSettings;\n}(ChildProperty));\nexport { NodeAnimationSettings };\n/**\n * The TreeView component is used to represent hierarchical data in a tree like structure with advanced\n * functions to perform edit, drag and drop, selection with check-box, and more.\n * ```html\n *
\n * ```\n * ```typescript\n * let treeObj: TreeView = new TreeView();\n * treeObj.appendTo('#tree');\n * ```\n */\nvar TreeView = /** @class */ (function (_super) {\n __extends(TreeView, _super);\n function TreeView(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.isRefreshed = false;\n _this.preventExpand = false;\n _this.checkedElement = [];\n _this.disableNode = [];\n // eslint-disable-next-line\n _this.validArr = [];\n _this.validNodes = [];\n _this.expandChildren = [];\n _this.isFieldChange = false;\n _this.changeDataSource = false;\n _this.hasTemplate = false;\n _this.mouseDownStatus = false;\n return _this;\n }\n TreeView_1 = TreeView;\n /**\n * Get component name.\n *\n * @returns {string} - returns module name.\n * @private\n */\n TreeView.prototype.getModuleName = function () {\n return 'treeview';\n };\n /**\n * Initialize the event handler\n *\n * @returns {void}\n */\n TreeView.prototype.preRender = function () {\n var _this = this;\n this.checkActionNodes = [];\n this.parentNodeCheck = [];\n this.dragStartAction = false;\n this.isAnimate = false;\n this.keyConfigs = {\n escape: 'escape',\n end: 'end',\n enter: 'enter',\n f2: 'f2',\n home: 'home',\n moveDown: 'downarrow',\n moveLeft: 'leftarrow',\n moveRight: 'rightarrow',\n moveUp: 'uparrow',\n ctrlDown: 'ctrl+downarrow',\n ctrlUp: 'ctrl+uparrow',\n ctrlEnter: 'ctrl+enter',\n ctrlHome: 'ctrl+home',\n ctrlEnd: 'ctrl+end',\n ctrlA: 'ctrl+A',\n shiftDown: 'shift+downarrow',\n shiftUp: 'shift+uparrow',\n shiftEnter: 'shift+enter',\n shiftHome: 'shift+home',\n shiftEnd: 'shift+end',\n csDown: 'ctrl+shift+downarrow',\n csUp: 'ctrl+shift+uparrow',\n csEnter: 'ctrl+shift+enter',\n csHome: 'ctrl+shift+home',\n csEnd: 'ctrl+shift+end',\n space: 'space'\n };\n this.listBaseOption = {\n expandCollapse: true,\n showIcon: true,\n expandIconClass: EXPANDABLE,\n ariaAttributes: treeAriaAttr,\n expandIconPosition: 'Left',\n itemCreated: function (e) {\n _this.beforeNodeCreate(e);\n },\n enableHtmlSanitizer: this.enableHtmlSanitizer,\n itemNavigable: this.fullRowNavigable\n };\n this.updateListProp(this.fields);\n this.aniObj = new Animation({});\n this.treeList = [];\n this.isLoaded = false;\n this.isInitalExpand = false;\n this.expandChildren = [];\n this.index = 0;\n this.setTouchClass();\n if (isNOU(this.selectedNodes)) {\n this.setProperties({ selectedNodes: [] }, true);\n }\n if (isNOU(this.checkedNodes)) {\n this.setProperties({ checkedNodes: [] }, true);\n }\n if (isNOU(this.expandedNodes)) {\n this.setProperties({ expandedNodes: [] }, true);\n }\n else {\n this.isInitalExpand = true;\n }\n };\n /**\n * Get the properties to be maintained in the persisted state.\n *\n * @returns {string} - returns the persisted data\n * @hidden\n */\n TreeView.prototype.getPersistData = function () {\n var keyEntity = ['selectedNodes', 'checkedNodes', 'expandedNodes'];\n return this.addOnPersist(keyEntity);\n };\n /**\n * To Initialize the control rendering\n *\n * @private\n * @returns {void}\n */\n TreeView.prototype.render = function () {\n this.initialRender = true;\n this.initialize();\n this.setDataBinding(false);\n this.setDisabledMode();\n this.setExpandOnType();\n if (!this.disabled) {\n this.setRipple();\n }\n this.wireEditingEvents(this.allowEditing);\n this.setDragAndDrop(this.allowDragAndDrop);\n if (!this.disabled) {\n this.wireEvents();\n }\n this.initialRender = false;\n this.renderComplete();\n };\n TreeView.prototype.initialize = function () {\n this.element.setAttribute('role', 'tree');\n this.element.setAttribute('tabindex', '0');\n this.element.setAttribute('aria-activedescendant', this.element.id + '_active');\n this.setCssClass(null, this.cssClass);\n this.setEnableRtl();\n this.setFullRow(this.fullRowSelect);\n this.nodeTemplateFn = this.templateComplier(this.nodeTemplate);\n };\n TreeView.prototype.setDisabledMode = function () {\n if (this.disabled) {\n this.element.classList.add(DISABLED);\n }\n else {\n this.element.classList.remove(DISABLED);\n }\n };\n TreeView.prototype.setEnableRtl = function () {\n (this.enableRtl ? addClass : removeClass)([this.element], RTL);\n };\n TreeView.prototype.setRipple = function () {\n var tempStr = '.' + FULLROW + ',.' + TEXTWRAP;\n var rippleModel = {\n selector: tempStr,\n ignore: '.' + TEXTWRAP + ' > .' + ICON + ',.' + INPUTGROUP + ',.' + INPUT + ', .' + CHECKBOXWRAP\n };\n this.rippleFn = rippleEffect(this.element, rippleModel);\n var iconModel = {\n selector: '.' + TEXTWRAP + ' > .' + ICON,\n isCenterRipple: true\n };\n this.rippleIconFn = rippleEffect(this.element, iconModel);\n };\n TreeView.prototype.setFullRow = function (isEnabled) {\n (isEnabled ? addClass : removeClass)([this.element], FULLROWWRAP);\n };\n TreeView.prototype.setMultiSelect = function (isEnabled) {\n var firstUl = select('.' + PARENTITEM, this.element);\n if (isEnabled) {\n firstUl.setAttribute('aria-multiselectable', 'true');\n }\n else {\n firstUl.removeAttribute('aria-multiselectable');\n }\n };\n // eslint-disable-next-line\n TreeView.prototype.templateComplier = function (template) {\n if (template) {\n this.hasTemplate = true;\n // eslint-disable-next-line\n var e = void 0;\n this.element.classList.add(INTERACTION);\n try {\n if (document.querySelectorAll(template).length) {\n return compile(document.querySelector(template).innerHTML.trim());\n }\n }\n catch (e) {\n return compile(template);\n }\n }\n this.element.classList.remove(INTERACTION);\n return undefined;\n };\n TreeView.prototype.setDataBinding = function (changeDataSource) {\n var _this = this;\n this.treeList.push('false');\n if (this.fields.dataSource instanceof DataManager) {\n /* eslint-disable */\n this.isOffline = this.fields.dataSource.dataSource.offline;\n if (this.fields.dataSource.ready) {\n this.fields.dataSource.ready.then(function (e) {\n /* eslint-disable */\n _this.isOffline = _this.fields.dataSource.dataSource.offline;\n if (_this.fields.dataSource instanceof DataManager && _this.isOffline) {\n _this.treeList.pop();\n _this.treeData = e.result;\n _this.isNumberTypeId = _this.getType();\n _this.setRootData();\n _this.renderItems(true);\n if (_this.treeList.length === 0 && !_this.isLoaded) {\n _this.finalize();\n }\n }\n }).catch(function (e) {\n _this.trigger('actionFailure', { error: e });\n });\n }\n else {\n this.fields.dataSource.executeQuery(this.getQuery(this.fields)).then(function (e) {\n _this.treeList.pop();\n _this.treeData = e.result;\n _this.isNumberTypeId = _this.getType();\n _this.setRootData();\n if (changeDataSource) {\n _this.changeDataSource = true;\n }\n _this.renderItems(true);\n _this.changeDataSource = false;\n if (_this.treeList.length === 0 && !_this.isLoaded) {\n _this.finalize();\n }\n }).catch(function (e) {\n _this.trigger('actionFailure', { error: e });\n });\n }\n }\n else {\n this.treeList.pop();\n if (isNOU(this.fields.dataSource)) {\n this.rootData = this.treeData = [];\n }\n else {\n this.treeData = JSON.parse(JSON.stringify(this.fields.dataSource));\n this.setRootData();\n }\n this.isNumberTypeId = this.getType();\n this.renderItems(false);\n }\n if (this.treeList.length === 0 && !this.isLoaded) {\n this.finalize();\n }\n };\n TreeView.prototype.getQuery = function (mapper, value) {\n if (value === void 0) { value = null; }\n var columns = [];\n var query;\n if (!mapper.query) {\n query = new Query();\n var prop = this.getActualProperties(mapper);\n for (var _i = 0, _a = Object.keys(prop); _i < _a.length; _i++) {\n var col = _a[_i];\n if (col !== 'dataSource' && col !== 'tableName' && col !== 'child' && !!mapper[col]\n && col !== 'url' && columns.indexOf(mapper[col]) === -1) {\n columns.push(mapper[col]);\n }\n }\n query.select(columns);\n if (prop.hasOwnProperty('tableName')) {\n query.from(mapper.tableName);\n }\n }\n else {\n query = mapper.query.clone();\n }\n ListBase.addSorting(this.sortOrder, mapper.text, query);\n if (!isNOU(value) && !isNOU(mapper.parentID)) {\n query.where(mapper.parentID, 'equal', (this.isNumberTypeId ? parseFloat(value) : value));\n }\n return query;\n };\n TreeView.prototype.getType = function () {\n return this.treeData[0] ? ((typeof getValue(this.fields.id, this.treeData[0]) === 'number') ? true : false) : false;\n };\n TreeView.prototype.setRootData = function () {\n this.dataType = this.getDataType(this.treeData, this.fields);\n if (this.dataType === 1) {\n this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);\n var rootItems = this.getChildNodes(this.treeData, undefined, true);\n if (isNOU(rootItems)) {\n this.rootData = [];\n }\n else {\n this.rootData = rootItems;\n }\n }\n else {\n this.rootData = this.treeData;\n }\n };\n TreeView.prototype.renderItems = function (isSorted) {\n /* eslint-disable */\n this.listBaseOption.ariaAttributes.level = 1;\n var sortedData = this.getSortedData(this.rootData);\n this.ulElement = ListBase.createList(this.createElement, isSorted ? this.rootData : sortedData, this.listBaseOption);\n this.element.appendChild(this.ulElement);\n var rootNodes = this.ulElement.querySelectorAll('.e-list-item');\n if (this.loadOnDemand === false) {\n var i = 0;\n while (i < rootNodes.length) {\n this.renderChildNodes(rootNodes[i], true, null, true);\n i++;\n }\n }\n var parentEle = selectAll('.' + PARENTITEM, this.element);\n if ((parentEle.length === 1 && (rootNodes && rootNodes.length !== 0)) || this.loadOnDemand) {\n this.finalizeNode(this.element);\n }\n this.parentNodeCheck = [];\n this.parentCheckData = [];\n this.updateCheckedStateFromDS();\n if (this.autoCheck && this.showCheckBox && !this.isLoaded) {\n this.updateParentCheckState();\n }\n };\n /**\n * Update the checkedNodes from datasource at initial rendering\n */\n TreeView.prototype.updateCheckedStateFromDS = function (id) {\n this.validNodes = [];\n if (this.treeData && this.showCheckBox) {\n if (this.dataType === 1) {\n var mapper = this.fields;\n var resultData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.isChecked, 'equal', true, false));\n for (var i = 0; i < resultData.length; i++) {\n var resultId = resultData[i][this.fields.id] ? resultData[i][this.fields.id].toString() : null;\n var resultPId = resultData[i][this.fields.parentID] ? resultData[i][this.fields.parentID].toString() : null;\n if (this.checkedNodes.indexOf(resultId) === -1 && !(this.isLoaded)) {\n this.checkedNodes.push(resultId);\n }\n if (resultData[i][this.fields.hasChildren]) {\n var id_1 = resultData[i][this.fields.id];\n var childData = new DataManager(this.treeData).\n executeLocal(new Query().where(mapper.parentID, 'equal', id_1, false));\n for (var child = 0; child < childData.length; child++) {\n var childId = childData[child][this.fields.id] ? childData[child][this.fields.id].toString() : null;\n if (this.checkedNodes.indexOf(childId) === -1 && this.autoCheck) {\n this.checkedNodes.push(childId);\n }\n }\n }\n }\n for (var i = 0; i < this.checkedNodes.length; i++) {\n var mapper_1 = this.fields;\n var checkState = new DataManager(this.treeData).\n executeLocal(new Query().where(mapper_1.id, 'equal', this.checkedNodes[i], true));\n if (checkState[0] && this.autoCheck) {\n this.getCheckedNodeDetails(mapper_1, checkState);\n this.checkIndeterminateState(checkState[0]);\n }\n if (checkState.length > 0) {\n var checkedId = checkState[0][this.fields.id] ? checkState[0][this.fields.id].toString() : null;\n if (this.checkedNodes.indexOf(checkedId) > -1 && this.validNodes.indexOf(checkedId) === -1) {\n this.validNodes.push(checkedId);\n }\n }\n var checkedData = new DataManager(this.treeData).\n executeLocal(new Query().where(mapper_1.parentID, 'equal', this.checkedNodes[i], true));\n for (var index = 0; index < checkedData.length; index++) {\n var checkedId = checkedData[index][this.fields.id] ? checkedData[index][this.fields.id].toString() : null;\n if (this.checkedNodes.indexOf(checkedId) === -1 && this.autoCheck) {\n this.checkedNodes.push(checkedId);\n }\n if (this.checkedNodes.indexOf(checkedId) > -1 && this.validNodes.indexOf(checkedId) === -1) {\n this.validNodes.push(checkedId);\n }\n }\n }\n }\n else if (this.dataType === 2 || (this.fields.dataSource instanceof DataManager &&\n this.isOffline)) {\n for (var index = 0; index < this.treeData.length; index++) {\n var fieldId = this.treeData[index][this.fields.id] ? this.treeData[index][this.fields.id].toString() : '';\n if (this.treeData[index][this.fields.isChecked] && !(this.isLoaded) && this.checkedNodes.indexOf(fieldId) === -1) {\n this.checkedNodes.push(fieldId);\n }\n if (this.checkedNodes.indexOf(fieldId) > -1 && this.validNodes.indexOf(fieldId) === -1) {\n this.validNodes.push(fieldId);\n }\n var childItems = getValue(this.fields.child.toString(), this.treeData[index]);\n if (childItems) {\n this.updateChildCheckState(childItems, this.treeData[index]);\n }\n }\n }\n this.setProperties({ checkedNodes: this.validNodes }, true);\n }\n };\n /**\n * To check whether the list data has sub child and to change the parent check state accordingly\n */\n TreeView.prototype.getCheckedNodeDetails = function (mapper, checkNodes) {\n var id = checkNodes[0][this.fields.parentID] ? checkNodes[0][this.fields.parentID].toString() : null;\n var count = 0;\n var element = this.element.querySelector('[data-uid=\"' + checkNodes[0][this.fields.id] + '\"]');\n var parentEle = this.element.querySelector('[data-uid=\"' + checkNodes[0][this.fields.parentID] + '\"]');\n if (!element && !parentEle) {\n var len = this.parentNodeCheck.length;\n if (this.parentNodeCheck.indexOf(id) === -1) {\n this.parentNodeCheck.push(id);\n }\n var childNodes = this.getChildNodes(this.treeData, id);\n for (var i = 0; i < childNodes.length; i++) {\n var childId = childNodes[i][this.fields.id] ? childNodes[i][this.fields.id].toString() : null;\n if (this.checkedNodes.indexOf(childId) !== -1) {\n count++;\n }\n if (count === childNodes.length && this.checkedNodes.indexOf(id) === -1) {\n this.checkedNodes.push(id);\n }\n }\n var preElement = new DataManager(this.treeData).\n executeLocal(new Query().where(mapper.id, 'equal', id, true));\n this.getCheckedNodeDetails(mapper, preElement);\n }\n else if (parentEle) {\n var check = select('.' + CHECK, parentEle);\n if (!check) {\n this.changeState(parentEle, 'indeterminate', null, true, true);\n }\n }\n };\n /**\n * Update the checkedNodes and parent state when all the child Nodes are in checkedstate at initial rendering\n */\n TreeView.prototype.updateParentCheckState = function () {\n var indeterminate = selectAll('.' + INDETERMINATE, this.element);\n var childCheckedElement;\n for (var i = 0; i < indeterminate.length; i++) {\n var node = closest(indeterminate[i], '.' + LISTITEM);\n var nodeId = node.getAttribute('data-uid').toString();\n if (this.dataType === 1) {\n childCheckedElement = new DataManager(this.treeData).\n executeLocal(new Query().where(this.fields.parentID, 'equal', nodeId, true));\n }\n else {\n childCheckedElement = this.getChildNodes(this.treeData, nodeId);\n }\n var count = 0;\n if (childCheckedElement) {\n for (var j = 0; j < childCheckedElement.length; j++) {\n var childId = childCheckedElement[j][this.fields.id].toString();\n if (this.checkedNodes.indexOf(childId) !== -1) {\n count++;\n }\n }\n if (count === childCheckedElement.length) {\n var nodeCheck = node.getAttribute('data-uid');\n if (this.checkedNodes.indexOf(nodeCheck) === -1) {\n this.checkedNodes.push(nodeCheck);\n }\n this.changeState(node, 'check', null, true, true);\n }\n else if (count === 0 && this.checkedNodes.length === 0) {\n this.changeState(node, 'uncheck', null, true, true);\n }\n }\n }\n };\n /**\n * Change the parent to indeterminate state whenever the child is in checked state which is not rendered in DOM\n */\n TreeView.prototype.checkIndeterminateState = function (data) {\n var element;\n if (this.dataType === 1) {\n element = this.element.querySelector('[data-uid=\"' + data[this.fields.parentID] + '\"]');\n }\n else {\n element = this.element.querySelector('[data-uid=\"' + data[this.fields.id] + '\"]');\n }\n if (element) {\n var ariaChecked = element.querySelector('.' + CHECKBOXWRAP).getAttribute('aria-checked');\n if (ariaChecked !== 'true') {\n this.changeState(element, 'indeterminate', null, true, true);\n }\n }\n else if (this.dataType === 2) {\n var len = this.parentNodeCheck.length;\n if (this.parentNodeCheck.indexOf(data[this.fields.id].toString()) === -1) {\n this.parentNodeCheck.push(data[this.fields.id].toString());\n }\n }\n };\n /**\n * Update the checkedNodes for child and subchild from datasource (hierarchical datasource) at initial rendering\n */\n TreeView.prototype.updateChildCheckState = function (childItems, treeData) {\n var count = 0;\n var checkedParent = treeData[this.fields.id] ? treeData[this.fields.id].toString() : '';\n for (var index = 0; index < childItems.length; index++) {\n var checkedChild = childItems[index][this.fields.id] ? childItems[index][this.fields.id].toString() : '';\n if (childItems[index][this.fields.isChecked] && !(this.isLoaded) && this.checkedNodes.indexOf(checkedChild) === -1) {\n this.checkedNodes.push(checkedChild);\n }\n if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1 && this.autoCheck) {\n this.checkedNodes.push(checkedChild);\n }\n if (this.checkedNodes.indexOf(checkedChild) !== -1 && this.autoCheck) {\n count++;\n }\n if (this.checkedNodes.indexOf(checkedChild) > -1 && this.validNodes.indexOf(checkedChild) === -1) {\n this.validNodes.push(checkedChild);\n }\n var subChildItems = getValue(this.fields.child.toString(), childItems[index]);\n if (subChildItems) {\n this.parentCheckData.push(treeData);\n this.updateChildCheckState(subChildItems, childItems[index]);\n }\n if (count === childItems.length && this.autoCheck && this.checkedNodes.indexOf(checkedParent) === -1) {\n this.checkedNodes.push(checkedParent);\n }\n }\n if (count !== 0 && this.autoCheck) {\n this.checkIndeterminateState(treeData);\n for (var len = 0; len < this.parentCheckData.length; len++) {\n if ((treeData !== this.parentCheckData[len]) && (this.parentCheckData[len])) {\n this.checkIndeterminateState(this.parentCheckData[len]);\n }\n }\n }\n this.parentCheckData = [];\n };\n TreeView.prototype.beforeNodeCreate = function (e) {\n if (this.showCheckBox) {\n var checkboxEle = createCheckBox(this.createElement, true, { cssClass: this.touchClass });\n checkboxEle.setAttribute('role', 'checkbox');\n var icon = select('div.' + ICON, e.item);\n var id = e.item.getAttribute('data-uid');\n e.item.childNodes[0].insertBefore(checkboxEle, e.item.childNodes[0].childNodes[isNOU(icon) ? 0 : 1]);\n var checkValue = getValue(e.fields.isChecked, e.curData);\n if (this.checkedNodes.indexOf(id) > -1) {\n select('.' + CHECKBOXFRAME, checkboxEle).classList.add(CHECK);\n checkboxEle.setAttribute('aria-checked', 'true');\n this.addCheck(e.item);\n }\n else if (!isNOU(checkValue) && checkValue.toString() === 'true') {\n select('.' + CHECKBOXFRAME, checkboxEle).classList.add(CHECK);\n checkboxEle.setAttribute('aria-checked', 'true');\n this.addCheck(e.item);\n }\n else {\n checkboxEle.setAttribute('aria-checked', 'false');\n }\n var frame = select('.' + CHECKBOXFRAME, checkboxEle);\n EventHandler.add(frame, 'mousedown', this.frameMouseHandler, this);\n EventHandler.add(frame, 'mouseup', this.frameMouseHandler, this);\n }\n if (this.fullRowSelect) {\n this.createFullRow(e.item);\n }\n if (this.allowMultiSelection && !e.item.classList.contains(SELECTED)) {\n e.item.setAttribute('aria-selected', 'false');\n }\n var fields = e.fields;\n this.addActionClass(e, fields.selected, SELECTED);\n this.addActionClass(e, fields.expanded, EXPANDED);\n if (!isNOU(this.nodeTemplateFn)) {\n var textEle = e.item.querySelector('.' + LISTTEXT);\n var dataId = e.item.getAttribute('data-uid');\n textEle.innerHTML = '';\n this.renderNodeTemplate(e.curData, textEle, dataId);\n }\n var eventArgs = {\n node: e.item,\n nodeData: e.curData,\n text: e.text,\n };\n if (!this.isRefreshed) {\n this.trigger('drawNode', eventArgs);\n }\n };\n TreeView.prototype.frameMouseHandler = function (e) {\n var rippleSpan = select('.' + CHECKBOXRIPPLE, e.target.parentElement);\n rippleMouseHandler(e, rippleSpan);\n };\n TreeView.prototype.addActionClass = function (e, action, cssClass) {\n var data = e.curData;\n var actionValue = getValue(action, data);\n if (!isNOU(actionValue) && actionValue.toString() !== 'false') {\n e.item.classList.add(cssClass);\n }\n };\n TreeView.prototype.getDataType = function (ds, mapper) {\n if (this.fields.dataSource instanceof DataManager) {\n for (var i = 0; i < ds.length; i++) {\n if (this.isOffline) {\n if ((typeof mapper.child === 'string') && isNOU(getValue(mapper.child, ds[i])) && !isNOU(getValue(mapper.parentID, ds[i]))) {\n return 1;\n }\n }\n else if ((typeof mapper.child === 'string') && isNOU(getValue(mapper.child, ds[i]))) {\n return 1;\n }\n }\n return 2;\n }\n for (var i = 0, len = ds.length; i < len; i++) {\n if ((typeof mapper.child === 'string') && !isNOU(getValue(mapper.child, ds[i]))) {\n return 2;\n }\n if (!isNOU(getValue(mapper.parentID, ds[i])) || !isNOU(getValue(mapper.hasChildren, ds[i]))) {\n return 1;\n }\n }\n return 1;\n };\n TreeView.prototype.getGroupedData = function (dataSource, groupBy) {\n var cusQuery = new Query().group(groupBy);\n var ds = ListBase.getDataSource(dataSource, cusQuery);\n var grpItem = [];\n for (var j = 0; j < ds.length; j++) {\n var itemObj = ds[j].items;\n grpItem.push(itemObj);\n }\n return grpItem;\n };\n TreeView.prototype.getSortedData = function (list) {\n if (list && this.sortOrder !== 'None') {\n list = ListBase.getDataSource(list, ListBase.addSorting(this.sortOrder, this.fields.text));\n }\n return list;\n };\n TreeView.prototype.finalizeNode = function (element) {\n var iNodes = selectAll('.' + IMAGE, element);\n for (var k = 0; k < iNodes.length; k++) {\n iNodes[k].setAttribute('alt', IMAGE);\n }\n if (this.isLoaded) {\n var sNodes = selectAll('.' + SELECTED, element);\n for (var i = 0; i < sNodes.length; i++) {\n this.selectNode(sNodes[i], null);\n break;\n }\n removeClass(sNodes, SELECTED);\n }\n var cNodes = selectAll('.' + LISTITEM + ':not(.' + EXPANDED + ')', element);\n for (var j = 0; j < cNodes.length; j++) {\n var icon = select('div.' + ICON, cNodes[j]);\n if (icon && icon.classList.contains(EXPANDABLE)) {\n this.disableExpandAttr(cNodes[j]);\n }\n }\n var eNodes = selectAll('.' + EXPANDED, element);\n if (!this.isInitalExpand) {\n for (var i = 0; i < eNodes.length; i++) {\n this.renderChildNodes(eNodes[i]);\n }\n }\n removeClass(eNodes, EXPANDED);\n this.updateList();\n if (this.isLoaded) {\n this.updateCheckedProp();\n }\n };\n TreeView.prototype.updateCheckedProp = function () {\n if (this.showCheckBox) {\n var nodes = [].concat([], this.checkedNodes);\n this.setProperties({ checkedNodes: nodes }, true);\n }\n };\n TreeView.prototype.ensureIndeterminate = function () {\n if (this.autoCheck) {\n var liElement = selectAll('li', this.element);\n var ulElement = void 0;\n for (var i = 0; i < liElement.length; i++) {\n if (liElement[i].classList.contains(LISTITEM)) {\n ulElement = select('.' + PARENTITEM, liElement[i]);\n if (ulElement) {\n this.ensureParentCheckState(liElement[i]);\n }\n else {\n this.ensureChildCheckState(liElement[i]);\n }\n }\n }\n }\n else {\n var indeterminate = selectAll('.' + INDETERMINATE, this.element);\n for (var i = 0; i < indeterminate.length; i++) {\n indeterminate[i].classList.remove(INDETERMINATE);\n }\n }\n };\n TreeView.prototype.ensureParentCheckState = function (element) {\n if (!isNOU(element)) {\n if (element.classList.contains(ROOT)) {\n return;\n }\n var ulElement = element;\n if (element.classList.contains(LISTITEM)) {\n ulElement = select('.' + PARENTITEM, element);\n }\n var checkedNodes = selectAll('.' + CHECK, ulElement);\n var indeterminateNodes = selectAll('.' + INDETERMINATE, ulElement);\n var nodes = selectAll('.' + LISTITEM, ulElement);\n var checkBoxEle = element.getElementsByClassName(CHECKBOXWRAP)[0];\n if (nodes.length === checkedNodes.length) {\n this.changeState(checkBoxEle, 'check', null, true, true);\n }\n else if (checkedNodes.length > 0 || indeterminateNodes.length > 0) {\n this.changeState(checkBoxEle, 'indeterminate', null, true, true);\n }\n else if (checkedNodes.length === 0) {\n this.changeState(checkBoxEle, 'uncheck', null, true, true);\n }\n var parentUL = closest(element, '.' + PARENTITEM);\n if (!isNOU(parentUL)) {\n var currentParent = closest(parentUL, '.' + LISTITEM);\n this.ensureParentCheckState(currentParent);\n }\n }\n };\n TreeView.prototype.ensureChildCheckState = function (element, e) {\n if (!isNOU(element)) {\n var childElement = select('.' + PARENTITEM, element);\n var checkBoxes = void 0;\n if (!isNOU(childElement)) {\n checkBoxes = selectAll('.' + CHECKBOXWRAP, childElement);\n var isChecked = element.getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(CHECK);\n var parentCheck = element.getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(INDETERMINATE);\n var childCheck = childElement.querySelectorAll('li');\n var expandState = childElement.parentElement.getAttribute('aria-expanded');\n var checkedState = void 0;\n for (var index = 0; index < checkBoxes.length; index++) {\n var childId = childCheck[index].getAttribute('data-uid');\n if (!isNOU(this.currentLoadData) && !isNOU(getValue(this.fields.isChecked, this.currentLoadData[index]))) {\n checkedState = getValue(this.fields.isChecked, this.currentLoadData[index]) ? 'check' : 'uncheck';\n if (this.ele !== -1) {\n checkedState = isChecked ? 'check' : 'uncheck';\n }\n if ((checkedState === 'uncheck') && (!isUndefined(this.parentNodeCheck) && this.autoCheck\n && this.parentNodeCheck.indexOf(childId) !== -1)) {\n this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(childId), 1);\n checkedState = 'indeterminate';\n }\n }\n else {\n var isNodeChecked = checkBoxes[index].getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(CHECK);\n if (isChecked) {\n checkedState = 'check';\n }\n else if (isNodeChecked && !this.isLoaded) {\n checkedState = 'check';\n }\n else if (this.checkedNodes.indexOf(childId) !== -1 && this.isLoaded && (parentCheck || isChecked)) {\n checkedState = 'check';\n }\n else if (childCheck[index].classList.contains(CHILD) && (!isUndefined(this.parentNodeCheck) && this.autoCheck\n && (isChecked || parentCheck) && this.parentNodeCheck.indexOf(childId) !== -1)) {\n checkedState = 'indeterminate';\n this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(childId), 1);\n }\n else if (this.dataType === 1 && (!isUndefined(this.parentNodeCheck) && this.autoCheck &&\n (isChecked || parentCheck) && this.parentNodeCheck.indexOf(childId) !== -1)) {\n checkedState = 'indeterminate';\n this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(childId), 1);\n }\n else {\n checkedState = 'uncheck';\n }\n }\n this.changeState(checkBoxes[index], checkedState, e, true, true);\n }\n }\n if (this.autoCheck && this.isLoaded) {\n this.updateParentCheckState();\n }\n }\n };\n TreeView.prototype.doCheckBoxAction = function (nodes, doCheck) {\n var li = selectAll('.' + LISTITEM, this.element);\n if (!isNOU(nodes)) {\n for (var len = nodes.length; len >= 0; len--) {\n var liEle = void 0;\n if (nodes.length === 1) {\n liEle = this.getElement(nodes[len - 1]);\n }\n else {\n liEle = this.getElement(nodes[len]);\n }\n if (isNOU(liEle)) {\n var node = void 0;\n node = nodes[len - nodes.length] ? nodes[len - nodes.length].toString() : nodes[len] ? nodes[len].toString() : null;\n if (node !== '' && doCheck && node) {\n this.setValidCheckedNode(node);\n this.dynamicCheckState(node, doCheck);\n }\n else if (this.checkedNodes.indexOf(node) !== -1 && node !== '' && !doCheck) {\n this.checkedNodes.splice(this.checkedNodes.indexOf(node), 1);\n var childItems = this.getChildNodes(this.treeData, node);\n if (childItems) {\n for (var i = 0; i < childItems.length; i++) {\n var id = childItems[i][this.fields.id] ? childItems[i][this.fields.id].toString() : null;\n if (this.checkedNodes.indexOf(id) !== -1) {\n this.checkedNodes.splice(this.checkedNodes.indexOf(id), 1);\n }\n }\n if (this.parentNodeCheck.indexOf(node) !== -1) {\n this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(node), 1);\n }\n }\n if (node) {\n this.dynamicCheckState(node, doCheck);\n }\n this.updateField(this.treeData, this.fields, node, 'isChecked', null);\n }\n continue;\n }\n var checkBox = select('.' + PARENTITEM + ' .' + CHECKBOXWRAP, liEle);\n this.validateCheckNode(checkBox, !doCheck, liEle, null);\n }\n }\n else {\n var checkBoxes = selectAll('.' + CHECKBOXWRAP, this.element);\n if (this.loadOnDemand) {\n for (var index = 0; index < checkBoxes.length; index++) {\n this.updateFieldChecked(checkBoxes[index], doCheck);\n this.changeState(checkBoxes[index], doCheck ? 'check' : 'uncheck', null, null, null, doCheck);\n }\n }\n else {\n for (var index = 0; index < checkBoxes.length; index++) {\n this.updateFieldChecked(checkBoxes[index], doCheck);\n this.changeState(checkBoxes[index], doCheck ? 'check' : 'uncheck');\n }\n }\n }\n if (nodes) {\n for (var j = 0; j < nodes.length; j++) {\n var node = nodes[j] ? nodes[j].toString() : '';\n if (!doCheck) {\n this.updateField(this.treeData, this.fields, node, 'isChecked', null);\n }\n }\n }\n if (this.autoCheck) {\n this.updateParentCheckState();\n }\n };\n TreeView.prototype.updateFieldChecked = function (checkbox, doCheck) {\n var currLi = closest(checkbox, '.' + LISTITEM);\n var id = currLi.getAttribute('data-uid');\n var nodeDetails = this.getNodeData(currLi);\n if (nodeDetails.isChecked === 'true' && !doCheck) {\n this.updateField(this.treeData, this.fields, id, 'isChecked', null);\n }\n };\n /**\n * Changes the parent and child check state while changing the checkedNodes via setmodel\n */\n TreeView.prototype.dynamicCheckState = function (node, doCheck) {\n if (this.dataType === 1) {\n var count = 0;\n var resultId = new DataManager(this.treeData).executeLocal(new Query().where(this.fields.id, 'equal', node, true));\n if (resultId[0]) {\n var id = resultId[0][this.fields.id] ? resultId[0][this.fields.id].toString() : null;\n var parent_1 = resultId[0][this.fields.parentID] ? resultId[0][this.fields.parentID].toString() : null;\n var parentElement = this.element.querySelector('[data-uid=\"' + parent_1 + '\"]');\n var indeterminate = parentElement ? select('.' + INDETERMINATE, parentElement) : null;\n var check = parentElement ? select('.' + CHECK, parentElement) : null;\n var element = this.element.querySelector('[data-uid=\"' + id + '\"]');\n var childNodes = this.getChildNodes(this.treeData, parent_1);\n if (childNodes) {\n for (var i = 0; i < childNodes.length; i++) {\n var childId = childNodes[i][this.fields.id] ? childNodes[i][this.fields.id].toString() : null;\n if (this.checkedNodes.indexOf(childId) !== -1) {\n count++;\n }\n }\n }\n if (this.checkedNodes.indexOf(node) !== -1 && parentElement && (id === node) && this.autoCheck) {\n this.changeState(parentElement, 'indeterminate', null);\n }\n else if (this.checkedNodes.indexOf(node) === -1 && element && (id === node) && !doCheck) {\n this.changeState(element, 'uncheck', null);\n }\n else if (this.checkedNodes.indexOf(node) !== -1 && element && (id === node) && doCheck) {\n this.changeState(element, 'check', null);\n }\n else if (this.checkedNodes.indexOf(node) === -1 && !element && parentElement && (id === node) && this.autoCheck\n && count !== 0) {\n this.changeState(parentElement, 'indeterminate', null);\n }\n else if (this.checkedNodes.indexOf(node) === -1 && !element && parentElement && (id === node) && this.autoCheck\n && count === 0) {\n this.changeState(parentElement, 'uncheck', null);\n }\n else if (!element && !parentElement && (id === node) && this.autoCheck) {\n this.updateIndeterminate(node, doCheck);\n }\n }\n }\n else if (this.dataType === 2 || (this.fields.dataSource instanceof DataManager &&\n this.isOffline)) {\n var id = void 0;\n var parentElement = void 0;\n var check = void 0;\n for (var i = 0; i < this.treeData.length; i++) {\n id = this.treeData[i][this.fields.id] ? this.treeData[i][this.fields.id].toString() : '';\n parentElement = this.element.querySelector('[data-uid=\"' + id + '\"]');\n check = parentElement ? select('.' + CHECK, parentElement) : null;\n if (this.checkedNodes.indexOf(id) === -1 && parentElement && check && !doCheck) {\n this.changeState(parentElement, 'uncheck', null);\n }\n var subChild = getValue(this.fields.child.toString(), this.treeData[i]);\n if (subChild) {\n this.updateChildIndeterminate(subChild, id, node, doCheck, id);\n }\n }\n }\n };\n /**\n * updates the parent and child check state while changing the checkedNodes via setmodel for listData\n */\n TreeView.prototype.updateIndeterminate = function (node, doCheck) {\n var indeterminateData = this.getTreeData(node);\n var count = 0;\n var parent;\n if (this.dataType === 1) {\n parent = indeterminateData[0][this.fields.parentID] ? indeterminateData[0][this.fields.parentID].toString() : null;\n }\n var childNodes = this.getChildNodes(this.treeData, parent);\n if (childNodes) {\n for (var i = 0; i < childNodes.length; i++) {\n var childId = childNodes[i][this.fields.id] ? childNodes[i][this.fields.id].toString() : null;\n if (this.checkedNodes.indexOf(childId) !== -1) {\n count++;\n }\n }\n }\n var parentElement = this.element.querySelector('[data-uid=\"' + parent + '\"]');\n if (parentElement && doCheck) {\n this.changeState(parentElement, 'indeterminate', null);\n }\n else if (!doCheck && parentElement && this.parentNodeCheck.indexOf(parent) === -1 && count !== 0) {\n this.changeState(parentElement, 'indeterminate', null);\n }\n else if (!doCheck && parentElement && this.parentNodeCheck.indexOf(parent) === -1 && count === 0) {\n this.changeState(parentElement, 'uncheck', null);\n }\n else if (!parentElement) {\n if (!doCheck && this.checkedNodes.indexOf(parent) === -1 && this.parentNodeCheck.indexOf(parent) !== -1) {\n this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(parent), 1);\n }\n else if (doCheck && this.checkedNodes.indexOf(parent) === -1 && this.parentNodeCheck.indexOf(parent) === -1) {\n this.parentNodeCheck.push(parent);\n }\n else if (!doCheck && this.checkedNodes.indexOf(parent) !== -1 && this.parentNodeCheck.indexOf(parent) === -1\n && count !== 0) {\n this.parentNodeCheck.push(parent);\n }\n this.updateIndeterminate(parent, doCheck);\n if (this.checkedNodes.indexOf(parent) !== -1 && !doCheck) {\n this.checkedNodes.splice(this.checkedNodes.indexOf(parent), 1);\n }\n }\n };\n /**\n * updates the parent and child check state while changing the checkedNodes via setmodel for hierarchical data\n */\n TreeView.prototype.updateChildIndeterminate = function (subChild, parent, node, doCheck, child) {\n var count = 0;\n for (var j = 0; j < subChild.length; j++) {\n var subId = subChild[j][this.fields.id] ? subChild[j][this.fields.id].toString() : '';\n if (this.checkedNodes.indexOf(subId) !== -1) {\n count++;\n }\n var parentElement = this.element.querySelector('[data-uid=\"' + parent + '\"]');\n var indeterminate = parentElement ? select('.' + INDETERMINATE, parentElement) : null;\n var check = parentElement ? select('.' + CHECK, parentElement) : null;\n var element = this.element.querySelector('[data-uid=\"' + subId + '\"]');\n var childElementCheck = element ? select('.' + CHECK, element) : null;\n if (this.checkedNodes.indexOf(node) !== -1 && parentElement && (subId === node) && this.autoCheck) {\n this.changeState(parentElement, 'indeterminate', null);\n }\n else if (this.checkedNodes.indexOf(node) === -1 && parentElement && !element && (subId === node) && !doCheck) {\n if (this.autoCheck) {\n this.changeState(parentElement, 'uncheck', null);\n }\n else {\n if (count !== 0) {\n this.changeState(parentElement, 'indeterminate', null);\n }\n else {\n this.changeState(parentElement, 'uncheck', null);\n }\n }\n }\n else if (this.checkedNodes.indexOf(node) === -1 && element && (subId === node) && !doCheck) {\n this.changeState(element, 'uncheck', null);\n }\n else if (this.checkedNodes.indexOf(node) === -1 && indeterminate && (subId === node) && this.autoCheck && count === 0\n && !doCheck) {\n indeterminate.classList.remove(INDETERMINATE);\n }\n else if (this.checkedNodes.indexOf(node) === -1 && !element && check && (subId === node) && count === 0) {\n this.changeState(parentElement, 'uncheck', null);\n }\n else if (this.checkedNodes.indexOf(subId) === -1 && element && childElementCheck && count === 0) {\n this.changeState(element, 'uncheck', null);\n }\n else if (!element && !parentElement && (subId === node) || (this.parentNodeCheck.indexOf(parent) !== -1) && this.autoCheck) {\n var childElement = this.element.querySelector('[data-uid=\"' + child + '\"]');\n if (doCheck && count !== 0) {\n this.changeState(childElement, 'indeterminate', null);\n }\n else if (doCheck && count === subChild.length && this.checkedNodes.indexOf(parent) === -1) {\n this.checkedNodes.push(parent);\n }\n else if (!doCheck && count === 0 && this.parentNodeCheck.indexOf(parent) !== -1) {\n this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(parent));\n }\n if (this.parentNodeCheck.indexOf(parent) === -1) {\n this.parentNodeCheck.push(parent);\n }\n }\n var innerChild = getValue(this.fields.child.toString(), subChild[j]);\n if (innerChild) {\n this.updateChildIndeterminate(innerChild, subId, node, doCheck, child);\n }\n }\n };\n TreeView.prototype.changeState = function (wrapper, state, e, isPrevent, isAdd, doCheck) {\n var _this = this;\n var eventArgs;\n var currLi = closest(wrapper, '.' + LISTITEM);\n if (!isPrevent) {\n this.checkActionNodes = [];\n eventArgs = this.getCheckEvent(currLi, state, e);\n this.trigger('nodeChecking', eventArgs, function (observedArgs) {\n if (!observedArgs.cancel) {\n _this.nodeCheckAction(wrapper, state, currLi, observedArgs, e, isPrevent, isAdd, doCheck);\n }\n });\n }\n else {\n this.nodeCheckAction(wrapper, state, currLi, eventArgs, e, isPrevent, isAdd, doCheck);\n }\n };\n TreeView.prototype.nodeCheckAction = function (wrapper, state, currLi, eventArgs, e, isPrevent, isAdd, doCheck) {\n var ariaState;\n var frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME)[0];\n if (state === 'check' && !frameSpan.classList.contains(CHECK)) {\n frameSpan.classList.remove(INDETERMINATE);\n frameSpan.classList.add(CHECK);\n this.addCheck(currLi);\n ariaState = 'true';\n }\n else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK) || frameSpan.classList.contains(INDETERMINATE))) {\n removeClass([frameSpan], [CHECK, INDETERMINATE]);\n this.removeCheck(currLi);\n ariaState = 'false';\n }\n else if (state === 'indeterminate' && this.autoCheck) {\n frameSpan.classList.remove(CHECK);\n frameSpan.classList.add(INDETERMINATE);\n this.removeCheck(currLi);\n ariaState = 'mixed';\n }\n ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;\n if (!isNOU(ariaState)) {\n wrapper.setAttribute('aria-checked', ariaState);\n }\n if (isAdd) {\n var data = [].concat([], this.checkActionNodes);\n eventArgs = this.getCheckEvent(currLi, state, e);\n if (isUndefined(isPrevent)) {\n eventArgs.data = data;\n }\n }\n if (doCheck !== undefined) {\n this.ensureStateChange(currLi, doCheck);\n }\n if (!isPrevent) {\n if (!isNOU(ariaState)) {\n wrapper.setAttribute('aria-checked', ariaState);\n eventArgs.data[0].checked = ariaState;\n this.trigger('nodeChecked', eventArgs);\n this.checkActionNodes = [];\n }\n }\n };\n TreeView.prototype.addCheck = function (liEle) {\n var id = liEle.getAttribute('data-uid');\n if (!isNOU(id) && this.checkedNodes.indexOf(id) === -1) {\n this.checkedNodes.push(id);\n }\n };\n TreeView.prototype.removeCheck = function (liEle) {\n var index = this.checkedNodes.indexOf(liEle.getAttribute('data-uid'));\n if (index > -1) {\n this.checkedNodes.splice(index, 1);\n }\n };\n TreeView.prototype.getCheckEvent = function (currLi, action, e) {\n this.checkActionNodes.push(this.getNodeData(currLi));\n var nodeData = this.checkActionNodes;\n return { action: action, cancel: false, isInteracted: isNOU(e) ? false : true, node: currLi, data: nodeData };\n };\n TreeView.prototype.finalize = function () {\n var firstUl = select('.' + PARENTITEM, this.element);\n if (!isNullOrUndefined(firstUl)) {\n firstUl.setAttribute('role', treeAriaAttr.treeRole);\n this.setMultiSelect(this.allowMultiSelection);\n var firstNode = select('.' + LISTITEM, this.element);\n if (firstNode) {\n addClass([firstNode], FOCUS);\n this.updateIdAttr(null, firstNode);\n }\n this.renderReactTemplates();\n this.hasPid = this.rootData[0] ? this.rootData[0].hasOwnProperty(this.fields.parentID) : false;\n this.doExpandAction();\n }\n };\n TreeView.prototype.doExpandAction = function () {\n var eUids = this.expandedNodes;\n if (this.isInitalExpand && eUids.length > 0) {\n this.setProperties({ expandedNodes: [] }, true);\n /* eslint-disable */\n if (this.fields.dataSource instanceof DataManager) {\n this.expandGivenNodes(eUids);\n }\n else {\n for (var i = 0; i < eUids.length; i++) {\n var eNode = select('[data-uid=\"' + eUids[i] + '\"]', this.element);\n if (!isNOU(eNode)) {\n var icon = select('.' + EXPANDABLE, select('.' + TEXTWRAP, eNode));\n if (!isNOU(icon)) {\n this.expandAction(eNode, icon, null);\n }\n }\n else {\n if (eUids[i] && this.expandChildren.indexOf(eUids[i]) === -1) {\n this.expandChildren.push(eUids[i].toString());\n }\n continue;\n }\n }\n this.afterFinalized();\n }\n }\n else {\n this.afterFinalized();\n }\n };\n TreeView.prototype.expandGivenNodes = function (arr) {\n var proxy = this;\n this.expandCallback(arr[this.index], function () {\n proxy.index++;\n if (proxy.index < arr.length) {\n proxy.expandGivenNodes(arr);\n }\n else {\n proxy.afterFinalized();\n }\n });\n };\n TreeView.prototype.expandCallback = function (eUid, callback) {\n var eNode = select('[data-uid=\"' + eUid + '\"]', this.element);\n if (!isNOU(eNode)) {\n var icon = select('.' + EXPANDABLE, select('.' + TEXTWRAP, eNode));\n if (!isNOU(icon)) {\n this.expandAction(eNode, icon, null, false, callback);\n }\n else {\n callback();\n }\n }\n else {\n callback();\n }\n };\n TreeView.prototype.afterFinalized = function () {\n this.doSelectionAction();\n this.updateCheckedProp();\n this.isAnimate = true;\n this.isInitalExpand = false;\n if (!this.isLoaded || this.isFieldChange) {\n var eventArgs = { data: this.treeData };\n this.trigger('dataBound', eventArgs);\n }\n this.isLoaded = true;\n };\n TreeView.prototype.doSelectionAction = function () {\n var sNodes = selectAll('.' + SELECTED, this.element);\n var sUids = this.selectedNodes;\n if (sUids.length > 0) {\n this.setProperties({ selectedNodes: [] }, true);\n for (var i = 0; i < sUids.length; i++) {\n var sNode = select('[data-uid=\"' + sUids[i] + '\"]', this.element);\n if (sNode && !(sNode.classList.contains('e-active'))) {\n this.selectNode(sNode, null, true);\n }\n else {\n this.selectedNodes.push(sUids[i]);\n }\n if (!this.allowMultiSelection) {\n break;\n }\n }\n }\n else {\n this.selectGivenNodes(sNodes);\n }\n removeClass(sNodes, SELECTED);\n };\n TreeView.prototype.selectGivenNodes = function (sNodes) {\n for (var i = 0; i < sNodes.length; i++) {\n if (!sNodes[i].classList.contains('e-disable')) {\n this.selectNode(sNodes[i], null, true);\n }\n if (!this.allowMultiSelection) {\n break;\n }\n }\n };\n TreeView.prototype.clickHandler = function (event) {\n var target = event.originalEvent.target;\n EventHandler.remove(this.element, 'contextmenu', this.preventContextMenu);\n if (!target || this.dragStartAction) {\n return;\n }\n else {\n var classList = target.classList;\n var li = closest(target, '.' + LISTITEM);\n if (!li) {\n return;\n }\n else if (event.originalEvent.which !== 3) {\n var rippleElement = select('.' + RIPPLEELMENT, li);\n var rippleIcons = select('.' + ICON, li);\n this.removeHover();\n this.setFocusElement(li);\n if (this.showCheckBox && !li.classList.contains('e-disable')) {\n var checkWrapper = closest(target, '.' + CHECKBOXWRAP);\n if (!isNOU(checkWrapper)) {\n var checkElement = select('.' + CHECKBOXFRAME, checkWrapper);\n this.validateCheckNode(checkWrapper, checkElement.classList.contains(CHECK), li, event.originalEvent);\n this.triggerClickEvent(event.originalEvent, li);\n return;\n }\n }\n if (classList.contains(EXPANDABLE)) {\n this.expandAction(li, target, event);\n }\n else if (classList.contains(COLLAPSIBLE)) {\n this.collapseNode(li, target, event);\n }\n else if (rippleElement && rippleIcons) {\n if (rippleIcons.classList.contains(RIPPLE) && rippleIcons.classList.contains(EXPANDABLE)) {\n this.expandAction(li, rippleIcons, event);\n }\n else if (rippleIcons.classList.contains(RIPPLE) && rippleIcons.classList.contains(COLLAPSIBLE)) {\n this.collapseNode(li, rippleIcons, event);\n }\n else if (!classList.contains(PARENTITEM) && !classList.contains(LISTITEM)) {\n this.toggleSelect(li, event.originalEvent, false);\n }\n }\n else {\n if (!classList.contains(PARENTITEM) && !classList.contains(LISTITEM)) {\n this.toggleSelect(li, event.originalEvent, false);\n }\n }\n }\n this.triggerClickEvent(event.originalEvent, li);\n }\n };\n TreeView.prototype.nodeCheckedEvent = function (wrapper, isCheck, e) {\n var currLi = closest(wrapper, '.' + LISTITEM);\n var eventArgs = this.getCheckEvent(wrapper, isCheck ? 'uncheck' : 'check', e);\n eventArgs.data = eventArgs.data.splice(0, eventArgs.data.length - 1);\n this.trigger('nodeChecked', eventArgs);\n };\n TreeView.prototype.triggerClickEvent = function (e, li) {\n var eventArgs = {\n event: e,\n node: li,\n };\n this.trigger('nodeClicked', eventArgs);\n };\n TreeView.prototype.expandNode = function (currLi, icon, loaded) {\n var _this = this;\n this.renderReactTemplates();\n if (icon.classList.contains(LOAD)) {\n this.hideSpinner(icon);\n }\n if (!this.initialRender) {\n icon.classList.add('interaction');\n }\n if (loaded !== true || (loaded === true && currLi.classList.contains('e-expanded'))) {\n if (this.preventExpand !== true) {\n removeClass([icon], EXPANDABLE);\n addClass([icon], COLLAPSIBLE);\n var start_1 = 0;\n var end_1 = 0;\n var proxy_1 = this;\n var ul_1 = select('.' + PARENTITEM, currLi);\n var liEle_1 = currLi;\n this.setHeight(liEle_1, ul_1);\n var activeElement_1 = select('.' + LISTITEM + '.' + ACTIVE, currLi);\n if (this.isAnimate && !this.isRefreshed) {\n this.aniObj.animate(ul_1, {\n name: this.animation.expand.effect,\n duration: this.animation.expand.duration,\n timingFunction: this.animation.expand.easing,\n begin: function (args) {\n liEle_1.style.overflow = 'hidden';\n if (!isNullOrUndefined(activeElement_1) && activeElement_1 instanceof HTMLElement) {\n activeElement_1.classList.add(ITEM_ANIMATION_ACTIVE);\n }\n start_1 = liEle_1.offsetHeight;\n end_1 = select('.' + TEXTWRAP, currLi).offsetHeight;\n },\n progress: function (args) {\n args.element.style.display = 'block';\n proxy_1.animateHeight(args, start_1, end_1);\n },\n end: function (args) {\n args.element.style.display = 'block';\n if (!isNullOrUndefined(activeElement_1) && activeElement_1 instanceof HTMLElement) {\n activeElement_1.classList.remove(ITEM_ANIMATION_ACTIVE);\n }\n _this.expandedNode(liEle_1, ul_1, icon);\n }\n });\n }\n else {\n this.expandedNode(liEle_1, ul_1, icon);\n }\n }\n }\n else {\n var ul = select('.' + PARENTITEM, currLi);\n ul.style.display = 'none';\n if (this.fields.dataSource instanceof DataManager === true) {\n this.preventExpand = false;\n }\n }\n if (this.initialRender) {\n icon.classList.add('interaction');\n }\n };\n TreeView.prototype.expandedNode = function (currLi, ul, icon) {\n ul.style.display = 'block';\n currLi.style.display = 'block';\n currLi.style.overflow = '';\n currLi.style.height = '';\n removeClass([icon], PROCESS);\n this.addExpand(currLi);\n if (this.isLoaded && this.expandArgs && !this.isRefreshed) {\n this.expandArgs = this.getExpandEvent(currLi, null);\n this.trigger('nodeExpanded', this.expandArgs);\n }\n };\n TreeView.prototype.addExpand = function (liEle) {\n liEle.setAttribute('aria-expanded', 'true');\n removeClass([liEle], NODECOLLAPSED);\n var id = liEle.getAttribute('data-uid');\n if (!isNOU(id) && this.expandedNodes.indexOf(id) === -1) {\n this.expandedNodes.push(id);\n }\n };\n TreeView.prototype.collapseNode = function (currLi, icon, e) {\n var _this = this;\n if (icon.classList.contains(PROCESS)) {\n return;\n }\n else {\n addClass([icon], PROCESS);\n }\n var colArgs;\n if (this.isLoaded) {\n colArgs = this.getExpandEvent(currLi, e);\n this.trigger('nodeCollapsing', colArgs, function (observedArgs) {\n if (observedArgs.cancel) {\n removeClass([icon], PROCESS);\n }\n else {\n _this.nodeCollapseAction(currLi, icon, observedArgs);\n }\n });\n }\n else {\n this.nodeCollapseAction(currLi, icon, colArgs);\n }\n };\n TreeView.prototype.nodeCollapseAction = function (currLi, icon, colArgs) {\n var _this = this;\n removeClass([icon], COLLAPSIBLE);\n addClass([icon], EXPANDABLE);\n var start = 0;\n var end = 0;\n var proxy = this;\n var ul = select('.' + PARENTITEM, currLi);\n var liEle = currLi;\n var activeElement = select('.' + LISTITEM + '.' + ACTIVE, currLi);\n if (this.isAnimate) {\n this.aniObj.animate(ul, {\n name: this.animation.collapse.effect,\n duration: this.animation.collapse.duration,\n timingFunction: this.animation.collapse.easing,\n begin: function (args) {\n liEle.style.overflow = 'hidden';\n if (!isNullOrUndefined(activeElement) && activeElement instanceof HTMLElement) {\n activeElement.classList.add(ITEM_ANIMATION_ACTIVE);\n }\n start = select('.' + TEXTWRAP, currLi).offsetHeight;\n end = liEle.offsetHeight;\n },\n progress: function (args) {\n proxy.animateHeight(args, start, end);\n },\n end: function (args) {\n args.element.style.display = 'none';\n if (!isNullOrUndefined(activeElement) && activeElement instanceof HTMLElement) {\n activeElement.classList.remove(ITEM_ANIMATION_ACTIVE);\n }\n _this.collapsedNode(liEle, ul, icon, colArgs);\n }\n });\n }\n else {\n this.collapsedNode(liEle, ul, icon, colArgs);\n }\n };\n TreeView.prototype.collapsedNode = function (liEle, ul, icon, colArgs) {\n ul.style.display = 'none';\n liEle.style.overflow = '';\n liEle.style.height = '';\n removeClass([icon], PROCESS);\n this.removeExpand(liEle);\n if (this.isLoaded) {\n colArgs = this.getExpandEvent(liEle, null);\n this.trigger('nodeCollapsed', colArgs);\n }\n };\n TreeView.prototype.removeExpand = function (liEle, toRemove) {\n if (toRemove) {\n liEle.removeAttribute('aria-expanded');\n }\n else {\n this.disableExpandAttr(liEle);\n }\n var index = this.expandedNodes.indexOf(liEle.getAttribute('data-uid'));\n if (index > -1) {\n this.expandedNodes.splice(index, 1);\n }\n };\n TreeView.prototype.disableExpandAttr = function (liEle) {\n liEle.setAttribute('aria-expanded', 'false');\n addClass([liEle], NODECOLLAPSED);\n };\n TreeView.prototype.setHeight = function (currLi, ul) {\n ul.style.display = 'block';\n ul.style.visibility = 'hidden';\n currLi.style.height = currLi.offsetHeight + 'px';\n ul.style.display = 'none';\n ul.style.visibility = '';\n };\n TreeView.prototype.animateHeight = function (args, start, end) {\n var remaining = (args.duration - args.timeStamp) / args.duration;\n var currentHeight = (end - start) * remaining + start;\n args.element.parentElement.style.height = currentHeight + 'px';\n };\n TreeView.prototype.renderChildNodes = function (parentLi, expandChild, callback, loaded) {\n var _this = this;\n var eicon = select('div.' + ICON, parentLi);\n if (isNOU(eicon)) {\n return;\n }\n this.showSpinner(eicon);\n var childItems;\n /* eslint-disable */\n if (this.fields.dataSource instanceof DataManager) {\n var level = this.parents(parentLi, '.' + PARENTITEM).length;\n var mapper_2 = this.getChildFields(this.fields, level, 1);\n if (isNOU(mapper_2) || isNOU(mapper_2.dataSource)) {\n detach(eicon);\n this.removeExpand(parentLi, true);\n return;\n }\n this.treeList.push('false');\n if (this.fields.dataSource instanceof DataManager && this.isOffline) {\n this.treeList.pop();\n childItems = this.getChildNodes(this.treeData, parentLi.getAttribute('data-uid'));\n this.loadChild(childItems, mapper_2, eicon, parentLi, expandChild, callback, loaded);\n }\n else {\n mapper_2.dataSource.executeQuery(this.getQuery(mapper_2, parentLi.getAttribute('data-uid'))).then(function (e) {\n _this.treeList.pop();\n childItems = e.result;\n if (_this.dataType === 1) {\n _this.dataType = 2;\n }\n _this.loadChild(childItems, mapper_2, eicon, parentLi, expandChild, callback, loaded);\n }).catch(function (e) {\n _this.trigger('actionFailure', { error: e });\n });\n }\n }\n else {\n childItems = this.getChildNodes(this.treeData, parentLi.getAttribute('data-uid'));\n this.currentLoadData = this.getSortedData(childItems);\n if (isNOU(childItems) || childItems.length === 0) {\n detach(eicon);\n this.removeExpand(parentLi, true);\n return;\n }\n else {\n this.listBaseOption.ariaAttributes.level = parseFloat(parentLi.getAttribute('aria-level')) + 1;\n parentLi.appendChild(ListBase.createList(this.createElement, this.currentLoadData, this.listBaseOption));\n this.expandNode(parentLi, eicon, loaded);\n this.setSelectionForChildNodes(childItems);\n this.ensureCheckNode(parentLi);\n this.finalizeNode(parentLi);\n this.disableTreeNodes(childItems);\n this.renderSubChild(parentLi, expandChild, loaded);\n }\n }\n };\n TreeView.prototype.loadChild = function (childItems, mapper, eicon, parentLi, expandChild, callback, loaded) {\n this.currentLoadData = childItems;\n if (isNOU(childItems) || childItems.length === 0) {\n detach(eicon);\n this.removeExpand(parentLi, true);\n }\n else {\n this.updateListProp(mapper);\n if (this.fields.dataSource instanceof DataManager && !this.isOffline) {\n var id = parentLi.getAttribute('data-uid');\n var nodeData = this.getNodeObject(id);\n setValue('child', childItems, nodeData);\n }\n this.listBaseOption.ariaAttributes.level = parseFloat(parentLi.getAttribute('aria-level')) + 1;\n parentLi.appendChild(ListBase.createList(this.createElement, childItems, this.listBaseOption));\n this.expandNode(parentLi, eicon, loaded);\n this.setSelectionForChildNodes(childItems);\n this.ensureCheckNode(parentLi);\n this.finalizeNode(parentLi);\n this.disableTreeNodes(childItems);\n this.renderSubChild(parentLi, expandChild, loaded);\n }\n if (callback) {\n callback();\n }\n if (this.treeList.length === 0 && !this.isLoaded) {\n this.finalize();\n }\n };\n TreeView.prototype.disableTreeNodes = function (childItems) {\n var i = 0;\n while (i < childItems.length) {\n var id = childItems[i][this.fields.id] ? childItems[i][this.fields.id].toString() : null;\n if (this.disableNode !== undefined && this.disableNode.indexOf(id) !== -1) {\n this.doDisableAction([id]);\n }\n i++;\n }\n };\n /**\n * Sets the child Item in selectedState while rendering the child node\n */\n TreeView.prototype.setSelectionForChildNodes = function (nodes) {\n var i;\n for (i = 0; i < nodes.length; i++) {\n var id = nodes[i][this.fields.id] ? nodes[i][this.fields.id].toString() : null;\n if (this.selectedNodes !== undefined && this.selectedNodes.indexOf(id) !== -1) {\n this.doSelectionAction();\n }\n }\n };\n TreeView.prototype.ensureCheckNode = function (element) {\n if (this.showCheckBox) {\n this.ele = (this.checkedElement) ? this.checkedElement.indexOf(element.getAttribute('data-uid')) : null;\n if (this.autoCheck) {\n this.ensureChildCheckState(element);\n this.ensureParentCheckState(element);\n }\n }\n this.currentLoadData = null;\n };\n TreeView.prototype.getFields = function (mapper, nodeLevel, dataLevel) {\n if (nodeLevel === dataLevel) {\n return mapper;\n }\n else {\n return this.getFields(this.getChildMapper(mapper), nodeLevel, dataLevel + 1);\n }\n };\n TreeView.prototype.getChildFields = function (mapper, nodeLevel, dataLevel) {\n var childData;\n if (nodeLevel === dataLevel) {\n return this.getChildMapper(mapper);\n }\n else {\n return this.getChildFields(this.getChildMapper(mapper), nodeLevel, dataLevel + 1);\n }\n };\n TreeView.prototype.getChildMapper = function (mapper) {\n return (typeof mapper.child === 'string' || isNOU(mapper.child)) ? mapper : mapper.child;\n };\n TreeView.prototype.getChildNodes = function (obj, parentId, isRoot) {\n if (isRoot === void 0) { isRoot = false; }\n var childNodes;\n if (isNOU(obj)) {\n return childNodes;\n }\n else if (this.dataType === 1) {\n return this.getChildGroup(this.groupedData, parentId, isRoot);\n }\n else {\n if (typeof this.fields.child === 'string') {\n for (var i = 0, objlen = obj.length; i < objlen; i++) {\n var dataId = getValue(this.fields.id, obj[i]);\n if (dataId && dataId.toString() === parentId) {\n return getValue(this.fields.child, obj[i]);\n }\n else if (!isNOU(getValue(this.fields.child, obj[i]))) {\n childNodes = this.getChildNodes(getValue(this.fields.child, obj[i]), parentId);\n if (childNodes !== undefined) {\n break;\n }\n }\n }\n }\n }\n return childNodes;\n };\n TreeView.prototype.getChildGroup = function (data, parentId, isRoot) {\n var childNodes;\n if (isNOU(data)) {\n return childNodes;\n }\n for (var i = 0, objlen = data.length; i < objlen; i++) {\n if (!isNOU(data[i][0]) && !isNOU(getValue(this.fields.parentID, data[i][0]))) {\n if (getValue(this.fields.parentID, data[i][0]).toString() === parentId) {\n return data[i];\n }\n }\n else if (isRoot) {\n return data[i];\n }\n else {\n return [];\n }\n }\n return childNodes;\n };\n TreeView.prototype.renderSubChild = function (element, expandChild, loaded) {\n if (expandChild) {\n var cIcons = selectAll('.' + EXPANDABLE, element);\n for (var i = 0, len = cIcons.length; i < len; i++) {\n var icon = cIcons[i];\n if (element.querySelector('.e-icons') !== cIcons[i]) {\n var curLi = closest(icon, '.' + LISTITEM);\n this.expandArgs = this.getExpandEvent(curLi, null);\n if (loaded !== true) {\n this.trigger('nodeExpanding', this.expandArgs);\n }\n this.renderChildNodes(curLi, expandChild, null, loaded);\n }\n }\n }\n };\n TreeView.prototype.toggleSelect = function (li, e, multiSelect) {\n if (!li.classList.contains('e-disable')) {\n if (this.allowMultiSelection && ((e && e.ctrlKey) || multiSelect) && this.isActive(li)) {\n this.unselectNode(li, e);\n }\n else {\n this.selectNode(li, e, multiSelect);\n }\n }\n };\n TreeView.prototype.isActive = function (li) {\n return li.classList.contains(ACTIVE) ? true : false;\n };\n TreeView.prototype.selectNode = function (li, e, multiSelect) {\n var _this = this;\n if (isNOU(li) || (!this.allowMultiSelection && this.isActive(li) && !isNOU(e))) {\n this.setFocusElement(li);\n return;\n }\n var eventArgs;\n if (this.isLoaded) {\n eventArgs = this.getSelectEvent(li, 'select', e);\n this.trigger('nodeSelecting', eventArgs, function (observedArgs) {\n if (!observedArgs.cancel) {\n _this.nodeSelectAction(li, e, observedArgs, multiSelect);\n }\n });\n }\n else {\n this.nodeSelectAction(li, e, eventArgs, multiSelect);\n }\n };\n TreeView.prototype.nodeSelectAction = function (li, e, eventArgs, multiSelect) {\n if (!this.allowMultiSelection || (!multiSelect && (!e || (e && !e.ctrlKey)))) {\n this.removeSelectAll();\n }\n if (this.allowMultiSelection && e && e.shiftKey) {\n if (!this.startNode) {\n this.startNode = li;\n }\n var startIndex = this.liList.indexOf(this.startNode);\n var endIndex = this.liList.indexOf(li);\n if (startIndex > endIndex) {\n var temp = startIndex;\n startIndex = endIndex;\n endIndex = temp;\n }\n for (var i = startIndex; i <= endIndex; i++) {\n var currNode = this.liList[i];\n if (isVisible(currNode) && !currNode.classList.contains('e-disable')) {\n this.addSelect(currNode);\n }\n }\n }\n else {\n this.startNode = li;\n this.addSelect(li);\n }\n this.setFocusElement(li);\n if (this.isLoaded) {\n eventArgs.nodeData = this.getNodeData(li);\n this.trigger('nodeSelected', eventArgs);\n }\n };\n TreeView.prototype.unselectNode = function (li, e) {\n var _this = this;\n var eventArgs;\n if (this.isLoaded) {\n eventArgs = this.getSelectEvent(li, 'un-select', e);\n this.trigger('nodeSelecting', eventArgs, function (observedArgs) {\n if (!observedArgs.cancel) {\n _this.nodeUnselectAction(li, observedArgs);\n }\n });\n }\n else {\n this.nodeUnselectAction(li, eventArgs);\n }\n };\n TreeView.prototype.nodeUnselectAction = function (li, eventArgs) {\n this.removeSelect(li);\n this.setFocusElement(li);\n if (this.isLoaded) {\n eventArgs.nodeData = this.getNodeData(li);\n this.trigger('nodeSelected', eventArgs);\n }\n };\n TreeView.prototype.setFocusElement = function (li) {\n if (!isNOU(li)) {\n var focusedNode = this.getFocusedNode();\n if (focusedNode) {\n removeClass([focusedNode], FOCUS);\n }\n addClass([li], FOCUS);\n this.updateIdAttr(focusedNode, li);\n }\n };\n TreeView.prototype.addSelect = function (liEle) {\n liEle.setAttribute('aria-selected', 'true');\n addClass([liEle], ACTIVE);\n var id = liEle.getAttribute('data-uid');\n if (!isNOU(id) && this.selectedNodes.indexOf(id) === -1) {\n this.selectedNodes.push(id);\n }\n };\n TreeView.prototype.removeSelect = function (liEle) {\n if (this.allowMultiSelection) {\n liEle.setAttribute('aria-selected', 'false');\n }\n else {\n liEle.removeAttribute('aria-selected');\n }\n removeClass([liEle], ACTIVE);\n var index = this.selectedNodes.indexOf(liEle.getAttribute('data-uid'));\n if (index > -1) {\n this.selectedNodes.splice(index, 1);\n }\n };\n TreeView.prototype.removeSelectAll = function () {\n var selectedLI = this.element.querySelectorAll('.' + ACTIVE);\n for (var _i = 0, selectedLI_1 = selectedLI; _i < selectedLI_1.length; _i++) {\n var ele = selectedLI_1[_i];\n if (this.allowMultiSelection) {\n ele.setAttribute('aria-selected', 'false');\n }\n else {\n ele.removeAttribute('aria-selected');\n }\n }\n removeClass(selectedLI, ACTIVE);\n this.setProperties({ selectedNodes: [] }, true);\n };\n TreeView.prototype.getSelectEvent = function (currLi, action, e) {\n var nodeData = this.getNodeData(currLi);\n return { action: action, cancel: false, isInteracted: isNOU(e) ? false : true, node: currLi, nodeData: nodeData };\n };\n TreeView.prototype.setExpandOnType = function () {\n this.expandOnType = (this.expandOn === 'Auto') ? (Browser.isDevice ? 'Click' : 'DblClick') : this.expandOn;\n };\n TreeView.prototype.expandHandler = function (e) {\n var target = e.originalEvent.target;\n if (!target || target.classList.contains(INPUT) || target.classList.contains(ROOT) ||\n target.classList.contains(PARENTITEM) || target.classList.contains(LISTITEM) ||\n target.classList.contains(ICON) || this.showCheckBox && closest(target, '.' + CHECKBOXWRAP)) {\n return;\n }\n else {\n this.expandCollapseAction(closest(target, '.' + LISTITEM), e);\n }\n };\n TreeView.prototype.expandCollapseAction = function (currLi, e) {\n var icon = select('div.' + ICON, currLi);\n if (!icon || icon.classList.contains(PROCESS)) {\n return;\n }\n else {\n var classList = icon.classList;\n if (classList.contains(EXPANDABLE)) {\n this.expandAction(currLi, icon, e);\n }\n else if (classList.contains(COLLAPSIBLE)) {\n this.collapseNode(currLi, icon, e);\n }\n }\n };\n TreeView.prototype.expandAction = function (currLi, icon, e, expandChild, callback) {\n var _this = this;\n if (icon.classList.contains(PROCESS)) {\n return;\n }\n else {\n addClass([icon], PROCESS);\n }\n if (this.isLoaded && !this.isRefreshed) {\n this.expandArgs = this.getExpandEvent(currLi, e);\n this.trigger('nodeExpanding', this.expandArgs, function (observedArgs) {\n if (observedArgs.cancel) {\n removeClass([icon], PROCESS);\n }\n else {\n _this.nodeExpandAction(currLi, icon, expandChild, callback);\n }\n });\n }\n else {\n this.nodeExpandAction(currLi, icon, expandChild, callback);\n }\n };\n TreeView.prototype.nodeExpandAction = function (currLi, icon, expandChild, callback) {\n var ul = select('.' + PARENTITEM, currLi);\n if (ul && ul.nodeName === 'UL') {\n this.expandNode(currLi, icon);\n }\n else {\n this.renderChildNodes(currLi, expandChild, callback);\n var liEles = selectAll('.' + LISTITEM, currLi);\n for (var i = 0; i < liEles.length; i++) {\n var id = this.getId(liEles[i]);\n if (this.expandChildren.indexOf(id) !== -1 && this.expandChildren !== undefined) {\n var icon_1 = select('.' + EXPANDABLE, select('.' + TEXTWRAP, liEles[i]));\n if (!isNOU(icon_1)) {\n this.expandAction(liEles[i], icon_1, null);\n }\n this.expandChildren.splice(this.expandChildren.indexOf(id), 1);\n }\n }\n }\n };\n TreeView.prototype.keyActionHandler = function (e) {\n var _this = this;\n var target = e.target;\n var focusedNode = this.getFocusedNode();\n if (target && target.classList.contains(INPUT)) {\n var inpEle = target;\n if (e.action === 'enter') {\n inpEle.blur();\n this.element.focus();\n addClass([focusedNode], HOVER);\n }\n else if (e.action === 'escape') {\n inpEle.value = this.oldText;\n inpEle.blur();\n this.element.focus();\n addClass([focusedNode], HOVER);\n }\n return;\n }\n e.preventDefault();\n var eventArgs = {\n cancel: false,\n event: e,\n node: focusedNode,\n };\n this.trigger('keyPress', eventArgs, function (observedArgs) {\n if (!observedArgs.cancel) {\n switch (e.action) {\n case 'space':\n if (_this.showCheckBox) {\n _this.checkNode(e);\n }\n break;\n case 'moveRight':\n _this.openNode(_this.enableRtl ? false : true, e);\n break;\n case 'moveLeft':\n _this.openNode(_this.enableRtl ? true : false, e);\n break;\n case 'shiftDown':\n _this.shiftKeySelect(true, e);\n break;\n case 'moveDown':\n case 'ctrlDown':\n case 'csDown':\n _this.navigateNode(true);\n break;\n case 'shiftUp':\n _this.shiftKeySelect(false, e);\n break;\n case 'moveUp':\n case 'ctrlUp':\n case 'csUp':\n _this.navigateNode(false);\n break;\n case 'home':\n case 'shiftHome':\n case 'ctrlHome':\n case 'csHome':\n _this.navigateRootNode(true);\n break;\n case 'end':\n case 'shiftEnd':\n case 'ctrlEnd':\n case 'csEnd':\n _this.navigateRootNode(false);\n break;\n case 'enter':\n case 'ctrlEnter':\n case 'shiftEnter':\n case 'csEnter':\n _this.toggleSelect(focusedNode, e);\n break;\n case 'f2':\n if (_this.allowEditing && !focusedNode.classList.contains('e-disable')) {\n _this.createTextbox(focusedNode, e);\n }\n break;\n case 'ctrlA':\n if (_this.allowMultiSelection) {\n var sNodes = selectAll('.' + LISTITEM + ':not(.' + ACTIVE + ')', _this.element);\n _this.selectGivenNodes(sNodes);\n }\n break;\n }\n }\n });\n };\n TreeView.prototype.navigateToFocus = function (isUp) {\n var focusNode = this.getFocusedNode().querySelector('.' + TEXTWRAP);\n var pos = focusNode.getBoundingClientRect();\n var parent = this.getScrollParent(this.element);\n if (!isNOU(parent)) {\n var parentPos = parent.getBoundingClientRect();\n if (pos.bottom > parentPos.bottom) {\n parent.scrollTop += pos.bottom - parentPos.bottom;\n }\n else if (pos.top < parentPos.top) {\n parent.scrollTop -= parentPos.top - pos.top;\n }\n }\n var isVisible = this.isVisibleInViewport(focusNode);\n if (!isVisible) {\n focusNode.scrollIntoView(isUp);\n }\n };\n TreeView.prototype.isVisibleInViewport = function (txtWrap) {\n var pos = txtWrap.getBoundingClientRect();\n return (pos.top >= 0 && pos.left >= 0 && pos.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n pos.right <= (window.innerWidth || document.documentElement.clientWidth));\n };\n TreeView.prototype.getScrollParent = function (node) {\n if (isNOU(node)) {\n return null;\n }\n return (node.scrollHeight > node.clientHeight) ? node : this.getScrollParent(node.parentElement);\n };\n TreeView.prototype.shiftKeySelect = function (isTowards, e) {\n if (this.allowMultiSelection) {\n var focusedNode = this.getFocusedNode();\n var nextNode = isTowards ? this.getNextNode(focusedNode) : this.getPrevNode(focusedNode);\n this.removeHover();\n this.setFocusElement(nextNode);\n this.toggleSelect(nextNode, e, false);\n this.navigateToFocus(!isTowards);\n }\n else {\n this.navigateNode(isTowards);\n }\n };\n TreeView.prototype.checkNode = function (e) {\n var focusedNode = this.getFocusedNode();\n var checkWrap = select('.' + CHECKBOXWRAP, focusedNode);\n var isChecked = select(' .' + CHECKBOXFRAME, checkWrap).classList.contains(CHECK);\n if (!focusedNode.classList.contains('e-disable')) {\n if (focusedNode.getElementsByClassName(\"e-checkbox-disabled\").length == 0) {\n this.validateCheckNode(checkWrap, isChecked, focusedNode, e);\n }\n }\n };\n TreeView.prototype.validateCheckNode = function (checkWrap, isCheck, li, e) {\n var _this = this;\n var currLi = closest(checkWrap, '.' + LISTITEM);\n this.checkActionNodes = [];\n var ariaState = !isCheck ? 'true' : 'false';\n if (!isNOU(ariaState)) {\n checkWrap.setAttribute('aria-checked', ariaState);\n }\n var eventArgs = this.getCheckEvent(currLi, isCheck ? 'uncheck' : 'check', e);\n this.trigger('nodeChecking', eventArgs, function (observedArgs) {\n if (!observedArgs.cancel) {\n _this.nodeCheckingAction(checkWrap, isCheck, li, observedArgs, e);\n }\n });\n };\n TreeView.prototype.nodeCheckingAction = function (checkWrap, isCheck, li, eventArgs, e) {\n if (this.checkedElement.indexOf(li.getAttribute('data-uid')) === -1) {\n this.checkedElement.push(li.getAttribute('data-uid'));\n var child = this.getChildNodes(this.treeData, li.getAttribute('data-uid'));\n (child !== null) ? this.allCheckNode(child, this.checkedElement, null, null, false) : child = null;\n }\n this.changeState(checkWrap, isCheck ? 'uncheck' : 'check', e, true);\n if (this.autoCheck) {\n this.ensureChildCheckState(li);\n this.ensureParentCheckState(closest(closest(li, '.' + PARENTITEM), '.' + LISTITEM));\n var doCheck = void 0;\n if (eventArgs.action === 'check') {\n doCheck = true;\n }\n else if (eventArgs.action === 'uncheck') {\n doCheck = false;\n }\n this.ensureStateChange(li, doCheck);\n }\n this.nodeCheckedEvent(checkWrap, isCheck, e);\n };\n /**\n * Update checkedNodes when UI interaction happens before the child node renders in DOM\n */\n TreeView.prototype.ensureStateChange = function (li, doCheck) {\n var childElement = select('.' + PARENTITEM, li);\n var parentIndex = li.getAttribute('data-uid');\n var mapper = this.fields;\n if (this.dataType === 1 && this.autoCheck) {\n var resultData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.parentID, 'equal', parentIndex, true));\n for (var i = 0; i < resultData.length; i++) {\n var resultId = resultData[i][this.fields.id] ? resultData[i][this.fields.id].toString() : null;\n var isCheck = resultData[i][this.fields.isChecked] ? resultData[i][this.fields.isChecked].toString() : null;\n if (this.checkedNodes.indexOf(parentIndex) !== -1 && this.checkedNodes.indexOf(resultId) === -1) {\n this.checkedNodes.push(resultId);\n var childItems = this.getChildNodes(this.treeData, resultId);\n this.getChildItems(childItems, doCheck);\n if (this.parentNodeCheck.indexOf(resultId) !== -1) {\n this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(resultId), 1);\n }\n }\n else if (this.checkedNodes.indexOf(parentIndex) === -1 && childElement === null &&\n this.checkedNodes.indexOf(resultId) !== -1) {\n this.checkedNodes.splice(this.checkedNodes.indexOf(resultId), 1);\n if (isCheck === 'true') {\n this.updateField(this.treeData, this.fields, resultId, 'isChecked', null);\n }\n if (this.checkedNodes.indexOf(parentIndex) === -1 && childElement === null ||\n this.parentNodeCheck.indexOf(resultId) !== -1) {\n var childNodes = this.getChildNodes(this.treeData, resultId);\n this.getChildItems(childNodes, doCheck);\n if (this.parentNodeCheck.indexOf(resultId) !== -1) {\n this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(resultId), 1);\n }\n }\n }\n else {\n var childItems = this.getChildNodes(this.treeData, resultId);\n this.getChildItems(childItems, doCheck);\n }\n }\n }\n else if (this.dataType === 1 && !this.autoCheck) {\n if (!doCheck) {\n var checkedData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.isChecked, 'equal', true, false));\n for (var i = 0; i < checkedData.length; i++) {\n var id = checkedData[i][this.fields.id] ? checkedData[i][this.fields.id].toString() : null;\n if (this.checkedNodes.indexOf(id) !== -1) {\n this.checkedNodes.splice(this.checkedNodes.indexOf(id), 1);\n }\n this.updateField(this.treeData, this.fields, id, 'isChecked', null);\n }\n this.checkedNodes = [];\n }\n else {\n for (var i = 0; i < this.treeData.length; i++) {\n var checkedId = this.treeData[i][this.fields.id] ? this.treeData[i][this.fields.id].toString() : null;\n if (this.checkedNodes.indexOf(checkedId) === -1) {\n this.checkedNodes.push(checkedId);\n }\n }\n }\n }\n else {\n var childItems = this.getChildNodes(this.treeData, parentIndex);\n if (childItems) {\n this.childStateChange(childItems, parentIndex, childElement, doCheck);\n }\n }\n };\n TreeView.prototype.getChildItems = function (childItems, doCheck) {\n for (var i = 0; i < childItems.length; i++) {\n var childId = childItems[i][this.fields.id] ? childItems[i][this.fields.id].toString() : null;\n var childIsCheck = childItems[i][this.fields.isChecked] ? childItems[i][this.fields.isChecked].toString() :\n null;\n if (this.checkedNodes.indexOf(childId) !== -1 && !doCheck) {\n this.checkedNodes.splice(this.checkedNodes.indexOf(childId), 1);\n }\n if (this.checkedNodes.indexOf(childId) === -1 && doCheck) {\n this.checkedNodes.push(childId);\n }\n if (childIsCheck === 'true' && !doCheck) {\n this.updateField(this.treeData, this.fields, childId, 'isChecked', null);\n }\n var subChildItems = this.getChildNodes(this.treeData, childId);\n if (subChildItems.length > 0) {\n this.getChildItems(subChildItems, doCheck);\n }\n }\n };\n /**\n * Update checkedNodes when UI interaction happens before the child node renders in DOM for hierarchical DS\n */\n TreeView.prototype.childStateChange = function (childItems, parent, childElement, doCheck) {\n for (var i = 0; i < childItems.length; i++) {\n var checkedChild = childItems[i][this.fields.id] ? childItems[i][this.fields.id].toString() : '';\n var isCheck = childItems[i][this.fields.isChecked] ? childItems[i][this.fields.isChecked].toString() : null;\n if (this.autoCheck) {\n if (this.checkedNodes.indexOf(parent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1) {\n this.checkedNodes.push(checkedChild);\n if (this.parentNodeCheck.indexOf(checkedChild) !== -1) {\n this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(checkedChild), 1);\n }\n }\n else if (this.checkedNodes.indexOf(parent) === -1 && this.checkedNodes.indexOf(checkedChild) !== -1 && !doCheck) {\n this.checkedNodes.splice(this.checkedNodes.indexOf(checkedChild), 1);\n if (isCheck === 'true') {\n this.updateField(this.treeData, this.fields, checkedChild, 'isChecked', null);\n }\n }\n }\n else if (!this.autoCheck) {\n if (!doCheck) {\n if (this.checkedNodes.indexOf(checkedChild) !== -1) {\n this.checkedNodes.splice(this.checkedNodes.indexOf(checkedChild), 1);\n }\n this.updateField(this.treeData, this.fields, checkedChild, 'isChecked', null);\n this.checkedNodes = [];\n }\n else {\n if (this.checkedNodes.indexOf(checkedChild) === -1) {\n this.checkedNodes.push(checkedChild);\n }\n }\n }\n var subChild = this.getChildNodes([childItems[i]], checkedChild);\n if (subChild) {\n this.childStateChange(subChild, parent, childElement, doCheck);\n }\n }\n };\n //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\n TreeView.prototype.allCheckNode = function (child, newCheck, checked, childCheck, validateCheck) {\n if (child) {\n for (var length_1 = 0; length_1 < child.length; length_1++) {\n var childId = getValue(this.fields.id, child[length_1]);\n var check = this.element.querySelector('[data-uid=\"' + childId + '\"]');\n //Validates isChecked case while no UI interaction has been performed on the node or it's parent\n if (validateCheck !== false && this.checkedElement.indexOf(childId.toString()) === -1) {\n if (((check === null && !isNOU(child[length_1][this.fields.isChecked]) && newCheck.indexOf(childId.toString()) === -1)\n || childCheck === 0 || checked === 2)) {\n (child[length_1][this.fields.isChecked] !== false || checked === 2) ? newCheck.push(childId.toString())\n : childCheck = null;\n childCheck = (child[length_1][this.fields.isChecked] !== false || checked === 2) ? 0 : null;\n }\n }\n //Pushes child checked node done thro' UI interaction\n if (newCheck.indexOf(childId.toString()) === -1 && isNOU(checked)) {\n newCheck.push(childId.toString());\n }\n //Gets if any next level children are available for child nodes\n if (getValue(this.fields.hasChildren, child[length_1]) === true ||\n getValue(this.fields.child.toString(), child[length_1])) {\n var id = getValue(this.fields.id, child[length_1]);\n var childId_1 = this.getChildNodes(this.treeData, id.toString());\n if (childId_1) {\n (isNOU(validateCheck)) ? this.allCheckNode(childId_1, newCheck, checked, childCheck) :\n this.allCheckNode(childId_1, newCheck, checked, childCheck, validateCheck);\n childCheck = null;\n }\n }\n childCheck = null;\n }\n }\n };\n TreeView.prototype.openNode = function (toBeOpened, e) {\n var focusedNode = this.getFocusedNode();\n var icon = select('div.' + ICON, focusedNode);\n if (toBeOpened) {\n if (!icon) {\n return;\n }\n else if (icon.classList.contains(EXPANDABLE)) {\n this.expandAction(focusedNode, icon, e);\n }\n else {\n this.focusNextNode(focusedNode, true);\n }\n }\n else {\n if (icon && icon.classList.contains(COLLAPSIBLE)) {\n this.collapseNode(focusedNode, icon, e);\n }\n else {\n var parentLi = closest(closest(focusedNode, '.' + PARENTITEM), '.' + LISTITEM);\n if (!parentLi) {\n return;\n }\n else {\n if (!parentLi.classList.contains('e-disable')) {\n this.setFocus(focusedNode, parentLi);\n this.navigateToFocus(true);\n }\n }\n }\n }\n };\n TreeView.prototype.navigateNode = function (isTowards) {\n var focusedNode = this.getFocusedNode();\n this.focusNextNode(focusedNode, isTowards);\n };\n TreeView.prototype.navigateRootNode = function (isBackwards) {\n var focusedNode = this.getFocusedNode();\n var rootNode = isBackwards ? this.getRootNode() : this.getEndNode();\n if (!rootNode.classList.contains('e-disable')) {\n this.setFocus(focusedNode, rootNode);\n this.navigateToFocus(isBackwards);\n }\n };\n TreeView.prototype.getFocusedNode = function () {\n var selectedItem;\n var fNode = select('.' + LISTITEM + '.' + FOCUS, this.element);\n if (isNOU(fNode)) {\n selectedItem = select('.' + LISTITEM, this.element);\n }\n return isNOU(fNode) ? (isNOU(selectedItem) ? this.element.firstElementChild : selectedItem) : fNode;\n };\n TreeView.prototype.focusNextNode = function (li, isTowards) {\n var nextNode = isTowards ? this.getNextNode(li) : this.getPrevNode(li);\n this.setFocus(li, nextNode);\n this.navigateToFocus(!isTowards);\n if (nextNode.classList.contains('e-disable')) {\n var lastChild = nextNode.lastChild;\n if (nextNode.previousSibling == null && nextNode.classList.contains('e-level-1')) {\n this.focusNextNode(nextNode, true);\n }\n else if (nextNode.nextSibling == null && nextNode.classList.contains('e-node-collapsed')) {\n this.focusNextNode(nextNode, false);\n }\n else if (nextNode.nextSibling == null && lastChild.classList.contains(TEXTWRAP)) {\n this.focusNextNode(nextNode, false);\n }\n else {\n this.focusNextNode(nextNode, isTowards);\n }\n }\n };\n TreeView.prototype.getNextNode = function (li) {\n var index = this.liList.indexOf(li);\n var nextNode;\n do {\n index++;\n nextNode = this.liList[index];\n if (isNOU(nextNode)) {\n return li;\n }\n } while (!isVisible(nextNode));\n return nextNode;\n };\n TreeView.prototype.getPrevNode = function (li) {\n var index = this.liList.indexOf(li);\n var prevNode;\n do {\n index--;\n prevNode = this.liList[index];\n if (isNOU(prevNode)) {\n return li;\n }\n } while (!isVisible(prevNode));\n return prevNode;\n };\n TreeView.prototype.getRootNode = function () {\n var index = 0;\n var rootNode;\n do {\n rootNode = this.liList[index];\n index++;\n } while (!isVisible(rootNode));\n return rootNode;\n };\n TreeView.prototype.getEndNode = function () {\n var index = this.liList.length - 1;\n var endNode;\n do {\n endNode = this.liList[index];\n index--;\n } while (!isVisible(endNode));\n return endNode;\n };\n TreeView.prototype.setFocus = function (preNode, nextNode) {\n removeClass([preNode], [HOVER, FOCUS]);\n if (!nextNode.classList.contains('e-disable')) {\n addClass([nextNode], [HOVER, FOCUS]);\n this.updateIdAttr(preNode, nextNode);\n }\n };\n TreeView.prototype.updateIdAttr = function (preNode, nextNode) {\n this.element.removeAttribute('aria-activedescendant');\n if (preNode) {\n preNode.removeAttribute('id');\n }\n nextNode.setAttribute('id', this.element.id + '_active');\n this.element.setAttribute('aria-activedescendant', this.element.id + '_active');\n };\n TreeView.prototype.focusIn = function () {\n if (!this.mouseDownStatus) {\n addClass([this.getFocusedNode()], HOVER);\n }\n this.mouseDownStatus = false;\n };\n TreeView.prototype.focusOut = function () {\n removeClass([this.getFocusedNode()], HOVER);\n };\n TreeView.prototype.onMouseOver = function (e) {\n var target = e.target;\n var classList = target.classList;\n var currentLi = closest(target, '.' + LISTITEM);\n if (!currentLi || classList.contains(PARENTITEM) || classList.contains(LISTITEM)) {\n this.removeHover();\n return;\n }\n else {\n if (currentLi && !currentLi.classList.contains('e-disable')) {\n this.setHover(currentLi);\n }\n }\n };\n TreeView.prototype.setHover = function (li) {\n if (!li.classList.contains(HOVER)) {\n this.removeHover();\n addClass([li], HOVER);\n }\n };\n ;\n TreeView.prototype.onMouseLeave = function (e) {\n this.removeHover();\n };\n TreeView.prototype.removeHover = function () {\n var hoveredNode = selectAll('.' + HOVER, this.element);\n if (hoveredNode && hoveredNode.length) {\n removeClass(hoveredNode, HOVER);\n }\n };\n ;\n TreeView.prototype.getNodeData = function (currLi, fromDS) {\n if (!isNOU(currLi) && currLi.classList.contains(LISTITEM) &&\n !isNOU(closest(currLi, '.' + CONTROL)) && closest(currLi, '.' + CONTROL).classList.contains(ROOT)) {\n var id = currLi.getAttribute('data-uid');\n var text = this.getText(currLi, fromDS);\n var pNode = closest(currLi.parentNode, '.' + LISTITEM);\n var pid = pNode ? pNode.getAttribute('data-uid') : null;\n var selected = currLi.classList.contains(ACTIVE);\n var expanded = (currLi.getAttribute('aria-expanded') === 'true') ? true : false;\n var hasChildren = currLi.getAttribute('aria-expanded') !== null ? true : (select('.' + EXPANDABLE, currLi) || select('.' + COLLAPSIBLE, currLi)) != null ? true : false;\n var checked = null;\n if (this.showCheckBox) {\n checked = select('.' + CHECKBOXWRAP, currLi).getAttribute('aria-checked');\n }\n return {\n id: id, text: text, parentID: pid, selected: selected, expanded: expanded,\n isChecked: checked, hasChildren: hasChildren\n };\n }\n return { id: '', text: '', parentID: '', selected: false, expanded: false, isChecked: '', hasChildren: false };\n };\n TreeView.prototype.getText = function (currLi, fromDS) {\n if (fromDS) {\n var nodeData = this.getNodeObject(currLi.getAttribute('data-uid'));\n var level = parseFloat(currLi.getAttribute('aria-level'));\n var nodeFields = this.getFields(this.fields, level, 1);\n return getValue(nodeFields.text, nodeData);\n }\n return select('.' + LISTTEXT, currLi).textContent;\n };\n TreeView.prototype.getExpandEvent = function (currLi, e) {\n var nodeData = this.getNodeData(currLi);\n return { cancel: false, isInteracted: isNOU(e) ? false : true, node: currLi, nodeData: nodeData, event: e };\n };\n TreeView.prototype.renderNodeTemplate = function (data, textEle, dataId) {\n var tempArr = this.nodeTemplateFn(data, this, 'nodeTemplate' + dataId, this.element.id + 'nodeTemplate', this.isStringTemplate, undefined, textEle);\n if (tempArr) {\n tempArr = Array.prototype.slice.call(tempArr);\n append(tempArr, textEle);\n }\n };\n TreeView.prototype.destroyTemplate = function (liEle) {\n this.clearTemplate(['nodeTemplate' + liEle.getAttribute('data-uid')]);\n };\n TreeView.prototype.reRenderNodes = function () {\n this.updateListProp(this.fields);\n if (Browser.isIE) {\n this.ulElement = this.element.querySelector('.e-list-parent.e-ul');\n this.ulElement.parentElement.removeChild(this.ulElement);\n }\n else {\n this.element.innerHTML = '';\n }\n if (!isNOU(this.nodeTemplateFn)) {\n this.clearTemplate();\n }\n this.setTouchClass();\n this.setProperties({ selectedNodes: [], checkedNodes: [], expandedNodes: [] }, true);\n this.checkedElement = [];\n this.isLoaded = false;\n this.setDataBinding(true);\n };\n TreeView.prototype.setCssClass = function (oldClass, newClass) {\n if (!isNOU(oldClass) && oldClass !== '') {\n removeClass([this.element], oldClass.split(' '));\n }\n if (!isNOU(newClass) && newClass !== '') {\n addClass([this.element], newClass.split(' '));\n }\n };\n TreeView.prototype.editingHandler = function (e) {\n var target = e.target;\n if (!target || target.classList.contains(ROOT) || target.classList.contains(PARENTITEM) ||\n target.classList.contains(LISTITEM) || target.classList.contains(ICON) ||\n target.classList.contains(INPUT) || target.classList.contains(INPUTGROUP)) {\n return;\n }\n else {\n var liEle = closest(target, '.' + LISTITEM);\n this.createTextbox(liEle, e);\n }\n };\n TreeView.prototype.createTextbox = function (liEle, e) {\n var _this = this;\n var oldInpEle = select('.' + TREEINPUT, this.element);\n if (oldInpEle) {\n oldInpEle.blur();\n }\n var textEle = select('.' + LISTTEXT, liEle);\n this.updateOldText(liEle);\n var innerEle = this.createElement('input', { className: TREEINPUT, attrs: { value: this.oldText } });\n var eventArgs = this.getEditEvent(liEle, null, innerEle.outerHTML);\n this.trigger('nodeEditing', eventArgs, function (observedArgs) {\n if (!observedArgs.cancel) {\n var inpWidth = textEle.offsetWidth + 5;\n var style = 'width:' + inpWidth + 'px';\n addClass([liEle], EDITING);\n if (!isNOU(_this.nodeTemplateFn)) {\n _this.destroyTemplate(liEle);\n }\n textEle.innerHTML = eventArgs.innerHtml;\n var inpEle = select('.' + TREEINPUT, textEle);\n _this.inputObj = Input.createInput({\n element: inpEle,\n properties: {\n enableRtl: _this.enableRtl,\n }\n }, _this.createElement);\n _this.inputObj.container.setAttribute('style', style);\n inpEle.focus();\n var inputEle = inpEle;\n inputEle.setSelectionRange(0, inputEle.value.length);\n _this.wireInputEvents(inpEle);\n }\n });\n };\n TreeView.prototype.updateOldText = function (liEle) {\n var id = liEle.getAttribute('data-uid');\n this.editData = this.getNodeObject(id);\n var level = parseFloat(liEle.getAttribute('aria-level'));\n this.editFields = this.getFields(this.fields, level, 1);\n this.oldText = getValue(this.editFields.text, this.editData);\n };\n TreeView.prototype.inputFocusOut = function (e) {\n if (!select('.' + TREEINPUT, this.element)) {\n return;\n }\n var target = e.target;\n var newText = target.value;\n var txtEle = closest(target, '.' + LISTTEXT);\n var liEle = closest(target, '.' + LISTITEM);\n detach(this.inputObj.container);\n if (this.fields.dataSource instanceof DataManager && !this.isOffline) {\n this.crudOperation('update', null, liEle, newText, null, null, true);\n }\n else {\n this.appendNewText(liEle, txtEle, newText, true);\n }\n };\n TreeView.prototype.appendNewText = function (liEle, txtEle, newText, isInput) {\n var _this = this;\n var eventArgs = this.getEditEvent(liEle, newText, null);\n this.trigger('nodeEdited', eventArgs, function (observedArgs) {\n newText = observedArgs.cancel ? observedArgs.oldText : observedArgs.newText;\n _this.updateText(liEle, txtEle, newText, isInput);\n if (observedArgs.oldText !== newText) {\n _this.triggerEvent();\n }\n });\n };\n TreeView.prototype.updateText = function (liEle, txtEle, newText, isInput) {\n var newData = setValue(this.editFields.text, newText, this.editData);\n if (!isNOU(this.nodeTemplateFn)) {\n txtEle.innerText = '';\n var dataId = liEle.getAttribute('data-uid');\n this.renderNodeTemplate(newData, txtEle, dataId);\n this.renderReactTemplates();\n }\n else {\n txtEle.innerText = newText;\n }\n if (isInput) {\n removeClass([liEle], EDITING);\n txtEle.focus();\n }\n };\n TreeView.prototype.getElement = function (ele) {\n if (isNOU(ele)) {\n return null;\n }\n else if (typeof ele === 'string') {\n return this.element.querySelector('[data-uid=\"' + ele + '\"]');\n }\n else if (typeof ele === 'object') {\n return getElement(ele);\n }\n else {\n return null;\n }\n };\n TreeView.prototype.getId = function (ele) {\n if (isNOU(ele)) {\n return null;\n }\n else if (typeof ele === 'string') {\n return ele;\n }\n else if (typeof ele === 'object') {\n return (getElement(ele)).getAttribute('data-uid');\n }\n else {\n return null;\n }\n };\n TreeView.prototype.getEditEvent = function (liEle, newText, inpEle) {\n var data = this.getNodeData(liEle);\n return { cancel: false, newText: newText, node: liEle, nodeData: data, oldText: this.oldText, innerHtml: inpEle };\n };\n TreeView.prototype.getNodeObject = function (id) {\n var childNodes;\n if (isNOU(id)) {\n return childNodes;\n }\n else if (this.dataType === 1) {\n for (var i = 0, objlen = this.treeData.length; i < objlen; i++) {\n var dataId = getValue(this.fields.id, this.treeData[i]);\n if (!isNOU(this.treeData[i]) && !isNOU(dataId) && dataId.toString() === id) {\n return this.treeData[i];\n }\n }\n }\n else {\n return this.getChildNodeObject(this.treeData, this.fields, id);\n }\n return childNodes;\n };\n TreeView.prototype.getChildNodeObject = function (obj, mapper, id) {\n var newList;\n if (isNOU(obj)) {\n return newList;\n }\n for (var i = 0, objlen = obj.length; i < objlen; i++) {\n var dataId = getValue(mapper.id, obj[i]);\n if (obj[i] && dataId && dataId.toString() === id) {\n return obj[i];\n }\n else if (typeof mapper.child === 'string' && !isNOU(getValue(mapper.child, obj[i]))) {\n var childData = getValue(mapper.child, obj[i]);\n newList = this.getChildNodeObject(childData, this.getChildMapper(mapper), id);\n if (newList !== undefined) {\n break;\n }\n }\n else if (this.fields.dataSource instanceof DataManager && !isNOU(getValue('child', obj[i]))) {\n var child = 'child';\n newList = this.getChildNodeObject(getValue(child, obj[i]), this.getChildMapper(mapper), id);\n if (newList !== undefined) {\n break;\n }\n }\n }\n return newList;\n };\n TreeView.prototype.setDragAndDrop = function (toBind) {\n if (toBind && !this.disabled) {\n this.initializeDrag();\n }\n else {\n this.destroyDrag();\n }\n };\n TreeView.prototype.initializeDrag = function () {\n var _this = this;\n var virtualEle;\n var proxy = this;\n this.dragObj = new Draggable(this.element, {\n enableTailMode: true, enableAutoScroll: true,\n dragArea: this.dragArea,\n dragTarget: '.' + TEXTWRAP,\n helper: function (e) {\n _this.dragTarget = e.sender.target;\n var dragRoot = closest(_this.dragTarget, '.' + ROOT);\n var dragWrap = closest(_this.dragTarget, '.' + TEXTWRAP);\n _this.dragLi = closest(_this.dragTarget, '.' + LISTITEM);\n if (_this.fullRowSelect && !dragWrap && _this.dragTarget.classList.contains(FULLROW)) {\n dragWrap = _this.dragTarget.nextElementSibling;\n }\n if (!_this.dragTarget || !e.element.isSameNode(dragRoot) || !dragWrap ||\n _this.dragTarget.classList.contains(ROOT) || _this.dragTarget.classList.contains(PARENTITEM) ||\n _this.dragTarget.classList.contains(LISTITEM) || _this.dragLi.classList.contains('e-disable')) {\n return false;\n }\n var cloneEle = (dragWrap.cloneNode(true));\n if (isNOU(select('div.' + ICON, cloneEle))) {\n var icon = proxy.createElement('div', { className: ICON + ' ' + EXPANDABLE });\n cloneEle.insertBefore(icon, cloneEle.children[0]);\n }\n var cssClass = DRAGITEM + ' ' + ROOT + ' ' + _this.cssClass + ' ' + (_this.enableRtl ? RTL : '');\n virtualEle = proxy.createElement('div', { className: cssClass });\n virtualEle.appendChild(cloneEle);\n var nLen = _this.selectedNodes.length;\n if (nLen > 1 && _this.allowMultiSelection && _this.dragLi.classList.contains(ACTIVE)) {\n var cNode = proxy.createElement('span', { className: DROPCOUNT, innerHTML: '' + nLen });\n virtualEle.appendChild(cNode);\n }\n document.body.appendChild(virtualEle);\n document.body.style.cursor = '';\n _this.dragData = _this.getNodeData(_this.dragLi);\n return virtualEle;\n },\n dragStart: function (e) {\n addClass([_this.element], DRAGGING);\n var listItem = closest(e.target, '.e-list-item');\n var level;\n if (listItem) {\n level = parseInt(listItem.getAttribute('aria-level'), 10);\n }\n var eventArgs = _this.getDragEvent(e.event, _this, null, e.target, null, virtualEle, level);\n if (eventArgs.draggedNode.classList.contains(EDITING)) {\n _this.dragObj.intDestroy(e.event);\n _this.dragCancelAction(virtualEle);\n }\n else {\n _this.trigger('nodeDragStart', eventArgs, function (observedArgs) {\n if (observedArgs.cancel) {\n _this.dragObj.intDestroy(e.event);\n _this.dragCancelAction(virtualEle);\n }\n else {\n _this.dragStartAction = true;\n }\n });\n }\n },\n drag: function (e) {\n _this.dragObj.setProperties({ cursorAt: { top: (!isNOU(e.event.targetTouches) || Browser.isDevice) ? 60 : -20 } });\n _this.dragAction(e, virtualEle);\n },\n dragStop: function (e) {\n removeClass([_this.element], DRAGGING);\n _this.removeVirtualEle();\n var dropTarget = e.target;\n var preventTargetExpand = false;\n var dropRoot = (closest(dropTarget, '.' + DROPPABLE));\n var isHelperElement = true;\n if (!dropTarget || !dropRoot) {\n detach(e.helper);\n document.body.style.cursor = '';\n isHelperElement = false;\n }\n var listItem = closest(dropTarget, '.e-list-item');\n var level;\n if (listItem) {\n level = parseInt(listItem.getAttribute('aria-level'), 10);\n }\n var eventArgs = _this.getDragEvent(e.event, _this, dropTarget, dropTarget, null, e.helper, level);\n eventArgs.preventTargetExpand = preventTargetExpand;\n _this.trigger('nodeDragStop', eventArgs, function (observedArgs) {\n _this.dragParent = observedArgs.draggedParentNode;\n _this.preventExpand = observedArgs.preventTargetExpand;\n if (observedArgs.cancel) {\n if (e.helper.parentNode) {\n detach(e.helper);\n }\n document.body.style.cursor = '';\n isHelperElement = false;\n }\n _this.dragStartAction = false;\n });\n }\n });\n this.dropObj = new Droppable(this.element, {\n out: function (e) {\n if (!isNOU(e) && !e.target.classList.contains(SIBLING)) {\n document.body.style.cursor = 'not-allowed';\n }\n },\n over: function (e) {\n document.body.style.cursor = '';\n },\n drop: function (e) {\n _this.dropAction(e);\n }\n });\n };\n TreeView.prototype.dragCancelAction = function (virtualEle) {\n detach(virtualEle);\n removeClass([this.element], DRAGGING);\n this.dragStartAction = false;\n };\n TreeView.prototype.dragAction = function (e, virtualEle) {\n var dropRoot = closest(e.target, '.' + DROPPABLE);\n var dropWrap = closest(e.target, '.' + TEXTWRAP);\n var icon = select('div.' + ICON, virtualEle);\n removeClass([icon], [DROPIN, DROPNEXT, DROPOUT, NODROP]);\n this.removeVirtualEle();\n document.body.style.cursor = '';\n var classList = e.target.classList;\n if (this.fullRowSelect && !dropWrap && !isNOU(classList) && classList.contains(FULLROW)) {\n dropWrap = e.target.nextElementSibling;\n }\n if (dropRoot) {\n var dropLi = closest(e.target, '.' + LISTITEM);\n var checkWrapper = closest(e.target, '.' + CHECKBOXWRAP);\n var collapse = closest(e.target, '.' + COLLAPSIBLE);\n var expand = closest(e.target, '.' + EXPANDABLE);\n if (!dropRoot.classList.contains(ROOT) || (dropWrap &&\n (!dropLi.isSameNode(this.dragLi) && !this.isDescendant(this.dragLi, dropLi)))) {\n if (this.hasTemplate && dropLi) {\n var templateTarget = select(this.fullRowSelect ? '.' + FULLROW : '.' + TEXTWRAP, dropLi);\n if ((e && (!expand && !collapse) && e.event.offsetY < 7 && !checkWrapper) || (((expand && e.event.offsetY < 5) || (collapse && e.event.offsetX < 3)))) {\n var index = this.fullRowSelect ? (1) : (0);\n this.appendIndicator(dropLi, icon, index);\n }\n else if ((e && (!expand && !collapse) && !checkWrapper && templateTarget && e.event.offsetY > templateTarget.offsetHeight - 10) || ((expand && e.event.offsetY > 19) || (collapse && e.event.offsetX > 19))) {\n var index = this.fullRowSelect ? (2) : (1);\n this.appendIndicator(dropLi, icon, index);\n }\n else {\n addClass([icon], DROPIN);\n }\n }\n else {\n if ((dropLi && e && (!expand && !collapse) && (e.event.offsetY < 7) && !checkWrapper) || (((expand && e.event.offsetY < 5) || (collapse && e.event.offsetX < 3)))) {\n var index = this.fullRowSelect ? (1) : (0);\n this.appendIndicator(dropLi, icon, index);\n }\n 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)))) {\n var index = this.fullRowSelect ? (2) : (1);\n this.appendIndicator(dropLi, icon, index);\n }\n else {\n addClass([icon], DROPIN);\n }\n }\n }\n else if (e.target.nodeName === 'LI' && (!dropLi.isSameNode(this.dragLi) && !this.isDescendant(this.dragLi, dropLi))) {\n addClass([icon], DROPNEXT);\n this.renderVirtualEle(e);\n }\n else if (e.target.classList.contains(SIBLING)) {\n addClass([icon], DROPNEXT);\n }\n else {\n addClass([icon], DROPOUT);\n }\n }\n else {\n addClass([icon], NODROP);\n document.body.style.cursor = 'not-allowed';\n }\n var listItem = closest(e.target, '.e-list-item');\n var level;\n if (listItem) {\n level = parseInt(listItem.getAttribute('aria-level'), 10);\n }\n var eventArgs = this.getDragEvent(e.event, this, e.target, e.target, null, virtualEle, level);\n if (eventArgs.dropIndicator) {\n removeClass([icon], eventArgs.dropIndicator);\n }\n this.trigger('nodeDragging', eventArgs);\n if (eventArgs.dropIndicator) {\n addClass([icon], eventArgs.dropIndicator);\n }\n };\n TreeView.prototype.appendIndicator = function (dropLi, icon, index) {\n addClass([icon], DROPNEXT);\n var virEle = this.createElement('div', { className: SIBLING });\n dropLi.insertBefore(virEle, dropLi.children[index]);\n };\n /* eslint-disable */\n TreeView.prototype.dropAction = function (e) {\n var offsetY = e.event.offsetY;\n var dropTarget = e.target;\n var dragObj;\n var level;\n var drop = false;\n var dragInstance;\n dragInstance = e.dragData.draggable;\n for (var i = 0; i < dragInstance.ej2_instances.length; i++) {\n if (dragInstance.ej2_instances[i] instanceof TreeView_1) {\n dragObj = dragInstance.ej2_instances[i];\n break;\n }\n }\n if (dragObj && dragObj.dragTarget) {\n var dragTarget = dragObj.dragTarget;\n var dragLi = (closest(dragTarget, '.' + LISTITEM));\n var dropLi = (closest(dropTarget, '.' + LISTITEM));\n if (dropLi == null && dropTarget.classList.contains(ROOT)) {\n dropLi = dropTarget.firstElementChild;\n }\n detach(e.droppedElement);\n document.body.style.cursor = '';\n if (!dropLi || dropLi.isSameNode(dragLi) || this.isDescendant(dragLi, dropLi)) {\n if (this.fields.dataSource instanceof DataManager === false) {\n this.preventExpand = false;\n }\n return;\n }\n if (dragObj.allowMultiSelection && dragLi.classList.contains(ACTIVE)) {\n var sNodes = selectAll('.' + ACTIVE, dragObj.element);\n if (e.target.offsetHeight <= 33 && offsetY > e.target.offsetHeight - 10 && offsetY > 6) {\n for (var i = sNodes.length - 1; i >= 0; i--) {\n if (dropLi.isSameNode(sNodes[i]) || this.isDescendant(sNodes[i], dropLi)) {\n continue;\n }\n this.appendNode(dropTarget, sNodes[i], dropLi, e, dragObj, offsetY);\n }\n }\n else {\n for (var i = 0; i < sNodes.length; i++) {\n if (dropLi.isSameNode(sNodes[i]) || this.isDescendant(sNodes[i], dropLi)) {\n continue;\n }\n this.appendNode(dropTarget, sNodes[i], dropLi, e, dragObj, offsetY);\n }\n }\n }\n else {\n this.appendNode(dropTarget, dragLi, dropLi, e, dragObj, offsetY);\n }\n level = parseInt(dragLi.getAttribute('aria-level'), 10);\n drop = true;\n }\n if (this.fields.dataSource instanceof DataManager === false) {\n this.preventExpand = false;\n }\n this.trigger('nodeDropped', this.getDragEvent(e.event, dragObj, dropTarget, e.target, e.dragData.draggedElement, null, level, drop));\n if (dragObj.element.id !== this.element.id) {\n dragObj.triggerEvent();\n }\n this.triggerEvent();\n };\n TreeView.prototype.appendNode = function (dropTarget, dragLi, dropLi, e, dragObj, offsetY) {\n var checkWrapper = closest(dropTarget, '.' + CHECKBOXWRAP);\n var collapse = closest(e.target, '.' + COLLAPSIBLE);\n var expand = closest(e.target, '.' + EXPANDABLE);\n 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))) {\n if (dropTarget.nodeName === 'LI') {\n this.dropAsSiblingNode(dragLi, dropLi, e, dragObj);\n }\n else if (dropTarget.firstElementChild && dropTarget.classList.contains(ROOT)) {\n if (dropTarget.firstElementChild.nodeName === 'UL') {\n this.dropAsSiblingNode(dragLi, dropLi, e, dragObj);\n }\n }\n else if ((dropTarget.classList.contains('e-icon-collapsible')) || (dropTarget.classList.contains('e-icon-expandable'))) {\n this.dropAsSiblingNode(dragLi, dropLi, e, dragObj);\n }\n else {\n this.dropAsChildNode(dragLi, dropLi, dragObj, null, e, offsetY);\n }\n }\n else {\n this.dropAsChildNode(dragLi, dropLi, dragObj, null, e, offsetY, true);\n }\n };\n TreeView.prototype.dropAsSiblingNode = function (dragLi, dropLi, e, dragObj) {\n var dropUl = closest(dropLi, '.' + PARENTITEM);\n var dragParentUl = closest(dragLi, '.' + PARENTITEM);\n var dragParentLi = closest(dragParentUl, '.' + LISTITEM);\n var pre;\n if (e.target.offsetHeight > 0 && e.event.offsetY > e.target.offsetHeight - 2) {\n pre = false;\n }\n else if (e.event.offsetY < 2) {\n pre = true;\n }\n else if (e.target.classList.contains('e-icon-expandable') || (e.target.classList.contains('e-icon-collapsible'))) {\n if ((e.event.offsetY < 5) || (e.event.offsetX < 3)) {\n pre = true;\n }\n else if ((e.event.offsetY > 15) || (e.event.offsetX > 17)) {\n pre = false;\n }\n }\n if ((e.target.classList.contains('e-icon-expandable')) || (e.target.classList.contains('e-icon-collapsible'))) {\n var target = e.target.closest('li');\n dropUl.insertBefore(dragLi, pre ? target : target.nextElementSibling);\n }\n else {\n dropUl.insertBefore(dragLi, pre ? e.target : e.target.nextElementSibling);\n }\n this.moveData(dragLi, dropLi, dropUl, pre, dragObj);\n this.updateElement(dragParentUl, dragParentLi);\n this.updateAriaLevel(dragLi);\n if (dragObj.element.id === this.element.id) {\n this.updateList();\n }\n else {\n dragObj.updateInstance();\n this.updateInstance();\n }\n };\n TreeView.prototype.dropAsChildNode = function (dragLi, dropLi, dragObj, index, e, pos, isCheck) {\n var dragParentUl = closest(dragLi, '.' + PARENTITEM);\n var dragParentLi = closest(dragParentUl, '.' + LISTITEM);\n var dropParentUl = closest(dropLi, '.' + PARENTITEM);\n var templateTarget;\n if (e && e.target) {\n templateTarget = select(this.fullRowSelect ? '.' + FULLROW : '.' + TEXTWRAP, dropLi);\n }\n if (e && (pos < 7) && !isCheck) {\n dropParentUl.insertBefore(dragLi, dropLi);\n this.moveData(dragLi, dropLi, dropParentUl, true, dragObj);\n }\n else if (e && (e.target.offsetHeight > 0 && pos > (e.target.offsetHeight - 10)) && !isCheck && !this.hasTemplate) {\n dropParentUl.insertBefore(dragLi, dropLi.nextElementSibling);\n this.moveData(dragLi, dropLi, dropParentUl, false, dragObj);\n }\n else if (this.hasTemplate && templateTarget && pos > templateTarget.offsetHeight - 10 && !isCheck) {\n dropParentUl.insertBefore(dragLi, dropLi.nextElementSibling);\n this.moveData(dragLi, dropLi, dropParentUl, false, dragObj);\n }\n else {\n var dropUl = this.expandParent(dropLi);\n var childLi = dropUl.childNodes[index];\n dropUl.insertBefore(dragLi, childLi);\n this.moveData(dragLi, childLi, dropUl, true, dragObj);\n }\n this.updateElement(dragParentUl, dragParentLi);\n this.updateAriaLevel(dragLi);\n if (dragObj.element.id === this.element.id) {\n this.updateList();\n }\n else {\n dragObj.updateInstance();\n this.updateInstance();\n }\n };\n TreeView.prototype.moveData = function (dragLi, dropLi, dropUl, pre, dragObj) {\n var dropParentLi = closest(dropUl, '.' + LISTITEM);\n var id = this.getId(dragLi);\n var removedData = dragObj.updateChildField(dragObj.treeData, dragObj.fields, id, null, null, true);\n var refId = this.getId(dropLi);\n var index = this.getDataPos(this.treeData, this.fields, refId);\n var parentId = this.getId(dropParentLi);\n if (this.dataType === 1) {\n this.updateField(this.treeData, this.fields, parentId, 'hasChildren', true);\n var pos = isNOU(index) ? this.treeData.length : (pre ? index : index + 1);\n if (isNOU(parentId) && !this.hasPid) {\n delete removedData[0][this.fields.parentID];\n }\n else {\n var currPid = this.isNumberTypeId ? parseFloat(parentId) : parentId;\n setValue(this.fields.parentID, currPid, removedData[0]);\n }\n this.treeData.splice(pos, 0, removedData[0]);\n if (dragObj.element.id !== this.element.id) {\n var childData = dragObj.removeChildNodes(id);\n pos++;\n for (var i = 0, len = childData.length; i < len; i++) {\n this.treeData.splice(pos, 0, childData[i]);\n pos++;\n }\n dragObj.groupedData = dragObj.getGroupedData(dragObj.treeData, dragObj.fields.parentID);\n }\n this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);\n }\n else {\n this.addChildData(this.treeData, this.fields, parentId, removedData, pre ? index : index + 1);\n }\n };\n TreeView.prototype.expandParent = function (dropLi) {\n var dropIcon = select('div.' + ICON, dropLi);\n if (dropIcon && dropIcon.classList.contains(EXPANDABLE) && this.preventExpand !== true) {\n this.expandAction(dropLi, dropIcon, null);\n }\n var dropUl = select('.' + PARENTITEM, dropLi);\n if (this.preventExpand === true && !dropUl && dropIcon) {\n this.renderChildNodes(dropLi);\n }\n dropUl = select('.' + PARENTITEM, dropLi);\n if (!isNOU(dropUl) && this.preventExpand === true) {\n dropUl.style.display = 'none';\n }\n if (!isNOU(dropUl) && this.preventExpand === false) {\n dropUl.style.display = 'block';\n }\n if (isNOU(dropUl) && this.preventExpand === true) {\n if (isNOU(dropIcon)) {\n ListBase.generateIcon(this.createElement, dropLi, EXPANDABLE, this.listBaseOption);\n }\n var icon = select('div.' + ICON, dropLi);\n if (icon) {\n icon.classList.add('e-icon-expandable');\n }\n dropUl = ListBase.generateUL(this.createElement, [], null, this.listBaseOption);\n dropLi.appendChild(dropUl);\n if (icon) {\n removeClass([icon], COLLAPSIBLE);\n }\n else {\n ListBase.generateIcon(this.createElement, dropLi, EXPANDABLE, this.listBaseOption);\n }\n dropLi.setAttribute('aria-expanded', 'false');\n dropUl.style.display = 'none';\n }\n if (isNOU(dropUl)) {\n this.trigger('nodeExpanding', this.getExpandEvent(dropLi, null));\n if (isNOU(dropIcon)) {\n ListBase.generateIcon(this.createElement, dropLi, COLLAPSIBLE, this.listBaseOption);\n }\n var icon = select('div.' + ICON, dropLi);\n if (icon) {\n removeClass([icon], EXPANDABLE);\n }\n else {\n ListBase.generateIcon(this.createElement, dropLi, COLLAPSIBLE, this.listBaseOption);\n icon = select('div.' + ICON, dropLi);\n removeClass([icon], EXPANDABLE);\n }\n dropUl = ListBase.generateUL(this.createElement, [], null, this.listBaseOption);\n dropLi.appendChild(dropUl);\n this.addExpand(dropLi);\n this.trigger('nodeExpanded', this.getExpandEvent(dropLi, null));\n }\n return dropUl;\n };\n TreeView.prototype.updateElement = function (dragParentUl, dragParentLi) {\n if (dragParentLi && dragParentUl.childElementCount === 0) {\n var dragIcon = select('div.' + ICON, dragParentLi);\n detach(dragParentUl);\n detach(dragIcon);\n var parentId = this.getId(dragParentLi);\n this.updateField(this.treeData, this.fields, parentId, 'hasChildren', false);\n this.removeExpand(dragParentLi, true);\n }\n };\n TreeView.prototype.updateAriaLevel = function (dragLi) {\n var level = this.parents(dragLi, '.' + PARENTITEM).length;\n dragLi.setAttribute('aria-level', '' + level);\n this.updateChildAriaLevel(select('.' + PARENTITEM, dragLi), level + 1);\n };\n TreeView.prototype.updateChildAriaLevel = function (element, level) {\n if (!isNOU(element)) {\n var cNodes = element.childNodes;\n for (var i = 0, len = cNodes.length; i < len; i++) {\n var liEle = cNodes[i];\n liEle.setAttribute('aria-level', '' + level);\n this.updateChildAriaLevel(select('.' + PARENTITEM, liEle), level + 1);\n }\n }\n };\n TreeView.prototype.renderVirtualEle = function (e) {\n var pre;\n if (e.event.offsetY > e.target.offsetHeight - 2) {\n pre = false;\n }\n else if (e.event.offsetY < 2) {\n pre = true;\n }\n var virEle = this.createElement('div', { className: SIBLING });\n var index = this.fullRowSelect ? (pre ? 1 : 2) : (pre ? 0 : 1);\n e.target.insertBefore(virEle, e.target.children[index]);\n };\n TreeView.prototype.removeVirtualEle = function () {\n var sibEle = select('.' + SIBLING);\n if (sibEle) {\n detach(sibEle);\n }\n };\n TreeView.prototype.destroyDrag = function () {\n if (this.dragObj && this.dropObj) {\n this.dragObj.destroy();\n this.dropObj.destroy();\n }\n };\n TreeView.prototype.getDragEvent = function (event, obj, dropTarget, target, dragNode, cloneEle, level, drop) {\n var dropLi = dropTarget ? closest(dropTarget, '.' + LISTITEM) : null;\n var dropData = dropLi ? this.getNodeData(dropLi) : null;\n var draggedNode = obj ? obj.dragLi : dragNode;\n var draggedNodeData = obj ? obj.dragData : null;\n var newParent = dropTarget ? this.parents(dropTarget, '.' + LISTITEM) : null;\n var dragLiParent = obj.dragLi.parentElement;\n var dragParent = obj.dragLi ? closest(dragLiParent, '.' + LISTITEM) : null;\n var targetParent = null;\n var indexValue = null;\n var iconCss = [DROPNEXT, DROPIN, DROPOUT, NODROP];\n var iconClass = null;\n var node = (drop === true) ? draggedNode : dropLi;\n var index = node ? closest(node, '.e-list-parent') : null;\n var i = 0;\n var position = null;\n dragParent = (obj.dragLi && dragParent === null) ? closest(dragLiParent, '.' + ROOT) : dragParent;\n dragParent = (drop === true) ? this.dragParent : dragParent;\n if (cloneEle) {\n while (i < 4) {\n if (select('.' + ICON, cloneEle).classList.contains(iconCss[i])) {\n iconClass = iconCss[i];\n break;\n }\n i++;\n }\n }\n if (index) {\n var dropTar = 0;\n for (i = 0; i < index.childElementCount; i++) {\n dropTar = (drop !== true && index.children[i] === draggedNode && dropLi !== draggedNode) ? ++dropTar : dropTar;\n if ((drop !== true && index.children[i].classList.contains('e-hover'))) {\n indexValue = (event.offsetY >= 23) ? i + 1 : i;\n break;\n }\n else if (index.children[i] === node) {\n indexValue = (event.offsetY >= 23) ? i : i;\n break;\n }\n }\n indexValue = (dropTar !== 0) ? --indexValue : indexValue;\n position = (iconClass == \"e-drop-in\") ? \"Inside\" : ((event.offsetY < 7) ? \"Before\" : \"After\");\n }\n if (dropTarget) {\n if (newParent.length === 0) {\n targetParent = null;\n }\n else if (dropTarget.classList.contains(LISTITEM)) {\n targetParent = newParent[0];\n }\n else {\n targetParent = newParent[1];\n }\n }\n if (dropLi === draggedNode) {\n targetParent = dropLi;\n }\n if (dropTarget && target.offsetHeight <= 33 && event.offsetY < target.offsetHeight - 10 && event.offsetY > 6) {\n targetParent = dropLi;\n if (drop !== true) {\n level = ++level;\n var parent_2 = targetParent ? select('.e-list-parent', targetParent) : null;\n indexValue = (parent_2) ? parent_2.children.length : 0;\n if (!(this.fields.dataSource instanceof DataManager) && parent_2 === null && targetParent) {\n var parent_3 = targetParent.hasAttribute('data-uid') ?\n this.getChildNodes(this.fields.dataSource, targetParent.getAttribute('data-uid').toString()) : null;\n indexValue = (parent_3) ? parent_3.length : 0;\n }\n }\n }\n return {\n cancel: false,\n clonedNode: cloneEle,\n event: event,\n draggedNode: draggedNode,\n draggedNodeData: draggedNodeData,\n droppedNode: dropLi,\n droppedNodeData: dropData,\n dropIndex: indexValue,\n dropLevel: level,\n draggedParentNode: dragParent,\n dropTarget: targetParent,\n dropIndicator: iconClass,\n target: target,\n position: position,\n };\n };\n TreeView.prototype.addFullRow = function (toAdd) {\n var len = this.liList.length;\n if (toAdd) {\n for (var i = 0; i < len; i++) {\n this.createFullRow(this.liList[i]);\n }\n }\n else {\n for (var i = 0; i < len; i++) {\n var rowDiv = select('.' + FULLROW, this.liList[i]);\n detach(rowDiv);\n }\n }\n };\n TreeView.prototype.createFullRow = function (item) {\n var rowDiv = this.createElement('div', { className: FULLROW });\n item.insertBefore(rowDiv, item.childNodes[0]);\n };\n TreeView.prototype.addMultiSelect = function (toAdd) {\n if (toAdd) {\n var liEles = selectAll('.' + LISTITEM + ':not([aria-selected=\"true\"])', this.element);\n for (var _i = 0, liEles_1 = liEles; _i < liEles_1.length; _i++) {\n var ele = liEles_1[_i];\n ele.setAttribute('aria-selected', 'false');\n }\n }\n else {\n var liEles = selectAll('.' + LISTITEM + '[aria-selected=\"false\"]', this.element);\n for (var _a = 0, liEles_2 = liEles; _a < liEles_2.length; _a++) {\n var ele = liEles_2[_a];\n ele.removeAttribute('aria-selected');\n }\n }\n };\n TreeView.prototype.collapseByLevel = function (element, level, excludeHiddenNodes) {\n if (level > 0 && !isNOU(element)) {\n var cNodes = this.getVisibleNodes(excludeHiddenNodes, element.childNodes);\n for (var i = 0, len = cNodes.length; i < len; i++) {\n var liEle = cNodes[i];\n var icon = select('.' + COLLAPSIBLE, select('.' + TEXTWRAP, liEle));\n if (!isNOU(icon)) {\n this.collapseNode(liEle, icon, null);\n }\n this.collapseByLevel(select('.' + PARENTITEM, liEle), level - 1, excludeHiddenNodes);\n }\n }\n };\n TreeView.prototype.collapseAllNodes = function (excludeHiddenNodes) {\n var cIcons = this.getVisibleNodes(excludeHiddenNodes, selectAll('.' + COLLAPSIBLE, this.element));\n for (var i = 0, len = cIcons.length; i < len; i++) {\n var icon = cIcons[i];\n var liEle = closest(icon, '.' + LISTITEM);\n this.collapseNode(liEle, icon, null);\n }\n };\n TreeView.prototype.expandByLevel = function (element, level, excludeHiddenNodes) {\n if (level > 0 && !isNOU(element)) {\n var eNodes = this.getVisibleNodes(excludeHiddenNodes, element.childNodes);\n for (var i = 0, len = eNodes.length; i < len; i++) {\n var liEle = eNodes[i];\n var icon = select('.' + EXPANDABLE, select('.' + TEXTWRAP, liEle));\n if (!isNOU(icon)) {\n this.expandAction(liEle, icon, null);\n }\n this.expandByLevel(select('.' + PARENTITEM, liEle), level - 1, excludeHiddenNodes);\n }\n }\n };\n TreeView.prototype.expandAllNodes = function (excludeHiddenNodes) {\n var eIcons = this.getVisibleNodes(excludeHiddenNodes, selectAll('.' + EXPANDABLE, this.element));\n for (var i = 0, len = eIcons.length; i < len; i++) {\n var icon = eIcons[i];\n var liEle = closest(icon, '.' + LISTITEM);\n this.expandAction(liEle, icon, null, true);\n }\n };\n TreeView.prototype.getVisibleNodes = function (excludeHiddenNodes, nodes) {\n var vNodes = Array.prototype.slice.call(nodes);\n if (excludeHiddenNodes) {\n for (var i = 0; i < vNodes.length; i++) {\n if (!isVisible(vNodes[i])) {\n vNodes.splice(i, 1);\n i--;\n }\n }\n }\n return vNodes;\n };\n TreeView.prototype.removeNode = function (node) {\n var dragParentUl = closest(node, '.' + PARENTITEM);\n var dragParentLi = closest(dragParentUl, '.' + LISTITEM);\n if (!isNOU(this.nodeTemplateFn)) {\n this.destroyTemplate(node);\n }\n detach(node);\n this.updateElement(dragParentUl, dragParentLi);\n this.removeData(node);\n };\n TreeView.prototype.updateInstance = function () {\n this.updateList();\n this.updateSelectedNodes();\n this.updateExpandedNodes();\n };\n TreeView.prototype.updateList = function () {\n this.liList = Array.prototype.slice.call(selectAll('.' + LISTITEM, this.element));\n };\n TreeView.prototype.updateSelectedNodes = function () {\n this.setProperties({ selectedNodes: [] }, true);\n var sNodes = selectAll('.' + ACTIVE, this.element);\n this.selectGivenNodes(sNodes);\n };\n TreeView.prototype.updateExpandedNodes = function () {\n this.setProperties({ expandedNodes: [] }, true);\n var eNodes = selectAll('[aria-expanded=\"true\"]', this.element);\n for (var i = 0, len = eNodes.length; i < len; i++) {\n this.addExpand(eNodes[i]);\n }\n };\n TreeView.prototype.removeData = function (node) {\n if (this.dataType === 1) {\n var dm = new DataManager(this.treeData);\n var id = this.getId(node);\n var data = {};\n var newId = this.isNumberTypeId ? parseFloat(id) : id;\n data[this.fields.id] = newId;\n dm.remove(this.fields.id, data);\n this.removeChildNodes(id);\n }\n else {\n var id = this.getId(node);\n this.updateChildField(this.treeData, this.fields, id, null, null, true);\n }\n };\n TreeView.prototype.removeChildNodes = function (parentId) {\n var cNodes = this.getChildGroup(this.groupedData, parentId, false);\n var childData = [];\n if (cNodes) {\n for (var i = 0, len = cNodes.length; i < len; i++) {\n var dm = new DataManager(this.treeData);\n var id = getValue(this.fields.id, cNodes[i]).toString();\n var data = {};\n var currId = this.isNumberTypeId ? parseFloat(id) : id;\n data[this.fields.id] = currId;\n var nodeData = dm.remove(this.fields.id, data);\n childData.push(nodeData[0]);\n this.removeChildNodes(id);\n }\n }\n return childData;\n };\n TreeView.prototype.doGivenAction = function (nodes, selector, toExpand) {\n for (var i = 0, len = nodes.length; i < len; i++) {\n var liEle = this.getElement(nodes[i]);\n if (isNOU(liEle)) {\n continue;\n }\n var icon = select('.' + selector, select('.' + TEXTWRAP, liEle));\n if (!isNOU(icon)) {\n toExpand ? this.expandAction(liEle, icon, null) : this.collapseNode(liEle, icon, null);\n }\n }\n };\n TreeView.prototype.addGivenNodes = function (nodes, dropLi, index, isRemote, dropEle) {\n if (nodes.length === 0) {\n return;\n }\n var sNodes = this.getSortedData(nodes);\n var level = dropLi ? parseFloat(dropLi.getAttribute('aria-level')) + 1 : 1;\n if (isRemote) {\n this.updateMapper(level);\n }\n var li = ListBase.createListItemFromJson(this.createElement, sNodes, this.listBaseOption, level);\n var dropUl;\n if (!dropEle) {\n dropUl = dropLi ? this.expandParent(dropLi) : select('.' + PARENTITEM, this.element);\n }\n else {\n dropUl = dropEle;\n }\n var refNode = dropUl.childNodes[index];\n for (var i = 0; i < li.length; i++) {\n dropUl.insertBefore(li[i], refNode);\n }\n var id = this.getId(dropLi);\n if (this.dataType === 1) {\n this.updateField(this.treeData, this.fields, id, 'hasChildren', true);\n var refId = this.getId(refNode);\n var pos = isNOU(refId) ? this.treeData.length : this.getDataPos(this.treeData, this.fields, refId);\n for (var j = 0; j < nodes.length; j++) {\n if (!isNOU(id)) {\n var currId = this.isNumberTypeId ? parseFloat(id) : id;\n setValue(this.fields.parentID, currId, nodes[j]);\n }\n this.treeData.splice(pos, 0, nodes[j]);\n pos++;\n }\n }\n else {\n this.addChildData(this.treeData, this.fields, id, nodes, index);\n }\n this.finalizeNode(dropUl);\n };\n TreeView.prototype.updateMapper = function (level) {\n var mapper = (level === 1) ? this.fields : this.getChildFields(this.fields, level - 1, 1);\n this.updateListProp(mapper);\n };\n TreeView.prototype.updateListProp = function (mapper) {\n var prop = this.getActualProperties(mapper);\n this.listBaseOption.fields = prop;\n this.listBaseOption.fields.url = prop.hasOwnProperty('navigateUrl') ? prop.navigateUrl : 'navigateUrl';\n };\n TreeView.prototype.getDataPos = function (obj, mapper, id) {\n var pos = null;\n for (var i = 0, objlen = obj.length; i < objlen; i++) {\n var nodeId = getValue(mapper.id, obj[i]);\n if (obj[i] && nodeId && nodeId.toString() === id) {\n return i;\n }\n else if (typeof mapper.child === 'string' && !isNOU(getValue(mapper.child, obj[i]))) {\n var data = getValue(mapper.child, obj[i]);\n pos = this.getDataPos(data, this.getChildMapper(mapper), id);\n if (pos !== null) {\n break;\n }\n }\n else if (this.fields.dataSource instanceof DataManager && !isNOU(getValue('child', obj[i]))) {\n var items = getValue('child', obj[i]);\n pos = this.getDataPos(items, this.getChildMapper(mapper), id);\n if (pos !== null) {\n break;\n }\n }\n }\n return pos;\n };\n TreeView.prototype.addChildData = function (obj, mapper, id, data, index) {\n var updated;\n if (isNOU(id)) {\n index = isNOU(index) ? obj.length : index;\n for (var k = 0, len = data.length; k < len; k++) {\n obj.splice(index, 0, data[k]);\n index++;\n }\n return updated;\n }\n for (var i = 0, objlen = obj.length; i < objlen; i++) {\n var nodeId = getValue(mapper.id, obj[i]);\n if (obj[i] && nodeId && nodeId.toString() === id) {\n if ((typeof mapper.child === 'string' && (obj[i].hasOwnProperty(mapper.child) && obj[i][mapper.child] !== null)) ||\n ((this.fields.dataSource instanceof DataManager) && obj[i].hasOwnProperty('child'))) {\n var key = (typeof mapper.child === 'string') ? mapper.child : 'child';\n var childData = getValue(key, obj[i]);\n if (isNOU(childData)) {\n childData = [];\n }\n index = isNOU(index) ? childData.length : index;\n for (var k = 0, len = data.length; k < len; k++) {\n childData.splice(index, 0, data[k]);\n index++;\n }\n }\n else {\n var key = (typeof mapper.child === 'string') ? mapper.child : 'child';\n obj[i][key] = data;\n }\n return true;\n }\n else if (typeof mapper.child === 'string' && !isNOU(getValue(mapper.child, obj[i]))) {\n var childObj = getValue(mapper.child, obj[i]);\n updated = this.addChildData(childObj, this.getChildMapper(mapper), id, data, index);\n if (updated !== undefined) {\n break;\n }\n }\n else if ((this.fields.dataSource instanceof DataManager) && !isNOU(getValue('child', obj[i]))) {\n var childData = getValue('child', obj[i]);\n updated = this.addChildData(childData, this.getChildMapper(mapper), id, data, index);\n if (updated !== undefined) {\n break;\n }\n }\n }\n return updated;\n };\n TreeView.prototype.doDisableAction = function (nodes) {\n var validNodes = this.nodeType(nodes);\n var validID = this.checkValidId(validNodes);\n this.validArr = [];\n for (var i = 0, len = validID.length; i < len; i++) {\n var id = validID[i][this.fields.id].toString();\n if (id && this.disableNode.indexOf(id) === -1) {\n this.disableNode.push(id);\n }\n var liEle = this.getElement(id);\n if (liEle) {\n liEle.setAttribute('aria-disabled', 'true');\n addClass([liEle], DISABLE);\n }\n }\n };\n TreeView.prototype.doEnableAction = function (nodes) {\n var strNodes = this.nodeType(nodes);\n for (var i = 0, len = strNodes.length; i < len; i++) {\n var liEle = this.getElement(strNodes[i]);\n var id = strNodes[i];\n if (id && this.disableNode.indexOf(id) !== -1) {\n this.disableNode.splice(this.disableNode.indexOf(id), 1);\n }\n if (liEle) {\n liEle.removeAttribute('aria-disabled');\n removeClass([liEle], DISABLE);\n }\n }\n };\n TreeView.prototype.nodeType = function (nodes) {\n var validID = [];\n for (var i = 0, len = nodes.length; i < len; i++) {\n var id = void 0;\n if (typeof nodes[i] == \"string\") {\n id = (nodes[i]) ? nodes[i].toString() : null;\n }\n else if (typeof nodes[i] === \"object\") {\n id = nodes[i] ? nodes[i].getAttribute(\"data-uid\").toString() : null;\n }\n if (validID.indexOf(id) == -1) {\n validID.push(id);\n }\n }\n return validID;\n };\n TreeView.prototype.checkValidId = function (node) {\n var _this = this;\n if (this.dataType === 1) {\n this.validArr = this.treeData.filter(function (data) {\n return node.indexOf(data[_this.fields.id] ? data[_this.fields.id].toString() : null) !== -1;\n });\n }\n else if (this.dataType === 2) {\n for (var k = 0; k < this.treeData.length; k++) {\n var id = this.treeData[k][this.fields.id] ? this.treeData[k][this.fields.id].toString() : null;\n if (node.indexOf(id) !== -1) {\n this.validArr.push(this.treeData[k]);\n }\n var childItems = getValue(this.fields.child.toString(), this.treeData[k]);\n if (childItems) {\n this.filterNestedChild(childItems, node);\n }\n }\n }\n return this.validArr;\n };\n TreeView.prototype.filterNestedChild = function (treeData, nodes) {\n for (var k = 0; k < treeData.length; k++) {\n var id = treeData[k][this.fields.id] ? treeData[k][this.fields.id].toString() : null;\n if (nodes.indexOf(id) !== -1) {\n this.validArr.push(treeData[k]);\n }\n var childItems = getValue(this.fields.child.toString(), treeData[k]);\n if (childItems) {\n this.filterNestedChild(childItems, nodes);\n }\n }\n };\n TreeView.prototype.setTouchClass = function () {\n var ele = closest(this.element, '.' + BIGGER);\n this.touchClass = isNOU(ele) ? '' : SMALL;\n };\n TreeView.prototype.updatePersistProp = function () {\n this.removeField(this.treeData, this.fields, ['selected', 'expanded']);\n var sleNodes = this.selectedNodes;\n for (var l = 0, slelen = sleNodes.length; l < slelen; l++) {\n this.updateField(this.treeData, this.fields, sleNodes[l], 'selected', true);\n }\n var enodes = this.expandedNodes;\n for (var k = 0, nodelen = enodes.length; k < nodelen; k++) {\n this.updateField(this.treeData, this.fields, enodes[k], 'expanded', true);\n }\n if (this.showCheckBox) {\n this.removeField(this.treeData, this.fields, ['isChecked']);\n var cnodes = this.checkedNodes;\n for (var m = 0, nodelen = cnodes.length; m < nodelen; m++) {\n this.updateField(this.treeData, this.fields, cnodes[m], 'isChecked', true);\n }\n }\n };\n TreeView.prototype.removeField = function (obj, mapper, names) {\n if (isNOU(obj) || isNOU(mapper)) {\n return;\n }\n for (var i = 0, objlen = obj.length; i < objlen; i++) {\n for (var j = 0; j < names.length; j++) {\n var field = this.getMapperProp(mapper, names[j]);\n if (!isNOU(obj[i][field])) {\n delete obj[i][field];\n }\n }\n if (typeof mapper.child === 'string' && !isNOU(getValue(mapper.child, obj[i]))) {\n this.removeField(getValue(mapper.child, obj[i]), this.getChildMapper(mapper), names);\n }\n else if (this.fields.dataSource instanceof DataManager && !isNOU(getValue('child', obj[i]))) {\n this.removeField(getValue('child', obj[i]), this.getChildMapper(mapper), names);\n }\n }\n };\n TreeView.prototype.getMapperProp = function (mapper, fieldName) {\n switch (fieldName) {\n case 'selected':\n return !isNOU(mapper.selected) ? mapper.selected : 'selected';\n case 'expanded':\n return !isNOU(mapper.expanded) ? mapper.expanded : 'expanded';\n case 'isChecked':\n return !isNOU(mapper.isChecked) ? mapper.isChecked : 'isChecked';\n case 'hasChildren':\n return !isNOU(mapper.hasChildren) ? mapper.hasChildren : 'hasChildren';\n default:\n return fieldName;\n }\n };\n TreeView.prototype.updateField = function (obj, mapper, id, key, value) {\n var childNodes;\n if (isNOU(id)) {\n return;\n }\n else if (this.dataType === 1) {\n var newId = this.isNumberTypeId ? parseFloat(id) : id;\n var resultData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.id, 'equal', newId, false));\n setValue(this.getMapperProp(mapper, key), value, resultData[0]);\n }\n else {\n this.updateChildField(obj, mapper, id, key, value);\n }\n };\n TreeView.prototype.updateChildField = function (obj, mapper, id, key, value, remove) {\n var removedData;\n if (isNOU(obj)) {\n return removedData;\n }\n for (var i = 0, objlen = obj.length; i < objlen; i++) {\n var nodeId = getValue(mapper.id, obj[i]);\n if (obj[i] && nodeId && nodeId.toString() === id) {\n if (remove) {\n removedData = obj.splice(i, 1);\n }\n else {\n setValue(this.getMapperProp(mapper, key), value, obj[i]);\n removedData = [];\n }\n return removedData;\n }\n else if (typeof mapper.child === 'string' && !isNOU(getValue(mapper.child, obj[i]))) {\n var childData = getValue(mapper.child, obj[i]);\n removedData = this.updateChildField(childData, this.getChildMapper(mapper), id, key, value, remove);\n if (removedData !== undefined) {\n break;\n }\n }\n else if (this.fields.dataSource instanceof DataManager && !isNOU(getValue('child', obj[i]))) {\n var childItems = getValue('child', obj[i]);\n removedData = this.updateChildField(childItems, this.getChildMapper(mapper), id, key, value, remove);\n if (removedData !== undefined) {\n break;\n }\n }\n }\n return removedData;\n };\n TreeView.prototype.triggerEvent = function () {\n this.renderReactTemplates();\n var eventArgs = { data: this.treeData };\n this.trigger('dataSourceChanged', eventArgs);\n };\n TreeView.prototype.wireInputEvents = function (inpEle) {\n EventHandler.add(inpEle, 'blur', this.inputFocusOut, this);\n };\n TreeView.prototype.wireEditingEvents = function (toBind) {\n var _this = this;\n if (toBind && !this.disabled) {\n var proxy_2 = this;\n this.touchEditObj = new Touch(this.element, {\n tap: function (e) {\n if (_this.isDoubleTapped(e) && e.tapCount === 2) {\n e.originalEvent.preventDefault();\n proxy_2.editingHandler(e.originalEvent);\n }\n }\n });\n }\n else {\n if (this.touchEditObj) {\n this.touchEditObj.destroy();\n }\n }\n };\n TreeView.prototype.wireClickEvent = function (toBind) {\n if (toBind) {\n var proxy_3 = this;\n this.touchClickObj = new Touch(this.element, {\n tap: function (e) {\n proxy_3.clickHandler(e);\n }\n });\n }\n else {\n if (this.touchClickObj) {\n this.touchClickObj.destroy();\n }\n }\n };\n TreeView.prototype.wireExpandOnEvent = function (toBind) {\n var _this = this;\n if (toBind) {\n var proxy_4 = this;\n this.touchExpandObj = new Touch(this.element, {\n tap: function (e) {\n if ((_this.expandOnType === 'Click' || (_this.expandOnType === 'DblClick' && _this.isDoubleTapped(e) && e.tapCount === 2))\n && e.originalEvent.which !== 3) {\n proxy_4.expandHandler(e);\n }\n }\n });\n }\n else {\n if (this.touchExpandObj) {\n this.touchExpandObj.destroy();\n }\n }\n };\n TreeView.prototype.mouseDownHandler = function (e) {\n this.mouseDownStatus = true;\n if (e.shiftKey || e.ctrlKey) {\n e.preventDefault();\n }\n if (e.ctrlKey && this.allowMultiSelection) {\n EventHandler.add(this.element, 'contextmenu', this.preventContextMenu, this);\n }\n };\n ;\n TreeView.prototype.preventContextMenu = function (e) {\n e.preventDefault();\n };\n TreeView.prototype.wireEvents = function () {\n EventHandler.add(this.element, 'mousedown', this.mouseDownHandler, this);\n this.wireClickEvent(true);\n if (this.expandOnType !== 'None') {\n this.wireExpandOnEvent(true);\n }\n EventHandler.add(this.element, 'focus', this.focusIn, this);\n EventHandler.add(this.element, 'blur', this.focusOut, this);\n EventHandler.add(this.element, 'mouseover', this.onMouseOver, this);\n EventHandler.add(this.element, 'mouseout', this.onMouseLeave, this);\n this.keyboardModule = new KeyboardEvents(this.element, {\n keyAction: this.keyActionHandler.bind(this),\n keyConfigs: this.keyConfigs,\n eventName: 'keydown',\n });\n };\n TreeView.prototype.unWireEvents = function () {\n EventHandler.remove(this.element, 'mousedown', this.mouseDownHandler);\n this.wireClickEvent(false);\n this.wireExpandOnEvent(false);\n EventHandler.remove(this.element, 'focus', this.focusIn);\n EventHandler.remove(this.element, 'blur', this.focusOut);\n EventHandler.remove(this.element, 'mouseover', this.onMouseOver);\n EventHandler.remove(this.element, 'mouseout', this.onMouseLeave);\n if (!this.disabled) {\n this.keyboardModule.destroy();\n }\n };\n TreeView.prototype.parents = function (element, selector) {\n var matched = [];\n var el = element.parentNode;\n while (!isNOU(el)) {\n if (matches(el, selector)) {\n matched.push(el);\n }\n el = el.parentNode;\n }\n return matched;\n };\n TreeView.prototype.isDoubleTapped = function (e) {\n var target = e.originalEvent.target;\n var secondTap;\n if (target && e.tapCount) {\n if (e.tapCount === 1) {\n this.firstTap = closest(target, '.' + LISTITEM);\n }\n else if (e.tapCount === 2) {\n secondTap = closest(target, '.' + LISTITEM);\n }\n }\n return (this.firstTap === secondTap);\n };\n TreeView.prototype.isDescendant = function (parent, child) {\n var node = child.parentNode;\n while (!isNOU(node)) {\n if (node === parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n };\n TreeView.prototype.showSpinner = function (element) {\n addClass([element], LOAD);\n createSpinner({\n target: element,\n width: Browser.isDevice ? 16 : 14\n }, this.createElement);\n showSpinner(element);\n };\n TreeView.prototype.hideSpinner = function (element) {\n hideSpinner(element);\n element.innerHTML = '';\n removeClass([element], LOAD);\n };\n TreeView.prototype.setCheckedNodes = function (nodes) {\n nodes = JSON.parse(JSON.stringify(nodes));\n this.uncheckAll(this.checkedNodes);\n this.setIndeterminate(nodes);\n if (nodes.length > 0) {\n this.checkAll(nodes);\n }\n };\n /**\n * Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel\n */\n TreeView.prototype.setValidCheckedNode = function (node) {\n if (this.dataType === 1) {\n var mapper = this.fields;\n var resultData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.id, 'equal', node, true));\n if (resultData[0]) {\n this.setChildCheckState(resultData, node, resultData[0]);\n if (this.autoCheck) {\n var parent_4 = resultData[0][this.fields.parentID] ? resultData[0][this.fields.parentID].toString() : null;\n var childNodes = this.getChildNodes(this.treeData, parent_4);\n var count = 0;\n for (var len = 0; len < childNodes.length; len++) {\n var childId = childNodes[len][this.fields.id].toString();\n if (this.checkedNodes.indexOf(childId) !== -1) {\n count++;\n }\n }\n if (count === childNodes.length && this.checkedNodes.indexOf(parent_4) === -1 && parent_4) {\n this.checkedNodes.push(parent_4);\n }\n }\n }\n }\n else if (this.dataType === 2) {\n for (var a = 0; a < this.treeData.length; a++) {\n var index = this.treeData[a][this.fields.id] ? this.treeData[a][this.fields.id].toString() : '';\n if (index === node && this.checkedNodes.indexOf(node) === -1) {\n this.checkedNodes.push(node);\n break;\n }\n var childItems = getValue(this.fields.child.toString(), this.treeData[a]);\n if (childItems) {\n this.setChildCheckState(childItems, node, this.treeData[a]);\n }\n }\n }\n };\n /**\n * Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel(for hierarchical DS)\n */\n TreeView.prototype.setChildCheckState = function (childItems, node, treeData) {\n var checkedParent;\n var count = 0;\n if (this.dataType === 1) {\n if (treeData) {\n checkedParent = treeData[this.fields.id] ? treeData[this.fields.id].toString() : null;\n }\n for (var index = 0; index < childItems.length; index++) {\n var checkNode = childItems[index][this.fields.id] ? childItems[index][this.fields.id].toString() : null;\n if (treeData && checkedParent && this.autoCheck) {\n if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkNode) === -1) {\n this.checkedNodes.push(checkNode);\n }\n }\n if (checkNode === node && this.checkedNodes.indexOf(node) === -1) {\n this.checkedNodes.push(node);\n }\n var subChildItems = this.getChildNodes(this.treeData, checkNode);\n if (subChildItems) {\n this.setChildCheckState(subChildItems, node, treeData);\n }\n }\n }\n else {\n if (treeData) {\n checkedParent = treeData[this.fields.id] ? treeData[this.fields.id].toString() : '';\n }\n for (var index = 0; index < childItems.length; index++) {\n var checkedChild = childItems[index][this.fields.id] ? childItems[index][this.fields.id].toString() : '';\n if (treeData && checkedParent && this.autoCheck) {\n if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1) {\n this.checkedNodes.push(checkedChild);\n }\n }\n if (checkedChild === node && this.checkedNodes.indexOf(node) === -1) {\n this.checkedNodes.push(node);\n }\n var subChildItems = getValue(this.fields.child.toString(), childItems[index]);\n if (subChildItems) {\n this.setChildCheckState(subChildItems, node, childItems[index]);\n }\n if (this.checkedNodes.indexOf(checkedChild) !== -1 && this.autoCheck) {\n count++;\n }\n if (count === childItems.length && this.checkedNodes.indexOf(checkedParent) === -1 && this.autoCheck) {\n this.checkedNodes.push(checkedParent);\n }\n }\n }\n };\n TreeView.prototype.setIndeterminate = function (nodes) {\n for (var i = 0; i < nodes.length; i++) {\n this.setValidCheckedNode(nodes[i]);\n }\n };\n TreeView.prototype.updatePosition = function (id, newData, isRefreshChild, childValue) {\n if (this.dataType === 1) {\n var pos = this.getDataPos(this.treeData, this.fields, id);\n this.treeData.splice(pos, 1, newData);\n if (isRefreshChild) {\n this.removeChildNodes(id);\n for (var j = 0; j < childValue.length; j++) {\n this.treeData.splice(pos, 0, childValue[j]);\n pos++;\n }\n }\n this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);\n }\n else {\n this.updateChildPosition(this.treeData, this.fields, id, [newData], undefined);\n }\n };\n TreeView.prototype.updateChildPosition = function (treeData, mapper, currID, newData, index) {\n var found;\n for (var i = 0, objlen = treeData.length; i < objlen; i++) {\n var nodeId = getValue(mapper.id, treeData[i]);\n if (treeData[i] && nodeId && nodeId.toString() === currID) {\n treeData[i] = newData[0];\n return true;\n }\n else if (typeof mapper.child === 'string' && !isNOU(getValue(mapper.child, treeData[i]))) {\n var childObj = getValue(mapper.child, treeData[i]);\n found = this.updateChildPosition(childObj, this.getChildMapper(mapper), currID, newData, index);\n if (found !== undefined) {\n break;\n }\n }\n else if (this.fields.dataSource instanceof DataManager && !isNOU(getValue('child', treeData[i]))) {\n var childData = getValue('child', treeData[i]);\n found = this.updateChildPosition(childData, this.getChildMapper(mapper), currID, newData, index);\n if (found !== undefined) {\n break;\n }\n }\n }\n return found;\n };\n TreeView.prototype.dynamicState = function () {\n this.setDragAndDrop(this.allowDragAndDrop);\n this.wireEditingEvents(this.allowEditing);\n if (!this.disabled) {\n this.wireEvents();\n this.setRipple();\n }\n else {\n this.unWireEvents();\n this.rippleFn();\n this.rippleIconFn();\n }\n };\n TreeView.prototype.crudOperation = function (operation, nodes, target, newText, newNode, index, prevent) {\n var _this = this;\n var data = this.fields.dataSource;\n var matchedArr = [];\n var query = this.getQuery(this.fields);\n var key = this.fields.id;\n var crud;\n var changes = {\n addedRecords: [],\n deletedRecords: [],\n changedRecords: []\n };\n var nodesID = [];\n if (nodes) {\n nodesID = this.nodeType(nodes);\n }\n else if (target) {\n if (typeof target == \"string\") {\n nodesID[0] = target.toString();\n }\n else if (typeof target === \"object\") {\n nodesID[0] = target.getAttribute(\"data-uid\").toString();\n }\n }\n for (var i = 0, len = nodesID.length; i < len; i++) {\n var liEle = this.getElement(nodesID[i]);\n if (isNullOrUndefined(liEle)) {\n continue;\n }\n var removedData = this.getNodeObject(nodesID[i]);\n matchedArr.push(removedData);\n }\n switch (operation) {\n case 'delete':\n if (nodes.length == 1) {\n crud = data.remove(key, matchedArr[0], query.fromTable, query);\n }\n else {\n changes.deletedRecords = matchedArr;\n crud = data.saveChanges(changes, key, query.fromTable, query);\n }\n crud.then(function (e) { return _this.deleteSuccess(nodesID); })\n .catch(function (e) { return _this.dmFailure(e); });\n break;\n case 'update':\n matchedArr[0][this.fields.text] = newText;\n crud = data.update(key, matchedArr[0], query.fromTable, query);\n crud.then(function (e) { return _this.editSucess(target, newText, prevent); })\n .catch(function (e) { return _this.dmFailure(e, target, prevent); });\n break;\n case 'insert':\n if (newNode.length == 1) {\n crud = data.insert(newNode[0], query.fromTable, query);\n }\n else {\n var arr = [];\n for (var i = 0, len = newNode.length; i < len; i++) {\n arr.push(newNode[i]);\n }\n changes.addedRecords = arr;\n crud = data.saveChanges(changes, key, query.fromTable, query);\n }\n crud.then(function (e) {\n var dropLi = _this.getElement(target);\n _this.addSuccess(newNode, dropLi, index);\n _this.preventExpand = false;\n }).catch(function (e) { return _this.dmFailure(e); });\n break;\n }\n };\n TreeView.prototype.deleteSuccess = function (nodes) {\n for (var i = 0, len = nodes.length; i < len; i++) {\n var liEle = this.getElement(nodes[i]);\n if (isNOU(liEle)) {\n continue;\n }\n this.removeNode(liEle);\n }\n this.updateInstance();\n if (this.dataType === 1) {\n this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);\n }\n this.triggerEvent();\n };\n TreeView.prototype.editSucess = function (target, newText, prevent) {\n var liEle = this.getElement(target);\n var txtEle = select('.' + LISTTEXT, liEle);\n this.appendNewText(liEle, txtEle, newText, prevent);\n };\n TreeView.prototype.addSuccess = function (nodes, dropLi, index) {\n var dropUl;\n var icon = dropLi ? dropLi.querySelector('.' + ICON) : null;\n var proxy = this;\n if (dropLi && icon && icon.classList.contains(EXPANDABLE) &&\n dropLi.querySelector('.' + PARENTITEM) === null) {\n proxy.renderChildNodes(dropLi, null, function () {\n dropUl = dropLi.querySelector('.' + PARENTITEM);\n proxy.addGivenNodes(nodes, dropLi, index, true, dropUl);\n proxy.triggerEvent();\n });\n }\n else {\n this.addGivenNodes(nodes, dropLi, index, true);\n this.triggerEvent();\n }\n };\n TreeView.prototype.dmFailure = function (e, target, prevent) {\n if (target) {\n this.updatePreviousText(target, prevent);\n }\n this.trigger('actionFailure', { error: e });\n };\n TreeView.prototype.updatePreviousText = function (target, prevent) {\n var liEle = this.getElement(target);\n var txtEle = select('.' + LISTTEXT, liEle);\n this.updateText(liEle, txtEle, this.oldText, prevent);\n };\n /**\n * Called internally if any of the property value changed.\n * @param {TreeView} newProp\n * @param {TreeView} oldProp\n * @returns void\n * @private\n */\n TreeView.prototype.onPropertyChanged = function (newProp, oldProp) {\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'allowDragAndDrop':\n this.setDragAndDrop(this.allowDragAndDrop);\n break;\n case 'dragArea':\n if (this.allowDragAndDrop) {\n this.dragObj.dragArea = this.dragArea;\n }\n break;\n case 'allowEditing':\n this.wireEditingEvents(this.allowEditing);\n break;\n case 'allowMultiSelection':\n if (this.selectedNodes.length > 1) {\n var sNode = this.getElement(this.selectedNodes[0]);\n this.isLoaded = false;\n this.removeSelectAll();\n this.selectNode(sNode, null);\n this.isLoaded = true;\n }\n this.setMultiSelect(this.allowMultiSelection);\n this.addMultiSelect(this.allowMultiSelection);\n break;\n case 'checkedNodes':\n if (this.showCheckBox) {\n this.checkedNodes = oldProp.checkedNodes;\n this.setCheckedNodes(newProp.checkedNodes);\n }\n break;\n case 'autoCheck':\n if (this.showCheckBox) {\n this.autoCheck = newProp.autoCheck;\n this.ensureIndeterminate();\n }\n break;\n case 'cssClass':\n this.setCssClass(oldProp.cssClass, newProp.cssClass);\n break;\n case 'enableRtl':\n this.setEnableRtl();\n break;\n case 'expandedNodes':\n this.isAnimate = false;\n this.setProperties({ expandedNodes: [] }, true);\n this.collapseAll();\n this.isInitalExpand = true;\n this.setProperties({ expandedNodes: isNOU(newProp.expandedNodes) ? [] : newProp.expandedNodes }, true);\n this.doExpandAction();\n this.isInitalExpand = false;\n this.isAnimate = true;\n break;\n case 'expandOn':\n this.wireExpandOnEvent(false);\n this.setExpandOnType();\n if (this.expandOnType !== 'None' && !this.disabled) {\n this.wireExpandOnEvent(true);\n }\n break;\n case 'disabled':\n this.setDisabledMode();\n this.dynamicState();\n break;\n case 'fields':\n this.isAnimate = false;\n this.isFieldChange = true;\n this.initialRender = true;\n this.reRenderNodes();\n this.initialRender = false;\n this.isAnimate = true;\n this.isFieldChange = false;\n break;\n case 'fullRowSelect':\n this.setFullRow(this.fullRowSelect);\n this.addFullRow(this.fullRowSelect);\n break;\n case 'loadOnDemand':\n if (this.loadOnDemand === false && !this.onLoaded) {\n var nodes = this.element.querySelectorAll('li');\n var i = 0;\n while (i < nodes.length) {\n if (nodes[i].getAttribute('aria-expanded') !== 'true') {\n this.renderChildNodes(nodes[i], true, null, true);\n }\n i++;\n }\n this.onLoaded = true;\n }\n break;\n case 'nodeTemplate':\n this.hasTemplate = false;\n this.nodeTemplateFn = this.templateComplier(this.nodeTemplate);\n this.reRenderNodes();\n break;\n case 'selectedNodes':\n this.removeSelectAll();\n this.setProperties({ selectedNodes: newProp.selectedNodes }, true);\n this.doSelectionAction();\n break;\n case 'showCheckBox':\n this.reRenderNodes();\n break;\n case 'sortOrder':\n this.reRenderNodes();\n break;\n case 'fullRowNavigable':\n this.setProperties({ fullRowNavigable: newProp.fullRowNavigable }, true);\n this.listBaseOption.itemNavigable = newProp.fullRowNavigable;\n this.reRenderNodes();\n break;\n }\n }\n };\n /**\n * Removes the component from the DOM and detaches all its related event handlers. It also removes the attributes and classes.\n */\n TreeView.prototype.destroy = function () {\n this.clearTemplate();\n this.element.removeAttribute('aria-activedescendant');\n this.element.removeAttribute('tabindex');\n this.unWireEvents();\n this.wireEditingEvents(false);\n if (!this.disabled) {\n this.rippleFn();\n this.rippleIconFn();\n }\n this.setCssClass(this.cssClass, null);\n this.setDragAndDrop(false);\n this.setFullRow(false);\n if (this.ulElement && this.ulElement.parentElement) {\n this.ulElement.parentElement.removeChild(this.ulElement);\n }\n _super.prototype.destroy.call(this);\n };\n /**\n * Adds the collection of TreeView nodes based on target and index position. If target node is not specified,\n * then the nodes are added as children of the given parentID or in the root level of TreeView.\n * @param { { [key: string]: Object }[] } nodes - Specifies the array of JSON data that has to be added.\n * @param { string | Element } target - Specifies ID of TreeView node/TreeView node as target element.\n * @param { number } index - Specifies the index to place the newly added nodes in the target element.\n * @param { boolean } preventTargetExpand - If set to true, the target parent node will be prevented from auto expanding.\n */\n TreeView.prototype.addNodes = function (nodes, target, index, preventTargetExpand) {\n if (isNOU(nodes)) {\n return;\n }\n nodes = JSON.parse(JSON.stringify(nodes));\n var dropLi = this.getElement(target);\n this.preventExpand = preventTargetExpand;\n if (this.fields.dataSource instanceof DataManager) {\n if (!this.isOffline) {\n this.crudOperation('insert', null, target, null, nodes, index, this.preventExpand);\n }\n else {\n this.addSuccess(nodes, dropLi, index);\n }\n }\n else if (this.dataType === 2) {\n this.addGivenNodes(nodes, dropLi, index);\n }\n else {\n if (dropLi) {\n this.addGivenNodes(nodes, dropLi, index);\n }\n else {\n nodes = this.getSortedData(nodes);\n for (var i = 0; i < nodes.length; i++) {\n var pid = getValue(this.fields.parentID, nodes[i]);\n dropLi = pid ? this.getElement(pid.toString()) : pid;\n this.addGivenNodes([nodes[i]], dropLi, index);\n }\n }\n this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);\n }\n this.updateCheckedStateFromDS();\n if (this.showCheckBox && dropLi) {\n this.ensureParentCheckState(dropLi);\n }\n if ((this.fields.dataSource instanceof DataManager === false)) {\n this.preventExpand = false;\n this.triggerEvent();\n }\n };\n /**\n * Instead of clicking on the TreeView node for editing, we can enable it by using\n * `beginEdit` property. On passing the node ID or element through this property, the edit textBox\n * will be created for the particular node thus allowing us to edit it.\n * @param {string | Element} node - Specifies ID of TreeView node/TreeView node.\n */\n TreeView.prototype.beginEdit = function (node) {\n var ele = this.getElement(node);\n if (isNOU(ele) || this.disabled) {\n return;\n }\n this.createTextbox(ele, null);\n };\n /**\n * Checks all the unchecked nodes. You can also check specific nodes by passing array of unchecked nodes\n * as argument to this method.\n * @param {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView node.\n */\n TreeView.prototype.checkAll = function (nodes) {\n if (this.showCheckBox) {\n this.doCheckBoxAction(nodes, true);\n }\n };\n /**\n * Collapses all the expanded TreeView nodes. You can collapse specific nodes by passing array of nodes as argument to this method.\n * You can also collapse all the nodes excluding the hidden nodes by setting **excludeHiddenNodes** to true. If you want to collapse\n * a specific level of nodes, set **level** as argument to collapseAll method.\n * @param {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/ array of TreeView node.\n * @param {number} level - TreeView nodes will collapse up to the given level.\n * @param {boolean} excludeHiddenNodes - Whether or not to exclude hidden nodes of TreeView when collapsing all nodes.\n */\n TreeView.prototype.collapseAll = function (nodes, level, excludeHiddenNodes) {\n if (!isNOU(nodes)) {\n this.doGivenAction(nodes, COLLAPSIBLE, false);\n }\n else {\n if (level > 0) {\n this.collapseByLevel(select('.' + PARENTITEM, this.element), level, excludeHiddenNodes);\n }\n else {\n this.collapseAllNodes(excludeHiddenNodes);\n }\n }\n };\n /**\n * Disables the collection of nodes by passing the ID of nodes or node elements in the array.\n * @param {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView nodes.\n */\n TreeView.prototype.disableNodes = function (nodes) {\n if (!isNOU(nodes)) {\n this.doDisableAction(nodes);\n }\n };\n /**\n * Enables the collection of disabled nodes by passing the ID of nodes or node elements in the array.\n * @param {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView nodes.\n */\n TreeView.prototype.enableNodes = function (nodes) {\n if (!isNOU(nodes)) {\n this.doEnableAction(nodes);\n }\n };\n /**\n * Ensures visibility of the TreeView node by using node ID or node element.\n * When many TreeView nodes are present and we need to find a particular node, `ensureVisible` property\n * helps bring the node to visibility by expanding the TreeView and scrolling to the specific node.\n * @param {string | Element} node - Specifies ID of TreeView node/TreeView nodes.\n */\n TreeView.prototype.ensureVisible = function (node) {\n var liEle = this.getElement(node);\n if (isNOU(liEle)) {\n return;\n }\n var parents = this.parents(liEle, '.' + LISTITEM);\n this.expandAll(parents);\n setTimeout(function () { liEle.scrollIntoView(true); }, 450);\n };\n /**\n * Expands all the collapsed TreeView nodes. You can expand the specific nodes by passing the array of collapsed nodes\n * as argument to this method. You can also expand all the collapsed nodes by excluding the hidden nodes by setting\n * **excludeHiddenNodes** to true to this method. To expand a specific level of nodes, set **level** as argument to expandAll method.\n * @param {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView nodes.\n * @param {number} level - TreeView nodes will expand up to the given level.\n * @param {boolean} excludeHiddenNodes - Whether or not to exclude hidden nodes when expanding all nodes.\n */\n TreeView.prototype.expandAll = function (nodes, level, excludeHiddenNodes) {\n if (!isNOU(nodes)) {\n this.doGivenAction(nodes, EXPANDABLE, true);\n }\n else {\n if (level > 0) {\n this.expandByLevel(select('.' + PARENTITEM, this.element), level, excludeHiddenNodes);\n }\n else {\n this.expandAllNodes(excludeHiddenNodes);\n }\n }\n };\n /**\n * Gets all the checked nodes including child, whether it is loaded or not.\n */\n TreeView.prototype.getAllCheckedNodes = function () {\n var checkNodes = this.checkedNodes;\n return checkNodes;\n };\n /**\n * Gets all the disabled nodes including child, whether it is loaded or not.\n */\n TreeView.prototype.getDisabledNodes = function () {\n var disabledNodes = this.disableNode;\n return disabledNodes;\n };\n /**\n * Get the node's data such as id, text, parentID, selected, isChecked, and expanded by passing the node element or it's ID.\n * @param {string | Element} node - Specifies ID of TreeView node/TreeView node.\n */\n TreeView.prototype.getNode = function (node) {\n var ele = this.getElement(node);\n return this.getNodeData(ele, true);\n };\n /**\n * To get the updated data source of TreeView after performing some operation like drag and drop, node editing,\n * node selecting/unSelecting, node expanding/collapsing, node checking/unChecking, adding and removing node.\n * * If you pass the ID of TreeView node as arguments for this method then it will return the updated data source\n * of the corresponding node otherwise it will return the entire updated data source of TreeView.\n * * The updated data source also contains custom attributes if you specified in data source.\n * @param {string | Element} node - Specifies ID of TreeView node/TreeView node.\n * @isGenericType true\n */\n TreeView.prototype.getTreeData = function (node) {\n var id = this.getId(node);\n this.updatePersistProp();\n if (isNOU(id)) {\n return this.treeData;\n }\n else {\n var data = this.getNodeObject(id);\n return isNOU(data) ? [] : [data];\n }\n };\n /**\n * Moves the collection of nodes within the same TreeView based on target or its index position.\n * @param {string[] | Element[]} sourceNodes - Specifies the array of TreeView nodes ID/array of TreeView node.\n * @param {string | Element} target - Specifies ID of TreeView node/TreeView node as target element.\n * @param {number} index - Specifies the index to place the moved nodes in the target element.\n * @param { boolean } preventTargetExpand - If set to true, the target parent node will be prevented from auto expanding.\n */\n TreeView.prototype.moveNodes = function (sourceNodes, target, index, preventTargetExpand) {\n var dropLi = this.getElement(target);\n if (isNOU(dropLi)) {\n return;\n }\n for (var i = 0; i < sourceNodes.length; i++) {\n var dragLi = this.getElement(sourceNodes[i]);\n if (isNOU(dragLi) || dropLi.isSameNode(dragLi) || this.isDescendant(dragLi, dropLi)) {\n continue;\n }\n this.preventExpand = preventTargetExpand;\n this.dropAsChildNode(dragLi, dropLi, this, index);\n }\n if (this.fields.dataSource instanceof DataManager === false) {\n this.preventExpand = false;\n }\n this.triggerEvent();\n };\n /**\n * Refreshes a particular node of the TreeView.\n * @param {string | Element} target - Specifies the ID of TreeView node or TreeView node as target element.\n * @param {{ [key: string]: Object }[]} newData - Specifies the new data of TreeView node.\n */\n TreeView.prototype.refreshNode = function (target, newData) {\n if (isNOU(target) || isNOU(newData)) {\n return;\n }\n var id;\n var isRefreshChild = false;\n if (this.dataType == 1 && newData.length > 1) {\n isRefreshChild = true;\n }\n else if (this.dataType == 2 && newData.length === 1) {\n var updatedChildValue = getValue(this.fields.child.toString(), newData[0]);\n if (!isNOU(updatedChildValue)) {\n isRefreshChild = true;\n }\n }\n var liEle = this.getElement(target);\n id = liEle ? liEle.getAttribute('data-uid') : ((target) ? target.toString() : null);\n this.refreshData = this.getNodeObject(id);\n newData = JSON.parse(JSON.stringify(newData));\n /* eslint-disable */\n var newNodeData;\n var parentData;\n if (this.dataType == 1 && isRefreshChild) {\n for (var k = 0; k < newData.length; k++) {\n if (isNOU(newData[k][this.fields.parentID])) {\n parentData = newData[k];\n newData.splice(k, 1);\n break;\n }\n }\n newNodeData = extend({}, this.refreshData, parentData);\n }\n else {\n newNodeData = extend({}, this.refreshData, newData[0]);\n }\n if (isNOU(liEle)) {\n this.updatePosition(id, newNodeData, isRefreshChild, newData);\n return;\n }\n this.isRefreshed = true;\n var level = parseFloat(liEle.getAttribute('aria-level'));\n var newliEle = ListBase.createListItemFromJson(this.createElement, [newNodeData], this.listBaseOption, level);\n var ul = select('.' + PARENTITEM, liEle);\n var childItems = getValue(this.fields.child.toString(), newNodeData);\n if ((isRefreshChild && ul) || (isRefreshChild && !isNOU(childItems))) {\n var parentEle = liEle.parentElement;\n var index = Array.prototype.indexOf.call(parentEle.childNodes, liEle);\n remove(liEle);\n parentEle.insertBefore(newliEle[0], parentEle.childNodes[index]);\n this.updatePosition(id, newNodeData, isRefreshChild, newData);\n if (isRefreshChild && ul) {\n this.expandAll([id]);\n }\n }\n else {\n var txtEle = select('.' + TEXTWRAP, liEle);\n var newTextEle = select('.' + TEXTWRAP, newliEle[0]);\n var icon = select('div.' + ICON, txtEle);\n var newIcon = select('div.' + ICON, newTextEle);\n if (icon && newIcon) {\n if (newIcon.classList.contains(EXPANDABLE) && icon.classList.contains(COLLAPSIBLE)) {\n removeClass([newIcon], EXPANDABLE);\n addClass([newIcon], COLLAPSIBLE);\n }\n else if (newIcon.classList.contains(COLLAPSIBLE) && icon.classList.contains(EXPANDABLE)) {\n removeClass([newIcon], COLLAPSIBLE);\n addClass([newIcon], EXPANDABLE);\n }\n else if (icon.classList.contains('interaction')) {\n addClass([newIcon], 'interaction');\n }\n }\n remove(txtEle);\n var fullEle = select('.' + FULLROW, liEle);\n fullEle.parentNode.insertBefore(newTextEle, fullEle.nextSibling);\n this.updatePosition(id, newNodeData, isRefreshChild, newData);\n }\n liEle = this.getElement(target);\n if (newNodeData[this.fields.tooltip]) {\n liEle.setAttribute(\"title\", newNodeData[this.fields.tooltip]);\n }\n if (newNodeData.hasOwnProperty(this.fields.htmlAttributes) && newNodeData[this.fields.htmlAttributes]) {\n var attr = {};\n merge(attr, newNodeData[this.fields.htmlAttributes]);\n if (attr.class) {\n addClass([liEle], attr.class.split(' '));\n delete attr.class;\n }\n else {\n attributes(liEle, attr);\n }\n }\n if (this.selectedNodes.indexOf(id) !== -1) {\n liEle.setAttribute('aria-selected', 'true');\n addClass([liEle], ACTIVE);\n }\n this.isRefreshed = false;\n this.triggerEvent();\n };\n /**\n * Removes the collection of TreeView nodes by passing the array of node details as argument to this method.\n * @param {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView node.\n */\n TreeView.prototype.removeNodes = function (nodes) {\n if (!isNOU(nodes)) {\n if (this.fields.dataSource instanceof DataManager && !this.isOffline) {\n this.crudOperation('delete', nodes);\n }\n else {\n this.deleteSuccess(nodes);\n }\n }\n };\n /**\n * Replaces the text of the TreeView node with the given text.\n * @param {string | Element} target - Specifies ID of TreeView node/TreeView node as target element.\n * @param {string} newText - Specifies the new text of TreeView node.\n */\n TreeView.prototype.updateNode = function (target, newText) {\n var _this = this;\n if (isNOU(target) || isNOU(newText) || !this.allowEditing) {\n return;\n }\n var liEle = this.getElement(target);\n if (isNOU(liEle)) {\n return;\n }\n var txtEle = select('.' + LISTTEXT, liEle);\n this.updateOldText(liEle);\n var eventArgs = this.getEditEvent(liEle, null, null);\n this.trigger('nodeEditing', eventArgs, function (observedArgs) {\n if (!observedArgs.cancel) {\n if (_this.fields.dataSource instanceof DataManager && !_this.isOffline) {\n _this.crudOperation('update', null, target, newText, null, null, false);\n }\n else {\n _this.appendNewText(liEle, txtEle, newText, false);\n }\n }\n });\n };\n /**\n * Unchecks all the checked nodes. You can also uncheck the specific nodes by passing array of checked nodes\n * as argument to this method.\n * @param {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView node.\n */\n TreeView.prototype.uncheckAll = function (nodes) {\n if (this.showCheckBox) {\n this.doCheckBoxAction(nodes, false);\n }\n };\n var TreeView_1;\n __decorate([\n Property(false)\n ], TreeView.prototype, \"allowDragAndDrop\", void 0);\n __decorate([\n Property(false)\n ], TreeView.prototype, \"allowEditing\", void 0);\n __decorate([\n Property(false)\n ], TreeView.prototype, \"allowMultiSelection\", void 0);\n __decorate([\n Complex({}, NodeAnimationSettings)\n ], TreeView.prototype, \"animation\", void 0);\n __decorate([\n Property()\n ], TreeView.prototype, \"checkedNodes\", void 0);\n __decorate([\n Property('')\n ], TreeView.prototype, \"cssClass\", void 0);\n __decorate([\n Property(false)\n ], TreeView.prototype, \"disabled\", void 0);\n __decorate([\n Property(null)\n ], TreeView.prototype, \"dragArea\", void 0);\n __decorate([\n Property(false)\n ], TreeView.prototype, \"enableHtmlSanitizer\", void 0);\n __decorate([\n Property(false)\n ], TreeView.prototype, \"enablePersistence\", void 0);\n __decorate([\n Property()\n ], TreeView.prototype, \"expandedNodes\", void 0);\n __decorate([\n Property('Auto')\n ], TreeView.prototype, \"expandOn\", void 0);\n __decorate([\n Complex({}, FieldsSettings)\n ], TreeView.prototype, \"fields\", void 0);\n __decorate([\n Property(true)\n ], TreeView.prototype, \"fullRowSelect\", void 0);\n __decorate([\n Property(true)\n ], TreeView.prototype, \"loadOnDemand\", void 0);\n __decorate([\n Property()\n ], TreeView.prototype, \"locale\", void 0);\n __decorate([\n Property()\n ], TreeView.prototype, \"nodeTemplate\", void 0);\n __decorate([\n Property()\n ], TreeView.prototype, \"selectedNodes\", void 0);\n __decorate([\n Property('None')\n ], TreeView.prototype, \"sortOrder\", void 0);\n __decorate([\n Property(false)\n ], TreeView.prototype, \"showCheckBox\", void 0);\n __decorate([\n Property(true)\n ], TreeView.prototype, \"autoCheck\", void 0);\n __decorate([\n Property(false)\n ], TreeView.prototype, \"fullRowNavigable\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"actionFailure\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"dataBound\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"dataSourceChanged\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"drawNode\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"destroyed\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"keyPress\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeChecked\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeChecking\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeClicked\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeCollapsed\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeCollapsing\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeDragging\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeDragStart\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeDragStop\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeDropped\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeEdited\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeEditing\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeExpanded\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeExpanding\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeSelected\", void 0);\n __decorate([\n Event()\n ], TreeView.prototype, \"nodeSelecting\", void 0);\n TreeView = TreeView_1 = __decorate([\n NotifyPropertyChanges\n ], TreeView);\n return TreeView;\n}(Component));\nexport { TreeView };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-len */\nimport { extend, isNullOrUndefined, createElement, EventHandler, addClass, append, removeClass, remove, closest, classList } from '@syncfusion/ej2-base';\nimport { DataManager, Query } from '@syncfusion/ej2-data';\nimport { TreeView } from '@syncfusion/ej2-navigations';\nimport { Popup } from '@syncfusion/ej2-popups';\nimport { Data } from '../actions/data';\nimport * as cls from '../base/css-constant';\nimport * as events from '../base/constant';\nimport * as util from '../base/util';\nvar ResourceBase = /** @class */ (function () {\n function ResourceBase(parent) {\n this.resourceCollection = [];\n this.leftPixel = 25;\n this.parent = parent;\n }\n ResourceBase.prototype.renderResourceHeaderIndent = function (tr) {\n var resColTd = createElement('td', { className: cls.RESOURCE_LEFT_TD_CLASS });\n var resColDiv = createElement('div', { className: cls.RESOURCE_TEXT_CLASS });\n if (this.parent.activeViewOptions.headerIndentTemplate) {\n var data = { className: [resColTd.className], type: 'emptyCells' };\n this.parent.renderHeaderIndentTemplate(data, resColTd);\n }\n else {\n resColTd.appendChild(resColDiv);\n }\n var args = { elementType: 'emptyCells', element: resColTd };\n this.parent.trigger(events.renderCell, args);\n tr.appendChild(resColTd);\n };\n ResourceBase.prototype.hideResourceRows = function (tBody) {\n if (this.resourceCollection.length <= 1 || this.parent.virtualScrollModule) {\n return;\n }\n var trCount = this.lastResourceLevel.length;\n for (var i = 0; i < trCount; i++) {\n var resData = this.lastResourceLevel[i].resourceData;\n var res = this.lastResourceLevel[i].resource;\n if (resData.ClassName === cls.RESOURCE_PARENT_CLASS && !resData[res.expandedField] &&\n !isNullOrUndefined(resData[res.expandedField])) {\n var trCollection = [].slice.call(tBody.children);\n var slicedCollection = trCollection.slice(i + 1, i + (parseInt(resData.Count, 10) + 1));\n addClass(slicedCollection, cls.HIDDEN_CLASS);\n }\n }\n };\n ResourceBase.prototype.createResourceColumn = function () {\n var resColl = this.resourceCollection;\n var resDiv = createElement('div', { className: cls.RESOURCE_COLUMN_WRAP_CLASS });\n var tbl = this.parent.activeView.createTableLayout(cls.RESOURCE_COLUMN_TABLE_CLASS);\n if (!this.parent.uiStateValues.isGroupAdaptive && this.parent.rowAutoHeight && this.parent.activeView.isTimelineView()\n && this.parent.activeViewOptions.group.resources.length > 0) {\n addClass([tbl], cls.AUTO_HEIGHT);\n }\n var tBody = tbl.querySelector('tbody');\n var resData = this.generateTreeData(true);\n this.countCalculation(resColl.slice(0, -2), resColl.slice(0, -1));\n this.renderedResources = this.lastResourceLevel;\n if (this.parent.virtualScrollModule) {\n var resourceCount = this.parent.virtualScrollModule.getRenderedCount();\n this.setExpandedResources();\n resData = this.expandedResources.slice(0, resourceCount);\n this.renderedResources = resData;\n }\n append(this.getContentRows(resData), tBody);\n this.hideResourceRows(tBody);\n tbl.appendChild(tBody);\n resDiv.appendChild(tbl);\n return resDiv;\n };\n ResourceBase.prototype.setRenderedResources = function () {\n var resColl = this.resourceCollection;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var temp = this.generateTreeData(true);\n this.countCalculation(resColl.slice(0, -2), resColl.slice(0, -1));\n this.renderedResources = this.lastResourceLevel;\n };\n ResourceBase.prototype.setExpandedResources = function () {\n var resources = [];\n for (var i = 0; i < this.lastResourceLevel.length; i++) {\n var resource = this.lastResourceLevel[i].resourceData;\n var count = resource.Count;\n resources.push(this.lastResourceLevel[i]);\n var isExpanded = resource[this.lastResourceLevel[i].resource.expandedField];\n if (!isNullOrUndefined(isExpanded) && !isExpanded && count > 0) {\n i = i + count;\n }\n }\n this.expandedResources = resources;\n };\n ResourceBase.prototype.getContentRows = function (resData, isVirtualScroll) {\n var resRows = [];\n var left;\n var rIndex;\n var resColl = this.resourceCollection;\n var tr = createElement('tr');\n var td = createElement('td', { attrs: { tabindex: isVirtualScroll ? '-1' : '0' } });\n for (var i = 0; i < resData.length; i++) {\n var ntd = td.cloneNode();\n rIndex = util.findIndexInData(resColl, 'name', resData[i].resource.name);\n if (rIndex === resColl.length - 1) {\n extend(resData[i].resourceData, { ClassName: cls.RESOURCE_CHILD_CLASS });\n this.renderedResources[i].className = [cls.RESOURCE_CHILD_CLASS];\n }\n else {\n extend(resData[i].resourceData, { ClassName: cls.RESOURCE_PARENT_CLASS });\n this.renderedResources[i].className = [cls.RESOURCE_PARENT_CLASS];\n }\n left = (rIndex * this.leftPixel) + 'px';\n if (resData[i].resourceData.ClassName === cls.RESOURCE_PARENT_CLASS\n && !isNullOrUndefined(resData[i].resourceData.Count) && (resData[i].resourceData.Count > 0)) {\n var iconClass = void 0;\n if (resData[i].resourceData[resColl[rIndex].expandedField] ||\n isNullOrUndefined(resData[i].resourceData[resColl[rIndex].expandedField])) {\n iconClass = cls.RESOURCE_COLLAPSE_CLASS;\n }\n else {\n iconClass = cls.RESOURCE_EXPAND_CLASS;\n }\n var iconDiv = createElement('div');\n addClass([iconDiv], [cls.RESOURCE_TREE_ICON_CLASS, iconClass]);\n this.setMargin(iconDiv, left);\n ntd.appendChild(iconDiv);\n if (this.resourceCollection.length > 1) {\n EventHandler.add(iconDiv, 'click', this.onTreeIconClick, this);\n }\n }\n this.parent.activeView.setResourceHeaderContent(ntd, resData[i], cls.RESOURCE_TEXT_CLASS);\n ntd.setAttribute('data-group-index', resData[i].groupIndex.toString());\n ntd.setAttribute('aria-label', resData[i].resourceData[resData[i].resource.textField] + ' resource');\n if (!this.parent.activeViewOptions.resourceHeaderTemplate) {\n this.setMargin(ntd.querySelector('.' + cls.RESOURCE_TEXT_CLASS), left);\n }\n var classCollection = [cls.RESOURCE_CELLS_CLASS, resData[i].resourceData.ClassName];\n addClass([ntd], classCollection);\n var args = { elementType: 'resourceHeader', element: ntd, groupIndex: resData[i].groupIndex };\n this.parent.trigger(events.renderCell, args);\n var ntr = tr.cloneNode();\n ntr.appendChild(ntd);\n resRows.push(ntr);\n }\n return resRows;\n };\n ResourceBase.prototype.setMargin = function (element, value) {\n if (!this.parent.enableRtl) {\n element.style.marginLeft = value;\n }\n else {\n element.style.marginRight = value;\n }\n };\n ResourceBase.prototype.countCalculation = function (parentCollection, wholeCollection) {\n var collection;\n for (var y = 0; y < parentCollection.length; y++) {\n var data = parentCollection[parentCollection.length - (y + 1)].dataSource;\n for (var x = 0; x < data.length; x++) {\n var totalCount = 0;\n if (this.parent.activeViewOptions.group.byGroupID) {\n var query = new Query().where(wholeCollection[wholeCollection.length - 1].groupIDField, 'equal', data[x][parentCollection[parentCollection.length - (y + 1)].idField]);\n collection = new DataManager(wholeCollection[wholeCollection.length - 1].dataSource).executeLocal(query);\n }\n else {\n collection = wholeCollection[wholeCollection.length - 1].dataSource;\n }\n for (var z = 0; z < collection.length; z++) {\n totalCount = totalCount + parseInt(collection[z].Count, 10);\n }\n totalCount = totalCount + parseInt(data[x].Count, 10);\n extend(data[x], { Count: totalCount });\n }\n wholeCollection = wholeCollection.slice(0, -1);\n }\n };\n ResourceBase.prototype.onTreeIconClick = function (e) {\n var _this = this;\n if (this.parent.eventTooltip) {\n this.parent.eventTooltip.close();\n }\n var target = e.target;\n var hide;\n var trElement = closest(target, '.' + cls.RESOURCE_PARENT_CLASS)\n .parentElement;\n var index = parseInt(trElement.children[0].getAttribute('data-group-index'), 10);\n var args = {\n cancel: false, event: e, groupIndex: index,\n requestType: !target.classList.contains(cls.RESOURCE_COLLAPSE_CLASS) ? 'resourceExpand' : 'resourceCollapse'\n };\n this.parent.trigger(events.actionBegin, args, function (actionArgs) {\n if (!actionArgs.cancel) {\n if (target.classList.contains(cls.RESOURCE_COLLAPSE_CLASS)) {\n classList(target, [cls.RESOURCE_EXPAND_CLASS], [cls.RESOURCE_COLLAPSE_CLASS]);\n hide = true;\n }\n else {\n classList(target, [cls.RESOURCE_COLLAPSE_CLASS], [cls.RESOURCE_EXPAND_CLASS]);\n hide = false;\n }\n var eventElements = [].slice.call(_this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS));\n for (var _i = 0, eventElements_1 = eventElements; _i < eventElements_1.length; _i++) {\n var element = eventElements_1[_i];\n remove(element);\n }\n if (_this.parent.virtualScrollModule) {\n _this.updateVirtualContent(index, hide, e, target);\n }\n else {\n _this.updateContent(index, hide);\n }\n var data = { cssProperties: _this.parent.getCssProperties(), module: 'scroll' };\n _this.parent.notify(events.scrollUiUpdate, data);\n args = {\n cancel: false, event: e, groupIndex: index,\n requestType: target.classList.contains(cls.RESOURCE_COLLAPSE_CLASS) ? 'resourceExpanded' : 'resourceCollapsed'\n };\n _this.parent.refreshEvents(false);\n _this.parent.trigger(events.actionComplete, args);\n }\n });\n };\n ResourceBase.prototype.updateContent = function (index, hide) {\n var rowCollection = [];\n var workCellCollection = [];\n var headerRowCollection = [];\n var pNode;\n var clickedRes = this.lastResourceLevel[index].resourceData;\n var resRows = [].slice.call(this.parent.element.querySelectorAll('.' + cls.RESOURCE_COLUMN_WRAP_CLASS + ' ' + 'tr'));\n var contentRows = [].slice.call(this.parent.element.querySelectorAll('.' + cls.CONTENT_WRAP_CLASS + ' ' + 'tbody tr'));\n var eventRows = [].slice.call(this.parent.element.querySelectorAll('.' + cls.CONTENT_WRAP_CLASS + ' .' + cls.APPOINTMENT_CONTAINER_CLASS));\n for (var j = 0; j < clickedRes.Count; j++) {\n rowCollection.push(resRows[index + j + 1]);\n workCellCollection.push(contentRows[index + j + 1]);\n headerRowCollection.push(eventRows[index + j + 1]);\n }\n var clonedCollection = this.lastResourceLevel;\n for (var i = 0; i < rowCollection.length; i++) {\n var expanded = true;\n pNode = rowCollection[i].children[0].classList.contains(cls.RESOURCE_PARENT_CLASS);\n clonedCollection[index].resourceData[clonedCollection[index].resource.expandedField] = !hide;\n if (hide) {\n if (pNode) {\n var trElem = rowCollection[i].querySelector('.' + cls.RESOURCE_TREE_ICON_CLASS);\n if (trElem) {\n classList(trElem, [cls.RESOURCE_EXPAND_CLASS], [cls.RESOURCE_COLLAPSE_CLASS]);\n }\n }\n if (!rowCollection[i].classList.contains(cls.HIDDEN_CLASS)) {\n addClass([rowCollection[i], workCellCollection[i], headerRowCollection[i]], cls.HIDDEN_CLASS);\n }\n }\n else {\n if (pNode) {\n var rowIndex = rowCollection[i].rowIndex;\n if (!clonedCollection[rowIndex].resourceData[clonedCollection[rowIndex].resource.expandedField]\n && !isNullOrUndefined(clonedCollection[rowIndex].resourceData[clonedCollection[rowIndex].resource.expandedField])) {\n rowCollection.splice(i + 1, (parseInt(clonedCollection[rowIndex].resourceData.Count, 10)));\n workCellCollection.splice(i + 1, (parseInt(clonedCollection[rowIndex].resourceData.Count, 10)));\n headerRowCollection.splice(i + 1, (parseInt(clonedCollection[rowIndex].resourceData.Count, 10)));\n expanded = false;\n }\n if (expanded) {\n var trElem = rowCollection[i].querySelector('.' + cls.RESOURCE_TREE_ICON_CLASS);\n if (trElem) {\n classList(trElem, [cls.RESOURCE_COLLAPSE_CLASS], [cls.RESOURCE_EXPAND_CLASS]);\n }\n }\n }\n if (rowCollection[i].classList.contains(cls.HIDDEN_CLASS)) {\n removeClass([rowCollection[i], workCellCollection[i], headerRowCollection[i]], cls.HIDDEN_CLASS);\n }\n }\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ResourceBase.prototype.updateVirtualContent = function (index, expand, e, target) {\n this.lastResourceLevel[index].resourceData[this.lastResourceLevel[index].resource.expandedField] = !expand;\n this.setExpandedResources();\n var resourceCount = this.parent.virtualScrollModule.getRenderedCount();\n var startIndex = this.expandedResources.indexOf(this.renderedResources[0]);\n this.renderedResources = this.expandedResources.slice(startIndex, startIndex + resourceCount);\n if (this.renderedResources.length < resourceCount) {\n var sIndex = this.expandedResources.length - resourceCount;\n sIndex = (sIndex > 0) ? sIndex : 0;\n this.renderedResources = this.expandedResources.slice(sIndex, this.expandedResources.length);\n }\n var virtualTrack = this.parent.element.querySelector('.' + cls.VIRTUAL_TRACK_CLASS);\n this.parent.virtualScrollModule.updateVirtualTrackHeight(virtualTrack);\n var resTable = this.parent.element.querySelector('.' + cls.RESOURCE_COLUMN_WRAP_CLASS + ' ' + 'table');\n var contentTable = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS + ' ' + 'table');\n var eventTable = this.parent.element.querySelector('.' + cls.EVENT_TABLE_CLASS);\n this.parent.virtualScrollModule.updateContent(resTable, contentTable, eventTable, this.renderedResources);\n var timeIndicator = this.parent.element.querySelector('.' + cls.CURRENT_TIMELINE_CLASS);\n if (!isNullOrUndefined(timeIndicator)) {\n timeIndicator.style.height =\n this.parent.element.querySelector('.' + cls.CONTENT_TABLE_CLASS).offsetHeight + 'px';\n }\n };\n ResourceBase.prototype.renderResourceHeader = function () {\n var resourceWrapper = createElement('div', { className: cls.RESOURCE_TOOLBAR_CONTAINER });\n resourceWrapper.innerHTML = '
';\n if (this.parent.currentView === 'MonthAgenda') {\n var target = this.parent.activeView.getPanel().querySelector('.' + cls.CONTENT_WRAP_CLASS);\n target.insertBefore(resourceWrapper, target.querySelector('.' + cls.WRAPPER_CONTAINER_CLASS));\n }\n else {\n this.parent.element.insertBefore(resourceWrapper, this.parent.element.querySelector('.' + cls.TABLE_CONTAINER_CLASS));\n }\n this.renderResourceHeaderText();\n EventHandler.add(resourceWrapper.querySelector('.' + cls.RESOURCE_MENU_ICON), 'click', this.menuClick, this);\n };\n ResourceBase.prototype.renderResourceTree = function () {\n this.popupOverlay = createElement('div', { className: cls.RESOURCE_TREE_POPUP_OVERLAY });\n var treeWrapper = createElement('div', { className: cls.RESOURCE_TREE_POPUP + ' e-popup-close' });\n if (this.parent.currentView === 'MonthAgenda') {\n var target = this.parent.activeView.getPanel().querySelector('.' + cls.WRAPPER_CONTAINER_CLASS);\n target.insertBefore(treeWrapper, target.children[0]);\n target.appendChild(this.popupOverlay);\n }\n else {\n this.parent.element.querySelector('.' + cls.TABLE_CONTAINER_CLASS).appendChild(treeWrapper);\n this.parent.element.querySelector('.' + cls.TABLE_CONTAINER_CLASS).appendChild(this.popupOverlay);\n }\n var resourceTree = createElement('div', { className: cls.RESOURCE_TREE });\n treeWrapper.appendChild(resourceTree);\n this.treeViewObj = new TreeView({\n cssClass: this.parent.cssClass,\n enableRtl: this.parent.enableRtl,\n fields: {\n dataSource: [].slice.call(this.generateTreeData()),\n id: 'resourceId',\n text: 'resourceName',\n child: 'resourceChild'\n },\n nodeTemplate: this.parent.resourceHeaderTemplate,\n nodeClicked: this.resourceClick.bind(this)\n });\n this.treeViewObj.appendTo(resourceTree);\n this.treeViewObj.expandAll();\n this.treePopup = new Popup(treeWrapper, {\n targetType: 'relative',\n actionOnScroll: 'none',\n content: this.treeViewObj.element,\n enableRtl: this.parent.enableRtl,\n hideAnimation: { name: 'SlideLeftOut', duration: 500 },\n showAnimation: { name: 'SlideLeftIn', duration: 500 },\n viewPortElement: this.parent.element.querySelector('.' + (this.parent.currentView === 'MonthAgenda' ?\n cls.WRAPPER_CONTAINER_CLASS : cls.TABLE_CONTAINER_CLASS))\n });\n this.parent.on(events.documentClick, this.documentClick, this);\n };\n ResourceBase.prototype.generateTreeData = function (isTimeLine) {\n var _this = this;\n var treeCollection = [];\n var resTreeColl = [];\n var groupIndex = 0;\n var _loop_1 = function (i, len) {\n var treeHandler = function (treeLevel, index, levelId) {\n var resource = _this.resourceCollection[index];\n var treeArgs;\n var resObj;\n if (!isTimeLine) {\n treeArgs = {\n resourceId: levelId,\n resourceName: treeLevel.resourceData[resource.textField],\n resource: treeLevel.resource,\n resourceData: treeLevel.resourceData\n };\n }\n else {\n resObj = {\n type: 'resourceHeader', resource: treeLevel.resource,\n resourceData: treeLevel.resourceData, groupIndex: groupIndex,\n groupOrder: treeLevel.groupOrder\n };\n resTreeColl.push(resObj);\n groupIndex++;\n }\n if (treeLevel.child.length > 0 && !isTimeLine) {\n treeArgs.resourceChild = [];\n }\n var count = 1;\n for (var _i = 0, _a = treeLevel.child; _i < _a.length; _i++) {\n var tree = _a[_i];\n if (!isTimeLine) {\n treeArgs.resourceChild.push(treeHandler(tree, index + 1, levelId + '-' + count));\n }\n else {\n treeHandler(tree, index + 1, levelId + '-' + count);\n }\n count += 1;\n }\n if (isTimeLine) {\n extend(resObj.resourceData, { Count: count - 1 });\n }\n return treeArgs;\n };\n if (!isTimeLine) {\n treeCollection.push(treeHandler(this_1.resourceTreeLevel[i], 0, (i + 1).toString()));\n }\n else {\n treeHandler(this_1.resourceTreeLevel[i], 0, (i + 1).toString());\n }\n };\n var this_1 = this;\n for (var i = 0, len = this.resourceTreeLevel.length; i < len; i++) {\n _loop_1(i, len);\n }\n if (isTimeLine) {\n this.lastResourceLevel = resTreeColl;\n return resTreeColl;\n }\n else {\n return treeCollection;\n }\n };\n ResourceBase.prototype.renderResourceHeaderText = function () {\n var resource = this.lastResourceLevel[this.parent.uiStateValues.groupIndex];\n var headerCollection = [];\n var _loop_2 = function (i, len) {\n var resourceLevel = this_2.resourceCollection[i];\n var resourceText = resourceLevel.dataSource.filter(function (resData) {\n return resData[resourceLevel.idField] === resource.groupOrder[i];\n });\n var resourceName = createElement('div', {\n className: cls.RESOURCE_NAME,\n innerHTML: resourceText[0][resourceLevel.textField]\n });\n headerCollection.push(resourceName);\n var levelIcon = createElement('div', { className: 'e-icons e-icon-next' });\n headerCollection.push(levelIcon);\n };\n var this_2 = this;\n for (var i = 0, len = resource.groupOrder.length; i < len; i++) {\n _loop_2(i, len);\n }\n headerCollection.pop();\n var target = (this.parent.currentView === 'MonthAgenda') ? this.parent.activeView.getPanel() : this.parent.element;\n var headerWrapper = target.querySelector('.' + cls.RESOURCE_LEVEL_TITLE);\n util.removeChildren(headerWrapper);\n for (var _i = 0, headerCollection_1 = headerCollection; _i < headerCollection_1.length; _i++) {\n var header = headerCollection_1[_i];\n headerWrapper.appendChild(header);\n }\n if (this.lastResourceLevel.length === 1) {\n addClass([this.parent.element.querySelector('.' + cls.RESOURCE_MENU)], cls.DISABLE_CLASS);\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ResourceBase.prototype.menuClick = function (event) {\n if (this.parent.element.querySelector('.' + cls.RESOURCE_TREE_POPUP).classList.contains(cls.POPUP_OPEN)) {\n this.treePopup.hide();\n removeClass([this.popupOverlay], cls.ENABLE_CLASS);\n }\n else {\n var treeNodes = [].slice.call(this.treeViewObj.element.querySelectorAll('.e-list-item:not(.e-has-child)'));\n removeClass(treeNodes, 'e-active');\n addClass([treeNodes[this.parent.uiStateValues.groupIndex]], 'e-active');\n this.treePopup.show();\n addClass([this.popupOverlay], cls.ENABLE_CLASS);\n }\n };\n ResourceBase.prototype.selectResourceByIndex = function (groupIndex) {\n if (this.lastResourceLevel && groupIndex > -1 && groupIndex < this.lastResourceLevel.length) {\n this.triggerEvents(groupIndex);\n }\n };\n ResourceBase.prototype.resourceClick = function (event) {\n if (!event.node.classList.contains('e-has-child')) {\n this.treePopup.hide();\n removeClass([this.popupOverlay], cls.ENABLE_CLASS);\n var treeNodes = [].slice.call(this.treeViewObj.element.querySelectorAll('.e-list-item:not(.e-has-child)'));\n var groupIndex = treeNodes.indexOf(event.node);\n this.triggerEvents(groupIndex, event);\n event.event.preventDefault();\n }\n };\n ResourceBase.prototype.triggerEvents = function (groupIndex, event) {\n var _this = this;\n var args = { cancel: false, event: (event) ? event.event : null, groupIndex: groupIndex, requestType: 'resourceChange' };\n this.parent.trigger(events.actionBegin, args, function (actionArgs) {\n if (!actionArgs.cancel) {\n _this.parent.uiStateValues.groupIndex = actionArgs.groupIndex;\n _this.parent.renderModule.render(_this.parent.currentView);\n args = {\n cancel: false, event: (event) ? event.event : null, groupIndex: _this.parent.uiStateValues.groupIndex, requestType: 'resourceChanged'\n };\n _this.parent.trigger(events.actionComplete, args);\n }\n });\n };\n ResourceBase.prototype.documentClick = function (args) {\n if (closest(args.event.target, '.' + cls.RESOURCE_TREE_POPUP)) {\n return;\n }\n var treeWrapper = this.parent.element.querySelector('.' + cls.RESOURCE_TREE_POPUP);\n if (treeWrapper && treeWrapper.classList.contains(cls.POPUP_OPEN)) {\n this.treePopup.hide();\n removeClass([this.popupOverlay], cls.ENABLE_CLASS);\n }\n };\n ResourceBase.prototype.bindResourcesData = function (isSetModel) {\n var _this = this;\n this.parent.showSpinner();\n var promises = [];\n for (var _i = 0, _a = this.parent.resources; _i < _a.length; _i++) {\n var resource = _a[_i];\n var dataModule = new Data(resource.dataSource, resource.query);\n promises.push(dataModule.getData(dataModule.generateQuery()));\n }\n Promise.all(promises).then(function (e) { return _this.dataManagerSuccess(e, isSetModel); })\n .catch(function (e) { return _this.parent.crudModule.dataManagerFailure(e); });\n };\n ResourceBase.prototype.dataManagerSuccess = function (e, isSetModel) {\n if (!this.parent || this.parent && this.parent.isDestroyed) {\n return;\n }\n this.parent.resourceCollection = [];\n for (var i = 0, length_1 = e.length; i < length_1; i++) {\n var resource = this.parent.resources[i];\n var resourceObj = this.getResourceModel(resource, e[i].result);\n this.parent.resourceCollection.push(resourceObj);\n }\n this.refreshLayout(isSetModel);\n };\n ResourceBase.prototype.getResourceModel = function (resource, resourceData) {\n var resourceObj = {\n field: resource.field,\n title: resource.title,\n name: resource.name,\n allowMultiple: resource.allowMultiple,\n dataSource: resourceData || resource.dataSource,\n idField: resource.idField,\n textField: resource.textField,\n groupIDField: resource.groupIDField,\n colorField: resource.colorField,\n startHourField: resource.startHourField,\n endHourField: resource.endHourField,\n workDaysField: resource.workDaysField,\n expandedField: resource.expandedField,\n cssClassField: resource.cssClassField\n };\n return resourceObj;\n };\n ResourceBase.prototype.refreshLayout = function (isSetModel) {\n if (isNullOrUndefined(this.parent.uiStateValues.groupIndex) || !(this.parent.enablePersistence)) {\n this.parent.uiStateValues.groupIndex = 0;\n }\n this.parent.renderElements(isSetModel);\n };\n ResourceBase.prototype.setResourceCollection = function () {\n var requiredResources = [];\n this.resourceCollection = [];\n this.colorIndex = null;\n if (this.parent.activeViewOptions.group.resources.length > 0) {\n for (var _i = 0, _a = this.parent.activeViewOptions.group.resources; _i < _a.length; _i++) {\n var resource = _a[_i];\n var index_1 = util.findIndexInData(this.parent.resourceCollection, 'name', resource);\n if (index_1 >= 0) {\n requiredResources.push(this.parent.resourceCollection[index_1]);\n }\n }\n }\n else if (this.parent.resourceCollection.length > 0) {\n requiredResources = this.parent.resourceCollection;\n }\n var index = 0;\n for (var _b = 0, requiredResources_1 = requiredResources; _b < requiredResources_1.length; _b++) {\n var resource = requiredResources_1[_b];\n var resources = this.getResourceModel(resource);\n if (resource.name === this.parent.eventSettings.resourceColorField) {\n this.colorIndex = index;\n }\n index++;\n this.resourceCollection.push(resources);\n }\n if (isNullOrUndefined(this.colorIndex)) {\n this.colorIndex = this.resourceCollection.length - 1;\n }\n };\n ResourceBase.prototype.generateResourceLevels = function (innerDates, isTimeLine) {\n var _this = this;\n var resources = this.resourceCollection;\n var resTreeGroup = [];\n var lastColumnDates = [];\n var group = function (resources, index, prevResource, prevResourceData, prevOrder) {\n var resTree = [];\n var resource = resources[0];\n if (resource) {\n var data = void 0;\n if (prevResourceData && _this.parent.activeViewOptions.group.byGroupID) {\n var id_1 = prevResourceData[prevResource.idField];\n data = resource.dataSource.filter(function (e) {\n return e[resource.groupIDField] === id_1;\n });\n }\n else {\n data = resource.dataSource;\n }\n for (var i = 0; i < data.length; i++) {\n var groupOrder = [];\n if (prevOrder && prevOrder.length > 0) {\n groupOrder = groupOrder.concat(prevOrder);\n }\n groupOrder.push(data[i][resource.idField]);\n var items = group(resources.slice(1), index + 1, resource, data[i], groupOrder);\n // Here validate child item empty top level resource only\n if (index === 0 && items.length === 0 && _this.resourceCollection.length > 1) {\n continue;\n }\n var dateCol = [];\n var renderDates = _this.parent.activeView.renderDates;\n var resWorkDays = void 0;\n if (!_this.parent.activeViewOptions.group.byDate && index + 1 === _this.resourceCollection.length) {\n var workDays = data[i][resource.workDaysField];\n var resStartHour = data[i][resource.startHourField];\n var resEndHour = data[i][resource.endHourField];\n if (workDays && workDays.length > 0) {\n renderDates = _this.parent.activeView.getRenderDates(workDays);\n resWorkDays = workDays;\n dateCol = _this.parent.activeView.getDateSlots(renderDates, workDays);\n }\n else {\n resWorkDays = _this.parent.activeViewOptions.workDays;\n dateCol = innerDates;\n }\n var dateSlots = _this.generateCustomHours(dateCol, resStartHour, resEndHour, groupOrder);\n lastColumnDates = lastColumnDates.concat(dateSlots);\n }\n var resCssClass = data[i][resource.cssClassField];\n var slotData = {\n type: 'resourceHeader', className: ['e-resource-cells'],\n resourceLevelIndex: index, groupOrder: groupOrder,\n resource: resource, resourceData: data[i],\n colSpan: _this.parent.activeViewOptions.group.byDate ? 1 : dateCol.length,\n renderDates: renderDates, workDays: resWorkDays, cssClass: resCssClass,\n child: items\n };\n resTree.push(slotData);\n }\n if (!resTreeGroup[index]) {\n resTreeGroup[index] = [];\n }\n if (resTree.length > 0) {\n resTreeGroup[index].push(resTree);\n }\n return resTree;\n }\n return [];\n };\n this.resourceTreeLevel = group(resources, 0);\n return (isTimeLine) ? [] : this.generateHeaderLevels(resTreeGroup, lastColumnDates, innerDates);\n };\n ResourceBase.prototype.generateCustomHours = function (renderDates, startHour, endHour, groupOrder) {\n var dateSlots = extend([], renderDates, null, true);\n for (var _i = 0, dateSlots_1 = dateSlots; _i < dateSlots_1.length; _i++) {\n var dateSlot = dateSlots_1[_i];\n if (startHour) {\n dateSlot.startHour = this.parent.getStartEndTime(startHour);\n }\n if (endHour) {\n dateSlot.endHour = this.parent.getStartEndTime(endHour);\n }\n if (groupOrder) {\n dateSlot.groupOrder = groupOrder;\n }\n }\n return dateSlots;\n };\n ResourceBase.prototype.generateHeaderLevels = function (resTreeGroup, lastColumnDates, headerDates) {\n var headerLevels = [];\n for (var i = resTreeGroup.length - 1; i >= 0; i--) {\n var temp = 0;\n for (var _i = 0, _a = resTreeGroup[i]; _i < _a.length; _i++) {\n var currentLevelChilds = _a[_i];\n for (var _b = 0, currentLevelChilds_1 = currentLevelChilds; _b < currentLevelChilds_1.length; _b++) {\n var currentLevelChild = currentLevelChilds_1[_b];\n if (resTreeGroup[i + 1] && resTreeGroup[i + 1].length > 0) {\n var nextLevelChilds = resTreeGroup[i + 1][temp];\n if (!nextLevelChilds) {\n continue;\n }\n var colSpan = 0;\n for (var _c = 0, nextLevelChilds_1 = nextLevelChilds; _c < nextLevelChilds_1.length; _c++) {\n var nextLevelChild = nextLevelChilds_1[_c];\n if (!this.parent.activeViewOptions.group.byGroupID || (this.parent.activeViewOptions.group.byGroupID &&\n nextLevelChild.resourceData[nextLevelChild.resource.groupIDField] ===\n currentLevelChild.resourceData[currentLevelChild.resource.idField])) {\n colSpan += nextLevelChild.colSpan;\n }\n }\n currentLevelChild.colSpan = colSpan;\n }\n currentLevelChild.groupIndex = temp;\n temp++;\n headerLevels[currentLevelChild.resourceLevelIndex] = headerLevels[currentLevelChild.resourceLevelIndex] || [];\n headerLevels[currentLevelChild.resourceLevelIndex].push(currentLevelChild);\n }\n }\n }\n this.lastResourceLevel = headerLevels.slice(-1)[0] || [];\n if (!this.parent.activeViewOptions.group.byDate) {\n var index = 0;\n for (var _d = 0, _e = this.lastResourceLevel; _d < _e.length; _d++) {\n var lastLevelResource = _e[_d];\n for (var i = 0; i < lastLevelResource.colSpan; i++) {\n lastColumnDates[index].groupIndex = lastLevelResource.groupIndex;\n index++;\n }\n }\n headerLevels.push(lastColumnDates);\n return headerLevels;\n }\n var dateHeaderLevels = [];\n var levels = extend([], headerLevels, null, true);\n var dateColSpan = 0;\n for (var _f = 0, _g = levels[0]; _f < _g.length; _f++) {\n var firstRowTd = _g[_f];\n dateColSpan += firstRowTd.colSpan;\n }\n var datesColumn = [];\n for (var _h = 0, headerDates_1 = headerDates; _h < headerDates_1.length; _h++) {\n var headerDate = headerDates_1[_h];\n headerDate.colSpan = dateColSpan;\n datesColumn.push(headerDate);\n var resGroup = extend([], levels, null, true);\n for (var k = 0, length_2 = resGroup.length; k < length_2; k++) {\n if (k === resGroup.length - 1) {\n for (var _j = 0, _k = resGroup[k]; _j < _k.length; _j++) {\n var resTd = _k[_j];\n resTd.date = headerDate.date;\n resTd.workDays = headerDate.workDays;\n resTd.startHour = this.parent.getStartEndTime(resTd.resourceData[resTd.resource.startHourField]) ||\n headerDate.startHour;\n resTd.endHour = this.parent.getStartEndTime(resTd.resourceData[resTd.resource.endHourField]) ||\n headerDate.endHour;\n }\n }\n if (!dateHeaderLevels[k]) {\n dateHeaderLevels[k] = [];\n }\n dateHeaderLevels[k] = dateHeaderLevels[k].concat(resGroup[k]);\n }\n }\n dateHeaderLevels.unshift(datesColumn);\n return dateHeaderLevels;\n };\n ResourceBase.prototype.setResourceValues = function (eventObj, groupIndex) {\n var _this = this;\n var setValues = function (index, field, value) {\n if (_this.resourceCollection[index].allowMultiple && _this.parent.activeViewOptions.group.allowGroupEdit) {\n eventObj[field] = [value];\n }\n else {\n eventObj[field] = value;\n }\n };\n if (groupIndex === void 0) {\n groupIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex :\n this.parent.activeCellsData.groupIndex;\n }\n if (this.parent.activeViewOptions.group.resources.length > 0 && !isNullOrUndefined(groupIndex)) {\n var groupOrder = this.lastResourceLevel[groupIndex].groupOrder;\n for (var index = 0; index < this.resourceCollection.length; index++) {\n setValues(index, this.resourceCollection[index].field, groupOrder[index]);\n }\n }\n else if (this.parent.resourceCollection.length > 0) {\n for (var index = 0; index < this.resourceCollection.length; index++) {\n var data = this.resourceCollection[index].dataSource[0];\n if (data) {\n setValues(index, this.resourceCollection[index].field, data[this.resourceCollection[index].idField]);\n }\n }\n }\n };\n ResourceBase.prototype.getResourceColor = function (eventObj, groupOrder) {\n var colorFieldIndex = (!isNullOrUndefined(groupOrder) &&\n this.colorIndex > groupOrder.length - 1) ? groupOrder.length - 1 : this.colorIndex;\n var resource = this.resourceCollection[colorFieldIndex];\n if (isNullOrUndefined(groupOrder) && this.parent.activeViewOptions.group.allowGroupEdit && resource.allowMultiple) {\n return undefined;\n }\n var id = isNullOrUndefined(groupOrder) ? eventObj[resource.field] : groupOrder[colorFieldIndex];\n var data = this.filterData(resource.dataSource, resource.idField, id);\n if (data.length > 0) {\n return data[0][resource.colorField];\n }\n return undefined;\n };\n ResourceBase.prototype.getCssClass = function (eventObj) {\n var resource = this.resourceCollection.slice(-1)[0];\n if (this.parent.activeViewOptions.group.allowGroupEdit && resource.allowMultiple) {\n return undefined;\n }\n var data = this.filterData(resource.dataSource, resource.idField, eventObj[resource.field]);\n if (data.length > 0) {\n return data[0][resource.cssClassField];\n }\n return undefined;\n };\n ResourceBase.prototype.getResourceRenderDates = function () {\n // eslint-disable-next-line prefer-spread\n var resourceDates = [].concat.apply([], this.lastResourceLevel.map(function (e) { return e.renderDates; }));\n var removeDuplicateDates = function (dateColl) { return dateColl.filter(function (date, index, dates) {\n return dates.map(function (dateObj) { return dateObj.getTime(); }).indexOf(date.getTime()) === index;\n }); };\n var renderDates = removeDuplicateDates(resourceDates);\n renderDates.sort(function (a, b) { return a.getTime() - b.getTime(); });\n return renderDates;\n };\n ResourceBase.prototype.filterData = function (dataSource, field, value) {\n return dataSource.filter(function (data) { return data[field] === value; });\n };\n ResourceBase.prototype.getResourceData = function (eventObj, index, groupEditIndex) {\n if (this.parent.activeViewOptions.group.allowGroupEdit) {\n var resourceObj = {};\n for (var _i = 0, groupEditIndex_1 = groupEditIndex; _i < groupEditIndex_1.length; _i++) {\n var groupIndex = groupEditIndex_1[_i];\n var resourceLevel = this.lastResourceLevel[groupIndex].groupOrder;\n for (var level = 0, length_3 = resourceLevel.length; level < length_3; level++) {\n var fieldName = this.resourceCollection[level].field;\n if (isNullOrUndefined(resourceObj[fieldName])) {\n resourceObj[fieldName] = [];\n }\n resourceObj[fieldName].push(resourceLevel[level]);\n }\n }\n eventObj = extend(eventObj, resourceObj);\n }\n else {\n for (var level = 0, length_4 = this.resourceCollection.length; level < length_4; level++) {\n if (this.lastResourceLevel[index]) {\n eventObj[this.resourceCollection[level].field] = this.lastResourceLevel[index].groupOrder[level];\n }\n }\n }\n };\n ResourceBase.prototype.addResource = function (resources, name, index) {\n var resourceCollection = (resources instanceof Array) ? resources : [resources];\n var _loop_3 = function (resource) {\n if (resource.name === name) {\n resourceCollection.forEach(function (addObj, i) {\n return new DataManager({ json: resource.dataSource }).insert(addObj, null, null, index + i);\n });\n return \"break\";\n }\n };\n for (var _i = 0, _a = this.parent.resourceCollection; _i < _a.length; _i++) {\n var resource = _a[_i];\n var state_1 = _loop_3(resource);\n if (state_1 === \"break\")\n break;\n }\n this.refreshLayout(true);\n };\n ResourceBase.prototype.removeResource = function (resourceId, name) {\n var resourceCollection = (resourceId instanceof Array) ? resourceId : [resourceId];\n var _loop_4 = function (resource) {\n if (resource.name === name) {\n resourceCollection.forEach(function (removeObj) {\n return new DataManager({ json: resource.dataSource }).remove(resource.idField, removeObj);\n });\n return \"break\";\n }\n };\n for (var _i = 0, _a = this.parent.resourceCollection; _i < _a.length; _i++) {\n var resource = _a[_i];\n var state_2 = _loop_4(resource);\n if (state_2 === \"break\")\n break;\n }\n this.refreshLayout(true);\n };\n ResourceBase.prototype.getIndexFromResourceId = function (id, name, resourceData, event, parentField) {\n name = name || this.parent.resourceCollection.slice(-1)[0].name;\n if (isNullOrUndefined(resourceData)) {\n resourceData = this.resourceCollection.filter(function (e) { return e.name === name; })[0];\n if (isNullOrUndefined(resourceData)) {\n return null;\n }\n }\n var resource = resourceData.dataSource.filter(function (e) {\n if (event && e[resourceData.idField] === id) {\n if (e[resourceData.groupIDField] === event[parentField]) {\n return e[resourceData.idField] === id;\n }\n return null;\n }\n else {\n return e[resourceData.idField] === id;\n }\n })[0];\n return (this.lastResourceLevel.map(function (e) { return e.resourceData; }).indexOf(resource));\n };\n ResourceBase.prototype.resourceExpand = function (id, name, hide) {\n var resource = this.parent.resourceCollection.filter(function (e) {\n if (e.name === name) {\n return e;\n }\n return null;\n })[0];\n var index = 0;\n var resourceData = resource.dataSource.filter(function (e) { return e[resource.idField] === id; })[0];\n if (!this.parent.activeViewOptions.group.byGroupID) {\n index = this.getIndexFromResourceId(id, name, resource);\n }\n else {\n index = this.lastResourceLevel.map(function (e) { return e.resourceData; }).indexOf(resourceData);\n }\n var target = this.parent.element.querySelector('.' + cls.RESOURCE_COLUMN_WRAP_CLASS + ' ' + (\"[data-group-index=\\\"\" + index + \"\\\"]\") +\n ' ' + '.' + cls.RESOURCE_TREE_ICON_CLASS);\n if (target) {\n if (target.classList.contains(cls.RESOURCE_EXPAND_CLASS) && !hide) {\n target.click();\n }\n else if (target.classList.contains(cls.RESOURCE_COLLAPSE_CLASS) && hide) {\n target.click();\n }\n }\n };\n ResourceBase.prototype.resourceScroll = function (id, name) {\n if (this.parent.isAdaptive || ['Agenda', 'MonthAgenda'].indexOf(this.parent.currentView) > -1) {\n return;\n }\n var levelName = name || this.parent.resourceCollection.slice(-1)[0].name;\n var levelIndex = this.parent.resourceCollection.length - 1;\n var resource = this.parent.resourceCollection.filter(function (e, index) {\n if (e.name === levelName) {\n levelIndex = index;\n return e;\n }\n return null;\n })[0];\n var scrollElement = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);\n var index = 0;\n if (this.parent.activeView.isTimelineView()) {\n if (!this.parent.activeViewOptions.group.byGroupID) {\n index = this.getIndexFromResourceId(id, levelName, resource);\n }\n else {\n var resourceData = resource.dataSource.filter(function (e) {\n return e[resource.idField] === id;\n })[0];\n index = this.lastResourceLevel.map(function (e) { return e.resourceData; }).indexOf(resourceData);\n }\n if (this.parent.virtualScrollModule) {\n var virtual = this.parent.element.querySelector('.' + cls.VIRTUAL_TRACK_CLASS);\n var averageRowHeight = Math.round(virtual.offsetHeight / this.expandedResources.length);\n if (this.parent.rowAutoHeight) {\n scrollElement.scrollTop = 0;\n this.parent.virtualScrollModule.virtualScrolling();\n }\n scrollElement.scrollTop = (index * averageRowHeight) - (((this.parent.virtualScrollModule.bufferCount - 1) * averageRowHeight));\n this.parent.virtualScrollModule.virtualScrolling();\n if (this.parent.rowAutoHeight) {\n var td = this.parent.element.querySelector(\".\" + cls.WORK_CELLS_CLASS + \"[data-group-index=\\\"\" + index + \"\\\"]\");\n if (td && !td.parentElement.classList.contains(cls.HIDDEN_CLASS)) {\n scrollElement.scrollTop =\n (scrollElement.scrollTop < td.offsetTop) ? td.offsetTop : scrollElement.scrollTop + td.offsetTop;\n }\n }\n else {\n scrollElement.scrollTop = (index * averageRowHeight);\n }\n }\n else {\n var td = this.parent.element.querySelector(\".\" + cls.WORK_CELLS_CLASS + \"[data-group-index=\\\"\" + index + \"\\\"]\");\n if (td && !td.parentElement.classList.contains(cls.HIDDEN_CLASS)) {\n scrollElement.scrollTop = td.offsetTop;\n }\n }\n }\n else {\n if (!this.parent.activeViewOptions.group.byGroupID) {\n index = this.getIndexFromResourceId(id, levelName, resource);\n }\n else {\n if (levelName === this.parent.resourceCollection.slice(-1)[0].name) {\n index = this.lastResourceLevel.map(function (e) { return e.resourceData[resource.idField]; }).indexOf(id);\n }\n else {\n index = resource.dataSource.map(function (e) { return e[resource.idField]; }).indexOf(id);\n }\n }\n var offsetTarget = this.parent.element.querySelector(\".\" + cls.HEADER_ROW_CLASS + \":nth-child(\" + (levelIndex + 1) + \")\");\n var offset = [].slice.call(offsetTarget.children).map(function (node) { return node.offsetLeft; });\n scrollElement.scrollLeft = offset[index];\n }\n };\n ResourceBase.prototype.destroy = function () {\n this.parent.off(events.documentClick, this.documentClick);\n if (this.treeViewObj) {\n this.treeViewObj.destroy();\n this.treeViewObj = null;\n }\n if (this.treePopup) {\n this.treePopup.destroy();\n this.treePopup = null;\n remove(this.parent.element.querySelector('.' + cls.RESOURCE_TREE_POPUP));\n remove(this.parent.element.querySelector('.' + cls.RESOURCE_TREE_POPUP_OVERLAY));\n }\n var resToolBarEle = this.parent.element.querySelector('.' + cls.RESOURCE_TOOLBAR_CONTAINER);\n if (resToolBarEle) {\n remove(resToolBarEle);\n }\n };\n return ResourceBase;\n}());\nexport { ResourceBase };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Component, Property, Event, Animation, Collection, append } from '@syncfusion/ej2-base';\nimport { EventHandler, Browser, Internationalization, getDefaultDateObject, cldrData, L10n } from '@syncfusion/ej2-base';\nimport { getValue, compile, extend, isNullOrUndefined, NotifyPropertyChanges, Complex } from '@syncfusion/ej2-base';\nimport { getElement, removeClass, addClass, classList, remove } from '@syncfusion/ej2-base';\nimport { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';\nimport { HeaderRenderer } from '../renderer/header-renderer';\nimport { Scroll } from '../actions/scroll';\nimport { ScheduleTouch } from '../actions/touch';\nimport { KeyboardInteraction } from '../actions/keyboard';\nimport { Data } from '../actions/data';\nimport { EventBase } from '../event-renderer/event-base';\nimport { InlineEdit } from '../event-renderer/inline-edit';\nimport { QuickPopups } from '../popups/quick-popups';\nimport { EventTooltip } from '../popups/event-tooltip';\nimport { EventWindow } from '../popups/event-window';\nimport { Render } from '../renderer/renderer';\nimport { WorkHours } from '../models/work-hours';\nimport { TimeScale } from '../models/time-scale';\nimport { QuickInfoTemplates } from '../models/quick-info-templates';\nimport { HeaderRows } from '../models/header-rows';\nimport { Crud } from '../actions/crud';\nimport { WorkCellInteraction } from '../actions/work-cells';\nimport { EventSettings } from '../models/event-settings';\nimport { Group } from '../models/group';\nimport { Resources } from '../models/resources';\nimport { Gregorian, Islamic } from '../../common/calendar-util';\nimport { ResourceBase } from '../base/resource';\nimport { Timezone, timezoneData } from '../timezone/timezone';\nimport * as events from '../base/constant';\nimport * as cls from '../base/css-constant';\nimport * as util from '../base/util';\n/**\n * Represents the Schedule component that displays a list of events scheduled against specific date and timings,\n * thus helping us to plan and manage it properly.\n * ```html\n *
\n * ```\n * ```typescript\n * \n * ```\n */\nvar Schedule = /** @class */ (function (_super) {\n __extends(Schedule, _super);\n /**\n * Constructor for creating the Schedule widget\n *\n * @param {ScheduleModel} options Accepts the schedule model properties to initiate the rendering\n * @param {string | HTMLElement} element Accepts the DOM element reference\n */\n function Schedule(options, element) {\n return _super.call(this, options, element) || this;\n }\n /**\n * Core method that initializes the control rendering.\n *\n * @returns {void}\n * @private\n */\n Schedule.prototype.render = function () {\n var addClasses = [];\n var removeClasses = [];\n addClasses.push(cls.ROOT);\n if (this.enableRtl) {\n addClasses.push(cls.RTL);\n }\n else {\n removeClasses.push(cls.RTL);\n }\n if (this.isAdaptive) {\n addClasses.push(cls.DEVICE_CLASS);\n }\n else {\n removeClasses.push(cls.DEVICE_CLASS);\n }\n if (this.allowMultiDrag) {\n addClasses.push(cls.MULTI_DRAG);\n }\n else {\n removeClasses.push(cls.MULTI_DRAG);\n }\n if (this.cssClass) {\n var cssClass = this.cssClass.split(' ');\n for (var _i = 0, cssClass_1 = cssClass; _i < cssClass_1.length; _i++) {\n var cls_1 = cssClass_1[_i];\n addClasses.push(cls_1);\n }\n }\n classList(this.element, addClasses, removeClasses);\n this.validateDate();\n createSpinner({ target: this.element });\n this.scrollModule = new Scroll(this);\n this.scrollModule.setWidth();\n this.scrollModule.setHeight();\n this.renderModule = new Render(this);\n this.eventBase = new EventBase(this);\n this.workCellAction = new WorkCellInteraction(this);\n if (this.allowKeyboardInteraction) {\n this.keyboardInteractionModule = new KeyboardInteraction(this);\n }\n this.inlineModule = new InlineEdit(this);\n this.initializeDataModule();\n this.renderTableContainer();\n this.activeViewOptions = this.getActiveViewOptions();\n this.initializeResources();\n this.wireEvents();\n };\n Schedule.prototype.renderTableContainer = function () {\n if (!this.element.querySelector('.' + cls.TABLE_CONTAINER_CLASS)) {\n this.element.appendChild(this.createElement('div', { className: cls.TABLE_CONTAINER_CLASS }));\n }\n };\n /**\n * Method to render react templates\n *\n * @returns {void}\n * @private\n */\n Schedule.prototype.renderTemplates = function () {\n if (this.isReact) {\n this.renderReactTemplates();\n }\n };\n /**\n * Method to reset react templates\n *\n * @param {string[]} templates Accepts the template ID\n * @returns {void}\n * @private\n */\n Schedule.prototype.resetTemplates = function (templates) {\n if (this.isAngular || this.isReact) {\n this.clearTemplate(templates);\n }\n };\n Schedule.prototype.initializeResources = function (isSetModel) {\n if (isSetModel === void 0) { isSetModel = false; }\n if (this.resources.length > 0) {\n this.resourceBase = new ResourceBase(this);\n this.resourceBase.bindResourcesData(isSetModel);\n }\n else {\n this.resourceBase = null;\n this.resourceCollection = [];\n this.renderElements(isSetModel);\n }\n };\n /**\n * Method to render the layout elements\n *\n * @param {boolean} isLayoutOnly Accepts the boolean value to render layout or not\n * @returns {void}\n * @private\n */\n Schedule.prototype.renderElements = function (isLayoutOnly) {\n if (isLayoutOnly) {\n this.initializeView(this.currentView);\n this.eventWindow.refresh();\n return;\n }\n this.destroyHeaderModule();\n if (this.showHeaderBar) {\n this.headerModule = new HeaderRenderer(this);\n }\n this.renderTableContainer();\n if (Browser.isDevice || Browser.isTouch) {\n this.scheduleTouchModule = new ScheduleTouch(this);\n }\n this.initializeView(this.currentView);\n this.destroyPopups();\n if (!this.isPrinting) {\n this.initializePopups();\n }\n };\n Schedule.prototype.validateDate = function (selectedDate) {\n if (selectedDate === void 0) { selectedDate = this.selectedDate; }\n // persist the selected date value\n var date = selectedDate instanceof Date ? new Date(selectedDate.getTime()) : new Date(selectedDate);\n var minDate = this.minDate instanceof Date ? new Date(this.minDate.getTime()) : new Date(this.minDate);\n var maxDate = this.maxDate instanceof Date ? new Date(this.maxDate.getTime()) : new Date(this.maxDate);\n if (minDate <= maxDate) {\n if (date < minDate) {\n date = minDate;\n }\n if (date > maxDate) {\n date = maxDate;\n }\n this.setProperties({ selectedDate: new Date('' + date), minDate: new Date('' + minDate), maxDate: new Date('' + maxDate) }, true);\n if (this.eventWindow) {\n this.eventWindow.updateMinMaxDateToEditor();\n }\n }\n else {\n throw Error('minDate should be equal or less than maxDate');\n }\n };\n Schedule.prototype.getViewIndex = function (viewName) {\n for (var item = 0; item < this.viewCollections.length; item++) {\n var checkIndex = this.viewCollections[item].option;\n if (checkIndex === viewName) {\n return item;\n }\n }\n return -1;\n };\n Schedule.prototype.setViewOptions = function (isModuleLoad) {\n if (isModuleLoad === void 0) { isModuleLoad = false; }\n this.viewOptions = {};\n this.viewCollections = [];\n var viewName;\n var selectedView;\n var prevIndex = this.viewIndex;\n var count = 0;\n this.viewIndex = -1;\n for (var _i = 0, _a = this.views; _i < _a.length; _i++) {\n var view = _a[_i];\n var isOptions = (typeof view === 'string') ? false : true;\n if (typeof view === 'string') {\n viewName = view;\n if (this.currentView === viewName) {\n selectedView = viewName;\n this.viewIndex = count;\n }\n }\n else {\n viewName = view.option;\n if (view.isSelected) {\n selectedView = viewName;\n this.viewIndex = count;\n }\n }\n var obj = extend({ option: viewName }, isOptions ? view : {});\n var fieldViewName = viewName.charAt(0).toLowerCase() + viewName.slice(1);\n obj.cellHeaderTemplateName = obj.cellHeaderTemplate ? obj.option : '';\n obj.dateHeaderTemplateName = obj.dateHeaderTemplate ? obj.option : '';\n obj.cellTemplateName = obj.cellTemplate ? obj.option : '';\n obj.dayHeaderTemplateName = obj.dayHeaderTemplate ? obj.option : '';\n obj.monthHeaderTemplateName = obj.monthHeaderTemplate ? obj.option : '';\n obj.resourceHeaderTemplateName = obj.resourceHeaderTemplate ? obj.option : '';\n obj.headerIndentTemplateName = obj.headerIndentTemplate ? obj.option : '';\n obj.eventTemplateName = obj.eventTemplate ? obj.option : '';\n if (!isNullOrUndefined(obj.firstDayOfWeek) && obj.firstDayOfWeek === 0) {\n delete obj.firstDayOfWeek;\n }\n if (!isNullOrUndefined(obj.interval) && obj.interval === 1) {\n delete obj.interval;\n }\n this.viewCollections.push(obj);\n if (isNullOrUndefined(this.viewOptions[fieldViewName])) {\n this.viewOptions[fieldViewName] = [obj];\n }\n else {\n this.viewOptions[fieldViewName].push(obj);\n }\n count++;\n }\n if (!isModuleLoad && selectedView) {\n this.setProperties({ currentView: selectedView }, true);\n }\n if (this.viewIndex === -1) {\n var currentIndex = this.getViewIndex(this.currentView);\n this.viewIndex = ((typeof this.views[0] !== 'string') && (!isNullOrUndefined(prevIndex) && prevIndex !== -1)) ? prevIndex :\n (currentIndex === -1) ? 0 : currentIndex;\n }\n };\n Schedule.prototype.getActiveViewOptions = function () {\n var timeScale = {\n enable: this.timeScale.enable,\n interval: this.timeScale.interval,\n slotCount: this.timeScale.slotCount,\n majorSlotTemplate: this.timeScale.majorSlotTemplate,\n minorSlotTemplate: this.timeScale.minorSlotTemplate\n };\n var isYearView = this.viewCollections[this.viewIndex].option.indexOf('Year') > -1;\n var group = {\n byDate: isYearView ? false : this.group.byDate,\n byGroupID: this.group.byGroupID,\n allowGroupEdit: this.group.allowGroupEdit,\n resources: this.group.resources,\n headerTooltipTemplate: this.group.headerTooltipTemplate,\n enableCompactView: this.group.enableCompactView\n };\n var workDays = this.viewCollections[this.viewIndex].workDays ? [] : this.workDays;\n var scheduleOptions = {\n dateFormat: this.dateFormat,\n endHour: this.endHour,\n isSelected: false,\n option: null,\n readonly: this.readonly,\n startHour: this.startHour,\n allowVirtualScrolling: false,\n cellHeaderTemplate: this.cellHeaderTemplate,\n dayHeaderTemplate: this.dayHeaderTemplate,\n monthHeaderTemplate: this.monthHeaderTemplate,\n cellTemplate: this.cellTemplate,\n eventTemplate: this.eventSettings.template,\n dateHeaderTemplate: this.dateHeaderTemplate,\n resourceHeaderTemplate: this.resourceHeaderTemplate,\n headerIndentTemplate: this.headerIndentTemplate,\n firstMonthOfYear: this.firstMonthOfYear,\n firstDayOfWeek: this.firstDayOfWeek,\n workDays: workDays,\n monthsCount: this.monthsCount,\n showWeekend: this.showWeekend,\n showWeekNumber: this.showWeekNumber,\n displayName: null,\n interval: 1,\n timeScale: timeScale,\n timeFormat: this.internalTimeFormat,\n group: group,\n headerRows: this.headerRows,\n orientation: 'Horizontal'\n };\n var viewOptions = this.viewCollections[this.viewIndex];\n var viewsData = extend(scheduleOptions, viewOptions, undefined, true);\n if (this.firstDayOfWeek !== 0 && viewOptions.firstDayOfWeek && this.firstDayOfWeek !== viewOptions.firstDayOfWeek) {\n viewsData.firstDayOfWeek = this.firstDayOfWeek;\n }\n return viewsData;\n };\n Schedule.prototype.initializeDataModule = function () {\n this.eventFields = {\n id: this.eventSettings.fields.id,\n isBlock: this.eventSettings.fields.isBlock,\n subject: this.eventSettings.fields.subject.name,\n startTime: this.eventSettings.fields.startTime.name,\n endTime: this.eventSettings.fields.endTime.name,\n startTimezone: this.eventSettings.fields.startTimezone.name,\n endTimezone: this.eventSettings.fields.endTimezone.name,\n location: this.eventSettings.fields.location.name,\n description: this.eventSettings.fields.description.name,\n isAllDay: this.eventSettings.fields.isAllDay.name,\n recurrenceID: this.eventSettings.fields.recurrenceID.name,\n recurrenceRule: this.eventSettings.fields.recurrenceRule.name,\n recurrenceException: this.eventSettings.fields.recurrenceException.name,\n isReadonly: this.eventSettings.fields.isReadonly,\n followingID: this.eventSettings.fields.followingID\n };\n this.setEditorTitles();\n this.dataModule = new Data(this.eventSettings.dataSource, this.eventSettings.query);\n this.crudModule = new Crud(this);\n };\n Schedule.prototype.setEditorTitles = function () {\n this.editorTitles = {\n subject: this.eventSettings.fields.subject.title || this.localeObj.getConstant('title'),\n startTime: this.eventSettings.fields.startTime.title || this.localeObj.getConstant('start'),\n endTime: this.eventSettings.fields.endTime.title || this.localeObj.getConstant('end'),\n isAllDay: this.eventSettings.fields.isAllDay.title || this.localeObj.getConstant('allDay'),\n startTimezone: this.eventSettings.fields.startTimezone.title || this.localeObj.getConstant('startTimezone'),\n endTimezone: this.eventSettings.fields.endTimezone.title || this.localeObj.getConstant('endTimezone'),\n location: this.eventSettings.fields.location.title || this.localeObj.getConstant('location'),\n description: this.eventSettings.fields.description.title || this.localeObj.getConstant('description'),\n recurrenceRule: this.eventSettings.fields.recurrenceRule.title || this.localeObj.getConstant('repeat')\n };\n };\n Schedule.prototype.initializeView = function (viewName) {\n this.showSpinner();\n this.activeViewOptions = this.getActiveViewOptions();\n if (this.resourceBase) {\n this.resourceBase.setResourceCollection();\n }\n this.initializeTemplates();\n this.renderModule.render(viewName);\n };\n Schedule.prototype.initializeTemplates = function () {\n this.cellHeaderTemplateFn = this.templateParser(this.activeViewOptions.cellHeaderTemplate);\n this.dayHeaderTemplateFn = this.templateParser(this.activeViewOptions.dayHeaderTemplate);\n this.monthHeaderTemplateFn = this.templateParser(this.activeViewOptions.monthHeaderTemplate);\n this.cellTemplateFn = this.templateParser(this.activeViewOptions.cellTemplate);\n this.dateHeaderTemplateFn = this.templateParser(this.activeViewOptions.dateHeaderTemplate);\n this.majorSlotTemplateFn = this.templateParser(this.activeViewOptions.timeScale.majorSlotTemplate);\n this.minorSlotTemplateFn = this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate);\n this.appointmentTemplateFn = this.templateParser(this.activeViewOptions.eventTemplate);\n this.resourceHeaderTemplateFn = this.templateParser(this.activeViewOptions.resourceHeaderTemplate);\n this.headerIndentTemplateFn = this.templateParser(this.activeViewOptions.headerIndentTemplate);\n this.headerTooltipTemplateFn = this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);\n this.eventTooltipTemplateFn = this.templateParser(this.eventSettings.tooltipTemplate);\n this.editorTemplateFn = this.templateParser(this.editorTemplate);\n this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);\n this.quickInfoTemplatesContentFn = this.templateParser(this.quickInfoTemplates.content);\n this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);\n };\n Schedule.prototype.initializePopups = function () {\n this.eventWindow = new EventWindow(this);\n this.quickPopup = new QuickPopups(this);\n };\n /**\n * Method to get day names\n *\n * @param {string} type Accepts the day name\n * @returns {string[]} Returns the collection of day names\n * @private\n */\n Schedule.prototype.getDayNames = function (type) {\n var culShortNames = [];\n var cldrObj;\n var nameSpace = '';\n if (this.locale === 'en' || this.locale === 'en-US') {\n nameSpace = 'days.stand-alone.';\n cldrObj = (getValue(nameSpace + type, getDefaultDateObject(this.getCalendarMode())));\n }\n else {\n nameSpace = 'main.' + '' + this.locale + '.dates.calendars.' + this.getCalendarMode() + '.days.format.' + type;\n cldrObj = (getValue(nameSpace, cldrData));\n }\n for (var _i = 0, _a = Object.keys(cldrObj); _i < _a.length; _i++) {\n var obj = _a[_i];\n culShortNames.push(getValue(obj, cldrObj));\n }\n return culShortNames;\n };\n Schedule.prototype.setCldrTimeFormat = function () {\n if (!isNullOrUndefined(this.timeFormat)) {\n this.internalTimeFormat = this.timeFormat;\n return;\n }\n if (this.locale === 'en' || this.locale === 'en-US') {\n this.internalTimeFormat = (getValue('timeFormats.short', getDefaultDateObject(this.getCalendarMode())));\n }\n else {\n this.internalTimeFormat = (getValue('main.' + '' + this.locale + '.dates.calendars.' + this.getCalendarMode() + '.timeFormats.short', cldrData));\n }\n };\n /**\n * Method to get calendar mode\n *\n * @returns {string} Returns the calendar mode\n * @private\n */\n Schedule.prototype.getCalendarMode = function () {\n return this.calendarMode.toLowerCase();\n };\n /**\n * Method to get time in string\n *\n * @param {Date} date Accepts the date object\n * @returns {string} Returns the time in string\n * @private\n */\n Schedule.prototype.getTimeString = function (date) {\n var time = this.globalize.formatDate(date, {\n format: this.activeViewOptions.timeFormat,\n type: 'time', calendar: this.getCalendarMode()\n });\n return time.toLocaleUpperCase();\n };\n /**\n * Method to get date object\n *\n * @param {Date} date Accepts the date object\n * @returns {Date} Returns the date object\n * @private\n */\n Schedule.prototype.getDateTime = function (date) {\n return date instanceof Date ? new Date(date.getTime()) : new Date(date);\n };\n Schedule.prototype.setCalendarMode = function () {\n if (this.calendarMode === 'Islamic') {\n this.calendarUtil = new Islamic();\n }\n else {\n this.calendarUtil = new Gregorian();\n }\n };\n /**\n * Method to change the current view\n *\n * @param {View} view Accepts the view name\n * @param {Event} event Accepts the event object\n * @param {boolean} muteOnChange Accepts the value to enable or disable mute on change\n * @param {number} index Accepts the index value\n * @returns {void}\n * @private\n */\n Schedule.prototype.changeView = function (view, event, muteOnChange, index) {\n var _this = this;\n if (isNullOrUndefined(index)) {\n index = this.getViewIndex(view);\n }\n if (!muteOnChange && index === this.viewIndex && this.currentView === view || index < 0) {\n return;\n }\n this.viewIndex = index;\n var args = { requestType: 'viewNavigate', cancel: false, event: event };\n this.trigger(events.actionBegin, args, function (actionArgs) {\n if (!actionArgs.cancel) {\n var navArgs = {\n action: 'view', cancel: false, currentDate: _this.selectedDate, previousView: _this.currentView, currentView: view, viewIndex: _this.viewIndex\n };\n _this.trigger(events.navigating, navArgs, function (navigationArgs) {\n if (!navigationArgs.cancel) {\n _this.viewIndex = navigationArgs.viewIndex;\n _this.setProperties({ currentView: view }, true);\n if (_this.headerModule) {\n _this.headerModule.updateActiveView();\n _this.headerModule.setCalendarDate(_this.selectedDate);\n _this.headerModule.setCalendarView();\n }\n _this.initializeView(_this.currentView);\n _this.animateLayout();\n args = { requestType: 'viewNavigate', cancel: false, event: event };\n _this.trigger(events.actionComplete, args);\n }\n });\n }\n });\n };\n /**\n * Method to change the view date\n *\n * @param {Date} selectedDate Accepts the selected date\n * @param {Event} event Accepts the event object\n * @returns {void}\n * @private\n */\n Schedule.prototype.changeDate = function (selectedDate, event) {\n var _this = this;\n var args = { requestType: 'dateNavigate', cancel: false, event: event };\n this.trigger(events.actionBegin, args, function (actionArgs) {\n if (!actionArgs.cancel) {\n var navArgs = {\n action: 'date', cancel: false, previousDate: _this.selectedDate, currentDate: selectedDate\n };\n _this.trigger(events.navigating, navArgs, function (navigationArgs) {\n if (!navigationArgs.cancel) {\n _this.uiStateValues.isInitial = _this.activeView.isTimelineView() ? true : _this.uiStateValues.isInitial;\n _this.validateDate(navigationArgs.currentDate);\n if (_this.headerModule) {\n _this.headerModule.setCalendarDate(navigationArgs.currentDate);\n }\n _this.initializeView(_this.currentView);\n _this.animateLayout();\n args = { requestType: 'dateNavigate', cancel: false, event: event };\n _this.trigger(events.actionComplete, args);\n }\n });\n }\n });\n };\n /**\n * Method to validate min and max date\n *\n * @param {Date} date Accepts the date object\n * @returns {boolean} Returns the boolean result to validate the min and max date\n * @private\n */\n Schedule.prototype.isMinMaxDate = function (date) {\n if (date === void 0) { date = this.selectedDate; }\n return ((date.getTime() >= this.minDate.getTime()) && (date.getTime() <= this.maxDate.getTime()));\n };\n /**\n * Method to validate the selected date\n *\n * @param {Date} date Accepts the date object\n * @returns {boolean} Returns the boolean value for given date is selected date or not\n * @private\n */\n Schedule.prototype.isSelectedDate = function (date) {\n return date.setHours(0, 0, 0, 0) === new Date('' + this.selectedDate).setHours(0, 0, 0, 0);\n };\n /**\n * Method to get the current time\n *\n * @param {Date} date Accepts the date object\n * @returns {Date} Returns the date object after performing the timezone conversion\n * @private\n */\n Schedule.prototype.getCurrentTime = function (date) {\n if (date === void 0) { date = new Date(); }\n if (this.timezone) {\n return this.tzModule.convert(date, this.tzModule.getLocalTimezoneName(), this.timezone);\n }\n return date;\n };\n /** Method to get navigate view\n *\n * @returns {View} Return the navigate view name\n * @private\n */\n Schedule.prototype.getNavigateView = function () {\n if (this.activeView.isTimelineView()) {\n return this.currentView === 'TimelineMonth' || this.currentView === 'TimelineYear' ? 'TimelineDay' : 'Agenda';\n }\n return 'Day';\n };\n Schedule.prototype.animateLayout = function () {\n if (!this.activeView.element) {\n return;\n }\n new Animation({ duration: 600, name: 'FadeIn', timingFunction: 'easeIn' }).animate(this.activeView.element);\n };\n /**\n * To provide the array of modules needed for control rendering\n *\n * @returns {ModuleDeclaration[]} Returns the declared modules\n * @private\n */\n Schedule.prototype.requiredModules = function () {\n var modules = [];\n this.setViewOptions(true);\n for (var _i = 0, _a = Object.keys(this.viewOptions); _i < _a.length; _i++) {\n var view = _a[_i];\n view = (view === 'timelineDay' || view === 'timelineWeek' || view === 'timelineWorkWeek') ? 'timelineViews' : view;\n modules.push({ member: view, args: [this] });\n }\n if (this.allowDragAndDrop) {\n modules.push({ member: 'dragAndDrop', args: [this] });\n }\n if (this.allowResizing) {\n modules.push({ member: 'resize', args: [this] });\n }\n modules.push({ member: 'excelExport', args: [this] });\n modules.push({ member: 'iCalendarExport', args: [this] });\n modules.push({ member: 'iCalendarImport', args: [this] });\n modules.push({ member: 'print', args: [this] });\n return modules;\n };\n /**\n * Initializes the values of private members.\n *\n * @returns {void}\n * @private\n */\n Schedule.prototype.preRender = function () {\n this.isAdaptive = Browser.isDevice || util.isIPadDevice();\n this.globalize = new Internationalization(this.locale);\n this.tzModule = new Timezone();\n if (this && isNullOrUndefined(this.uiStateValues) || !(this.enablePersistence)) {\n this.uiStateValues = {\n expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,\n isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false\n };\n }\n this.activeCellsData = { startTime: this.getCurrentTime(), endTime: this.getCurrentTime(), isAllDay: false };\n this.activeEventData = { event: undefined, element: undefined };\n this.getDefaultLocale();\n this.localeObj = new L10n(this.getModuleName(), this.defaultLocale, this.locale);\n this.setCldrTimeFormat();\n this.setCalendarMode();\n this.eventsData = [];\n this.eventsProcessed = [];\n this.blockData = [];\n this.blockProcessed = [];\n this.resourceCollection = [];\n this.currentAction = null;\n this.selectedElements = [];\n this.setViewOptions();\n };\n Schedule.prototype.getDefaultLocale = function () {\n this.defaultLocale = {\n day: 'Day',\n week: 'Week',\n workWeek: 'Work Week',\n month: 'Month',\n year: 'Year',\n agenda: 'Agenda',\n weekAgenda: 'Week Agenda',\n workWeekAgenda: 'Work Week Agenda',\n monthAgenda: 'Month Agenda',\n today: 'Today',\n noEvents: 'No events',\n emptyContainer: 'There are no events scheduled on this day.',\n allDay: 'All day',\n start: 'Start',\n end: 'End',\n more: 'more',\n close: 'Close',\n cancel: 'Cancel',\n noTitle: '(No Title)',\n delete: 'Delete',\n deleteEvent: 'Delete Event',\n deleteMultipleEvent: 'Delete Multiple Events',\n selectedItems: 'Items selected',\n deleteSeries: 'Entire Series',\n edit: 'Edit',\n editSeries: 'Entire Series',\n editEvent: 'Edit Event',\n createEvent: 'Create',\n subject: 'Subject',\n addTitle: 'Add title',\n moreDetails: 'More Details',\n save: 'Save',\n editContent: 'How would you like to change the appointment in the series?',\n deleteContent: 'Are you sure you want to delete this event?',\n deleteMultipleContent: 'Are you sure you want to delete the selected events?',\n newEvent: 'New Event',\n title: 'Title',\n location: 'Location',\n description: 'Description',\n timezone: 'Timezone',\n startTimezone: 'Start Timezone',\n endTimezone: 'End Timezone',\n repeat: 'Repeat',\n saveButton: 'Save',\n cancelButton: 'Cancel',\n deleteButton: 'Delete',\n recurrence: 'Recurrence',\n wrongPattern: 'The recurrence pattern is not valid.',\n seriesChangeAlert: 'Do you want to cancel the changes made to specific ' +\n 'instances of this series and match it to the whole series again?',\n createError: 'The duration of the event must be shorter than how frequently it occurs. ' +\n 'Shorten the duration, or change the recurrence pattern in the recurrence event editor.',\n sameDayAlert: 'Two occurrences of the same event cannot occur on the same day.',\n occurenceAlert: 'Cannot reschedule an occurrence of the recurring appointment if it skips over ' +\n 'a later occurrence of the same appointment.',\n editRecurrence: 'Edit Recurrence',\n repeats: 'Repeats',\n alert: 'Alert',\n startEndError: 'The selected end date occurs before the start date.',\n invalidDateError: 'The entered date value is invalid.',\n blockAlert: 'Events cannot be scheduled within the blocked time range.',\n ok: 'Ok',\n yes: 'Yes',\n no: 'No',\n occurrence: 'Occurrence',\n series: 'Series',\n previous: 'Previous',\n next: 'Next',\n timelineDay: 'Timeline Day',\n timelineWeek: 'Timeline Week',\n timelineWorkWeek: 'Timeline Work Week',\n timelineMonth: 'Timeline Month',\n timelineYear: 'Timeline Year',\n editFollowingEvent: 'Following Events',\n deleteTitle: 'Delete Event',\n editTitle: 'Edit Event',\n beginFrom: 'Begin From',\n endAt: 'Ends At',\n expandAllDaySection: 'Expand-all-day-section',\n collapseAllDaySection: 'Collapse-all-day-section',\n searchTimezone: 'Search Timezone',\n noRecords: 'No records found'\n };\n };\n Schedule.prototype.wireEvents = function () {\n EventHandler.add(window, 'resize', this.onScheduleResize, this);\n EventHandler.add(window, 'orientationchange', this.onScheduleResize, this);\n EventHandler.add(document, Browser.touchStartEvent, this.onDocumentClick, this);\n };\n /**\n * Method to remove selected class\n *\n * @returns {void}\n * @private\n */\n Schedule.prototype.removeSelectedClass = function () {\n var selectedCells = this.getSelectedElements();\n for (var _i = 0, selectedCells_1 = selectedCells; _i < selectedCells_1.length; _i++) {\n var cell = selectedCells_1[_i];\n cell.setAttribute('aria-selected', 'false');\n cell.removeAttribute('tabindex');\n }\n removeClass(selectedCells, cls.SELECTED_CELL_CLASS);\n };\n /**\n * Method to add selected class\n *\n * @param {HTMLTableCellElement[]} cells Accepts the collection of elements\n * @param {HTMLTableCellElement} focusCell Accepts the focus element\n * @param {boolean} isPreventScroll Accepts the boolean value to prevent scroll\n * @returns {void}\n * @private\n */\n Schedule.prototype.addSelectedClass = function (cells, focusCell, isPreventScroll) {\n for (var _i = 0, cells_1 = cells; _i < cells_1.length; _i++) {\n var cell = cells_1[_i];\n cell.setAttribute('aria-selected', 'true');\n }\n addClass(cells, cls.SELECTED_CELL_CLASS);\n if (focusCell) {\n focusCell.setAttribute('tabindex', '0');\n focusCell.focus({ preventScroll: isPreventScroll || false });\n }\n };\n /**\n * Method to select cell\n *\n * @param {HTMLElement | HTMLTableCellElement} element Accepts the select element\n * @returns {void}\n * @private\n */\n Schedule.prototype.selectCell = function (element) {\n this.removeSelectedClass();\n this.addSelectedClass([element], element);\n };\n /**\n * Method to get all day row element\n *\n * @returns {Element} Returns the all day row element\n * @private\n */\n Schedule.prototype.getAllDayRow = function () {\n return this.element.querySelector('.' + cls.ALLDAY_ROW_CLASS);\n };\n /**\n * Method to get content table element\n *\n * @returns {HTMLElement} Returns the content table element\n * @private\n */\n Schedule.prototype.getContentTable = function () {\n return this.activeView.element.querySelector('.' + cls.CONTENT_TABLE_CLASS + ' tbody');\n };\n /**\n * Method to get all content table rows\n *\n * @returns {HTMLElement[]} Returns the content table rows\n * @private\n */\n Schedule.prototype.getTableRows = function () {\n return [].slice.call(this.element.querySelectorAll('.' + cls.CONTENT_TABLE_CLASS + ' tbody tr:not(.' + cls.HIDDEN_CLASS + ')'));\n };\n /**\n * Method to get work cell elements\n *\n * @returns {Element[]} Returns the all work cell elements\n * @private\n */\n Schedule.prototype.getWorkCellElements = function () {\n return [].slice.call(this.element.querySelectorAll('.' + cls.WORK_CELLS_CLASS));\n };\n /**\n * Method to get the index from date collection\n *\n * @param {Date[]} collection Accepts the collections of date\n * @param {Date} date Accepts the date object\n * @returns {number} Returns the index compared date with date collections\n * @private\n */\n Schedule.prototype.getIndexOfDate = function (collection, date) {\n return collection.map(Number).indexOf(+date);\n };\n /**\n * Method to find all day cell\n *\n * @param {Element} td Accepts the DOM Element\n * @returns {boolean} Returns the boolean value\n * @private\n */\n Schedule.prototype.isAllDayCell = function (td) {\n if (['Month', 'TimelineMonth', 'TimelineYear', 'MonthAgenda'].indexOf(this.currentView) > -1 ||\n td.classList.contains(cls.ALLDAY_CELLS_CLASS) ||\n td.classList.contains(cls.HEADER_CELLS_CLASS) || !this.activeViewOptions.timeScale.enable) {\n return true;\n }\n if (this.activeView.isTimelineView() && this.activeViewOptions.headerRows.length > 0 &&\n this.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {\n return true;\n }\n return false;\n };\n /**\n * Method to get date from element\n *\n * @param {Element} td Accepts the DOM element\n * @returns {Date} Returns the date object\n * @private\n */\n Schedule.prototype.getDateFromElement = function (td) {\n var dateString;\n if (!isNullOrUndefined(td)) {\n dateString = td.getAttribute('data-date');\n }\n if (!isNullOrUndefined(dateString)) {\n var dateInMS = parseInt(dateString, 10);\n var date = new Date(dateInMS);\n return date;\n }\n return undefined;\n };\n /**\n * Method to get target element from given selector\n *\n * @param {string} selector Accepts the element selector\n * @param {number} left Accepts the pageX value\n * @param {number} top Accepts the pageY value\n * @returns {Element[]} Returns the collection of elements based on the given selector\n * @private\n */\n Schedule.prototype.getTargetElement = function (selector, left, top) {\n var element = document.elementFromPoint(left, top);\n var targetElement;\n if (element) {\n targetElement = element.closest(selector);\n }\n return (targetElement) ? [targetElement] : null;\n };\n /**\n * Method to process cell header template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getCellHeaderTemplate = function () {\n return this.cellHeaderTemplateFn;\n };\n /**\n * Method to process cell header template in year view.\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getDayHeaderTemplate = function () {\n return this.dayHeaderTemplateFn;\n };\n /**\n * Method to process cell header template in year view.\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getMonthHeaderTemplate = function () {\n return this.monthHeaderTemplateFn;\n };\n /**\n * Method to process cell template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getCellTemplate = function () {\n return this.cellTemplateFn;\n };\n /**\n * Method to process date header template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getDateHeaderTemplate = function () {\n return this.dateHeaderTemplateFn;\n };\n /**\n * Method to process major slot template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getMajorSlotTemplate = function () {\n return this.majorSlotTemplateFn;\n };\n /**\n * Method to process minor slot template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getMinorSlotTemplate = function () {\n return this.minorSlotTemplateFn;\n };\n /**\n * Method to process appointment template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getAppointmentTemplate = function () {\n return this.appointmentTemplateFn;\n };\n /**\n * Method to process appointment tooltip template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getEventTooltipTemplate = function () {\n return this.eventTooltipTemplateFn;\n };\n /**\n * Method to process header tooltip template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getHeaderTooltipTemplate = function () {\n return this.headerTooltipTemplateFn;\n };\n /**\n * Method to process editor template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getEditorTemplate = function () {\n return this.editorTemplateFn;\n };\n /**\n * Method to process quick info header template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getQuickInfoTemplatesHeader = function () {\n return this.quickInfoTemplatesHeaderFn;\n };\n /**\n * Method to process quick info content template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getQuickInfoTemplatesContent = function () {\n return this.quickInfoTemplatesContentFn;\n };\n /**\n * Method to process quick info footer template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getQuickInfoTemplatesFooter = function () {\n return this.quickInfoTemplatesFooterFn;\n };\n /**\n * Method to process resource header template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getResourceHeaderTemplate = function () {\n return this.resourceHeaderTemplateFn;\n };\n /**\n * Method to process indent template\n *\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.getHeaderIndentTemplate = function () {\n return this.headerIndentTemplateFn;\n };\n /**\n * Method to get dynamic CSS properties\n *\n * @returns {ScrollCss} Returns the CSS properties dynamically\n * @private\n */\n Schedule.prototype.getCssProperties = function () {\n var cssProps = {\n border: this.enableRtl ? 'borderLeftWidth' : 'borderRightWidth',\n padding: this.enableRtl ? 'paddingLeft' : 'paddingRight',\n rtlBorder: this.enableRtl ? 'borderRightWidth' : 'borderLeftWidth',\n rtlPadding: this.enableRtl ? 'paddingRight' : 'paddingLeft'\n };\n return cssProps;\n };\n /**\n * Method to remove new event element in adaptive mode\n *\n * @returns {void}\n * @private\n */\n Schedule.prototype.removeNewEventElement = function () {\n var eventClone = this.element.querySelector('.' + cls.NEW_EVENT_CLASS);\n if (!isNullOrUndefined(eventClone)) {\n remove(eventClone);\n }\n };\n /**\n * Method to get start end time from string\n *\n * @param {string} startEndTime Accepts the start end time string value\n * @returns {Date} Returns the date object\n * @private\n */\n Schedule.prototype.getStartEndTime = function (startEndTime) {\n if (!isNullOrUndefined(startEndTime) && startEndTime !== '') {\n var startEndDate = util.resetTime(this.getCurrentTime());\n var timeString = startEndTime.split(':');\n if (timeString.length === 2) {\n startEndDate.setHours(parseInt(timeString[0], 10), parseInt(timeString[1], 10), 0);\n }\n return startEndDate;\n }\n return null;\n };\n Schedule.prototype.onDocumentClick = function (args) {\n this.notify(events.documentClick, { event: args });\n };\n Schedule.prototype.onScheduleResize = function () {\n if (isNullOrUndefined(this.activeView) || ((this.isAdaptive || util.isMobile()) && document.activeElement\n && document.activeElement.classList.contains(cls.SUBJECT_CLASS))) {\n return;\n }\n if (this.activeViewOptions.timeScale.enable && this.activeView) {\n this.activeView.highlightCurrentTime();\n }\n if (this.quickPopup) {\n this.quickPopup.onClosePopup();\n }\n if (this.currentView === 'Month' || ((this.currentView !== 'Agenda' && this.currentView !== 'MonthAgenda')\n && !this.activeViewOptions.timeScale.enable) || this.activeView.isTimelineView()) {\n this.activeView.resetColWidth();\n this.notify(events.scrollUiUpdate, { cssProperties: this.getCssProperties(), isPreventScrollUpdate: true });\n this.refreshEvents(false);\n }\n else {\n this.notify(events.contentReady, {});\n }\n };\n /**\n * Method to process the templates\n *\n * @param {string} template Accepts the template in string\n * @returns {CallbackFunction} Returns the callback function\n * @private\n */\n Schedule.prototype.templateParser = function (template) {\n if (template) {\n try {\n if (document.querySelectorAll(template).length) {\n return compile(document.querySelector(template).innerHTML.trim());\n }\n }\n catch (error) {\n return compile(template);\n }\n }\n return undefined;\n };\n /**\n * Method to generate the announcement string\n *\n * @param {Object} event Accepts the event object\n * @param {string} subject Accepts the subject text\n * @returns {string} Returns the announcement string\n * @private\n */\n Schedule.prototype.getAnnouncementString = function (event, subject) {\n var resourceName;\n if (this.quickPopup && this.activeViewOptions.group.resources.length > 0) {\n var constantText = '\"s event - ';\n resourceName = this.quickPopup.getResourceText({ event: event }, 'event') + constantText;\n }\n var recordSubject = (subject || (event[this.eventFields.subject] || this.eventSettings.fields.subject.default));\n var skeleton = 'full';\n var startDateText = this.globalize.formatDate(event[this.eventFields.startTime], {\n type: 'dateTime', skeleton: skeleton, calendar: this.getCalendarMode()\n });\n var endDateText = this.globalize.formatDate(event[this.eventFields.endTime], {\n type: 'dateTime', skeleton: skeleton, calendar: this.getCalendarMode()\n });\n var announcementString = recordSubject + ' ' + this.localeObj.getConstant('beginFrom') + ' '\n + startDateText + ' ' + this.localeObj.getConstant('endAt') + ' ' + endDateText;\n if (resourceName) {\n announcementString = resourceName + ' ' + announcementString;\n }\n return announcementString;\n };\n /**\n * Method to process the element boundary validation\n *\n * @param {number} pageY Accepts the pageY value\n * @param {number} pageX Accepts the pageX value\n * @returns {ResizeEdges} Returns the boundary validation object\n * @private\n */\n Schedule.prototype.boundaryValidation = function (pageY, pageX) {\n var autoScrollDistance = 30;\n var scrollEdges = { left: false, right: false, top: false, bottom: false };\n var viewBoundaries = this.element.querySelector('.' + cls.CONTENT_WRAP_CLASS).getBoundingClientRect();\n if ((pageY < viewBoundaries.top + autoScrollDistance + window.pageYOffset) &&\n (pageY > viewBoundaries.top + window.pageYOffset)) {\n scrollEdges.top = true;\n }\n if ((pageY > (viewBoundaries.bottom - autoScrollDistance) + window.pageYOffset) &&\n (pageY < viewBoundaries.bottom + window.pageYOffset)) {\n scrollEdges.bottom = true;\n }\n if ((pageX < viewBoundaries.left + autoScrollDistance + window.pageXOffset) &&\n (pageX > viewBoundaries.left + window.pageXOffset)) {\n scrollEdges.left = true;\n }\n if ((pageX > (viewBoundaries.right - autoScrollDistance) + window.pageXOffset) &&\n (pageX < viewBoundaries.right + window.pageXOffset)) {\n scrollEdges.right = true;\n }\n return scrollEdges;\n };\n /**\n * Method to get the week number.\n *\n * @param {Date[]} dates Accepts the date collections\n * @returns {number} Returns the week number\n * @private\n */\n Schedule.prototype.getWeekNumberContent = function (dates) {\n var weekNumber;\n if (this.weekRule === 'FirstDay') {\n var weekNumberDate = util.getWeekLastDate(dates.slice(-1)[0], this.firstDayOfWeek);\n weekNumber = this.globalize.formatNumber(util.getWeekNumber(weekNumberDate));\n }\n else if (this.weekRule === 'FirstFourDayWeek') {\n var weekFirstDate = util.getWeekFirstDate(dates.slice(-1)[0], this.firstDayOfWeek);\n var weekLastDate = util.getWeekLastDate(dates.slice(-1)[0], this.firstDayOfWeek);\n var weekMidDate = util.getWeekMiddleDate(weekFirstDate, weekLastDate);\n weekNumber = this.globalize.formatNumber(util.getWeekNumber(weekMidDate));\n }\n else if (this.weekRule === 'FirstFullWeek') {\n var weekFirstDate = util.getWeekFirstDate(dates.slice(-1)[0], this.firstDayOfWeek);\n weekNumber = this.globalize.formatNumber(util.getWeekNumber(weekFirstDate));\n }\n return weekNumber;\n };\n /**\n * Method to render the header indent template.\n *\n * @param {TdData} data Accepts the td data\n * @param {Element} td Accepts the td element\n * @returns {void}\n * @private\n */\n Schedule.prototype.renderHeaderIndentTemplate = function (data, td) {\n if (this.activeViewOptions.headerIndentTemplate) {\n var scheduleId = this.element.id + '_';\n var viewName = this.activeViewOptions.headerIndentTemplateName;\n var templateId = scheduleId + viewName + 'headerIndentTemplate';\n var indentTemplate = [].slice.call(this.getHeaderIndentTemplate()(data, this, 'headerIndentTemplate', templateId, false));\n append(indentTemplate, td);\n }\n };\n Schedule.prototype.unWireEvents = function () {\n EventHandler.remove(window, 'resize', this.onScheduleResize);\n EventHandler.remove(window, 'orientationchange', this.onScheduleResize);\n EventHandler.remove(document, Browser.touchStartEvent, this.onDocumentClick);\n };\n /**\n * Core method to return the component name.\n *\n * @returns {string} Returns the module name\n * @private\n */\n Schedule.prototype.getModuleName = function () {\n return 'schedule';\n };\n /**\n * Returns the properties to be maintained in the persisted state.\n *\n * @returns {string} Returns the persistance data\n * @private\n */\n Schedule.prototype.getPersistData = function () {\n return this.addOnPersist(['currentView', 'selectedDate', 'scrollTop', 'scrollLeft']);\n };\n /**\n * Called internally, if any of the property value changed.\n *\n * @returns {void}\n * @private\n */\n Schedule.prototype.onPropertyChanged = function (newProp, oldProp) {\n if (this.isReact && isNullOrUndefined(this.activeView)) {\n return;\n }\n var state = {\n isRefresh: false, isResource: false, isDate: false, isView: false, isLayout: false, isDataManager: false\n };\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'views':\n this.setViewOptions();\n if (this.headerModule) {\n this.headerModule.updateItems();\n }\n state.isView = true;\n break;\n case 'currentView':\n state.isView = true;\n break;\n case 'minDate':\n case 'maxDate':\n case 'selectedDate':\n state.isDate = true;\n break;\n case 'dateFormat':\n this.activeViewOptions = this.getActiveViewOptions();\n if (this.headerModule) {\n this.headerModule.updateDateRange(this.activeView.getDateRangeText());\n }\n break;\n case 'showHeaderBar':\n this.destroyHeaderModule();\n if (newProp.showHeaderBar) {\n this.headerModule = new HeaderRenderer(this);\n this.headerModule.updateDateRange(this.activeView.getDateRangeText());\n }\n this.notify(events.scrollUiUpdate, { cssProperties: this.getCssProperties() });\n if (this.activeView.isTimelineView()) {\n this.refreshEvents(false);\n }\n break;\n case 'showWeekend':\n case 'workDays':\n case 'startHour':\n case 'endHour':\n case 'workHours':\n case 'readonly':\n case 'headerRows':\n case 'showWeekNumber':\n case 'rowAutoHeight':\n state.isLayout = true;\n break;\n case 'locale':\n case 'calendarMode':\n this.globalize = new Internationalization(this.locale);\n this.localeObj = new L10n(this.getModuleName(), this.defaultLocale, this.locale);\n this.setCldrTimeFormat();\n this.setCalendarMode();\n state.isRefresh = true;\n break;\n case 'firstDayOfWeek':\n this.activeViewOptions.firstDayOfWeek = newProp.firstDayOfWeek;\n if (this.eventWindow) {\n this.eventWindow.refreshRecurrenceEditor();\n }\n state.isLayout = true;\n break;\n case 'showTimeIndicator':\n if (this.activeViewOptions.timeScale.enable && this.activeView) {\n this.activeView.highlightCurrentTime();\n }\n break;\n case 'cellHeaderTemplate':\n this.activeViewOptions.cellHeaderTemplate = newProp.cellHeaderTemplate;\n this.cellHeaderTemplateFn = this.templateParser(this.activeViewOptions.cellHeaderTemplate);\n state.isLayout = true;\n break;\n case 'cellTemplate':\n this.activeViewOptions.cellTemplate = newProp.cellTemplate;\n this.cellTemplateFn = this.templateParser(this.activeViewOptions.cellTemplate);\n state.isLayout = true;\n break;\n case 'dateHeaderTemplate':\n this.activeViewOptions.dateHeaderTemplate = newProp.dateHeaderTemplate;\n this.dateHeaderTemplateFn = this.templateParser(this.activeViewOptions.dateHeaderTemplate);\n state.isLayout = true;\n break;\n case 'dayHeaderTemplate':\n this.activeViewOptions.dayHeaderTemplate = newProp.dayHeaderTemplate;\n this.dayHeaderTemplateFn = this.templateParser(this.activeViewOptions.dayHeaderTemplate);\n state.isLayout = true;\n break;\n case 'monthHeaderTemplate':\n this.activeViewOptions.monthHeaderTemplate = newProp.monthHeaderTemplate;\n this.monthHeaderTemplateFn = this.templateParser(this.activeViewOptions.monthHeaderTemplate);\n state.isLayout = true;\n break;\n case 'resourceHeaderTemplate':\n this.activeViewOptions.resourceHeaderTemplate = newProp.resourceHeaderTemplate;\n this.resourceHeaderTemplateFn = this.templateParser(this.activeViewOptions.resourceHeaderTemplate);\n state.isLayout = true;\n break;\n case 'timezone':\n this.eventBase.timezonePropertyChange(oldProp.timezone);\n this.headerModule.setCalendarTimezone();\n break;\n case 'enableRtl':\n this.setRtlClass();\n state.isRefresh = true;\n break;\n default:\n this.extendedPropertyChange(prop, newProp, oldProp, state);\n break;\n }\n }\n this.propertyChangeAction(state);\n };\n Schedule.prototype.propertyChangeAction = function (state) {\n if (state.isRefresh) {\n this.refresh();\n }\n else if (state.isResource) {\n this.initializeResources(true);\n }\n else if (state.isView) {\n this.changeView(this.currentView, null, true);\n }\n else if (state.isDate) {\n this.changeDate(this.selectedDate);\n }\n else if (state.isLayout) {\n this.initializeView(this.currentView);\n }\n else if (state.isDataManager && this.crudModule) {\n if (this.dragAndDropModule) {\n this.dragAndDropModule.actionObj.action = '';\n removeClass([this.element], cls.EVENT_ACTION_CLASS);\n }\n this.crudModule.refreshDataManager();\n }\n };\n Schedule.prototype.allDayRowScrollUpdate = function () {\n var dateHeader = this.element.querySelector('.' + cls.DATE_HEADER_WRAP_CLASS);\n var allDayRow = this.element.querySelector('.' + cls.ALLDAY_ROW_CLASS);\n if (this.height === 'auto' || !this.enableAllDayScroll) {\n addClass([dateHeader], cls.ALLDAY_APPOINTMENT_AUTO);\n if (dateHeader.classList.contains(cls.ALLDAY_APPOINTMENT_SCROLL)) {\n removeClass([dateHeader], cls.ALLDAY_APPOINTMENT_SCROLL);\n }\n if (this.uiStateValues.expand) {\n var allDayCells = [].slice.call(this.element.querySelectorAll('.' + cls.ALLDAY_CELLS_CLASS));\n allDayCells[0].style.height = (allDayRow.style.height) ? allDayRow.style.height : allDayCells[1].style.height;\n }\n }\n else {\n if (dateHeader.classList.contains(cls.ALLDAY_APPOINTMENT_AUTO)) {\n removeClass([dateHeader], cls.ALLDAY_APPOINTMENT_AUTO);\n }\n this.eventBase.allDayExpandScroll(dateHeader, true);\n }\n if (!this.uiStateValues.expand) {\n allDayRow.style.height = '';\n }\n };\n Schedule.prototype.extendedPropertyChange = function (prop, newProp, oldProp, state) {\n switch (prop) {\n case 'width':\n case 'height':\n case 'enableAllDayScroll':\n if (['Day', 'Week', 'WorkWeek'].indexOf(this.currentView) > -1) {\n this.allDayRowScrollUpdate();\n }\n this.notify(events.uiUpdate, { module: 'scroll', properties: { width: newProp.width, height: newProp.height } });\n break;\n case 'cssClass':\n if (oldProp.cssClass) {\n removeClass([this.element], oldProp.cssClass.split(' '));\n }\n if (newProp.cssClass) {\n addClass([this.element], newProp.cssClass.split(' '));\n }\n break;\n case 'hideEmptyAgendaDays':\n case 'agendaDaysCount':\n this.activeViewOptions = this.getActiveViewOptions();\n state.isView = true;\n break;\n case 'eventSettings':\n this.onEventSettingsPropertyChanged(newProp.eventSettings, oldProp.eventSettings, state);\n break;\n case 'allowKeyboardInteraction':\n if (this.keyboardInteractionModule) {\n this.keyboardInteractionModule.destroy();\n this.keyboardInteractionModule = null;\n }\n if (newProp.allowKeyboardInteraction) {\n this.keyboardInteractionModule = new KeyboardInteraction(this);\n }\n break;\n case 'timezoneDataSource':\n if (this.eventWindow) {\n this.eventWindow.refresh();\n }\n break;\n case 'editorTemplate':\n if (!isNullOrUndefined(this.editorTemplate)) {\n this.editorTemplateFn = this.templateParser(this.editorTemplate);\n }\n if (this.eventWindow) {\n this.eventWindow.setDialogContent();\n }\n break;\n case 'quickInfoTemplates':\n if (this.quickInfoTemplates.header) {\n this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);\n }\n if (this.quickInfoTemplates.content) {\n this.quickInfoTemplatesContentFn = this.templateParser(this.quickInfoTemplates.content);\n }\n if (this.quickInfoTemplates.footer) {\n this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);\n }\n break;\n case 'group':\n this.onGroupSettingsPropertyChanged(newProp.group, oldProp.group, state);\n break;\n case 'resources':\n state.isResource = true;\n break;\n case 'timeScale':\n this.activeViewOptions.timeScale.interval = newProp.timeScale.interval || this.activeViewOptions.timeScale.interval;\n this.activeViewOptions.timeScale.slotCount = newProp.timeScale.slotCount || this.activeViewOptions.timeScale.slotCount;\n if (this.eventWindow) {\n this.eventWindow.refreshDateTimePicker();\n }\n state.isLayout = true;\n break;\n case 'allowDragAndDrop':\n case 'allowResizing':\n case 'eventDragArea':\n this.refreshEvents(false);\n break;\n case 'weekRule':\n state.isLayout = true;\n break;\n case 'firstMonthOfYear':\n this.activeViewOptions.firstMonthOfYear = newProp.firstMonthOfYear;\n this.viewIndex = this.activeView.viewIndex;\n state.isLayout = true;\n break;\n case 'monthsCount':\n this.activeViewOptions.monthsCount = newProp.monthsCount;\n this.viewIndex = this.activeView.viewIndex;\n state.isLayout = true;\n break;\n case 'timeFormat':\n this.internalTimeFormat = newProp.timeFormat || this.activeViewOptions.timeFormat;\n if (this.eventWindow) {\n this.eventWindow.refreshDateTimePicker();\n }\n state.isLayout = true;\n break;\n case 'enableAdaptiveUI':\n if (this.showHeaderBar && this.headerModule) {\n this.destroyHeaderModule();\n this.headerModule = new HeaderRenderer(this);\n this.headerModule.updateDateRange(this.activeView.getDateRangeText());\n }\n state.isLayout = true;\n break;\n case 'headerIndentTemplate':\n this.activeViewOptions.headerIndentTemplate = newProp.headerIndentTemplate;\n this.headerIndentTemplateFn = this.templateParser(this.activeViewOptions.headerIndentTemplate);\n state.isLayout = true;\n break;\n }\n };\n Schedule.prototype.setRtlClass = function () {\n if (this.enableRtl) {\n addClass([this.element], 'e-rtl');\n }\n else {\n removeClass([this.element], 'e-rtl');\n }\n };\n Schedule.prototype.onGroupSettingsPropertyChanged = function (newProp, oldProp, state) {\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n if (prop === 'headerTooltipTemplate') {\n this.headerTooltipTemplateFn = this.templateParser(newProp[prop]);\n }\n else {\n state.isLayout = true;\n if (this.eventWindow) {\n this.eventWindow.refresh();\n }\n }\n }\n };\n Schedule.prototype.onEventSettingsPropertyChanged = function (newProp, oldProp, state) {\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'dataSource':\n case 'query':\n case 'fields':\n this.initializeDataModule();\n state.isDataManager = true;\n break;\n case 'template':\n this.activeViewOptions.eventTemplate = newProp.template;\n this.appointmentTemplateFn = this.templateParser(this.activeViewOptions.eventTemplate);\n state.isDataManager = true;\n break;\n case 'enableTooltip':\n if (this.eventTooltip) {\n this.eventTooltip.destroy();\n this.eventTooltip = null;\n }\n if (newProp.enableTooltip) {\n this.eventTooltip = new EventTooltip(this);\n }\n break;\n case 'tooltipTemplate':\n this.eventTooltipTemplateFn = this.templateParser(this.eventSettings.tooltipTemplate);\n break;\n case 'resourceColorField':\n if (this.resourceBase) {\n this.resourceBase.setResourceCollection();\n }\n state.isDataManager = true;\n break;\n case 'editFollowingEvents':\n if (this.quickPopup) {\n this.quickPopup.refreshQuickDialog();\n }\n break;\n case 'allowAdding':\n case 'allowEditing':\n case 'allowDeleting':\n if (this.showHeaderBar && this.headerModule) {\n this.headerModule.updateAddIcon();\n }\n if (this.eventWindow) {\n this.eventWindow.refresh();\n }\n break;\n case 'spannedEventPlacement':\n case 'enableMaxHeight':\n case 'enableIndicator':\n this.refreshEvents(false);\n break;\n case 'ignoreWhitespace':\n state.isLayout = true;\n break;\n }\n }\n };\n Schedule.prototype.destroyHeaderModule = function () {\n if (this.headerModule) {\n this.headerModule.destroy();\n this.headerModule = null;\n }\n };\n Schedule.prototype.destroyPopups = function () {\n if (this.quickPopup) {\n this.quickPopup.destroy();\n this.quickPopup = null;\n }\n if (this.eventWindow) {\n this.eventWindow.destroy();\n this.eventWindow = null;\n }\n };\n /**\n * Allows to show the spinner on schedule at the required scenarios.\n *\n * @function showSpinner\n * @returns {void}\n */\n Schedule.prototype.showSpinner = function () {\n showSpinner(this.element);\n };\n /**\n * When the spinner is shown manually using `showSpinner` method, it can be hidden using this `hideSpinner` method.\n *\n * @function hideSpinner\n * @returns {void}\n */\n Schedule.prototype.hideSpinner = function () {\n hideSpinner(this.element);\n };\n /**\n * Sets different working hours on the required working days by accepting the required start and end time as well as the date collection\n * as its parameters.\n *\n * @function setWorkHours\n * @param {Date} dates Collection of dates on which the given start and end hour range needs to be applied.\n * @param {string} start Defines the work start hour.\n * @param {string} end Defines the work end hour.\n * @param {number} groupIndex Defines the resource index from last level.\n * @returns {void}\n */\n Schedule.prototype.setWorkHours = function (dates, start, end, groupIndex) {\n var cells = [];\n cells = this.getWorkHourCells(dates, start, end, groupIndex);\n addClass(cells, cls.WORK_HOURS_CLASS);\n };\n /**\n * Removes or resets different working hours on the required working days by accepting the required start and end time as well as the\n * date collection as its parameters.\n * if no parameters has been passed to this function, it will remove all the work hours.\n *\n * @param {Date} dates Collection of dates on which the given start and end hour range need to be applied.\n * @param {string} start Defines the work start hour.\n * @param {string} end Defines the work end hour.\n * @param {number} groupIndex Defines the resource index from last level.\n * @returns {void}\n */\n Schedule.prototype.resetWorkHours = function (dates, start, end, groupIndex) {\n if (dates === void 0) { dates = this.activeView.renderDates; }\n if (dates && start && end) {\n var cells = this.getWorkHourCells(dates, start, end, groupIndex);\n removeClass(cells, cls.WORK_HOURS_CLASS);\n }\n else {\n var workHourCells = [].slice.call(this.element.querySelectorAll('.' + cls.WORK_HOURS_CLASS));\n removeClass(workHourCells, cls.WORK_HOURS_CLASS);\n }\n };\n Schedule.prototype.getWorkHourCells = function (dates, start, end, groupIndex) {\n if (['Agenda', 'MonthAgenda', 'Month', 'TimelineMonth'].indexOf(this.currentView) > -1) {\n return [];\n }\n var startHour = this.getStartEndTime(start);\n var endHour = this.getStartEndTime(end);\n var tableEle = this.getContentTable();\n if (isNullOrUndefined(startHour) || isNullOrUndefined(endHour) || !tableEle) {\n return [];\n }\n startHour.setMilliseconds(0);\n endHour.setMilliseconds(0);\n var viewStartHour = this.activeView.getStartHour();\n if (startHour < viewStartHour) {\n startHour = viewStartHour;\n }\n var viewEndHour = this.activeView.getEndHour();\n if (endHour > viewEndHour) {\n endHour = viewEndHour;\n }\n var msMajorInterval = this.activeViewOptions.timeScale.interval * util.MS_PER_MINUTE;\n var msInterval = msMajorInterval / this.activeViewOptions.timeScale.slotCount;\n var startIndex = Math.round((startHour.getTime() - viewStartHour.getTime()) / msInterval);\n var endIndex = Math.ceil((endHour.getTime() - viewStartHour.getTime()) / msInterval);\n var tempStartIndex = startIndex;\n var tempEndIndex = endIndex;\n var cells = [];\n for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {\n var date = dates_1[_i];\n date = this.getDateTime(date);\n util.resetTime(date);\n var renderDates = this.activeView.renderDates;\n if (!isNullOrUndefined(groupIndex) && this.resourceBase && !this.activeView.isTimelineView()) {\n renderDates = this.resourceBase.lastResourceLevel[groupIndex].renderDates;\n }\n var colIndex = this.getIndexOfDate(renderDates, date);\n if (colIndex >= 0) {\n if (this.activeView.isTimelineView()) {\n var slotsPerDay = Math.round((viewEndHour.getTime() - viewStartHour.getTime()) / msInterval);\n startIndex = tempStartIndex + (colIndex * slotsPerDay);\n endIndex = tempEndIndex + (colIndex * slotsPerDay);\n }\n for (var i = startIndex; i < endIndex; i++) {\n if (this.activeView.isTimelineView()) {\n var rowIndex = (!isNullOrUndefined(groupIndex)) ? groupIndex : 0;\n cells.push(tableEle.rows[rowIndex].cells[i]);\n }\n else {\n if (!isNullOrUndefined(groupIndex)) {\n var selector = '.' + cls.WORK_CELLS_CLASS + '[data-group-index=\"' + groupIndex + '\"]';\n var tds = [].slice.call(tableEle.rows[i].querySelectorAll(selector));\n cells.push(tds[colIndex]);\n }\n else {\n cells.push(tableEle.rows[i].cells[colIndex]);\n }\n }\n }\n }\n }\n return cells;\n };\n /**\n * Retrieves the start and end time information of the specific cell element.\n *\n * @function getCellDetails\n * @param {Element | Element[]} tdCol Accepts the single or collection of elements.\n * @returns {CellClickEventArgs} Object An object holding the startTime, endTime and all-day information along with the target HTML element will be returned.\n */\n Schedule.prototype.getCellDetails = function (tdCol) {\n var td = (tdCol instanceof Array) ? tdCol : [tdCol];\n var firstTd = getElement(td[0]);\n var lastTd = getElement(td.slice(-1)[0]);\n var startTime = this.getDateFromElement(firstTd);\n var endTime = this.getDateFromElement(lastTd);\n if (isNullOrUndefined(startTime) || isNullOrUndefined(endTime)) {\n return undefined;\n }\n var endDateFromColSpan = this.activeView.isTimelineView() && !isNullOrUndefined(lastTd.getAttribute('colSpan')) &&\n this.headerRows.length > 0;\n var duration = endDateFromColSpan ? parseInt(lastTd.getAttribute('colSpan'), 10) : 1;\n if (!this.activeViewOptions.timeScale.enable || endDateFromColSpan || lastTd.classList.contains(cls.ALLDAY_CELLS_CLASS) ||\n lastTd.classList.contains(cls.HEADER_CELLS_CLASS)) {\n endTime = util.addDays(new Date(endTime.getTime()), duration);\n }\n else {\n endTime = this.activeView.getEndDateFromStartDate(endTime);\n }\n var data = {\n startTime: startTime,\n endTime: endTime,\n isAllDay: this.isAllDayCell(firstTd),\n element: tdCol\n };\n var groupIndex = firstTd.getAttribute('data-group-index');\n if (!isNullOrUndefined(groupIndex)) {\n data.groupIndex = parseInt(groupIndex, 10);\n }\n return data;\n };\n /**\n * Retrieves the selected cell elements.\n *\n * @function getSelectedElements\n * @returns {Element[]} The elements of currently selected cells will be returned.\n */\n Schedule.prototype.getSelectedElements = function () {\n return [].slice.call(this.element.querySelectorAll('.' + cls.SELECTED_CELL_CLASS));\n };\n /**\n * To get the resource collection\n *\n * @function getResourceCollections\n * @returns {ResourcesModel[]} Returns the resource collections\n */\n Schedule.prototype.getResourceCollections = function () {\n return this.resourceCollection;\n };\n /**\n * To set the resource collection\n *\n * @function setResourceCollections\n * @param {ResourcesModel[]} resourceCol Accepts the resource collections in ResourcesModel type\n * @returns {void}\n */\n Schedule.prototype.setResourceCollections = function (resourceCol) {\n this.setProperties({ resources: resourceCol }, false);\n };\n /**\n * Current View could be change based on the provided parameters.\n *\n * @function changeCurrentView\n * @param {View} viewName Accept the view in the viewCollections.\n * @param {number} viewIndex Accept the viewIndex in the viewCollections.\n * @returns {void}\n */\n Schedule.prototype.changeCurrentView = function (viewName, viewIndex) {\n var index = this.getViewIndex(viewName);\n var view = viewName.charAt(0).toLowerCase() + viewName.slice(1);\n var viewOptions = this.viewOptions[view];\n if (viewOptions) {\n index = this.viewCollections.indexOf(viewOptions[viewIndex || 0]);\n }\n if (index === -1 || index === this.viewIndex) {\n return;\n }\n this.changeView(viewName, null, null, index);\n };\n /**\n * Return the current view Index.\n *\n * @function getCurrentViewIndex\n * @returns {number} Returns the view index\n */\n Schedule.prototype.getCurrentViewIndex = function () {\n return this.viewIndex;\n };\n /**\n * Retrieves the resource details based on the provided resource index.\n *\n * @param {number} index index of the resources at the last level.\n * @returns {ResourceDetails} Object An object holding the details of resource and resourceData.\n */\n Schedule.prototype.getResourcesByIndex = function (index) {\n if (this.resourceBase && this.resourceBase.lastResourceLevel) {\n if (index < 0 || index >= this.resourceBase.lastResourceLevel.length) {\n return undefined;\n }\n var data = this.resourceBase.lastResourceLevel[index];\n var groupData = {};\n this.resourceBase.setResourceValues(groupData, index);\n return { resource: data.resource, resourceData: data.resourceData, groupData: groupData };\n }\n return undefined;\n };\n /**\n * This method allows to expand the resource that available on the scheduler.\n *\n * @function expandResource\n * @param {string | number} resourceId Accepts the resource id in either string or number type\n * @param {string} name Accepts the name of the resource collection\n * @returns {void}\n */\n Schedule.prototype.expandResource = function (resourceId, name) {\n if (this.activeView.isTimelineView() && this.resourceBase && this.resourceCollection.length > 1) {\n this.resourceBase.resourceExpand(resourceId, name, false);\n }\n };\n /**\n * This method allows to collapse the resource that available on the scheduler.\n *\n * @function collapseResource\n * @param {string | number} resourceId Accepts the resource id in either string or number type\n * @param {string} name Accepts the name of the resource collection\n * @returns {void}\n */\n Schedule.prototype.collapseResource = function (resourceId, name) {\n if (this.activeView.isTimelineView() && this.resourceBase && this.resourceCollection.length > 1) {\n this.resourceBase.resourceExpand(resourceId, name, true);\n }\n };\n /**\n * Scrolls the Schedule content area to the specified time.\n *\n * @function scrollTo\n * @param {string} hour Accepts the time value in the skeleton format of 'Hm'.\n * @param {Date} scrollDate Accepts the date object value.\n * @returns {void}\n */\n Schedule.prototype.scrollTo = function (hour, scrollDate) {\n if (this.activeView.scrollToDate && isNullOrUndefined(hour) && scrollDate) {\n this.activeView.scrollToDate(scrollDate);\n }\n else if (this.activeView.scrollToHour) {\n this.activeView.scrollToHour(hour, scrollDate);\n }\n };\n /**\n * This method allows scroll to the position of the any resources that available on the scheduler.\n * This method is applicable for without Agenda and Month agenda views of the schedule.\n *\n * @function scrollToResource\n * @param {string | number} resourceId Accepts the resource id in either string or number type\n * @param {string} groupName Accepts the name of the resource collection\n * @returns {void}\n */\n Schedule.prototype.scrollToResource = function (resourceId, groupName) {\n if (this.resourceBase && this.resourceBase.lastResourceLevel) {\n this.resourceBase.resourceScroll(resourceId, groupName);\n }\n };\n /**\n * Exports the Scheduler events to a calendar (.ics) file. By default, the calendar is exported with a file name `Calendar.ics`.\n * To change this file name on export, pass the custom string value as `fileName` to get the file downloaded with this provided name.\n *\n * @function exportToICalendar\n * @param {string} fileName Accepts the string value.\n * @param {Object[]} customData Accepts the collection of objects.\n * @returns {void}\n */\n Schedule.prototype.exportToICalendar = function (fileName, customData) {\n if (this.iCalendarExportModule) {\n this.iCalendarExportModule.initializeCalendarExport(fileName, customData);\n }\n else {\n throw Error('Inject ICalendarExport module');\n }\n };\n /**\n * Imports the events from an .ics file downloaded from any of the calendars like Google or Outlook into the Scheduler.\n * This method accepts the blob object or string format of an .ics file to be imported as a mandatory argument.\n *\n * @function importICalendar\n * @param {Blob | string} fileContent Accepts the file object or string format of an .ics file.\n * @returns {void}\n */\n Schedule.prototype.importICalendar = function (fileContent) {\n if (this.iCalendarImportModule) {\n this.iCalendarImportModule.initializeCalendarImport(fileContent);\n }\n else {\n throw Error('Inject ICalendarImport module');\n }\n };\n /**\n * Adds the newly created event into the Schedule dataSource.\n *\n * @function addEvent\n * @param {Object | Object[]} data Single or collection of event objects to be added into Schedule.\n * @returns {void}\n */\n Schedule.prototype.addEvent = function (data) {\n this.crudModule.addEvent(data);\n };\n /**\n * Allows the Scheduler events data to be exported as an Excel file either in .xlsx or .csv file formats.\n * By default, the whole event collection bound to the Scheduler gets exported as an Excel file.\n * To export only the specific events of Scheduler, you need to pass the custom data collection as\n * a parameter to this `exportToExcel` method. This method accepts the export options as arguments such as fileName,\n * exportType, fields, customData, and includeOccurrences. The `fileName` denotes the name to be given for the exported\n * file and the `exportType` allows you to set the format of an Excel file to be exported either as .xlsx or .csv.\n * The custom or specific field collection of event dataSource to be exported can be provided through `fields` option\n * and the custom data collection can be exported by passing them through the `customData` option. There also exists\n * option to export each individual instances of the recurring events to an Excel file, by setting true or false to the\n * `includeOccurrences` option, denoting either to include or exclude the occurrences as separate instances on an exported Excel file.\n *\n * @function exportToExcel\n * @param {ExportOptions} excelExportOptions The export options to be set before start with exporting the Scheduler events to an Excel file.\n * @returns {void}\n */\n Schedule.prototype.exportToExcel = function (excelExportOptions) {\n if (this.excelExportModule) {\n this.excelExportModule.initializeExcelExport(excelExportOptions || {});\n }\n else {\n throw Error('Inject ExcelExport module');\n }\n };\n /**\n * Method allows to print the scheduler.\n *\n * @function print\n * @param {ScheduleModel} printOptions The export options to be set before start with exporting\n * the Scheduler events to the print window.\n * @returns {void}\n */\n Schedule.prototype.print = function (printOptions) {\n if (this.printModule) {\n this.printModule.print(printOptions);\n }\n else {\n throw Error('Inject Print module');\n }\n };\n /**\n * Updates the changes made in the event object by passing it as an parameter into the dataSource.\n *\n * @function saveEvent\n * @param {Object | Object[]} data Single or collection of event objects to be saved into Schedule.\n * @param {CurrentAction} currentAction Denotes the action that takes place either for editing occurrence or series.\n * The valid current action names are `EditOccurrence` or `EditSeries`.\n * @returns {void}\n */\n Schedule.prototype.saveEvent = function (data, currentAction) {\n this.crudModule.saveEvent(data, currentAction);\n };\n /**\n * Deletes the events based on the provided ID or event collection in the argument list.\n *\n * @function deleteEvent\n * @param {string | number | Object | Object[]} id Accepts the ID as string or number type or single or collection of the event object which needs to be removed from the Schedule.\n * @param {CurrentAction} currentAction Denotes the delete action that takes place either on occurrence or series events.\n * The valid current action names are `Delete`, `DeleteOccurrence` or `DeleteSeries`.\n * @returns {void}\n */\n Schedule.prototype.deleteEvent = function (id, currentAction) {\n this.crudModule.deleteEvent(id, currentAction);\n };\n /**\n * Retrieves the entire collection of events bound to the Schedule.\n *\n * @function getEvents\n * @param {Date} startDate Accepts the start date.\n * @param {Date} endDate Accepts te end date.\n * @param {boolean} includeOccurrences Accepts the boolean value to process the occurrence from recurrence series.\n * @returns {Object[]} Returns the collection of event objects from the Schedule.\n */\n Schedule.prototype.getEvents = function (startDate, endDate, includeOccurrences) {\n var eventCollections = [];\n if (includeOccurrences) {\n eventCollections = this.eventBase.getProcessedEvents();\n }\n else {\n eventCollections = this.eventsData;\n }\n if (startDate) {\n startDate = this.getDateTime(startDate);\n }\n if (endDate) {\n endDate = this.getDateTime(endDate);\n }\n eventCollections = this.eventBase.filterEventsByRange(eventCollections, startDate, endDate);\n return eventCollections;\n };\n /**\n * Retrieves the entire collection of block events bound to the Schedule.\n *\n * @function getBlockEvents\n * @param {Date} startDate Accepts the start date.\n * @param {Date} endDate Accepts te end date.\n * @param {boolean} includeOccurrences Accepts the boolean value to process the occurrence from recurrence series.\n * @returns {Object[]} Returns the collection of block event objects from the Schedule.\n */\n Schedule.prototype.getBlockEvents = function (startDate, endDate, includeOccurrences) {\n var eventCollections = [];\n if (includeOccurrences) {\n eventCollections = this.eventBase.getProcessedEvents(this.blockData);\n }\n else {\n eventCollections = this.blockData;\n }\n if (startDate) {\n startDate = this.getDateTime(startDate);\n }\n if (endDate) {\n endDate = this.getDateTime(endDate);\n }\n eventCollections = this.eventBase.filterEventsByRange(eventCollections, startDate, endDate);\n return eventCollections;\n };\n /**\n * Retrieves the occurrences of a single recurrence event based on the provided parent ID.\n *\n * @function getOccurrencesByID\n * @param {number} eventID ID of the parent recurrence data from which the occurrences are fetched.\n * @returns {Object[]} Returns the collection of occurrence event objects.\n */\n Schedule.prototype.getOccurrencesByID = function (eventID) {\n return this.eventBase.getOccurrencesByID(eventID);\n };\n /**\n * Retrieves all the occurrences that lies between the specific start and end time range.\n *\n * @function getOccurrencesByRange\n * @param {Date} startTime Denotes the start time range.\n * @param {Date} endTime Denotes the end time range.\n * @returns {Object[]} Returns the collection of occurrence event objects that lies between the provided start and end time.\n */\n Schedule.prototype.getOccurrencesByRange = function (startTime, endTime) {\n startTime = this.getDateTime(startTime);\n endTime = this.getDateTime(endTime);\n return this.eventBase.getOccurrencesByRange(startTime, endTime);\n };\n /**\n * Retrieves the dates that lies on active view of Schedule.\n *\n * @function getCurrentViewDates\n * @returns {Date[]} Returns the collection of dates.\n */\n Schedule.prototype.getCurrentViewDates = function () {\n return this.activeView ? this.activeView.renderDates : [];\n };\n /**\n * Set the recurrence editor instance from custom editor template.\n *\n * @function setRecurrenceEditor\n * @param {RecurrenceEditor} recurrenceEditor instance has passed to fetch the instance in event window.\n * @returns {void}\n */\n Schedule.prototype.setRecurrenceEditor = function (recurrenceEditor) {\n this.eventWindow.setRecurrenceEditor(recurrenceEditor);\n };\n /**\n * Get the maximum id of an event.\n *\n * @function getEventMaxID\n * @returns {number | string} Returns the maximum ID from scheduler data collections.\n */\n Schedule.prototype.getEventMaxID = function () {\n return this.eventBase.getEventMaxID();\n };\n /**\n * Get deleted occurrences from given recurrence series.\n *\n * @function getDeletedOccurrences\n * @param {string | number | Object} recurrenceData Accepts the parent ID of the event object or parent event object\n * @returns {Object[]} Returns the collection of deleted occurrence events.\n */\n Schedule.prototype.getDeletedOccurrences = function (recurrenceData) {\n return this.eventBase.getDeletedOccurrences(recurrenceData);\n };\n /**\n * Retrieves the events that lies on the current date range of the active view of Schedule.\n *\n * @function getCurrentViewEvents\n * @returns {Object[]} Returns the collection of events.\n */\n Schedule.prototype.getCurrentViewEvents = function () {\n return this.eventsProcessed;\n };\n /**\n * Refreshes the event dataSource. This method may be useful when the events alone in the schedule needs to be re-rendered.\n *\n * @function refreshEvents\n * @param {boolean} isRemoteRefresh Accepts the boolean to refresh data from remote or local\n * @returns {void}\n */\n Schedule.prototype.refreshEvents = function (isRemoteRefresh) {\n if (isRemoteRefresh === void 0) { isRemoteRefresh = true; }\n if (this.dragAndDropModule) {\n this.dragAndDropModule.actionObj.action = '';\n removeClass([this.element], cls.EVENT_ACTION_CLASS);\n }\n if (isRemoteRefresh) {\n this.crudModule.refreshDataManager();\n }\n else {\n var eventsData = this.eventsData || [];\n var blockData = this.blockData || [];\n var data = eventsData.concat(blockData);\n this.notify(events.dataReady, { processedData: this.eventBase ? this.eventBase.processData(data) : [] });\n }\n };\n /**\n * Method to refresh the given Schedule templates\n *\n * @param {string} templateName Accepts the template name\n * @returns {void}\n */\n Schedule.prototype.refreshTemplates = function (templateName) {\n if (templateName) {\n this.resetTemplates([templateName]);\n }\n else {\n this.resetTemplates();\n }\n switch (templateName) {\n case 'eventTemplate':\n this.appointmentTemplateFn = this.templateParser(this.activeViewOptions.eventTemplate);\n this.refreshEvents(false);\n break;\n case 'dateHeaderTemplate':\n this.dateHeaderTemplateFn = this.templateParser(this.activeViewOptions.dateHeaderTemplate);\n this.activeView.refreshHeader();\n break;\n case 'resourceHeaderTemplate':\n this.resourceHeaderTemplateFn = this.templateParser(this.activeViewOptions.resourceHeaderTemplate);\n if (this.activeView.isTimelineView()) {\n this.activeView.refreshResourceHeader();\n }\n else {\n this.activeView.refreshHeader();\n }\n break;\n case 'quickInfoTemplates':\n if (this.quickPopup) {\n this.quickPopup.destroy();\n this.quickPopup = null;\n }\n this.quickPopup = new QuickPopups(this);\n this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);\n this.quickInfoTemplatesContentFn = this.templateParser(this.quickInfoTemplates.content);\n this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);\n break;\n case 'editorTemplate':\n if (this.eventWindow) {\n this.eventWindow.destroy();\n this.eventWindow = null;\n }\n this.eventWindow = new EventWindow(this);\n this.editorTemplateFn = this.templateParser(this.editorTemplate);\n break;\n case 'tooltipTemplate':\n case 'headerTooltipTemplate':\n if (this.eventTooltip) {\n this.eventTooltip.destroy();\n this.eventTooltip = null;\n }\n this.eventTooltip = new EventTooltip(this);\n this.eventTooltipTemplateFn = this.templateParser(this.eventSettings.tooltipTemplate);\n this.headerTooltipTemplateFn = this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);\n break;\n default:\n this.initializeView(this.currentView);\n break;\n }\n };\n /**\n * Refreshes the Schedule layout without re-render.\n *\n * @function refreshLayout\n * @returns {void}\n */\n Schedule.prototype.refreshLayout = function () {\n this.onScheduleResize();\n if (this.headerModule) {\n this.headerModule.refresh();\n }\n if (this.eventWindow) {\n this.eventWindow.refresh();\n }\n };\n /**\n * To retrieve the appointment object from element.\n *\n * @function getEventDetails\n * @param {Element} element Denotes the event UI element on the Schedule.\n * @returns {Object} Returns the event details.\n */\n Schedule.prototype.getEventDetails = function (element) {\n element = getElement(element);\n var guid = element.getAttribute('data-guid');\n if (guid) {\n return this.eventBase.getEventByGuid(guid);\n }\n return {};\n };\n /**\n * To check whether the given time range slots are available for event creation or already occupied by other events.\n *\n * @function isSlotAvailable\n * @param {Date | Object} startTime Denotes the start time of the slot.\n * @param {Date} endTime Denotes the end time of the slot.\n * @param {number} groupIndex Defines the resource index from last level.\n * @returns {boolean} Returns true, if the slot that lies in the provided time range does not contain any other events.\n */\n Schedule.prototype.isSlotAvailable = function (startTime, endTime, groupIndex) {\n var _this = this;\n var eventStart;\n var eventEnd;\n var eventObj = this.activeEventData.event;\n if (startTime instanceof Date || typeof (startTime) === 'string') {\n eventStart = startTime;\n eventEnd = endTime;\n }\n else {\n eventObj = startTime;\n eventStart = startTime[this.eventFields.startTime];\n eventEnd = startTime[this.eventFields.endTime];\n if (this.resourceBase) {\n groupIndex = this.eventBase.getGroupIndexFromEvent(startTime);\n }\n }\n if (isNullOrUndefined(eventStart) || isNullOrUndefined(eventEnd)) {\n return true;\n }\n eventStart = this.getDateTime(eventStart);\n eventEnd = this.getDateTime(eventEnd);\n var eventCollection = this.eventBase.filterEvents(eventStart, eventEnd);\n if (!isNullOrUndefined(groupIndex) && this.resourceBase && this.resourceBase.lastResourceLevel.length > 0) {\n eventCollection = this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[groupIndex], eventCollection);\n }\n if (eventObj) {\n if (eventObj.Guid) {\n eventCollection = eventCollection.filter(function (event) { return event.Guid !== eventObj.Guid; });\n }\n else {\n eventCollection = eventCollection.filter(function (event) {\n return event[_this.eventFields.id] !== eventObj[_this.eventFields.id];\n });\n }\n }\n return (eventCollection.length > 0) ? false : true;\n };\n /**\n * To manually open the event editor on specific time or on certain events.\n *\n * @function openEditor\n * @param {Object} data It can be either cell data or event data.\n * @param {CurrentAction} action Defines the action for which the editor needs to be opened such as either for new event creation or\n * for editing of existing events. The applicable action names that can be used here are `Add`, `Save`, `EditOccurrence`\n * and `EditSeries`.\n * @param {boolean} isEventData It allows to decide whether the editor needs to be opened with the clicked cell details or with the\n * passed event details.\n * @param {number} repeatType It opens the editor with the recurrence options based on the provided repeat type.\n * @returns {void}\n */\n Schedule.prototype.openEditor = function (data, action, isEventData, repeatType) {\n if (action === 'Add' && !isEventData) {\n data.startTime = this.getDateTime(data.startTime);\n data.endTime = this.getDateTime(data.endTime);\n if (!isNullOrUndefined(data.element)) {\n data.element = getElement(data.element);\n }\n }\n else {\n data[this.eventFields.startTime] = this.getDateTime(data[this.eventFields.startTime]);\n data[this.eventFields.endTime] = this.getDateTime(data[this.eventFields.endTime]);\n }\n this.currentAction = action;\n if (action !== 'Add') {\n this.activeEventData.event = data;\n }\n this.eventWindow.openEditor(data, action, isEventData, repeatType);\n };\n /**\n * To manually close the event editor window\n *\n * @function closeEditor\n * @returns {void}\n */\n Schedule.prototype.closeEditor = function () {\n if (this.eventWindow) {\n this.eventWindow.dialogClose();\n }\n };\n /**\n * To manually close the quick info popup\n *\n * @function closeQuickInfoPopup\n * @returns {void}\n */\n Schedule.prototype.closeQuickInfoPopup = function () {\n if (this.quickPopup) {\n this.quickPopup.quickPopupHide(true);\n }\n };\n /**\n * Select the resource based on group index in mobile mode.\n *\n * @param {number} groupIndex Defines the resource index based on last level.\n * @returns {void}\n */\n Schedule.prototype.selectResourceByIndex = function (groupIndex) {\n if (this.resourceBase && this.uiStateValues.isGroupAdaptive) {\n this.resourceBase.selectResourceByIndex(groupIndex);\n }\n };\n /**\n * Select the resources to the based on id.\n *\n * @param {string | number} id id of the resource defined in resources collection.\n * @param {string} name Name of the resource defined in resources collection.\n * @returns {number} Returns the group index\n */\n Schedule.prototype.getIndexFromResourceId = function (id, name) {\n if (this.resourceBase) {\n return this.resourceBase.getIndexFromResourceId(id, name);\n }\n return null;\n };\n /**\n * Adds the resources to the specified index.\n *\n * @param {Object | Object[]} resources Accepts the resource data in single or collection of data.\n * @param {string} name Name of the resource defined in resources collection.\n * @param {number} index Index or position where the resource should be added.\n * @returns {void}\n */\n Schedule.prototype.addResource = function (resources, name, index) {\n this.resourceBase.addResource(resources, name, index);\n };\n /**\n * Removes the specified resource.\n *\n * @param {string | string[] | number | number[]} resourceId Specifies the resource id to be removed.\n * @param {string} name Specifies the resource name from which the id should be referred.\n * @returns {void}\n */\n Schedule.prototype.removeResource = function (resourceId, name) {\n this.resourceBase.removeResource(resourceId, name);\n };\n /**\n * Destroys the Schedule component.\n *\n * @function destroy\n * @returns {void}\n */\n Schedule.prototype.destroy = function () {\n if (this.eventTooltip) {\n this.eventTooltip.destroy();\n this.eventTooltip = null;\n }\n this.destroyPopups();\n this.unWireEvents();\n this.destroyHeaderModule();\n if (this.eventTooltip) {\n this.eventTooltip.destroy();\n this.eventTooltip = null;\n }\n if (this.eventBase) {\n this.eventBase.destroy();\n this.eventBase = null;\n }\n if (this.workCellAction) {\n this.workCellAction.destroy();\n this.workCellAction = null;\n }\n if (this.inlineModule) {\n this.inlineModule.destroy();\n this.inlineModule = null;\n }\n if (this.keyboardInteractionModule) {\n this.keyboardInteractionModule.destroy();\n this.keyboardInteractionModule = null;\n }\n if (this.scrollModule) {\n this.scrollModule.destroy();\n this.scrollModule = null;\n }\n if (this.printModule) {\n this.printModule.destroy();\n }\n if (this.activeView) {\n this.resetTemplates();\n this.activeView.removeEventListener();\n this.activeView.destroy();\n this.activeView = null;\n }\n if (this.scheduleTouchModule) {\n this.scheduleTouchModule.destroy();\n this.scheduleTouchModule = null;\n }\n if (this.crudModule) {\n this.crudModule.destroy();\n this.crudModule = null;\n }\n if (this.dataModule) {\n this.dataModule.destroy();\n this.dataModule = null;\n }\n _super.prototype.destroy.call(this);\n var modules = [\n 'dayModule', 'weekModule', 'workWeekModule', 'monthModule', 'monthAgendaModule', 'yearModule', 'agendaModule',\n 'timelineViewsModule', 'timelineMonthModule', 'timelineYearModule', 'resizeModule', 'dragAndDropModule',\n 'excelExportModule', 'printModule', 'iCalendarExportModule', 'iCalendarImportModule', 'tzModule', 'eventsData',\n 'eventsProcessed', 'blockData', 'blockProcessed', 'uiStateValues', 'viewCollections', 'viewOptions', 'defaultLocale',\n 'localeObj', 'selectedElements', 'resourceCollection', 'editorTitles', 'eventFields', 'activeViewOptions',\n 'activeEventData', 'activeCellsData', 'renderModule'\n ];\n for (var _i = 0, modules_1 = modules; _i < modules_1.length; _i++) {\n var module = modules_1[_i];\n this[module] = null;\n }\n util.removeChildren(this.element);\n var removeClasses = [cls.ROOT, cls.RTL, cls.DEVICE_CLASS, cls.MULTI_DRAG];\n if (this.cssClass) {\n removeClasses = removeClasses.concat(this.cssClass.split(' '));\n }\n removeClass([this.element], removeClasses);\n };\n __decorate([\n Property('auto')\n ], Schedule.prototype, \"width\", void 0);\n __decorate([\n Property('auto')\n ], Schedule.prototype, \"height\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"showHeaderBar\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"showTimeIndicator\", void 0);\n __decorate([\n Property('Week')\n ], Schedule.prototype, \"currentView\", void 0);\n __decorate([\n Property(['Day', 'Week', 'WorkWeek', 'Month', 'Agenda'])\n ], Schedule.prototype, \"views\", void 0);\n __decorate([\n Property(new Date())\n ], Schedule.prototype, \"selectedDate\", void 0);\n __decorate([\n Property(new Date(1900, 0, 1))\n ], Schedule.prototype, \"minDate\", void 0);\n __decorate([\n Property(new Date(2099, 11, 31))\n ], Schedule.prototype, \"maxDate\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"dateFormat\", void 0);\n __decorate([\n Property('Gregorian')\n ], Schedule.prototype, \"calendarMode\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"showWeekend\", void 0);\n __decorate([\n Property(0)\n ], Schedule.prototype, \"firstDayOfWeek\", void 0);\n __decorate([\n Property('FirstDay')\n ], Schedule.prototype, \"weekRule\", void 0);\n __decorate([\n Property([1, 2, 3, 4, 5])\n ], Schedule.prototype, \"workDays\", void 0);\n __decorate([\n Property(12)\n ], Schedule.prototype, \"monthsCount\", void 0);\n __decorate([\n Property('00:00')\n ], Schedule.prototype, \"startHour\", void 0);\n __decorate([\n Property('24:00')\n ], Schedule.prototype, \"endHour\", void 0);\n __decorate([\n Property(null)\n ], Schedule.prototype, \"timeFormat\", void 0);\n __decorate([\n Property(false)\n ], Schedule.prototype, \"enableAllDayScroll\", void 0);\n __decorate([\n Property(false)\n ], Schedule.prototype, \"enableAdaptiveUI\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"allowResizing\", void 0);\n __decorate([\n Complex({}, WorkHours)\n ], Schedule.prototype, \"workHours\", void 0);\n __decorate([\n Complex({}, TimeScale)\n ], Schedule.prototype, \"timeScale\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"allowKeyboardInteraction\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"allowDragAndDrop\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"dateHeaderTemplate\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"cellHeaderTemplate\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"dayHeaderTemplate\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"monthHeaderTemplate\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"cellTemplate\", void 0);\n __decorate([\n Property(false)\n ], Schedule.prototype, \"readonly\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"showQuickInfo\", void 0);\n __decorate([\n Property(false)\n ], Schedule.prototype, \"allowInline\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"allowMultiCellSelection\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"allowMultiRowSelection\", void 0);\n __decorate([\n Property(false)\n ], Schedule.prototype, \"quickInfoOnSelectionEnd\", void 0);\n __decorate([\n Property(false)\n ], Schedule.prototype, \"showWeekNumber\", void 0);\n __decorate([\n Property(false)\n ], Schedule.prototype, \"rowAutoHeight\", void 0);\n __decorate([\n Property(false)\n ], Schedule.prototype, \"allowMultiDrag\", void 0);\n __decorate([\n Property(0)\n ], Schedule.prototype, \"firstMonthOfYear\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"editorTemplate\", void 0);\n __decorate([\n Complex({}, QuickInfoTemplates)\n ], Schedule.prototype, \"quickInfoTemplates\", void 0);\n __decorate([\n Property(7)\n ], Schedule.prototype, \"agendaDaysCount\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"hideEmptyAgendaDays\", void 0);\n __decorate([\n Property(true)\n ], Schedule.prototype, \"enableRecurrenceValidation\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"timezone\", void 0);\n __decorate([\n Complex({}, EventSettings)\n ], Schedule.prototype, \"eventSettings\", void 0);\n __decorate([\n Property(timezoneData)\n ], Schedule.prototype, \"timezoneDataSource\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"resourceHeaderTemplate\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"headerIndentTemplate\", void 0);\n __decorate([\n Complex({}, Group)\n ], Schedule.prototype, \"group\", void 0);\n __decorate([\n Collection([], Resources)\n ], Schedule.prototype, \"resources\", void 0);\n __decorate([\n Collection([], HeaderRows)\n ], Schedule.prototype, \"headerRows\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"cssClass\", void 0);\n __decorate([\n Property()\n ], Schedule.prototype, \"eventDragArea\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"destroyed\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"cellClick\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"cellDoubleClick\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"moreEventsClick\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"hover\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"select\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"actionBegin\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"actionComplete\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"actionFailure\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"navigating\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"renderCell\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"eventClick\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"eventRendered\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"dataBinding\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"popupOpen\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"popupClose\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"dragStart\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"drag\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"dragStop\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"resizeStart\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"resizing\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"resizeStop\", void 0);\n __decorate([\n Event()\n ], Schedule.prototype, \"dataBound\", void 0);\n Schedule = __decorate([\n NotifyPropertyChanges\n ], Schedule);\n return Schedule;\n}(Component));\nexport { Schedule };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar ResourcesDirective = /** @class */ (function (_super) {\n __extends(ResourcesDirective, _super);\n function ResourcesDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ResourcesDirective.prototype.render = function () {\n return;\n };\n ResourcesDirective.prototype.getTag = function () {\n return 'e-resources';\n };\n ResourcesDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], ResourcesDirective);\n return ResourcesDirective;\n}(vueImport));\nexport { ResourcesDirective };\nexport var ResourcesPlugin = {\n name: 'e-resources',\n install: function (Vue) {\n Vue.component(ResourcesPlugin.name, ResourcesDirective);\n }\n};\n/**\n * `e-resources` directive represent a resources of the VueJS Schedule.\n * It must be contained in a Schedule component(`ejs-schedule`).\n * ```vue\n *
\n * \n * \n * \n * \n * \n * ```\n */\nvar ResourceDirective = /** @class */ (function (_super) {\n __extends(ResourceDirective, _super);\n function ResourceDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ResourceDirective.prototype.render = function () {\n return;\n };\n ResourceDirective.prototype.getTag = function () {\n return 'e-resource';\n };\n ResourceDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], ResourceDirective);\n return ResourceDirective;\n}(vueImport));\nexport { ResourceDirective };\nexport var ResourcePlugin = {\n name: 'e-resource',\n install: function (Vue) {\n Vue.component(ResourcePlugin.name, ResourceDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar HeaderRowsDirective = /** @class */ (function (_super) {\n __extends(HeaderRowsDirective, _super);\n function HeaderRowsDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n HeaderRowsDirective.prototype.render = function () {\n return;\n };\n HeaderRowsDirective.prototype.getTag = function () {\n return 'e-header-rows';\n };\n HeaderRowsDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], HeaderRowsDirective);\n return HeaderRowsDirective;\n}(vueImport));\nexport { HeaderRowsDirective };\nexport var HeaderRowsPlugin = {\n name: 'e-header-rows',\n install: function (Vue) {\n Vue.component(HeaderRowsPlugin.name, HeaderRowsDirective);\n }\n};\n/**\n * `e-header-rows` directive represent a header rows of the VueJS Schedule.\n * It must be contained in a Schedule component(`ejs-schedule`).\n * ```vue\n *
\n * \n * \n * \n * \n * \n * ```\n */\nvar HeaderRowDirective = /** @class */ (function (_super) {\n __extends(HeaderRowDirective, _super);\n function HeaderRowDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n HeaderRowDirective.prototype.render = function () {\n return;\n };\n HeaderRowDirective.prototype.getTag = function () {\n return 'e-header-row';\n };\n HeaderRowDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], HeaderRowDirective);\n return HeaderRowDirective;\n}(vueImport));\nexport { HeaderRowDirective };\nexport var HeaderRowPlugin = {\n name: 'e-header-row',\n install: function (Vue) {\n Vue.component(HeaderRowPlugin.name, HeaderRowDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { isUndefined } from '@syncfusion/ej2-base';\nimport { ComponentBase, EJComponentDecorator, getProps, gh } from '@syncfusion/ej2-vue-base';\nimport { isNullOrUndefined, getValue } from '@syncfusion/ej2-base';\nimport { Schedule } from '@syncfusion/ej2-schedule';\nimport { ViewsDirective, ViewDirective, ViewsPlugin, ViewPlugin } from './views.directive';\nimport { ResourcesDirective, ResourceDirective, ResourcesPlugin, ResourcePlugin } from './resources.directive';\nimport { HeaderRowsDirective, HeaderRowDirective, HeaderRowsPlugin, HeaderRowPlugin } from './headerrows.directive';\n\nexport var properties = ['islazyUpdate', 'agendaDaysCount', 'allowDragAndDrop', 'allowInline', 'allowKeyboardInteraction', 'allowMultiCellSelection', 'allowMultiDrag', 'allowMultiRowSelection', 'allowResizing', 'calendarMode', 'cellHeaderTemplate', 'cellTemplate', 'cssClass', 'currentView', 'dateFormat', 'dateHeaderTemplate', 'dayHeaderTemplate', 'editorTemplate', 'enableAdaptiveUI', 'enableAllDayScroll', 'enablePersistence', 'enableRecurrenceValidation', 'enableRtl', 'endHour', 'eventDragArea', 'eventSettings', 'firstDayOfWeek', 'firstMonthOfYear', 'group', 'headerIndentTemplate', 'headerRows', 'height', 'hideEmptyAgendaDays', 'locale', 'maxDate', 'minDate', 'monthHeaderTemplate', 'monthsCount', 'quickInfoOnSelectionEnd', 'quickInfoTemplates', 'readonly', 'resourceHeaderTemplate', 'resources', 'rowAutoHeight', 'selectedDate', 'showHeaderBar', 'showQuickInfo', 'showTimeIndicator', 'showWeekNumber', 'showWeekend', 'startHour', 'timeFormat', 'timeScale', 'timezone', 'timezoneDataSource', 'views', 'weekRule', 'width', 'workDays', 'workHours', 'actionBegin', 'actionComplete', 'actionFailure', 'cellClick', 'cellDoubleClick', 'created', 'dataBinding', 'dataBound', 'destroyed', 'drag', 'dragStart', 'dragStop', 'eventClick', 'eventRendered', 'hover', 'moreEventsClick', 'navigating', 'popupClose', 'popupOpen', 'renderCell', 'resizeStart', 'resizeStop', 'resizing', 'select'];\nexport var modelProps = ['currentView', 'selectedDate'];\nexport var testProp = getProps({ props: properties });\nexport var props = testProp[0];\nexport var watch = testProp[1];\nexport var emitProbs = Object.keys(watch);\nemitProbs.push('modelchanged');\nfor (var _i = 0, modelProps_1 = modelProps; _i < modelProps_1.length; _i++) {\n var props_1 = modelProps_1[_i];\n emitProbs.push('update:' + props_1);\n}\nexport var isExecute = gh ? false : true;\n/**\n * `ej-schedule` represents the VueJS Schedule Component.\n * ```vue\n *
\n * ```\n */\nvar ScheduleComponent = /** @class */ (function (_super) {\n __extends(ScheduleComponent, _super);\n function ScheduleComponent() {\n var _this = _super.call(this, arguments) || this;\n _this.propKeys = properties;\n _this.models = modelProps;\n _this.hasChildDirective = true;\n _this.hasInjectedModules = true;\n _this.tagMapper = { \"e-views\": \"e-view\", \"e-resources\": \"e-resource\", \"e-header-rows\": \"e-header-row\" };\n _this.tagNameMapper = { \"e-header-rows\": \"e-headerRows\" };\n _this.isVue3 = !isExecute;\n _this.ej2Instances = new Schedule({});\n _this.ej2Instances._trigger = _this.ej2Instances.trigger;\n _this.ej2Instances.trigger = _this.trigger;\n _this.bindProperties();\n _this.ej2Instances._setProperties = _this.ej2Instances.setProperties;\n _this.ej2Instances.setProperties = _this.setProperties;\n _this.ej2Instances.clearTemplate = _this.clearTemplate;\n return _this;\n }\n ScheduleComponent.prototype.clearTemplate = function (templateNames) {\n if (!templateNames) {\n templateNames = Object.keys(this.templateCollection || {});\n }\n if (templateNames.length && this.templateCollection) {\n for (var _i = 0, templateNames_1 = templateNames; _i < templateNames_1.length; _i++) {\n var tempName = templateNames_1[_i];\n var elementCollection = this.templateCollection[tempName];\n if (elementCollection && elementCollection.length) {\n for (var _a = 0, elementCollection_1 = elementCollection; _a < elementCollection_1.length; _a++) {\n var ele = elementCollection_1[_a];\n var destroy = getValue('__vue__.$destroy', ele);\n if (destroy) {\n ele.__vue__.$destroy();\n }\n if (ele.innerHTML) {\n ele.innerHTML = '';\n }\n }\n delete this.templateCollection[tempName];\n }\n }\n }\n };\n ScheduleComponent.prototype.setProperties = function (prop, muteOnChange) {\n var _this = this;\n if (this.isVue3) {\n this.models = !this.models ? this.ej2Instances.referModels : this.models;\n }\n if (this.ej2Instances && this.ej2Instances._setProperties) {\n this.ej2Instances._setProperties(prop, muteOnChange);\n }\n if (prop && this.models && this.models.length) {\n Object.keys(prop).map(function (key) {\n _this.models.map(function (model) {\n if ((key === model) && !(/datasource/i.test(key))) {\n if (_this.isVue3) {\n _this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);\n }\n else {\n _this.$emit('update:' + key, prop[key]);\n _this.$emit('modelchanged', prop[key]);\n }\n }\n });\n });\n }\n };\n ScheduleComponent.prototype.trigger = function (eventName, eventProp, successHandler) {\n if (!isExecute) {\n this.models = !this.models ? this.ej2Instances.referModels : this.models;\n }\n if ((eventName === 'change' || eventName === 'input') && this.models && (this.models.length !== 0)) {\n var key = this.models.toString().match(/checked|value/) || [];\n var propKey = key[0];\n if (eventProp && key && !isUndefined(eventProp[propKey])) {\n if (!isExecute) {\n this.ej2Instances.vueInstance.$emit('update:' + propKey, eventProp[propKey]);\n this.ej2Instances.vueInstance.$emit('modelchanged', eventProp[propKey]);\n }\n else {\n if (eventName === 'change' || (this.$props && !this.$props.islazyUpdate)) {\n this.$emit('update:' + propKey, eventProp[propKey]);\n this.$emit('modelchanged', eventProp[propKey]);\n }\n }\n }\n }\n else if ((eventName === 'actionBegin' && eventProp.requestType === 'dateNavigate') && this.models && (this.models.length !== 0)) {\n var key = this.models.toString().match(/currentView|selectedDate/) || [];\n var propKey = key[0];\n if (eventProp && key && !isUndefined(eventProp[propKey])) {\n if (!isExecute) {\n this.ej2Instances.vueInstance.$emit('update:' + propKey, eventProp[propKey]);\n this.ej2Instances.vueInstance.$emit('modelchanged', eventProp[propKey]);\n }\n else {\n this.$emit('update:' + propKey, eventProp[propKey]);\n this.$emit('modelchanged', eventProp[propKey]);\n }\n }\n }\n if ((this.ej2Instances && this.ej2Instances._trigger)) {\n this.ej2Instances._trigger(eventName, eventProp, successHandler);\n }\n };\n ScheduleComponent.prototype.render = function (createElement) {\n var h = gh || createElement;\n var slots = null;\n if (!isNullOrUndefined(this.$slots.default)) {\n slots = gh ? this.$slots.default() : this.$slots.default;\n }\n return h('div', slots);\n };\n ScheduleComponent.prototype.addEvent = function (data) {\n return this.ej2Instances.addEvent(data);\n };\n ScheduleComponent.prototype.addResource = function (resources, name, index) {\n return this.ej2Instances.addResource(resources, name, index);\n };\n ScheduleComponent.prototype.changeCurrentView = function (viewName, viewIndex) {\n return this.ej2Instances.changeCurrentView(viewName, viewIndex);\n };\n ScheduleComponent.prototype.closeEditor = function () {\n return this.ej2Instances.closeEditor();\n };\n ScheduleComponent.prototype.closeQuickInfoPopup = function () {\n return this.ej2Instances.closeQuickInfoPopup();\n };\n ScheduleComponent.prototype.collapseResource = function (resourceId, name) {\n return this.ej2Instances.collapseResource(resourceId, name);\n };\n ScheduleComponent.prototype.deleteEvent = function (id, currentAction) {\n return this.ej2Instances.deleteEvent(id, currentAction);\n };\n ScheduleComponent.prototype.expandResource = function (resourceId, name) {\n return this.ej2Instances.expandResource(resourceId, name);\n };\n ScheduleComponent.prototype.exportToExcel = function (excelExportOptions) {\n return this.ej2Instances.exportToExcel(excelExportOptions);\n };\n ScheduleComponent.prototype.exportToICalendar = function (fileName, customData) {\n return this.ej2Instances.exportToICalendar(fileName, customData);\n };\n ScheduleComponent.prototype.getBlockEvents = function (startDate, endDate, includeOccurrences) {\n return this.ej2Instances.getBlockEvents(startDate, endDate, includeOccurrences);\n };\n ScheduleComponent.prototype.getCellDetails = function (tdCol) {\n return this.ej2Instances.getCellDetails(tdCol);\n };\n ScheduleComponent.prototype.getCurrentViewDates = function () {\n return this.ej2Instances.getCurrentViewDates();\n };\n ScheduleComponent.prototype.getCurrentViewEvents = function () {\n return this.ej2Instances.getCurrentViewEvents();\n };\n ScheduleComponent.prototype.getCurrentViewIndex = function () {\n return this.ej2Instances.getCurrentViewIndex();\n };\n ScheduleComponent.prototype.getDeletedOccurrences = function (recurrenceData) {\n return this.ej2Instances.getDeletedOccurrences(recurrenceData);\n };\n ScheduleComponent.prototype.getEventDetails = function (element) {\n return this.ej2Instances.getEventDetails(element);\n };\n ScheduleComponent.prototype.getEventMaxID = function () {\n return this.ej2Instances.getEventMaxID();\n };\n ScheduleComponent.prototype.getEvents = function (startDate, endDate, includeOccurrences) {\n return this.ej2Instances.getEvents(startDate, endDate, includeOccurrences);\n };\n ScheduleComponent.prototype.getIndexFromResourceId = function (id, name) {\n return this.ej2Instances.getIndexFromResourceId(id, name);\n };\n ScheduleComponent.prototype.getOccurrencesByID = function (eventID) {\n return this.ej2Instances.getOccurrencesByID(eventID);\n };\n ScheduleComponent.prototype.getOccurrencesByRange = function (startTime, endTime) {\n return this.ej2Instances.getOccurrencesByRange(startTime, endTime);\n };\n ScheduleComponent.prototype.getResourceCollections = function () {\n return this.ej2Instances.getResourceCollections();\n };\n ScheduleComponent.prototype.getResourcesByIndex = function (index) {\n return this.ej2Instances.getResourcesByIndex(index);\n };\n ScheduleComponent.prototype.getSelectedElements = function () {\n return this.ej2Instances.getSelectedElements();\n };\n ScheduleComponent.prototype.hideSpinner = function () {\n return this.ej2Instances.hideSpinner();\n };\n ScheduleComponent.prototype.importICalendar = function (fileContent) {\n return this.ej2Instances.importICalendar(fileContent);\n };\n ScheduleComponent.prototype.isSlotAvailable = function (startTime, endTime, groupIndex) {\n return this.ej2Instances.isSlotAvailable(startTime, endTime, groupIndex);\n };\n ScheduleComponent.prototype.openEditor = function (data, action, isEventData, repeatType) {\n return this.ej2Instances.openEditor(data, action, isEventData, repeatType);\n };\n ScheduleComponent.prototype.print = function (printOptions) {\n return this.ej2Instances.print(printOptions);\n };\n ScheduleComponent.prototype.refreshEvents = function (isRemoteRefresh) {\n return this.ej2Instances.refreshEvents(isRemoteRefresh);\n };\n ScheduleComponent.prototype.refreshLayout = function () {\n return this.ej2Instances.refreshLayout();\n };\n ScheduleComponent.prototype.refreshTemplates = function (templateName) {\n return this.ej2Instances.refreshTemplates(templateName);\n };\n ScheduleComponent.prototype.removeResource = function (resourceId, name) {\n return this.ej2Instances.removeResource(resourceId, name);\n };\n ScheduleComponent.prototype.resetWorkHours = function (dates, start, end, groupIndex) {\n return this.ej2Instances.resetWorkHours(dates, start, end, groupIndex);\n };\n ScheduleComponent.prototype.saveEvent = function (data, currentAction) {\n return this.ej2Instances.saveEvent(data, currentAction);\n };\n ScheduleComponent.prototype.scrollTo = function (hour, scrollDate) {\n return this.ej2Instances.scrollTo(hour, scrollDate);\n };\n ScheduleComponent.prototype.scrollToResource = function (resourceId, groupName) {\n return this.ej2Instances.scrollToResource(resourceId, groupName);\n };\n ScheduleComponent.prototype.selectResourceByIndex = function (groupIndex) {\n return this.ej2Instances.selectResourceByIndex(groupIndex);\n };\n ScheduleComponent.prototype.setRecurrenceEditor = function (recurrenceEditor) {\n return this.ej2Instances.setRecurrenceEditor(recurrenceEditor);\n };\n ScheduleComponent.prototype.setResourceCollections = function (resourceCol) {\n return this.ej2Instances.setResourceCollections(resourceCol);\n };\n ScheduleComponent.prototype.setWorkHours = function (dates, start, end, groupIndex) {\n return this.ej2Instances.setWorkHours(dates, start, end, groupIndex);\n };\n ScheduleComponent.prototype.showSpinner = function () {\n return this.ej2Instances.showSpinner();\n };\n ScheduleComponent = __decorate([\n EJComponentDecorator({\n props: properties,\n model: {\n event: 'modelchanged'\n }\n }, isExecute)\n \n ], ScheduleComponent);\n return ScheduleComponent;\n}(ComponentBase));\nexport { ScheduleComponent };\nexport var SchedulePlugin = {\n name: 'ejs-schedule',\n install: function (Vue) {\n Vue.component(SchedulePlugin.name, ScheduleComponent);\n Vue.component(ViewPlugin.name, ViewDirective);\n Vue.component(ViewsPlugin.name, ViewsDirective);\n Vue.component(ResourcePlugin.name, ResourceDirective);\n Vue.component(ResourcesPlugin.name, ResourcesDirective);\n Vue.component(HeaderRowPlugin.name, HeaderRowDirective);\n Vue.component(HeaderRowsPlugin.name, HeaderRowsDirective);\n }\n};\n","/**\n * Position library\n */\nimport { isNullOrUndefined } from '@syncfusion/ej2-base';\nvar elementRect;\nvar popupRect;\nvar element;\nvar parentDocument;\nvar fixedParent = false;\n/**\n *\n * @param {HTMLElement} anchor - specifies the element\n * @param {HTMLElement} element - specifies the element\n * @returns {OffsetPosition} - returns the value\n */\nexport function calculateRelativeBasedPosition(anchor, element) {\n var fixedElement = false;\n var anchorPos = { left: 0, top: 0 };\n var tempAnchor = anchor;\n if (!anchor || !element) {\n return anchorPos;\n }\n if (isNullOrUndefined(element.offsetParent) && element.style.position === 'fixed') {\n fixedElement = true;\n }\n while ((element.offsetParent || fixedElement) && anchor && element.offsetParent !== anchor) {\n anchorPos.left += anchor.offsetLeft;\n anchorPos.top += anchor.offsetTop;\n anchor = anchor.offsetParent;\n }\n anchor = tempAnchor;\n while ((element.offsetParent || fixedElement) && anchor && element.offsetParent !== anchor) {\n anchorPos.left -= anchor.scrollLeft;\n anchorPos.top -= anchor.scrollTop;\n anchor = anchor.parentElement;\n }\n return anchorPos;\n}\n/**\n *\n * @param {Element} currentElement - specifies the element\n * @param {string} positionX - specifies the position\n * @param {string} positionY - specifies the position\n * @param {boolean} parentElement - specifies the boolean\n * @param {ClientRect} targetValues - specifies the client\n * @returns {OffsetPosition} - returns the position\n */\nexport function calculatePosition(currentElement, positionX, positionY, parentElement, targetValues) {\n //eslint-disable-next-line\n popupRect = undefined;\n popupRect = targetValues;\n fixedParent = parentElement ? true : false;\n if (!currentElement) {\n return { left: 0, top: 0 };\n }\n if (!positionX) {\n positionX = 'left';\n }\n if (!positionY) {\n positionY = 'top';\n }\n parentDocument = currentElement.ownerDocument;\n element = currentElement;\n var pos = { left: 0, top: 0 };\n return updatePosition(positionX.toLowerCase(), positionY.toLowerCase(), pos);\n}\n/**\n *\n * @param {number} value - specifies the number\n * @param {OffsetPosition} pos - specifies the position\n * @returns {void}\n */\nfunction setPosx(value, pos) {\n pos.left = value;\n}\n/**\n *\n * @param {number} value - specifies the number\n * @param {OffsetPosition} pos - specifies the position\n * @returns {void}\n */\nfunction setPosy(value, pos) {\n pos.top = value;\n}\n/**\n *\n * @param {string} posX - specifies the position\n * @param {string} posY - specifies the position\n * @param {OffsetPosition} pos - specifies the position\n * @returns {OffsetPosition} - returns the postion\n */\nfunction updatePosition(posX, posY, pos) {\n elementRect = element.getBoundingClientRect();\n switch (posY + posX) {\n case 'topcenter':\n setPosx(getElementHCenter(), pos);\n setPosy(getElementTop(), pos);\n break;\n case 'topright':\n setPosx(getElementRight(), pos);\n setPosy(getElementTop(), pos);\n break;\n case 'centercenter':\n setPosx(getElementHCenter(), pos);\n setPosy(getElementVCenter(), pos);\n break;\n case 'centerright':\n setPosx(getElementRight(), pos);\n setPosy(getElementVCenter(), pos);\n break;\n case 'centerleft':\n setPosx(getElementLeft(), pos);\n setPosy(getElementVCenter(), pos);\n break;\n case 'bottomcenter':\n setPosx(getElementHCenter(), pos);\n setPosy(getElementBottom(), pos);\n break;\n case 'bottomright':\n setPosx(getElementRight(), pos);\n setPosy(getElementBottom(), pos);\n break;\n case 'bottomleft':\n setPosx(getElementLeft(), pos);\n setPosy(getElementBottom(), pos);\n break;\n default:\n case 'topleft':\n setPosx(getElementLeft(), pos);\n setPosy(getElementTop(), pos);\n break;\n }\n return pos;\n}\n/**\n * @returns {number} - specifies the number value\n */\nfunction getBodyScrollTop() {\n return parentDocument.documentElement.scrollTop || parentDocument.body.scrollTop;\n}\n/**\n * @returns {number} - specifies the number value\n */\nfunction getBodyScrollLeft() {\n return parentDocument.documentElement.scrollLeft || parentDocument.body.scrollLeft;\n}\n/**\n * @returns {number} - specifies the number value\n */\nfunction getElementBottom() {\n return fixedParent ? elementRect.bottom : elementRect.bottom + getBodyScrollTop();\n}\n/**\n * @returns {number} - specifies the number value\n */\nfunction getElementVCenter() {\n return getElementTop() + (elementRect.height / 2);\n}\n/**\n * @returns {number} - specifies the number value\n */\nfunction getElementTop() {\n return fixedParent ? elementRect.top : elementRect.top + getBodyScrollTop();\n}\n/**\n * @returns {number} - specifies the number value\n */\nfunction getElementLeft() {\n return elementRect.left + getBodyScrollLeft();\n}\n/**\n * @returns {number} - specifies the number value\n */\nfunction getElementRight() {\n var popupWidth = (element && element.classList.contains('e-date-range-wrapper')) ? (popupRect ? popupRect.width : 0) :\n (popupRect && (elementRect.width >= popupRect.width) ? popupRect.width : 0);\n return elementRect.right + getBodyScrollLeft() - popupWidth;\n}\n/**\n * @returns {number} - specifies the number value\n */\nfunction getElementHCenter() {\n return getElementLeft() + (elementRect.width / 2);\n}\n","export var identity = function identity(x) {\n return x;\n};","//! moment.js locale configuration\n//! locale : Norwegian Bokmål [nb]\n//! authors : Espen Hovlandsdal : https://github.com/rexxars\n//! Sigurd Gartmann : https://github.com/sigurdga\n//! Stephen Ramthun : https://github.com/stephenramthun\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var nb = moment.defineLocale('nb', {\n months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(\n '_'\n ),\n monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),\n weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY [kl.] HH:mm',\n LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',\n },\n calendar: {\n sameDay: '[i dag kl.] LT',\n nextDay: '[i morgen kl.] LT',\n nextWeek: 'dddd [kl.] LT',\n lastDay: '[i går kl.] LT',\n lastWeek: '[forrige] dddd [kl.] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'om %s',\n past: '%s siden',\n s: 'noen sekunder',\n ss: '%d sekunder',\n m: 'ett minutt',\n mm: '%d minutter',\n h: 'en time',\n hh: '%d timer',\n d: 'en dag',\n dd: '%d dager',\n M: 'en måned',\n MM: '%d måneder',\n y: 'ett år',\n yy: '%d år',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return nb;\n\n})));\n","//! moment.js locale configuration\n//! locale : Kazakh [kk]\n//! authors : Nurlan Rakhimzhanov : https://github.com/nurlan\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var suffixes = {\n 0: '-ші',\n 1: '-ші',\n 2: '-ші',\n 3: '-ші',\n 4: '-ші',\n 5: '-ші',\n 6: '-шы',\n 7: '-ші',\n 8: '-ші',\n 9: '-шы',\n 10: '-шы',\n 20: '-шы',\n 30: '-шы',\n 40: '-шы',\n 50: '-ші',\n 60: '-шы',\n 70: '-ші',\n 80: '-ші',\n 90: '-шы',\n 100: '-ші',\n };\n\n var kk = moment.defineLocale('kk', {\n months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split(\n '_'\n ),\n monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),\n weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split(\n '_'\n ),\n weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),\n weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Бүгін сағат] LT',\n nextDay: '[Ертең сағат] LT',\n nextWeek: 'dddd [сағат] LT',\n lastDay: '[Кеше сағат] LT',\n lastWeek: '[Өткен аптаның] dddd [сағат] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: '%s ішінде',\n past: '%s бұрын',\n s: 'бірнеше секунд',\n ss: '%d секунд',\n m: 'бір минут',\n mm: '%d минут',\n h: 'бір сағат',\n hh: '%d сағат',\n d: 'бір күн',\n dd: '%d күн',\n M: 'бір ай',\n MM: '%d ай',\n y: 'бір жыл',\n yy: '%d жыл',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-(ші|шы)/,\n ordinal: function (number) {\n var a = number % 10,\n b = number >= 100 ? 100 : null;\n return number + (suffixes[number] || suffixes[a] || suffixes[b]);\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7, // The week that contains Jan 7th is the first week of the year.\n },\n });\n\n return kk;\n\n})));\n","//! moment.js locale configuration\n//! locale : Arabic (Tunisia) [ar-tn]\n//! author : Nader Toukabri : https://github.com/naderio\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var arTn = moment.defineLocale('ar-tn', {\n months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n '_'\n ),\n monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n '_'\n ),\n weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[اليوم على الساعة] LT',\n nextDay: '[غدا على الساعة] LT',\n nextWeek: 'dddd [على الساعة] LT',\n lastDay: '[أمس على الساعة] LT',\n lastWeek: 'dddd [على الساعة] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'في %s',\n past: 'منذ %s',\n s: 'ثوان',\n ss: '%d ثانية',\n m: 'دقيقة',\n mm: '%d دقائق',\n h: 'ساعة',\n hh: '%d ساعات',\n d: 'يوم',\n dd: '%d أيام',\n M: 'شهر',\n MM: '%d أشهر',\n y: 'سنة',\n yy: '%d سنوات',\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return arTn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Italian [it]\n//! author : Lorenzo : https://github.com/aliem\n//! author: Mattia Larentis: https://github.com/nostalgiaz\n//! author: Marco : https://github.com/Manfre98\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var it = moment.defineLocale('it', {\n months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(\n '_'\n ),\n monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(\n '_'\n ),\n weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),\n weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: function () {\n return (\n '[Oggi a' +\n (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n ']LT'\n );\n },\n nextDay: function () {\n return (\n '[Domani a' +\n (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n ']LT'\n );\n },\n nextWeek: function () {\n return (\n 'dddd [a' +\n (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n ']LT'\n );\n },\n lastDay: function () {\n return (\n '[Ieri a' +\n (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n ']LT'\n );\n },\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n return (\n '[La scorsa] dddd [a' +\n (this.hours() > 1\n ? 'lle '\n : this.hours() === 0\n ? ' '\n : \"ll'\") +\n ']LT'\n );\n default:\n return (\n '[Lo scorso] dddd [a' +\n (this.hours() > 1\n ? 'lle '\n : this.hours() === 0\n ? ' '\n : \"ll'\") +\n ']LT'\n );\n }\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: 'tra %s',\n past: '%s fa',\n s: 'alcuni secondi',\n ss: '%d secondi',\n m: 'un minuto',\n mm: '%d minuti',\n h: \"un'ora\",\n hh: '%d ore',\n d: 'un giorno',\n dd: '%d giorni',\n M: 'un mese',\n MM: '%d mesi',\n y: 'un anno',\n yy: '%d anni',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return it;\n\n})));\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar setGlobal = require('../internals/set-global');\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar getInternalState = InternalStateModule.get;\nvar enforceInternalState = InternalStateModule.enforce;\nvar TEMPLATE = String(String).split('String');\n\n(module.exports = function (O, key, value, options) {\n var unsafe = options ? !!options.unsafe : false;\n var simple = options ? !!options.enumerable : false;\n var noTargetGet = options ? !!options.noTargetGet : false;\n var state;\n if (typeof value == 'function') {\n if (typeof key == 'string' && !has(value, 'name')) {\n createNonEnumerableProperty(value, 'name', key);\n }\n state = enforceInternalState(value);\n if (!state.source) {\n state.source = TEMPLATE.join(typeof key == 'string' ? key : '');\n }\n }\n if (O === global) {\n if (simple) O[key] = value;\n else setGlobal(key, value);\n return;\n } else if (!unsafe) {\n delete O[key];\n } else if (!noTargetGet && O[key]) {\n simple = true;\n }\n if (simple) O[key] = value;\n else createNonEnumerableProperty(O, key, value);\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, 'toString', function toString() {\n return typeof this == 'function' && getInternalState(this).source || inspectSource(this);\n});\n","//! moment.js locale configuration\n//! locale : Italian (Switzerland) [it-ch]\n//! author : xfh : https://github.com/xfh\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var itCh = moment.defineLocale('it-ch', {\n months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(\n '_'\n ),\n monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(\n '_'\n ),\n weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),\n weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Oggi alle] LT',\n nextDay: '[Domani alle] LT',\n nextWeek: 'dddd [alle] LT',\n lastDay: '[Ieri alle] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n return '[la scorsa] dddd [alle] LT';\n default:\n return '[lo scorso] dddd [alle] LT';\n }\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: function (s) {\n return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;\n },\n past: '%s fa',\n s: 'alcuni secondi',\n ss: '%d secondi',\n m: 'un minuto',\n mm: '%d minuti',\n h: \"un'ora\",\n hh: '%d ore',\n d: 'un giorno',\n dd: '%d giorni',\n M: 'un mese',\n MM: '%d mesi',\n y: 'un anno',\n yy: '%d anni',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return itCh;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (New Zealand) [en-nz]\n//! author : Luke McGregor : https://github.com/lukemcgregor\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var enNz = moment.defineLocale('en-nz', {\n months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY h:mm A',\n LLLL: 'dddd, D MMMM YYYY h:mm A',\n },\n calendar: {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n ~~((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return enNz;\n\n})));\n","//! moment.js locale configuration\n//! locale : Frisian [fy]\n//! author : Robin van der Vliet : https://github.com/robin0van0der0v\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split(\n '_'\n ),\n monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split(\n '_'\n );\n\n var fy = moment.defineLocale('fy', {\n months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split(\n '_'\n ),\n monthsShort: function (m, format) {\n if (!m) {\n return monthsShortWithDots;\n } else if (/-MMM-/.test(format)) {\n return monthsShortWithoutDots[m.month()];\n } else {\n return monthsShortWithDots[m.month()];\n }\n },\n monthsParseExact: true,\n weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split(\n '_'\n ),\n weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),\n weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD-MM-YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[hjoed om] LT',\n nextDay: '[moarn om] LT',\n nextWeek: 'dddd [om] LT',\n lastDay: '[juster om] LT',\n lastWeek: '[ôfrûne] dddd [om] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'oer %s',\n past: '%s lyn',\n s: 'in pear sekonden',\n ss: '%d sekonden',\n m: 'ien minút',\n mm: '%d minuten',\n h: 'ien oere',\n hh: '%d oeren',\n d: 'ien dei',\n dd: '%d dagen',\n M: 'ien moanne',\n MM: '%d moannen',\n y: 'ien jier',\n yy: '%d jierren',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n ordinal: function (number) {\n return (\n number +\n (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')\n );\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return fy;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Israel) [en-il]\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var enIl = moment.defineLocale('en-il', {\n months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n ~~((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n });\n\n return enIl;\n\n})));\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n///
\nimport { EventHandler, Internationalization, Property, NotifyPropertyChanges, Browser } from '@syncfusion/ej2-base';\nimport { Animation, Event, cldrData, getDefaultDateObject, detach } from '@syncfusion/ej2-base';\nimport { createElement, remove, addClass, L10n, removeClass, closest, append, attributes } from '@syncfusion/ej2-base';\nimport { KeyboardEvents, isNullOrUndefined, formatUnit, getValue, rippleEffect } from '@syncfusion/ej2-base';\nimport { extend } from '@syncfusion/ej2-base';\nimport { Popup } from '@syncfusion/ej2-popups';\nimport { Input } from '@syncfusion/ej2-inputs';\nimport { DatePicker } from '../datepicker/datepicker';\nimport { TimePickerBase } from '../timepicker/timepicker';\n//class constant defination\nvar DATEWRAPPER = 'e-date-wrapper';\nvar DATEPICKERROOT = 'e-datepicker';\nvar DATETIMEWRAPPER = 'e-datetime-wrapper';\nvar DAY = new Date().getDate();\nvar MONTH = new Date().getMonth();\nvar YEAR = new Date().getFullYear();\nvar HOUR = new Date().getHours();\nvar MINUTE = new Date().getMinutes();\nvar SECOND = new Date().getSeconds();\nvar MILLISECOND = new Date().getMilliseconds();\nvar ROOT = 'e-datetimepicker';\nvar DATETIMEPOPUPWRAPPER = 'e-datetimepopup-wrapper';\nvar INPUTWRAPPER = 'e-input-group-icon';\nvar POPUP = 'e-popup';\nvar TIMEICON = 'e-time-icon';\nvar INPUTFOCUS = 'e-input-focus';\nvar POPUPDIMENSION = '250px';\nvar ICONANIMATION = 'e-icon-anim';\nvar DISABLED = 'e-disabled';\nvar ERROR = 'e-error';\nvar CONTENT = 'e-content';\nvar NAVIGATION = 'e-navigation';\nvar ACTIVE = 'e-active';\nvar HOVER = 'e-hover';\nvar ICONS = 'e-icons';\nvar HALFPOSITION = 2;\nvar LISTCLASS = 'e-list-item';\nvar ANIMATIONDURATION = 100;\nvar OVERFLOW = 'e-time-overflow';\n/**\n * Represents the DateTimePicker component that allows user to select\n * or enter a date time value.\n * ```html\n *
\n * ```\n * ```typescript\n * \n * ```\n */\nvar DateTimePicker = /** @class */ (function (_super) {\n __extends(DateTimePicker, _super);\n /**\n * Constructor for creating the widget\n *\n * @param {DateTimePickerModel} options - Specifies the DateTimePicker model.\n * @param {string | HTMLInputElement} element - Specifies the element to render as component.\n * @private\n */\n function DateTimePicker(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.valueWithMinutes = null;\n _this.scrollInvoked = false;\n _this.moduleName = _this.getModuleName();\n _this.dateTimeOptions = options;\n return _this;\n }\n DateTimePicker.prototype.focusHandler = function () {\n if (!this.enabled) {\n return;\n }\n addClass([this.inputWrapper.container], INPUTFOCUS);\n };\n /**\n * Sets the focus to widget for interaction.\n *\n * @returns {void}\n */\n DateTimePicker.prototype.focusIn = function () {\n _super.prototype.focusIn.call(this);\n };\n /**\n * Remove the focus from widget, if the widget is in focus state.\n *\n * @returns {void}\n */\n DateTimePicker.prototype.focusOut = function () {\n if (document.activeElement === this.inputElement) {\n this.inputElement.blur();\n removeClass([this.inputWrapper.container], [INPUTFOCUS]);\n }\n };\n DateTimePicker.prototype.blurHandler = function (e) {\n if (!this.enabled) {\n return;\n }\n // IE popup closing issue when click over the scrollbar\n if (this.isTimePopupOpen() && this.isPreventBlur) {\n this.inputElement.focus();\n return;\n }\n removeClass([this.inputWrapper.container], INPUTFOCUS);\n var blurArguments = {\n model: this\n };\n if (this.isTimePopupOpen()) {\n this.hide(e);\n }\n this.trigger('blur', blurArguments);\n };\n /**\n * To destroy the widget.\n *\n * @returns {void}\n */\n DateTimePicker.prototype.destroy = function () {\n if (this.popupObject && this.popupObject.element.classList.contains(POPUP)) {\n this.popupObject.destroy();\n detach(this.dateTimeWrapper);\n this.dateTimeWrapper = undefined;\n this.liCollections = this.timeCollections = [];\n if (!isNullOrUndefined(this.rippleFn)) {\n this.rippleFn();\n }\n }\n var ariaAttribute = {\n 'aria-live': 'assertive', 'aria-atomic': 'true', 'aria-invalid': 'false',\n 'aria-haspopup': 'true', 'aria-activedescendant': 'null',\n 'autocorrect': 'off', 'autocapitalize': 'off', 'spellcheck': 'false',\n 'aria-owns': this.element.id + '_options', 'aria-expanded': 'false', 'role': 'combobox', 'autocomplete': 'off'\n };\n if (this.inputElement) {\n Input.removeAttributes(ariaAttribute, this.inputElement);\n this.inputElement.removeAttribute('aria-placeholder');\n }\n if (this.isCalendar()) {\n if (this.popupWrapper) {\n detach(this.popupWrapper);\n }\n this.popupObject = this.popupWrapper = null;\n this.keyboardHandler.destroy();\n }\n this.unBindInputEvents();\n _super.prototype.destroy.call(this);\n };\n /**\n * To Initialize the control rendering.\n *\n * @returns {void}\n * @private\n */\n DateTimePicker.prototype.render = function () {\n this.timekeyConfigure = {\n enter: 'enter',\n escape: 'escape',\n end: 'end',\n tab: 'tab',\n home: 'home',\n down: 'downarrow',\n up: 'uparrow',\n left: 'leftarrow',\n right: 'rightarrow',\n open: 'alt+downarrow',\n close: 'alt+uparrow'\n };\n this.valueWithMinutes = null;\n this.previousDateTime = null;\n this.isPreventBlur = false;\n this.cloneElement = this.element.cloneNode(true);\n this.dateTimeFormat = this.cldrDateTimeFormat();\n this.initValue = this.value;\n _super.prototype.updateHtmlAttributeToElement.call(this);\n this.checkAttributes(false);\n var localeText = { placeholder: this.placeholder };\n this.l10n = new L10n('datetimepicker', localeText, this.locale);\n this.setProperties({ placeholder: this.placeholder || this.l10n.getConstant('placeholder') }, true);\n _super.prototype.render.call(this);\n this.createInputElement();\n _super.prototype.updateHtmlAttributeToWrapper.call(this);\n this.bindInputEvents();\n if (this.enableMask) {\n this.notify(\"createMask\", {\n module: \"MaskedDateTime\",\n });\n }\n this.setValue();\n if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {\n Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);\n }\n this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkValue(this.scrollTo))) }, true);\n this.previousDateTime = this.value && new Date(+this.value);\n if (this.element.tagName === 'EJS-DATETIMEPICKER') {\n this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';\n this.element.removeAttribute('tabindex');\n if (!this.enabled) {\n this.inputElement.tabIndex = -1;\n }\n }\n this.renderComplete();\n };\n DateTimePicker.prototype.setValue = function () {\n this.initValue = this.validateMinMaxRange(this.value);\n if (!this.strictMode && this.isDateObject(this.initValue)) {\n var value = this.validateMinMaxRange(this.initValue);\n Input.setValue(this.getFormattedValue(value), this.inputElement, this.floatLabelType, this.showClearButton);\n this.setProperties({ value: value }, true);\n }\n else {\n if (isNullOrUndefined(this.value)) {\n this.initValue = null;\n this.setProperties({ value: null }, true);\n }\n }\n this.valueWithMinutes = this.value;\n _super.prototype.updateInput.call(this);\n };\n DateTimePicker.prototype.validateMinMaxRange = function (value) {\n var result = value;\n if (this.isDateObject(value)) {\n result = this.validateValue(value);\n }\n else {\n if (+this.min > +this.max) {\n this.disablePopupButton(true);\n }\n }\n this.checkValidState(result);\n return result;\n };\n DateTimePicker.prototype.checkValidState = function (value) {\n this.isValidState = true;\n if (!this.strictMode) {\n if ((+(value) > +(this.max)) || (+(value) < +(this.min))) {\n this.isValidState = false;\n }\n }\n this.checkErrorState();\n };\n DateTimePicker.prototype.checkErrorState = function () {\n if (this.isValidState) {\n removeClass([this.inputWrapper.container], ERROR);\n }\n else {\n addClass([this.inputWrapper.container], ERROR);\n }\n attributes(this.inputElement, { 'aria-invalid': this.isValidState ? 'false' : 'true' });\n };\n DateTimePicker.prototype.validateValue = function (value) {\n var dateVal = value;\n if (this.strictMode) {\n if (+this.min > +this.max) {\n this.disablePopupButton(true);\n dateVal = this.max;\n }\n else if (+value < +this.min) {\n dateVal = this.min;\n }\n else if (+value > +this.max) {\n dateVal = this.max;\n }\n }\n else {\n if (+this.min > +this.max) {\n this.disablePopupButton(true);\n dateVal = value;\n }\n }\n return dateVal;\n };\n DateTimePicker.prototype.disablePopupButton = function (isDisable) {\n if (isDisable) {\n addClass([this.inputWrapper.buttons[0], this.timeIcon], DISABLED);\n this.hide();\n }\n else {\n removeClass([this.inputWrapper.buttons[0], this.timeIcon], DISABLED);\n }\n };\n DateTimePicker.prototype.getFormattedValue = function (value) {\n var dateOptions;\n if (!isNullOrUndefined(value)) {\n if (this.calendarMode === 'Gregorian') {\n dateOptions = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton: 'yMd' };\n }\n else {\n dateOptions = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };\n }\n return this.globalize.formatDate(value, dateOptions);\n }\n else {\n return null;\n }\n };\n DateTimePicker.prototype.isDateObject = function (value) {\n return (!isNullOrUndefined(value) && !isNaN(+value)) ? true : false;\n };\n DateTimePicker.prototype.createInputElement = function () {\n removeClass([this.inputElement], DATEPICKERROOT);\n removeClass([this.inputWrapper.container], DATEWRAPPER);\n addClass([this.inputWrapper.container], DATETIMEWRAPPER);\n addClass([this.inputElement], ROOT);\n this.renderTimeIcon();\n };\n DateTimePicker.prototype.renderTimeIcon = function () {\n this.timeIcon = Input.appendSpan(INPUTWRAPPER + ' ' + TIMEICON + ' ' + ICONS, this.inputWrapper.container);\n };\n DateTimePicker.prototype.bindInputEvents = function () {\n EventHandler.add(this.timeIcon, 'mousedown', this.timeHandler, this);\n EventHandler.add(this.inputWrapper.buttons[0], 'mousedown', this.dateHandler, this);\n EventHandler.add(this.inputElement, 'blur', this.blurHandler, this);\n EventHandler.add(this.inputElement, 'focus', this.focusHandler, this);\n this.defaultKeyConfigs = extend(this.defaultKeyConfigs, this.keyConfigs);\n this.keyboardHandler = new KeyboardEvents(this.inputElement, {\n eventName: 'keydown',\n keyAction: this.inputKeyAction.bind(this),\n keyConfigs: this.defaultKeyConfigs\n });\n };\n DateTimePicker.prototype.unBindInputEvents = function () {\n EventHandler.remove(this.timeIcon, 'mousedown touchstart', this.timeHandler);\n EventHandler.remove(this.inputWrapper.buttons[0], 'mousedown touchstart', this.dateHandler);\n if (this.inputElement) {\n EventHandler.remove(this.inputElement, 'blur', this.blurHandler);\n EventHandler.remove(this.inputElement, 'focus', this.focusHandler);\n }\n if (this.keyboardHandler) {\n this.keyboardHandler.destroy();\n }\n };\n DateTimePicker.prototype.cldrTimeFormat = function () {\n var cldrTime;\n if (this.isNullOrEmpty(this.timeFormat)) {\n if (this.locale === 'en' || this.locale === 'en-US') {\n cldrTime = (getValue('timeFormats.short', getDefaultDateObject()));\n }\n else {\n cldrTime = (this.getCultureTimeObject(cldrData, '' + this.locale));\n }\n }\n else {\n cldrTime = this.timeFormat;\n }\n return cldrTime;\n };\n DateTimePicker.prototype.cldrDateTimeFormat = function () {\n var cldrTime;\n var culture = new Internationalization(this.locale);\n var dateFormat = culture.getDatePattern({ skeleton: 'yMd' });\n if (this.isNullOrEmpty(this.formatString)) {\n cldrTime = dateFormat + ' ' + this.getCldrFormat('time');\n }\n else {\n cldrTime = this.formatString;\n }\n return cldrTime;\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DateTimePicker.prototype.getCldrFormat = function (type) {\n var cldrDateTime;\n if (this.locale === 'en' || this.locale === 'en-US') {\n cldrDateTime = (getValue('timeFormats.short', getDefaultDateObject()));\n }\n else {\n cldrDateTime = (this.getCultureTimeObject(cldrData, '' + this.locale));\n }\n return cldrDateTime;\n };\n DateTimePicker.prototype.isNullOrEmpty = function (value) {\n if (isNullOrUndefined(value) || (typeof value === 'string' && value.trim() === '')) {\n return true;\n }\n else {\n return false;\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DateTimePicker.prototype.getCultureTimeObject = function (ld, c) {\n if (this.calendarMode === 'Gregorian') {\n return getValue('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.short', ld);\n }\n else {\n return getValue('main.' + '' + this.locale + '.dates.calendars.islamic.timeFormats.short', ld);\n }\n };\n DateTimePicker.prototype.timeHandler = function (e) {\n if (!this.enabled) {\n return;\n }\n this.isIconClicked = true;\n if (Browser.isDevice) {\n this.inputElement.setAttribute('readonly', '');\n }\n if (e.currentTarget === this.timeIcon) {\n e.preventDefault();\n }\n if (this.enabled && !this.readonly) {\n if (this.isDatePopupOpen()) {\n _super.prototype.hide.call(this, e);\n }\n if (this.isTimePopupOpen()) {\n this.closePopup(e);\n }\n else {\n this.inputElement.focus();\n this.popupCreation('time', e);\n addClass([this.inputWrapper.container], [INPUTFOCUS]);\n }\n }\n this.isIconClicked = false;\n };\n DateTimePicker.prototype.dateHandler = function (e) {\n if (!this.enabled) {\n return;\n }\n if (e.currentTarget === this.inputWrapper.buttons[0]) {\n e.preventDefault();\n }\n if (this.enabled && !this.readonly) {\n if (this.isTimePopupOpen()) {\n this.closePopup(e);\n }\n if (!isNullOrUndefined(this.popupWrapper)) {\n this.popupCreation('date', e);\n }\n }\n };\n DateTimePicker.prototype.show = function (type, e) {\n if ((this.enabled && this.readonly) || !this.enabled) {\n return;\n }\n else {\n if (type === 'time' && !this.dateTimeWrapper) {\n if (this.isDatePopupOpen()) {\n this.hide(e);\n }\n this.popupCreation('time', e);\n }\n else if (!this.popupObj) {\n if (this.isTimePopupOpen()) {\n this.hide(e);\n }\n _super.prototype.show.call(this);\n this.popupCreation('date', e);\n }\n }\n };\n DateTimePicker.prototype.toggle = function (e) {\n if (this.isDatePopupOpen()) {\n _super.prototype.hide.call(this, e);\n this.show('time', null);\n }\n else if (this.isTimePopupOpen()) {\n this.hide(e);\n _super.prototype.show.call(this, null, e);\n this.popupCreation('date', null);\n }\n else {\n this.show(null, e);\n }\n };\n DateTimePicker.prototype.listCreation = function () {\n var dateObject;\n if (this.calendarMode === 'Gregorian') {\n dateObject = this.globalize.parseDate(this.inputElement.value, {\n format: this.cldrDateTimeFormat(), type: 'datetime'\n });\n }\n else {\n dateObject = this.globalize.parseDate(this.inputElement.value, {\n format: this.cldrDateTimeFormat(), type: 'datetime', calendar: 'islamic'\n });\n }\n var value = isNullOrUndefined(this.value) ? this.inputElement.value !== '' ?\n dateObject :\n new Date() : this.value;\n this.valueWithMinutes = value;\n this.listWrapper = createElement('div', { className: CONTENT, attrs: { 'tabindex': '0' } });\n var min = this.startTime(value);\n var max = this.endTime(value);\n var listDetails = TimePickerBase.createListItems(this.createElement, min, max, this.globalize, this.cldrTimeFormat(), this.step);\n this.timeCollections = listDetails.collection;\n this.listTag = listDetails.list;\n attributes(this.listTag, { 'role': 'listbox', 'aria-hidden': 'false', 'id': this.element.id + '_options' });\n append([listDetails.list], this.listWrapper);\n this.wireTimeListEvents();\n var rippleModel = { duration: 300, selector: '.' + LISTCLASS };\n this.rippleFn = rippleEffect(this.listWrapper, rippleModel);\n this.liCollections = this.listWrapper.querySelectorAll('.' + LISTCLASS);\n };\n DateTimePicker.prototype.popupCreation = function (type, e) {\n if (Browser.isDevice) {\n this.element.setAttribute('readonly', 'readonly');\n }\n if (type === 'date') {\n if (!this.readonly && this.popupWrapper) {\n addClass([this.popupWrapper], DATETIMEPOPUPWRAPPER);\n attributes(this.popupWrapper, { 'id': this.element.id + '_datepopup' });\n }\n }\n else {\n if (!this.readonly) {\n this.dateTimeWrapper = createElement('div', {\n className: ROOT + ' ' + POPUP,\n attrs: { 'id': this.element.id + '_timepopup', 'style': 'visibility:hidden ; display:block' }\n });\n if (!isNullOrUndefined(this.cssClass)) {\n this.dateTimeWrapper.className += ' ' + this.cssClass;\n }\n if (!isNullOrUndefined(this.step) && this.step > 0) {\n this.listCreation();\n append([this.listWrapper], this.dateTimeWrapper);\n }\n document.body.appendChild(this.dateTimeWrapper);\n this.addTimeSelection();\n this.renderPopup();\n this.setTimeScrollPosition();\n this.openPopup(e);\n this.popupObject.refreshPosition(this.inputElement);\n }\n }\n };\n DateTimePicker.prototype.openPopup = function (e) {\n var _this = this;\n this.preventArgs = {\n cancel: false,\n popup: this.popupObject,\n event: e || null\n };\n var eventArgs = this.preventArgs;\n this.trigger('open', eventArgs, function (eventArgs) {\n _this.preventArgs = eventArgs;\n if (!_this.preventArgs.cancel && !_this.readonly) {\n var openAnimation = {\n name: 'FadeIn',\n duration: ANIMATIONDURATION\n };\n if (_this.zIndex === 1000) {\n _this.popupObject.show(new Animation(openAnimation), _this.element);\n }\n else {\n _this.popupObject.show(new Animation(openAnimation), null);\n }\n addClass([_this.inputWrapper.container], [ICONANIMATION]);\n attributes(_this.inputElement, { 'aria-expanded': 'true' });\n EventHandler.add(document, 'mousedown touchstart', _this.documentClickHandler, _this);\n }\n });\n };\n DateTimePicker.prototype.documentClickHandler = function (event) {\n var target = event.target;\n if ((!isNullOrUndefined(this.popupObject) && (this.inputWrapper.container.contains(target) ||\n (this.popupObject.element && this.popupObject.element.contains(target)))) && event.type !== 'touchstart') {\n event.preventDefault();\n }\n if (!(closest(target, '[id=\"' + (this.popupObject && this.popupObject.element.id + '\"]'))) && target !== this.inputElement\n && target !== this.timeIcon && target !== this.inputWrapper.container) {\n if (this.isTimePopupOpen()) {\n this.hide(event);\n this.focusOut();\n }\n }\n else if (target !== this.inputElement) {\n if (!Browser.isDevice) {\n this.isPreventBlur = ((document.activeElement === this.inputElement) && (Browser.isIE || Browser.info.name === 'edge')\n && target === this.popupObject.element);\n }\n }\n };\n DateTimePicker.prototype.isTimePopupOpen = function () {\n return (this.dateTimeWrapper && this.dateTimeWrapper.classList.contains('' + ROOT)) ? true : false;\n };\n DateTimePicker.prototype.isDatePopupOpen = function () {\n return (this.popupWrapper && this.popupWrapper.classList.contains('' + DATETIMEPOPUPWRAPPER)) ? true : false;\n };\n DateTimePicker.prototype.renderPopup = function () {\n var _this = this;\n this.containerStyle = this.inputWrapper.container.getBoundingClientRect();\n if (Browser.isDevice) {\n this.timeModal = createElement('div');\n this.timeModal.className = '' + ROOT + ' e-time-modal';\n document.body.className += ' ' + OVERFLOW;\n this.timeModal.style.display = 'block';\n document.body.appendChild(this.timeModal);\n }\n var offset = 4;\n this.popupObject = new Popup(this.dateTimeWrapper, {\n width: this.setPopupWidth(),\n zIndex: this.zIndex,\n targetType: 'container',\n collision: Browser.isDevice ? { X: 'fit', Y: 'fit' } : { X: 'flip', Y: 'flip' },\n relateTo: Browser.isDevice ? document.body : this.inputWrapper.container,\n position: Browser.isDevice ? { X: 'center', Y: 'center' } : { X: 'left', Y: 'bottom' },\n enableRtl: this.enableRtl,\n offsetY: offset,\n open: function () {\n _this.dateTimeWrapper.style.visibility = 'visible';\n addClass([_this.timeIcon], ACTIVE);\n if (!Browser.isDevice) {\n _this.timekeyConfigure = extend(_this.timekeyConfigure, _this.keyConfigs);\n _this.inputEvent = new KeyboardEvents(_this.inputWrapper.container, {\n keyAction: _this.timeKeyActionHandle.bind(_this),\n keyConfigs: _this.timekeyConfigure,\n eventName: 'keydown'\n });\n }\n }, close: function () {\n removeClass([_this.timeIcon], ACTIVE);\n _this.unWireTimeListEvents();\n _this.inputElement.setAttribute('aria-activedescendant', 'null');\n remove(_this.popupObject.element);\n _this.popupObject.destroy();\n _this.dateTimeWrapper.innerHTML = '';\n _this.listWrapper = _this.dateTimeWrapper = undefined;\n if (_this.inputEvent) {\n _this.inputEvent.destroy();\n }\n }, targetExitViewport: function () {\n if (!Browser.isDevice) {\n _this.hide();\n }\n }\n });\n this.popupObject.element.style.maxHeight = POPUPDIMENSION;\n };\n DateTimePicker.prototype.setDimension = function (width) {\n if (typeof width === 'number') {\n width = formatUnit(width);\n }\n else if (typeof width === 'string') {\n // eslint-disable-next-line no-self-assign\n width = width;\n }\n else {\n width = '100%';\n }\n return width;\n };\n DateTimePicker.prototype.setPopupWidth = function () {\n var width = this.setDimension(this.width);\n if (width.indexOf('%') > -1) {\n var inputWidth = this.containerStyle.width * parseFloat(width) / 100;\n width = inputWidth.toString() + 'px';\n }\n return width;\n };\n DateTimePicker.prototype.wireTimeListEvents = function () {\n EventHandler.add(this.listWrapper, 'click', this.onMouseClick, this);\n if (!Browser.isDevice) {\n EventHandler.add(this.listWrapper, 'mouseover', this.onMouseOver, this);\n EventHandler.add(this.listWrapper, 'mouseout', this.onMouseLeave, this);\n }\n };\n DateTimePicker.prototype.unWireTimeListEvents = function () {\n if (this.listWrapper) {\n EventHandler.remove(this.listWrapper, 'click', this.onMouseClick);\n EventHandler.remove(document, 'mousedown touchstart', this.documentClickHandler);\n if (!Browser.isDevice) {\n EventHandler.add(this.listWrapper, 'mouseover', this.onMouseOver, this);\n EventHandler.add(this.listWrapper, 'mouseout', this.onMouseLeave, this);\n }\n }\n };\n DateTimePicker.prototype.onMouseOver = function (event) {\n var currentLi = closest(event.target, '.' + LISTCLASS);\n this.setTimeHover(currentLi, HOVER);\n };\n DateTimePicker.prototype.onMouseLeave = function () {\n this.removeTimeHover(HOVER);\n };\n DateTimePicker.prototype.setTimeHover = function (li, className) {\n if (this.enabled && this.isValidLI(li) && !li.classList.contains(className)) {\n this.removeTimeHover(className);\n addClass([li], className);\n }\n };\n DateTimePicker.prototype.getPopupHeight = function () {\n var height = parseInt(POPUPDIMENSION, 10);\n var popupHeight = this.dateTimeWrapper.getBoundingClientRect().height;\n return popupHeight > height ? height : popupHeight;\n };\n DateTimePicker.prototype.changeEvent = function (e) {\n if ((this.value && this.value.valueOf()) !== (this.previousDateTime && +this.previousDateTime.valueOf())) {\n _super.prototype.changeEvent.call(this, e);\n this.valueWithMinutes = this.value;\n this.setInputValue('date');\n this.previousDateTime = this.value && new Date(+this.value);\n }\n };\n DateTimePicker.prototype.updateValue = function (e) {\n this.setInputValue('time');\n if (+this.previousDateTime !== +this.value) {\n this.changedArgs = {\n value: this.value, event: e || null,\n isInteracted: !isNullOrUndefined(e),\n element: this.element\n };\n this.addTimeSelection();\n this.trigger('change', this.changedArgs);\n this.previousDateTime = this.value;\n }\n };\n DateTimePicker.prototype.setTimeScrollPosition = function () {\n var popupElement = this.selectedElement;\n if (!isNullOrUndefined(popupElement)) {\n this.findScrollTop(popupElement);\n }\n else if (this.dateTimeWrapper && this.checkDateValue(this.scrollTo)) {\n this.setScrollTo();\n }\n };\n DateTimePicker.prototype.findScrollTop = function (element) {\n var listHeight = this.getPopupHeight();\n var nextElement = element.nextElementSibling;\n var height = nextElement ? nextElement.offsetTop : element.offsetTop;\n var lineHeight = element.getBoundingClientRect().height;\n if ((height + element.offsetTop) > listHeight) {\n this.dateTimeWrapper.scrollTop = nextElement ? (height - (listHeight / HALFPOSITION + lineHeight / HALFPOSITION)) : height;\n }\n else {\n this.dateTimeWrapper.scrollTop = 0;\n }\n };\n DateTimePicker.prototype.setScrollTo = function () {\n var element;\n var items = this.dateTimeWrapper.querySelectorAll('.' + LISTCLASS);\n if (items.length >= 0) {\n this.scrollInvoked = true;\n var initialTime = this.timeCollections[0];\n var scrollTime = this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();\n element = items[Math.round((scrollTime - initialTime) / (this.step * 60000))];\n }\n else {\n this.dateTimeWrapper.scrollTop = 0;\n }\n if (!isNullOrUndefined(element)) {\n this.findScrollTop(element);\n }\n else {\n this.dateTimeWrapper.scrollTop = 0;\n }\n };\n DateTimePicker.prototype.setInputValue = function (type) {\n if (type === 'date') {\n this.inputElement.value = this.previousElementValue = this.getFormattedValue(this.getFullDateTime());\n this.setProperties({ value: this.getFullDateTime() }, true);\n }\n else {\n var tempVal = this.getFormattedValue(new Date(this.timeCollections[this.activeIndex]));\n Input.setValue(tempVal, this.inputElement, this.floatLabelType, this.showClearButton);\n this.previousElementValue = this.inputElement.value;\n this.setProperties({ value: new Date(this.timeCollections[this.activeIndex]) }, true);\n if (this.enableMask) {\n this.createMask();\n }\n }\n this.updateIconState();\n };\n DateTimePicker.prototype.getFullDateTime = function () {\n var value = null;\n if (this.isDateObject(this.valueWithMinutes)) {\n value = this.combineDateTime(this.valueWithMinutes);\n }\n else {\n value = this.previousDate;\n }\n return this.validateMinMaxRange(value);\n };\n DateTimePicker.prototype.createMask = function () {\n this.notify(\"createMask\", {\n module: \"MaskedDateTime\",\n });\n };\n DateTimePicker.prototype.combineDateTime = function (value) {\n if (this.isDateObject(value)) {\n var day = this.previousDate.getDate();\n var month = this.previousDate.getMonth();\n var year = this.previousDate.getFullYear();\n var hour = value.getHours();\n var minutes = value.getMinutes();\n var seconds = value.getSeconds();\n return new Date(year, month, day, hour, minutes, seconds);\n }\n else {\n return this.previousDate;\n }\n };\n DateTimePicker.prototype.onMouseClick = function (event) {\n var target = event.target;\n var li = this.selectedElement = closest(target, '.' + LISTCLASS);\n if (li && li.classList.contains(LISTCLASS)) {\n this.timeValue = li.getAttribute('data-value');\n this.hide(event);\n }\n this.setSelection(li, event);\n };\n DateTimePicker.prototype.setSelection = function (li, event) {\n if (this.isValidLI(li) && !li.classList.contains(ACTIVE)) {\n this.selectedElement = li;\n var index = Array.prototype.slice.call(this.liCollections).indexOf(li);\n this.activeIndex = index;\n this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);\n addClass([this.selectedElement], ACTIVE);\n this.selectedElement.setAttribute('aria-selected', 'true');\n this.updateValue(event);\n }\n };\n DateTimePicker.prototype.setTimeActiveClass = function () {\n var collections = isNullOrUndefined(this.dateTimeWrapper) ? this.listWrapper : this.dateTimeWrapper;\n if (!isNullOrUndefined(collections)) {\n var items = collections.querySelectorAll('.' + LISTCLASS);\n if (items.length) {\n for (var i = 0; i < items.length; i++) {\n if (this.timeCollections[i] === +(this.valueWithMinutes)) {\n items[i].setAttribute('aria-selected', 'true');\n this.selectedElement = items[i];\n this.activeIndex = i;\n this.setTimeActiveDescendant();\n break;\n }\n }\n }\n }\n };\n DateTimePicker.prototype.setTimeActiveDescendant = function () {\n if (!isNullOrUndefined(this.selectedElement)) {\n attributes(this.inputElement, { 'aria-activedescendant': this.selectedElement.getAttribute('id') });\n }\n else {\n attributes(this.inputElement, { 'aria-activedescendant': 'null' });\n }\n };\n DateTimePicker.prototype.addTimeSelection = function () {\n this.selectedElement = null;\n this.removeTimeSelection();\n this.setTimeActiveClass();\n if (!isNullOrUndefined(this.selectedElement)) {\n addClass([this.selectedElement], ACTIVE);\n this.selectedElement.setAttribute('aria-selected', 'true');\n }\n };\n DateTimePicker.prototype.removeTimeSelection = function () {\n this.removeTimeHover(HOVER);\n if (!isNullOrUndefined(this.dateTimeWrapper)) {\n var items = this.dateTimeWrapper.querySelectorAll('.' + ACTIVE);\n if (items.length) {\n removeClass(items, ACTIVE);\n items[0].removeAttribute('aria-selected');\n }\n }\n };\n DateTimePicker.prototype.removeTimeHover = function (className) {\n var hoveredItem = this.getTimeHoverItem(className);\n if (hoveredItem && hoveredItem.length) {\n removeClass(hoveredItem, className);\n }\n };\n DateTimePicker.prototype.getTimeHoverItem = function (className) {\n var collections = isNullOrUndefined(this.dateTimeWrapper) ? this.listWrapper : this.dateTimeWrapper;\n var hoveredItem;\n if (!isNullOrUndefined(collections)) {\n hoveredItem = collections.querySelectorAll('.' + className);\n }\n return hoveredItem;\n };\n DateTimePicker.prototype.isValidLI = function (li) {\n return (li && li.classList.contains(LISTCLASS) && !li.classList.contains(DISABLED));\n };\n DateTimePicker.prototype.calculateStartEnd = function (value, range, method) {\n var day = value.getDate();\n var month = value.getMonth();\n var year = value.getFullYear();\n var hours = value.getHours();\n var minutes = value.getMinutes();\n var seconds = value.getSeconds();\n var milliseconds = value.getMilliseconds();\n if (range) {\n if (method === 'starttime') {\n return new Date(year, month, day, 0, 0, 0);\n }\n else {\n return new Date(year, month, day, 23, 59, 59);\n }\n }\n else {\n return new Date(year, month, day, hours, minutes, seconds, milliseconds);\n }\n };\n DateTimePicker.prototype.startTime = function (date) {\n var tempStartValue;\n var start;\n var tempMin = this.min;\n var value = date === null ? new Date() : date;\n if ((+value.getDate() === +tempMin.getDate() && +value.getMonth() === +tempMin.getMonth() &&\n +value.getFullYear() === +tempMin.getFullYear()) || ((+new Date(value.getFullYear(), value.getMonth(), value.getDate())) <=\n +new Date(tempMin.getFullYear(), tempMin.getMonth(), tempMin.getDate()))) {\n start = false;\n tempStartValue = this.min;\n }\n else if (+value < +this.max && +value > +this.min) {\n start = true;\n tempStartValue = value;\n }\n else if (+value >= +this.max) {\n start = true;\n tempStartValue = this.max;\n }\n return this.calculateStartEnd(tempStartValue, start, 'starttime');\n };\n DateTimePicker.prototype.endTime = function (date) {\n var tempEndValue;\n var end;\n var tempMax = this.max;\n var value = date === null ? new Date() : date;\n if ((+value.getDate() === +tempMax.getDate() && +value.getMonth() === +tempMax.getMonth() &&\n +value.getFullYear() === +tempMax.getFullYear()) || (+new Date(value.getUTCFullYear(), value.getMonth(), value.getDate()) >=\n +new Date(tempMax.getFullYear(), tempMax.getMonth(), tempMax.getDate()))) {\n end = false;\n tempEndValue = this.max;\n }\n else if (+value < +this.max && +value > +this.min) {\n end = true;\n tempEndValue = value;\n }\n else if (+value <= +this.min) {\n end = true;\n tempEndValue = this.min;\n }\n return this.calculateStartEnd(tempEndValue, end, 'endtime');\n };\n DateTimePicker.prototype.hide = function (e) {\n var _this = this;\n if (this.popupObj || this.dateTimeWrapper) {\n this.preventArgs = {\n cancel: false,\n popup: this.popupObj || this.popupObject,\n event: e || null\n };\n var eventArgs = this.preventArgs;\n if (isNullOrUndefined(this.popupObj)) {\n this.trigger('close', eventArgs, function (eventArgs) {\n _this.dateTimeCloseEventCallback(e, eventArgs);\n });\n }\n else {\n this.dateTimeCloseEventCallback(e, eventArgs);\n }\n }\n else {\n if (Browser.isDevice && this.allowEdit && !this.readonly) {\n this.inputElement.removeAttribute('readonly');\n }\n this.setAllowEdit();\n }\n };\n DateTimePicker.prototype.dateTimeCloseEventCallback = function (e, eventArgs) {\n this.preventArgs = eventArgs;\n if (!this.preventArgs.cancel) {\n if (this.isDatePopupOpen()) {\n _super.prototype.hide.call(this, e);\n }\n else if (this.isTimePopupOpen()) {\n this.closePopup(e);\n removeClass([document.body], OVERFLOW);\n if (Browser.isDevice && this.timeModal) {\n this.timeModal.style.display = 'none';\n this.timeModal.outerHTML = '';\n this.timeModal = null;\n }\n this.setTimeActiveDescendant();\n }\n }\n if (Browser.isDevice && this.allowEdit && !this.readonly) {\n this.inputElement.removeAttribute('readonly');\n }\n this.setAllowEdit();\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DateTimePicker.prototype.closePopup = function (e) {\n if (this.isTimePopupOpen() && this.popupObject) {\n var animModel = {\n name: 'FadeOut',\n duration: ANIMATIONDURATION,\n delay: 0\n };\n this.popupObject.hide(new Animation(animModel));\n this.inputWrapper.container.classList.remove(ICONANIMATION);\n attributes(this.inputElement, { 'aria-expanded': 'false' });\n EventHandler.remove(document, 'mousedown touchstart', this.documentClickHandler);\n }\n };\n DateTimePicker.prototype.preRender = function () {\n this.checkFormat();\n this.dateTimeFormat = this.cldrDateTimeFormat();\n _super.prototype.preRender.call(this);\n removeClass([this.inputElementCopy], [ROOT]);\n };\n DateTimePicker.prototype.getProperty = function (date, val) {\n if (val === 'min') {\n this.setProperties({ min: this.validateValue(date.min) }, true);\n }\n else {\n this.setProperties({ max: this.validateValue(date.max) }, true);\n }\n };\n DateTimePicker.prototype.checkAttributes = function (isDynamic) {\n var attributes = isDynamic ? isNullOrUndefined(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :\n ['style', 'name', 'step', 'disabled', 'readonly', 'value', 'min', 'max', 'placeholder', 'type'];\n var value;\n for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {\n var prop = attributes_1[_i];\n if (!isNullOrUndefined(this.inputElement.getAttribute(prop))) {\n switch (prop) {\n case 'name':\n this.inputElement.setAttribute('name', this.inputElement.getAttribute(prop));\n break;\n case 'step':\n this.step = parseInt(this.inputElement.getAttribute(prop), 10);\n break;\n case 'readonly':\n if ((isNullOrUndefined(this.dateTimeOptions) || (this.dateTimeOptions['readonly'] === undefined)) || isDynamic) {\n var readonly = this.inputElement.getAttribute(prop) === 'disabled' ||\n this.inputElement.getAttribute(prop) === '' ||\n this.inputElement.getAttribute(prop) === 'true' ? true : false;\n this.setProperties({ readonly: readonly }, !isDynamic);\n }\n break;\n case 'placeholder':\n if ((isNullOrUndefined(this.dateTimeOptions) || (this.dateTimeOptions['placeholder'] === undefined)) || isDynamic) {\n this.setProperties({ placeholder: this.inputElement.getAttribute(prop) }, !isDynamic);\n }\n break;\n case 'min':\n if ((isNullOrUndefined(this.dateTimeOptions) || (this.dateTimeOptions['min'] === undefined)) || isDynamic) {\n value = new Date(this.inputElement.getAttribute(prop));\n if (!this.isNullOrEmpty(value) && !isNaN(+value)) {\n this.setProperties({ min: value }, !isDynamic);\n }\n }\n break;\n case 'disabled':\n if ((isNullOrUndefined(this.dateTimeOptions) || (this.dateTimeOptions['enabled'] === undefined)) || isDynamic) {\n var enabled = this.inputElement.getAttribute(prop) === 'disabled' ||\n this.inputElement.getAttribute(prop) === 'true' ||\n this.inputElement.getAttribute(prop) === '' ? false : true;\n this.setProperties({ enabled: enabled }, !isDynamic);\n }\n break;\n case 'value':\n if ((isNullOrUndefined(this.dateTimeOptions) || (this.dateTimeOptions['value'] === undefined)) || isDynamic) {\n value = new Date(this.inputElement.getAttribute(prop));\n if (!this.isNullOrEmpty(value) && !isNaN(+value)) {\n this.setProperties({ value: value }, !isDynamic);\n }\n }\n break;\n case 'max':\n if ((isNullOrUndefined(this.dateTimeOptions) || (this.dateTimeOptions['max'] === undefined)) || isDynamic) {\n value = new Date(this.inputElement.getAttribute(prop));\n if (!this.isNullOrEmpty(value) && !isNaN(+value)) {\n this.setProperties({ max: value }, !isDynamic);\n }\n }\n break;\n }\n }\n }\n };\n DateTimePicker.prototype.requiredModules = function () {\n var modules = [];\n if (this) {\n modules.push({ args: [this], member: 'islamic' });\n }\n if (this.enableMask) {\n modules.push(this.maskedDateModule());\n }\n return modules;\n };\n DateTimePicker.prototype.maskedDateModule = function () {\n var modules = { args: [this], member: 'MaskedDateTime' };\n return modules;\n };\n DateTimePicker.prototype.getTimeActiveElement = function () {\n if (!isNullOrUndefined(this.dateTimeWrapper)) {\n return this.dateTimeWrapper.querySelectorAll('.' + ACTIVE);\n }\n else {\n return null;\n }\n };\n DateTimePicker.prototype.createDateObj = function (val) {\n return val instanceof Date ? val : null;\n };\n DateTimePicker.prototype.getDateObject = function (text) {\n if (!this.isNullOrEmpty(text)) {\n var dateValue = this.createDateObj(text);\n var value = this.valueWithMinutes;\n var status_1 = !isNullOrUndefined(value);\n if (this.checkDateValue(dateValue)) {\n var date = status_1 ? value.getDate() : DAY;\n var month = status_1 ? value.getMonth() : MONTH;\n var year = status_1 ? value.getFullYear() : YEAR;\n var hour = status_1 ? value.getHours() : HOUR;\n var minute = status_1 ? value.getMinutes() : MINUTE;\n var second = status_1 ? value.getSeconds() : SECOND;\n var millisecond = status_1 ? value.getMilliseconds() : MILLISECOND;\n if (!this.scrollInvoked) {\n return new Date(year, month, date, hour, minute, second, millisecond);\n }\n else {\n this.scrollInvoked = false;\n return new Date(year, month, date, dateValue.getHours(), dateValue.getMinutes(), dateValue.getSeconds(), dateValue.getMilliseconds());\n }\n }\n }\n return null;\n };\n DateTimePicker.prototype.findNextTimeElement = function (event) {\n var textVal = (this.inputElement).value;\n var value = isNullOrUndefined(this.valueWithMinutes) ? this.createDateObj(textVal) :\n this.getDateObject(this.valueWithMinutes);\n var dateTimeVal = null;\n var listCount = this.liCollections.length;\n if (!isNullOrUndefined(this.activeIndex) || !isNullOrUndefined(this.checkDateValue(value))) {\n if (event.action === 'home') {\n dateTimeVal = +(this.createDateObj(new Date(this.timeCollections[0])));\n this.activeIndex = 0;\n }\n else if (event.action === 'end') {\n dateTimeVal = +(this.createDateObj(new Date(this.timeCollections[this.timeCollections.length - 1])));\n this.activeIndex = this.timeCollections.length - 1;\n }\n else {\n if (event.action === 'down') {\n for (var i = 0; i < listCount; i++) {\n if (+value < this.timeCollections[i]) {\n dateTimeVal = +(this.createDateObj(new Date(this.timeCollections[i])));\n this.activeIndex = i;\n break;\n }\n }\n }\n else {\n for (var i = listCount - 1; i >= 0; i--) {\n if (+value > this.timeCollections[i]) {\n dateTimeVal = +(this.createDateObj(new Date(this.timeCollections[i])));\n this.activeIndex = i;\n break;\n }\n }\n }\n }\n this.selectedElement = this.liCollections[this.activeIndex];\n this.timeElementValue(isNullOrUndefined(dateTimeVal) ? null : new Date(dateTimeVal));\n }\n };\n DateTimePicker.prototype.setTimeValue = function (date, value) {\n var dateString;\n var time;\n var val = this.validateMinMaxRange(value);\n var newval = this.createDateObj(val);\n if (this.getFormattedValue(newval) !== (!isNullOrUndefined(this.value) ? this.getFormattedValue(this.value) : null)) {\n this.valueWithMinutes = isNullOrUndefined(newval) ? null : newval;\n time = new Date(+this.valueWithMinutes);\n }\n else {\n if (this.strictMode) {\n //for strict mode case, when value not present within a range. Reset the nearest range value.\n date = newval;\n }\n this.valueWithMinutes = this.checkDateValue(date);\n time = new Date(+this.valueWithMinutes);\n }\n if (this.calendarMode === 'Gregorian') {\n dateString = this.globalize.formatDate(time, {\n format: !isNullOrUndefined(this.formatString) ? this.formatString : this.cldrDateTimeFormat(),\n type: 'dateTime', skeleton: 'yMd'\n });\n }\n else {\n dateString = this.globalize.formatDate(time, {\n format: !isNullOrUndefined(this.formatString) ? this.formatString : this.cldrDateTimeFormat(),\n type: 'dateTime', skeleton: 'yMd', calendar: 'islamic'\n });\n }\n if (!this.strictMode && isNullOrUndefined(time)) {\n Input.setValue(dateString, this.inputElement, this.floatLabelType, this.showClearButton);\n }\n else {\n Input.setValue(dateString, this.inputElement, this.floatLabelType, this.showClearButton);\n }\n return time;\n };\n DateTimePicker.prototype.timeElementValue = function (value) {\n if (!isNullOrUndefined(this.checkDateValue(value)) && !this.isNullOrEmpty(value)) {\n var date = value instanceof Date ? value : this.getDateObject(value);\n return this.setTimeValue(date, value);\n }\n return null;\n };\n DateTimePicker.prototype.timeKeyHandler = function (event) {\n if (isNullOrUndefined(this.step) || this.step <= 0) {\n return;\n }\n var listCount = this.timeCollections.length;\n if (isNullOrUndefined(this.getTimeActiveElement()) || this.getTimeActiveElement().length === 0) {\n if (this.liCollections.length > 0) {\n if (isNullOrUndefined(this.value) && isNullOrUndefined(this.activeIndex)) {\n this.activeIndex = 0;\n this.selectedElement = this.liCollections[0];\n this.timeElementValue(new Date(this.timeCollections[0]));\n }\n else {\n this.findNextTimeElement(event);\n }\n }\n }\n else {\n var nextItemValue = void 0;\n if ((event.keyCode >= 37) && (event.keyCode <= 40)) {\n var index = (event.keyCode === 40 || event.keyCode === 39) ? ++this.activeIndex : --this.activeIndex;\n this.activeIndex = index = this.activeIndex === (listCount) ? 0 : this.activeIndex;\n this.activeIndex = index = this.activeIndex < 0 ? (listCount - 1) : this.activeIndex;\n nextItemValue = isNullOrUndefined(this.timeCollections[index]) ? this.timeCollections[0] : this.timeCollections[index];\n }\n else if (event.action === 'home') {\n this.activeIndex = 0;\n nextItemValue = this.timeCollections[0];\n }\n else if (event.action === 'end') {\n this.activeIndex = listCount - 1;\n nextItemValue = this.timeCollections[listCount - 1];\n }\n this.selectedElement = this.liCollections[this.activeIndex];\n this.timeElementValue(new Date(nextItemValue));\n }\n this.isNavigate = true;\n this.setTimeHover(this.selectedElement, NAVIGATION);\n this.setTimeActiveDescendant();\n if (this.isTimePopupOpen() && this.selectedElement !== null && (!event || event.type !== 'click')) {\n this.setTimeScrollPosition();\n }\n };\n DateTimePicker.prototype.timeKeyActionHandle = function (event) {\n if (this.enabled) {\n if (event.action !== 'right' && event.action !== 'left' && event.action !== 'tab') {\n event.preventDefault();\n }\n switch (event.action) {\n case 'up':\n case 'down':\n case 'home':\n case 'end':\n this.timeKeyHandler(event);\n break;\n case 'enter':\n if (this.isNavigate) {\n this.selectedElement = this.liCollections[this.activeIndex];\n this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);\n this.setInputValue('time');\n if (+this.previousDateTime !== +this.value) {\n this.changedArgs.value = this.value;\n this.addTimeSelection();\n this.previousDateTime = this.value;\n }\n }\n else {\n this.updateValue(event);\n }\n this.hide(event);\n addClass([this.inputWrapper.container], INPUTFOCUS);\n this.isNavigate = false;\n event.stopPropagation();\n break;\n case 'escape':\n this.hide(event);\n break;\n default:\n this.isNavigate = false;\n break;\n }\n }\n };\n DateTimePicker.prototype.inputKeyAction = function (event) {\n switch (event.action) {\n case 'altDownArrow':\n this.strictModeUpdate();\n this.updateInput();\n this.toggle(event);\n break;\n }\n };\n /**\n * Called internally if any of the property value changed.\n *\n * @param {DateTimePickerModel} newProp - Returns the dynamic property value of the component.\n * @param {DateTimePickerModel} oldProp - Returns the previous property value of the component.\n * @returns {void}\n\n */\n DateTimePicker.prototype.onPropertyChanged = function (newProp, oldProp) {\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'value':\n this.isDynamicValueChanged = true;\n this.invalidValueString = null;\n this.checkInvalidValue(newProp.value);\n newProp.value = this.value;\n newProp.value = this.validateValue(newProp.value);\n Input.setValue(this.getFormattedValue(newProp.value), this.inputElement, this.floatLabelType, this.showClearButton);\n this.valueWithMinutes = newProp.value;\n this.setProperties({ value: newProp.value }, true);\n if (this.popupObj) {\n this.popupUpdate();\n }\n this.previousDateTime = new Date(this.inputElement.value);\n this.updateInput();\n this.changeTrigger(null);\n this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;\n if (this.enableMask && this.value) {\n this.notify(\"createMask\", {\n module: \"MaskedDateTime\",\n });\n }\n break;\n case 'min':\n case 'max':\n this.getProperty(newProp, prop);\n this.updateInput();\n break;\n case 'enableRtl':\n Input.setEnableRtl(this.enableRtl, [this.inputWrapper.container]);\n break;\n case 'cssClass':\n if (!isNullOrUndefined(oldProp.cssClass)) {\n oldProp.cssClass = (oldProp.cssClass.replace(/\\s+/g, ' ')).trim();\n }\n if (!isNullOrUndefined(newProp.cssClass)) {\n newProp.cssClass = (newProp.cssClass.replace(/\\s+/g, ' ')).trim();\n }\n Input.setCssClass(newProp.cssClass, [this.inputWrapper.container], oldProp.cssClass);\n if (this.dateTimeWrapper) {\n Input.setCssClass(newProp.cssClass, [this.dateTimeWrapper], oldProp.cssClass);\n }\n break;\n case 'locale':\n this.globalize = new Internationalization(this.locale);\n this.l10n.setLocale(this.locale);\n this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);\n Input.setPlaceholder(this.l10n.getConstant('placeholder'), this.inputElement);\n this.dateTimeFormat = this.cldrDateTimeFormat();\n _super.prototype.updateInput.call(this);\n break;\n case 'htmlAttributes':\n this.updateHtmlAttributeToElement();\n this.updateHtmlAttributeToWrapper();\n this.checkAttributes(true);\n break;\n case 'format':\n this.setProperties({ format: newProp.format }, true);\n this.checkFormat();\n this.dateTimeFormat = this.formatString;\n this.setValue();\n if (this.enableMask) {\n this.notify(\"createMask\", {\n module: \"MaskedDateTime\",\n });\n if (!this.value) {\n Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);\n }\n }\n break;\n case 'placeholder':\n Input.setPlaceholder(newProp.placeholder, this.inputElement);\n this.inputElement.setAttribute('aria-placeholder', newProp.placeholder);\n break;\n case 'enabled':\n Input.setEnabled(this.enabled, this.inputElement);\n if (!this.enabled) {\n this.inputElement.tabIndex = -1;\n }\n break;\n case 'strictMode':\n this.invalidValueString = null;\n this.updateInput();\n break;\n case 'width':\n this.setWidth(newProp.width);\n break;\n case 'readonly':\n Input.setReadonly(this.readonly, this.inputElement);\n break;\n case 'floatLabelType':\n this.floatLabelType = newProp.floatLabelType;\n Input.removeFloating(this.inputWrapper);\n Input.addFloating(this.inputElement, this.floatLabelType, this.placeholder);\n break;\n case 'scrollTo':\n if (this.checkDateValue(new Date(this.checkValue(newProp.scrollTo)))) {\n if (this.dateTimeWrapper) {\n this.setScrollTo();\n }\n this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkValue(newProp.scrollTo))) }, true);\n }\n else {\n this.setProperties({ scrollTo: null }, true);\n }\n break;\n case 'enableMask':\n if (this.enableMask) {\n this.notify(\"createMask\", {\n module: \"MaskedDateTime\",\n });\n Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);\n }\n else {\n if (this.inputElement.value === this.maskedDateValue) {\n this.maskedDateValue = '';\n Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);\n }\n }\n break;\n default:\n _super.prototype.onPropertyChanged.call(this, newProp, oldProp);\n break;\n }\n if (!this.isDynamicValueChanged) {\n this.hide(null);\n }\n this.isDynamicValueChanged = false;\n }\n };\n /**\n * To get component name.\n *\n * @returns {string} Returns the component name.\n * @private\n */\n DateTimePicker.prototype.getModuleName = function () {\n return 'datetimepicker';\n };\n DateTimePicker.prototype.restoreValue = function () {\n this.previousDateTime = this.previousDate;\n this.currentDate = this.value ? this.value : new Date();\n this.valueWithMinutes = this.value;\n this.previousDate = this.value;\n this.previousElementValue = this.previousElementValue = (isNullOrUndefined(this.inputValueCopy)) ? '' :\n this.getFormattedValue(this.inputValueCopy);\n };\n __decorate([\n Property(null)\n ], DateTimePicker.prototype, \"timeFormat\", void 0);\n __decorate([\n Property(30)\n ], DateTimePicker.prototype, \"step\", void 0);\n __decorate([\n Property(null)\n ], DateTimePicker.prototype, \"scrollTo\", void 0);\n __decorate([\n Property(1000)\n ], DateTimePicker.prototype, \"zIndex\", void 0);\n __decorate([\n Property(null)\n ], DateTimePicker.prototype, \"value\", void 0);\n __decorate([\n Property(null)\n ], DateTimePicker.prototype, \"keyConfigs\", void 0);\n __decorate([\n Property({})\n ], DateTimePicker.prototype, \"htmlAttributes\", void 0);\n __decorate([\n Property(false)\n ], DateTimePicker.prototype, \"enablePersistence\", void 0);\n __decorate([\n Property(true)\n ], DateTimePicker.prototype, \"allowEdit\", void 0);\n __decorate([\n Property(false)\n ], DateTimePicker.prototype, \"isMultiSelection\", void 0);\n __decorate([\n Property(null)\n ], DateTimePicker.prototype, \"values\", void 0);\n __decorate([\n Property(true)\n ], DateTimePicker.prototype, \"showClearButton\", void 0);\n __decorate([\n Property(null)\n ], DateTimePicker.prototype, \"placeholder\", void 0);\n __decorate([\n Property(false)\n ], DateTimePicker.prototype, \"strictMode\", void 0);\n __decorate([\n Property(null)\n ], DateTimePicker.prototype, \"serverTimezoneOffset\", void 0);\n __decorate([\n Property(new Date(1900, 0, 1))\n ], DateTimePicker.prototype, \"min\", void 0);\n __decorate([\n Property(new Date(2099, 11, 31))\n ], DateTimePicker.prototype, \"max\", void 0);\n __decorate([\n Property(null)\n ], DateTimePicker.prototype, \"firstDayOfWeek\", void 0);\n __decorate([\n Property('Gregorian')\n ], DateTimePicker.prototype, \"calendarMode\", void 0);\n __decorate([\n Property('Month')\n ], DateTimePicker.prototype, \"start\", void 0);\n __decorate([\n Property('Month')\n ], DateTimePicker.prototype, \"depth\", void 0);\n __decorate([\n Property(false)\n ], DateTimePicker.prototype, \"weekNumber\", void 0);\n __decorate([\n Property(true)\n ], DateTimePicker.prototype, \"showTodayButton\", void 0);\n __decorate([\n Property('Short')\n ], DateTimePicker.prototype, \"dayHeaderFormat\", void 0);\n __decorate([\n Property(false)\n ], DateTimePicker.prototype, \"openOnFocus\", void 0);\n __decorate([\n Property(false)\n ], DateTimePicker.prototype, \"enableMask\", void 0);\n __decorate([\n Property({ day: 'day', month: 'month', year: 'year', hour: 'hour', minute: 'minute', second: 'second', dayOfTheWeek: 'day of the week' })\n ], DateTimePicker.prototype, \"maskPlaceholder\", void 0);\n __decorate([\n Event()\n ], DateTimePicker.prototype, \"open\", void 0);\n __decorate([\n Event()\n ], DateTimePicker.prototype, \"close\", void 0);\n __decorate([\n Event()\n ], DateTimePicker.prototype, \"cleared\", void 0);\n __decorate([\n Event()\n ], DateTimePicker.prototype, \"blur\", void 0);\n __decorate([\n Event()\n ], DateTimePicker.prototype, \"focus\", void 0);\n __decorate([\n Event()\n ], DateTimePicker.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], DateTimePicker.prototype, \"destroyed\", void 0);\n DateTimePicker = __decorate([\n NotifyPropertyChanges\n ], DateTimePicker);\n return DateTimePicker;\n}(DatePicker));\nexport { DateTimePicker };\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { omit } from '../../utils/object';\nimport { kebabCase, pascalCase, trim } from '../../utils/string';\nimport { BVIconBase, props as BVIconBaseProps } from './icon-base';\nvar iconProps = omit(BVIconBaseProps, ['content']);\n/**\n * Icon component generator function\n *\n * @param {string} icon name (minus the leading `BIcon`)\n * @param {string} raw `innerHTML` for SVG\n * @return {VueComponent}\n */\n\nexport var makeIcon = function makeIcon(name, content) {\n // For performance reason we pre-compute some values, so that\n // they are not computed on each render of the icon component\n var kebabName = kebabCase(name);\n var iconName = \"BIcon\".concat(pascalCase(name));\n var iconNameClass = \"bi-\".concat(kebabName);\n var iconTitle = kebabName.replace(/-/g, ' ');\n var svgContent = trim(content || '');\n return /*#__PURE__*/extend({\n name: iconName,\n functional: true,\n props: iconProps,\n render: function render(h, _ref) {\n var data = _ref.data,\n props = _ref.props;\n return h(BVIconBase, mergeData( // Defaults\n {\n props: {\n title: iconTitle\n },\n attrs: {\n 'aria-label': iconTitle\n }\n }, // User data\n data, // Required data\n {\n staticClass: iconNameClass,\n props: _objectSpread(_objectSpread({}, props), {}, {\n content: svgContent\n })\n }));\n }\n });\n};","// --- BEGIN AUTO-GENERATED FILE ---\n//\n// @IconsVersion: 1.5.0\n// @Generated: 2022-10-26T01:10:52.933Z\n//\n// This file is generated on each build. Do not edit this file!\n/*!\n * BootstrapVue Icons, generated from Bootstrap Icons 1.5.0\n *\n * @link https://icons.getbootstrap.com/\n * @license MIT\n * https://github.com/twbs/icons/blob/master/LICENSE.md\n */import{makeIcon}from'./helpers/make-icon';// --- BootstrapVue custom icons ---\nexport var BIconBlank=/*#__PURE__*/makeIcon('Blank','');// --- Bootstrap Icons ---\n// eslint-disable-next-line\nexport var BIconAlarm=/*#__PURE__*/makeIcon('Alarm','
');// eslint-disable-next-line\nexport var BIconAlarmFill=/*#__PURE__*/makeIcon('AlarmFill','
');// eslint-disable-next-line\nexport var BIconAlignBottom=/*#__PURE__*/makeIcon('AlignBottom','
');// eslint-disable-next-line\nexport var BIconAlignCenter=/*#__PURE__*/makeIcon('AlignCenter','');// eslint-disable-next-line\nexport var BIconAlignEnd=/*#__PURE__*/makeIcon('AlignEnd','');// eslint-disable-next-line\nexport var BIconAlignMiddle=/*#__PURE__*/makeIcon('AlignMiddle','');// eslint-disable-next-line\nexport var BIconAlignStart=/*#__PURE__*/makeIcon('AlignStart','');// eslint-disable-next-line\nexport var BIconAlignTop=/*#__PURE__*/makeIcon('AlignTop','');// eslint-disable-next-line\nexport var BIconAlt=/*#__PURE__*/makeIcon('Alt','');// eslint-disable-next-line\nexport var BIconApp=/*#__PURE__*/makeIcon('App','');// eslint-disable-next-line\nexport var BIconAppIndicator=/*#__PURE__*/makeIcon('AppIndicator','');// eslint-disable-next-line\nexport var BIconArchive=/*#__PURE__*/makeIcon('Archive','');// eslint-disable-next-line\nexport var BIconArchiveFill=/*#__PURE__*/makeIcon('ArchiveFill','');// eslint-disable-next-line\nexport var BIconArrow90degDown=/*#__PURE__*/makeIcon('Arrow90degDown','');// eslint-disable-next-line\nexport var BIconArrow90degLeft=/*#__PURE__*/makeIcon('Arrow90degLeft','');// eslint-disable-next-line\nexport var BIconArrow90degRight=/*#__PURE__*/makeIcon('Arrow90degRight','');// eslint-disable-next-line\nexport var BIconArrow90degUp=/*#__PURE__*/makeIcon('Arrow90degUp','');// eslint-disable-next-line\nexport var BIconArrowBarDown=/*#__PURE__*/makeIcon('ArrowBarDown','');// eslint-disable-next-line\nexport var BIconArrowBarLeft=/*#__PURE__*/makeIcon('ArrowBarLeft','');// eslint-disable-next-line\nexport var BIconArrowBarRight=/*#__PURE__*/makeIcon('ArrowBarRight','');// eslint-disable-next-line\nexport var BIconArrowBarUp=/*#__PURE__*/makeIcon('ArrowBarUp','');// eslint-disable-next-line\nexport var BIconArrowClockwise=/*#__PURE__*/makeIcon('ArrowClockwise','');// eslint-disable-next-line\nexport var BIconArrowCounterclockwise=/*#__PURE__*/makeIcon('ArrowCounterclockwise','');// eslint-disable-next-line\nexport var BIconArrowDown=/*#__PURE__*/makeIcon('ArrowDown','');// eslint-disable-next-line\nexport var BIconArrowDownCircle=/*#__PURE__*/makeIcon('ArrowDownCircle','');// eslint-disable-next-line\nexport var BIconArrowDownCircleFill=/*#__PURE__*/makeIcon('ArrowDownCircleFill','');// eslint-disable-next-line\nexport var BIconArrowDownLeft=/*#__PURE__*/makeIcon('ArrowDownLeft','');// eslint-disable-next-line\nexport var BIconArrowDownLeftCircle=/*#__PURE__*/makeIcon('ArrowDownLeftCircle','');// eslint-disable-next-line\nexport var BIconArrowDownLeftCircleFill=/*#__PURE__*/makeIcon('ArrowDownLeftCircleFill','');// eslint-disable-next-line\nexport var BIconArrowDownLeftSquare=/*#__PURE__*/makeIcon('ArrowDownLeftSquare','');// eslint-disable-next-line\nexport var BIconArrowDownLeftSquareFill=/*#__PURE__*/makeIcon('ArrowDownLeftSquareFill','');// eslint-disable-next-line\nexport var BIconArrowDownRight=/*#__PURE__*/makeIcon('ArrowDownRight','');// eslint-disable-next-line\nexport var BIconArrowDownRightCircle=/*#__PURE__*/makeIcon('ArrowDownRightCircle','');// eslint-disable-next-line\nexport var BIconArrowDownRightCircleFill=/*#__PURE__*/makeIcon('ArrowDownRightCircleFill','');// eslint-disable-next-line\nexport var BIconArrowDownRightSquare=/*#__PURE__*/makeIcon('ArrowDownRightSquare','');// eslint-disable-next-line\nexport var BIconArrowDownRightSquareFill=/*#__PURE__*/makeIcon('ArrowDownRightSquareFill','');// eslint-disable-next-line\nexport var BIconArrowDownShort=/*#__PURE__*/makeIcon('ArrowDownShort','');// eslint-disable-next-line\nexport var BIconArrowDownSquare=/*#__PURE__*/makeIcon('ArrowDownSquare','');// eslint-disable-next-line\nexport var BIconArrowDownSquareFill=/*#__PURE__*/makeIcon('ArrowDownSquareFill','');// eslint-disable-next-line\nexport var BIconArrowDownUp=/*#__PURE__*/makeIcon('ArrowDownUp','');// eslint-disable-next-line\nexport var BIconArrowLeft=/*#__PURE__*/makeIcon('ArrowLeft','');// eslint-disable-next-line\nexport var BIconArrowLeftCircle=/*#__PURE__*/makeIcon('ArrowLeftCircle','');// eslint-disable-next-line\nexport var BIconArrowLeftCircleFill=/*#__PURE__*/makeIcon('ArrowLeftCircleFill','');// eslint-disable-next-line\nexport var BIconArrowLeftRight=/*#__PURE__*/makeIcon('ArrowLeftRight','');// eslint-disable-next-line\nexport var BIconArrowLeftShort=/*#__PURE__*/makeIcon('ArrowLeftShort','');// eslint-disable-next-line\nexport var BIconArrowLeftSquare=/*#__PURE__*/makeIcon('ArrowLeftSquare','');// eslint-disable-next-line\nexport var BIconArrowLeftSquareFill=/*#__PURE__*/makeIcon('ArrowLeftSquareFill','');// eslint-disable-next-line\nexport var BIconArrowRepeat=/*#__PURE__*/makeIcon('ArrowRepeat','');// eslint-disable-next-line\nexport var BIconArrowReturnLeft=/*#__PURE__*/makeIcon('ArrowReturnLeft','');// eslint-disable-next-line\nexport var BIconArrowReturnRight=/*#__PURE__*/makeIcon('ArrowReturnRight','');// eslint-disable-next-line\nexport var BIconArrowRight=/*#__PURE__*/makeIcon('ArrowRight','');// eslint-disable-next-line\nexport var BIconArrowRightCircle=/*#__PURE__*/makeIcon('ArrowRightCircle','');// eslint-disable-next-line\nexport var BIconArrowRightCircleFill=/*#__PURE__*/makeIcon('ArrowRightCircleFill','');// eslint-disable-next-line\nexport var BIconArrowRightShort=/*#__PURE__*/makeIcon('ArrowRightShort','');// eslint-disable-next-line\nexport var BIconArrowRightSquare=/*#__PURE__*/makeIcon('ArrowRightSquare','');// eslint-disable-next-line\nexport var BIconArrowRightSquareFill=/*#__PURE__*/makeIcon('ArrowRightSquareFill','');// eslint-disable-next-line\nexport var BIconArrowUp=/*#__PURE__*/makeIcon('ArrowUp','');// eslint-disable-next-line\nexport var BIconArrowUpCircle=/*#__PURE__*/makeIcon('ArrowUpCircle','');// eslint-disable-next-line\nexport var BIconArrowUpCircleFill=/*#__PURE__*/makeIcon('ArrowUpCircleFill','');// eslint-disable-next-line\nexport var BIconArrowUpLeft=/*#__PURE__*/makeIcon('ArrowUpLeft','');// eslint-disable-next-line\nexport var BIconArrowUpLeftCircle=/*#__PURE__*/makeIcon('ArrowUpLeftCircle','');// eslint-disable-next-line\nexport var BIconArrowUpLeftCircleFill=/*#__PURE__*/makeIcon('ArrowUpLeftCircleFill','');// eslint-disable-next-line\nexport var BIconArrowUpLeftSquare=/*#__PURE__*/makeIcon('ArrowUpLeftSquare','');// eslint-disable-next-line\nexport var BIconArrowUpLeftSquareFill=/*#__PURE__*/makeIcon('ArrowUpLeftSquareFill','');// eslint-disable-next-line\nexport var BIconArrowUpRight=/*#__PURE__*/makeIcon('ArrowUpRight','');// eslint-disable-next-line\nexport var BIconArrowUpRightCircle=/*#__PURE__*/makeIcon('ArrowUpRightCircle','');// eslint-disable-next-line\nexport var BIconArrowUpRightCircleFill=/*#__PURE__*/makeIcon('ArrowUpRightCircleFill','');// eslint-disable-next-line\nexport var BIconArrowUpRightSquare=/*#__PURE__*/makeIcon('ArrowUpRightSquare','');// eslint-disable-next-line\nexport var BIconArrowUpRightSquareFill=/*#__PURE__*/makeIcon('ArrowUpRightSquareFill','');// eslint-disable-next-line\nexport var BIconArrowUpShort=/*#__PURE__*/makeIcon('ArrowUpShort','');// eslint-disable-next-line\nexport var BIconArrowUpSquare=/*#__PURE__*/makeIcon('ArrowUpSquare','');// eslint-disable-next-line\nexport var BIconArrowUpSquareFill=/*#__PURE__*/makeIcon('ArrowUpSquareFill','');// eslint-disable-next-line\nexport var BIconArrowsAngleContract=/*#__PURE__*/makeIcon('ArrowsAngleContract','');// eslint-disable-next-line\nexport var BIconArrowsAngleExpand=/*#__PURE__*/makeIcon('ArrowsAngleExpand','');// eslint-disable-next-line\nexport var BIconArrowsCollapse=/*#__PURE__*/makeIcon('ArrowsCollapse','');// eslint-disable-next-line\nexport var BIconArrowsExpand=/*#__PURE__*/makeIcon('ArrowsExpand','');// eslint-disable-next-line\nexport var BIconArrowsFullscreen=/*#__PURE__*/makeIcon('ArrowsFullscreen','');// eslint-disable-next-line\nexport var BIconArrowsMove=/*#__PURE__*/makeIcon('ArrowsMove','');// eslint-disable-next-line\nexport var BIconAspectRatio=/*#__PURE__*/makeIcon('AspectRatio','');// eslint-disable-next-line\nexport var BIconAspectRatioFill=/*#__PURE__*/makeIcon('AspectRatioFill','');// eslint-disable-next-line\nexport var BIconAsterisk=/*#__PURE__*/makeIcon('Asterisk','');// eslint-disable-next-line\nexport var BIconAt=/*#__PURE__*/makeIcon('At','');// eslint-disable-next-line\nexport var BIconAward=/*#__PURE__*/makeIcon('Award','');// eslint-disable-next-line\nexport var BIconAwardFill=/*#__PURE__*/makeIcon('AwardFill','');// eslint-disable-next-line\nexport var BIconBack=/*#__PURE__*/makeIcon('Back','');// eslint-disable-next-line\nexport var BIconBackspace=/*#__PURE__*/makeIcon('Backspace','');// eslint-disable-next-line\nexport var BIconBackspaceFill=/*#__PURE__*/makeIcon('BackspaceFill','');// eslint-disable-next-line\nexport var BIconBackspaceReverse=/*#__PURE__*/makeIcon('BackspaceReverse','');// eslint-disable-next-line\nexport var BIconBackspaceReverseFill=/*#__PURE__*/makeIcon('BackspaceReverseFill','');// eslint-disable-next-line\nexport var BIconBadge3d=/*#__PURE__*/makeIcon('Badge3d','');// eslint-disable-next-line\nexport var BIconBadge3dFill=/*#__PURE__*/makeIcon('Badge3dFill','');// eslint-disable-next-line\nexport var BIconBadge4k=/*#__PURE__*/makeIcon('Badge4k','');// eslint-disable-next-line\nexport var BIconBadge4kFill=/*#__PURE__*/makeIcon('Badge4kFill','');// eslint-disable-next-line\nexport var BIconBadge8k=/*#__PURE__*/makeIcon('Badge8k','');// eslint-disable-next-line\nexport var BIconBadge8kFill=/*#__PURE__*/makeIcon('Badge8kFill','');// eslint-disable-next-line\nexport var BIconBadgeAd=/*#__PURE__*/makeIcon('BadgeAd','');// eslint-disable-next-line\nexport var BIconBadgeAdFill=/*#__PURE__*/makeIcon('BadgeAdFill','');// eslint-disable-next-line\nexport var BIconBadgeAr=/*#__PURE__*/makeIcon('BadgeAr','');// eslint-disable-next-line\nexport var BIconBadgeArFill=/*#__PURE__*/makeIcon('BadgeArFill','');// eslint-disable-next-line\nexport var BIconBadgeCc=/*#__PURE__*/makeIcon('BadgeCc','');// eslint-disable-next-line\nexport var BIconBadgeCcFill=/*#__PURE__*/makeIcon('BadgeCcFill','');// eslint-disable-next-line\nexport var BIconBadgeHd=/*#__PURE__*/makeIcon('BadgeHd','');// eslint-disable-next-line\nexport var BIconBadgeHdFill=/*#__PURE__*/makeIcon('BadgeHdFill','');// eslint-disable-next-line\nexport var BIconBadgeTm=/*#__PURE__*/makeIcon('BadgeTm','');// eslint-disable-next-line\nexport var BIconBadgeTmFill=/*#__PURE__*/makeIcon('BadgeTmFill','');// eslint-disable-next-line\nexport var BIconBadgeVo=/*#__PURE__*/makeIcon('BadgeVo','');// eslint-disable-next-line\nexport var BIconBadgeVoFill=/*#__PURE__*/makeIcon('BadgeVoFill','');// eslint-disable-next-line\nexport var BIconBadgeVr=/*#__PURE__*/makeIcon('BadgeVr','');// eslint-disable-next-line\nexport var BIconBadgeVrFill=/*#__PURE__*/makeIcon('BadgeVrFill','');// eslint-disable-next-line\nexport var BIconBadgeWc=/*#__PURE__*/makeIcon('BadgeWc','');// eslint-disable-next-line\nexport var BIconBadgeWcFill=/*#__PURE__*/makeIcon('BadgeWcFill','');// eslint-disable-next-line\nexport var BIconBag=/*#__PURE__*/makeIcon('Bag','');// eslint-disable-next-line\nexport var BIconBagCheck=/*#__PURE__*/makeIcon('BagCheck','');// eslint-disable-next-line\nexport var BIconBagCheckFill=/*#__PURE__*/makeIcon('BagCheckFill','');// eslint-disable-next-line\nexport var BIconBagDash=/*#__PURE__*/makeIcon('BagDash','');// eslint-disable-next-line\nexport var BIconBagDashFill=/*#__PURE__*/makeIcon('BagDashFill','');// eslint-disable-next-line\nexport var BIconBagFill=/*#__PURE__*/makeIcon('BagFill','');// eslint-disable-next-line\nexport var BIconBagPlus=/*#__PURE__*/makeIcon('BagPlus','');// eslint-disable-next-line\nexport var BIconBagPlusFill=/*#__PURE__*/makeIcon('BagPlusFill','');// eslint-disable-next-line\nexport var BIconBagX=/*#__PURE__*/makeIcon('BagX','');// eslint-disable-next-line\nexport var BIconBagXFill=/*#__PURE__*/makeIcon('BagXFill','');// eslint-disable-next-line\nexport var BIconBank=/*#__PURE__*/makeIcon('Bank','');// eslint-disable-next-line\nexport var BIconBank2=/*#__PURE__*/makeIcon('Bank2','');// eslint-disable-next-line\nexport var BIconBarChart=/*#__PURE__*/makeIcon('BarChart','');// eslint-disable-next-line\nexport var BIconBarChartFill=/*#__PURE__*/makeIcon('BarChartFill','');// eslint-disable-next-line\nexport var BIconBarChartLine=/*#__PURE__*/makeIcon('BarChartLine','');// eslint-disable-next-line\nexport var BIconBarChartLineFill=/*#__PURE__*/makeIcon('BarChartLineFill','');// eslint-disable-next-line\nexport var BIconBarChartSteps=/*#__PURE__*/makeIcon('BarChartSteps','');// eslint-disable-next-line\nexport var BIconBasket=/*#__PURE__*/makeIcon('Basket','');// eslint-disable-next-line\nexport var BIconBasket2=/*#__PURE__*/makeIcon('Basket2','');// eslint-disable-next-line\nexport var BIconBasket2Fill=/*#__PURE__*/makeIcon('Basket2Fill','');// eslint-disable-next-line\nexport var BIconBasket3=/*#__PURE__*/makeIcon('Basket3','');// eslint-disable-next-line\nexport var BIconBasket3Fill=/*#__PURE__*/makeIcon('Basket3Fill','');// eslint-disable-next-line\nexport var BIconBasketFill=/*#__PURE__*/makeIcon('BasketFill','');// eslint-disable-next-line\nexport var BIconBattery=/*#__PURE__*/makeIcon('Battery','');// eslint-disable-next-line\nexport var BIconBatteryCharging=/*#__PURE__*/makeIcon('BatteryCharging','');// eslint-disable-next-line\nexport var BIconBatteryFull=/*#__PURE__*/makeIcon('BatteryFull','');// eslint-disable-next-line\nexport var BIconBatteryHalf=/*#__PURE__*/makeIcon('BatteryHalf','');// eslint-disable-next-line\nexport var BIconBell=/*#__PURE__*/makeIcon('Bell','');// eslint-disable-next-line\nexport var BIconBellFill=/*#__PURE__*/makeIcon('BellFill','');// eslint-disable-next-line\nexport var BIconBellSlash=/*#__PURE__*/makeIcon('BellSlash','');// eslint-disable-next-line\nexport var BIconBellSlashFill=/*#__PURE__*/makeIcon('BellSlashFill','');// eslint-disable-next-line\nexport var BIconBezier=/*#__PURE__*/makeIcon('Bezier','');// eslint-disable-next-line\nexport var BIconBezier2=/*#__PURE__*/makeIcon('Bezier2','');// eslint-disable-next-line\nexport var BIconBicycle=/*#__PURE__*/makeIcon('Bicycle','');// eslint-disable-next-line\nexport var BIconBinoculars=/*#__PURE__*/makeIcon('Binoculars','');// eslint-disable-next-line\nexport var BIconBinocularsFill=/*#__PURE__*/makeIcon('BinocularsFill','');// eslint-disable-next-line\nexport var BIconBlockquoteLeft=/*#__PURE__*/makeIcon('BlockquoteLeft','');// eslint-disable-next-line\nexport var BIconBlockquoteRight=/*#__PURE__*/makeIcon('BlockquoteRight','');// eslint-disable-next-line\nexport var BIconBook=/*#__PURE__*/makeIcon('Book','');// eslint-disable-next-line\nexport var BIconBookFill=/*#__PURE__*/makeIcon('BookFill','');// eslint-disable-next-line\nexport var BIconBookHalf=/*#__PURE__*/makeIcon('BookHalf','');// eslint-disable-next-line\nexport var BIconBookmark=/*#__PURE__*/makeIcon('Bookmark','');// eslint-disable-next-line\nexport var BIconBookmarkCheck=/*#__PURE__*/makeIcon('BookmarkCheck','');// eslint-disable-next-line\nexport var BIconBookmarkCheckFill=/*#__PURE__*/makeIcon('BookmarkCheckFill','');// eslint-disable-next-line\nexport var BIconBookmarkDash=/*#__PURE__*/makeIcon('BookmarkDash','');// eslint-disable-next-line\nexport var BIconBookmarkDashFill=/*#__PURE__*/makeIcon('BookmarkDashFill','');// eslint-disable-next-line\nexport var BIconBookmarkFill=/*#__PURE__*/makeIcon('BookmarkFill','');// eslint-disable-next-line\nexport var BIconBookmarkHeart=/*#__PURE__*/makeIcon('BookmarkHeart','');// eslint-disable-next-line\nexport var BIconBookmarkHeartFill=/*#__PURE__*/makeIcon('BookmarkHeartFill','');// eslint-disable-next-line\nexport var BIconBookmarkPlus=/*#__PURE__*/makeIcon('BookmarkPlus','');// eslint-disable-next-line\nexport var BIconBookmarkPlusFill=/*#__PURE__*/makeIcon('BookmarkPlusFill','');// eslint-disable-next-line\nexport var BIconBookmarkStar=/*#__PURE__*/makeIcon('BookmarkStar','');// eslint-disable-next-line\nexport var BIconBookmarkStarFill=/*#__PURE__*/makeIcon('BookmarkStarFill','');// eslint-disable-next-line\nexport var BIconBookmarkX=/*#__PURE__*/makeIcon('BookmarkX','');// eslint-disable-next-line\nexport var BIconBookmarkXFill=/*#__PURE__*/makeIcon('BookmarkXFill','');// eslint-disable-next-line\nexport var BIconBookmarks=/*#__PURE__*/makeIcon('Bookmarks','');// eslint-disable-next-line\nexport var BIconBookmarksFill=/*#__PURE__*/makeIcon('BookmarksFill','');// eslint-disable-next-line\nexport var BIconBookshelf=/*#__PURE__*/makeIcon('Bookshelf','');// eslint-disable-next-line\nexport var BIconBootstrap=/*#__PURE__*/makeIcon('Bootstrap','');// eslint-disable-next-line\nexport var BIconBootstrapFill=/*#__PURE__*/makeIcon('BootstrapFill','');// eslint-disable-next-line\nexport var BIconBootstrapReboot=/*#__PURE__*/makeIcon('BootstrapReboot','');// eslint-disable-next-line\nexport var BIconBorder=/*#__PURE__*/makeIcon('Border','');// eslint-disable-next-line\nexport var BIconBorderAll=/*#__PURE__*/makeIcon('BorderAll','');// eslint-disable-next-line\nexport var BIconBorderBottom=/*#__PURE__*/makeIcon('BorderBottom','');// eslint-disable-next-line\nexport var BIconBorderCenter=/*#__PURE__*/makeIcon('BorderCenter','');// eslint-disable-next-line\nexport var BIconBorderInner=/*#__PURE__*/makeIcon('BorderInner','');// eslint-disable-next-line\nexport var BIconBorderLeft=/*#__PURE__*/makeIcon('BorderLeft','');// eslint-disable-next-line\nexport var BIconBorderMiddle=/*#__PURE__*/makeIcon('BorderMiddle','');// eslint-disable-next-line\nexport var BIconBorderOuter=/*#__PURE__*/makeIcon('BorderOuter','');// eslint-disable-next-line\nexport var BIconBorderRight=/*#__PURE__*/makeIcon('BorderRight','');// eslint-disable-next-line\nexport var BIconBorderStyle=/*#__PURE__*/makeIcon('BorderStyle','');// eslint-disable-next-line\nexport var BIconBorderTop=/*#__PURE__*/makeIcon('BorderTop','');// eslint-disable-next-line\nexport var BIconBorderWidth=/*#__PURE__*/makeIcon('BorderWidth','');// eslint-disable-next-line\nexport var BIconBoundingBox=/*#__PURE__*/makeIcon('BoundingBox','');// eslint-disable-next-line\nexport var BIconBoundingBoxCircles=/*#__PURE__*/makeIcon('BoundingBoxCircles','');// eslint-disable-next-line\nexport var BIconBox=/*#__PURE__*/makeIcon('Box','');// eslint-disable-next-line\nexport var BIconBoxArrowDown=/*#__PURE__*/makeIcon('BoxArrowDown','');// eslint-disable-next-line\nexport var BIconBoxArrowDownLeft=/*#__PURE__*/makeIcon('BoxArrowDownLeft','');// eslint-disable-next-line\nexport var BIconBoxArrowDownRight=/*#__PURE__*/makeIcon('BoxArrowDownRight','');// eslint-disable-next-line\nexport var BIconBoxArrowInDown=/*#__PURE__*/makeIcon('BoxArrowInDown','');// eslint-disable-next-line\nexport var BIconBoxArrowInDownLeft=/*#__PURE__*/makeIcon('BoxArrowInDownLeft','');// eslint-disable-next-line\nexport var BIconBoxArrowInDownRight=/*#__PURE__*/makeIcon('BoxArrowInDownRight','');// eslint-disable-next-line\nexport var BIconBoxArrowInLeft=/*#__PURE__*/makeIcon('BoxArrowInLeft','');// eslint-disable-next-line\nexport var BIconBoxArrowInRight=/*#__PURE__*/makeIcon('BoxArrowInRight','');// eslint-disable-next-line\nexport var BIconBoxArrowInUp=/*#__PURE__*/makeIcon('BoxArrowInUp','');// eslint-disable-next-line\nexport var BIconBoxArrowInUpLeft=/*#__PURE__*/makeIcon('BoxArrowInUpLeft','');// eslint-disable-next-line\nexport var BIconBoxArrowInUpRight=/*#__PURE__*/makeIcon('BoxArrowInUpRight','');// eslint-disable-next-line\nexport var BIconBoxArrowLeft=/*#__PURE__*/makeIcon('BoxArrowLeft','');// eslint-disable-next-line\nexport var BIconBoxArrowRight=/*#__PURE__*/makeIcon('BoxArrowRight','');// eslint-disable-next-line\nexport var BIconBoxArrowUp=/*#__PURE__*/makeIcon('BoxArrowUp','');// eslint-disable-next-line\nexport var BIconBoxArrowUpLeft=/*#__PURE__*/makeIcon('BoxArrowUpLeft','');// eslint-disable-next-line\nexport var BIconBoxArrowUpRight=/*#__PURE__*/makeIcon('BoxArrowUpRight','');// eslint-disable-next-line\nexport var BIconBoxSeam=/*#__PURE__*/makeIcon('BoxSeam','');// eslint-disable-next-line\nexport var BIconBraces=/*#__PURE__*/makeIcon('Braces','');// eslint-disable-next-line\nexport var BIconBricks=/*#__PURE__*/makeIcon('Bricks','');// eslint-disable-next-line\nexport var BIconBriefcase=/*#__PURE__*/makeIcon('Briefcase','');// eslint-disable-next-line\nexport var BIconBriefcaseFill=/*#__PURE__*/makeIcon('BriefcaseFill','');// eslint-disable-next-line\nexport var BIconBrightnessAltHigh=/*#__PURE__*/makeIcon('BrightnessAltHigh','');// eslint-disable-next-line\nexport var BIconBrightnessAltHighFill=/*#__PURE__*/makeIcon('BrightnessAltHighFill','');// eslint-disable-next-line\nexport var BIconBrightnessAltLow=/*#__PURE__*/makeIcon('BrightnessAltLow','');// eslint-disable-next-line\nexport var BIconBrightnessAltLowFill=/*#__PURE__*/makeIcon('BrightnessAltLowFill','');// eslint-disable-next-line\nexport var BIconBrightnessHigh=/*#__PURE__*/makeIcon('BrightnessHigh','');// eslint-disable-next-line\nexport var BIconBrightnessHighFill=/*#__PURE__*/makeIcon('BrightnessHighFill','');// eslint-disable-next-line\nexport var BIconBrightnessLow=/*#__PURE__*/makeIcon('BrightnessLow','');// eslint-disable-next-line\nexport var BIconBrightnessLowFill=/*#__PURE__*/makeIcon('BrightnessLowFill','');// eslint-disable-next-line\nexport var BIconBroadcast=/*#__PURE__*/makeIcon('Broadcast','');// eslint-disable-next-line\nexport var BIconBroadcastPin=/*#__PURE__*/makeIcon('BroadcastPin','');// eslint-disable-next-line\nexport var BIconBrush=/*#__PURE__*/makeIcon('Brush','');// eslint-disable-next-line\nexport var BIconBrushFill=/*#__PURE__*/makeIcon('BrushFill','');// eslint-disable-next-line\nexport var BIconBucket=/*#__PURE__*/makeIcon('Bucket','');// eslint-disable-next-line\nexport var BIconBucketFill=/*#__PURE__*/makeIcon('BucketFill','');// eslint-disable-next-line\nexport var BIconBug=/*#__PURE__*/makeIcon('Bug','');// eslint-disable-next-line\nexport var BIconBugFill=/*#__PURE__*/makeIcon('BugFill','');// eslint-disable-next-line\nexport var BIconBuilding=/*#__PURE__*/makeIcon('Building','');// eslint-disable-next-line\nexport var BIconBullseye=/*#__PURE__*/makeIcon('Bullseye','');// eslint-disable-next-line\nexport var BIconCalculator=/*#__PURE__*/makeIcon('Calculator','');// eslint-disable-next-line\nexport var BIconCalculatorFill=/*#__PURE__*/makeIcon('CalculatorFill','');// eslint-disable-next-line\nexport var BIconCalendar=/*#__PURE__*/makeIcon('Calendar','');// eslint-disable-next-line\nexport var BIconCalendar2=/*#__PURE__*/makeIcon('Calendar2','');// eslint-disable-next-line\nexport var BIconCalendar2Check=/*#__PURE__*/makeIcon('Calendar2Check','');// eslint-disable-next-line\nexport var BIconCalendar2CheckFill=/*#__PURE__*/makeIcon('Calendar2CheckFill','');// eslint-disable-next-line\nexport var BIconCalendar2Date=/*#__PURE__*/makeIcon('Calendar2Date','');// eslint-disable-next-line\nexport var BIconCalendar2DateFill=/*#__PURE__*/makeIcon('Calendar2DateFill','');// eslint-disable-next-line\nexport var BIconCalendar2Day=/*#__PURE__*/makeIcon('Calendar2Day','');// eslint-disable-next-line\nexport var BIconCalendar2DayFill=/*#__PURE__*/makeIcon('Calendar2DayFill','');// eslint-disable-next-line\nexport var BIconCalendar2Event=/*#__PURE__*/makeIcon('Calendar2Event','');// eslint-disable-next-line\nexport var BIconCalendar2EventFill=/*#__PURE__*/makeIcon('Calendar2EventFill','');// eslint-disable-next-line\nexport var BIconCalendar2Fill=/*#__PURE__*/makeIcon('Calendar2Fill','');// eslint-disable-next-line\nexport var BIconCalendar2Minus=/*#__PURE__*/makeIcon('Calendar2Minus','');// eslint-disable-next-line\nexport var BIconCalendar2MinusFill=/*#__PURE__*/makeIcon('Calendar2MinusFill','');// eslint-disable-next-line\nexport var BIconCalendar2Month=/*#__PURE__*/makeIcon('Calendar2Month','');// eslint-disable-next-line\nexport var BIconCalendar2MonthFill=/*#__PURE__*/makeIcon('Calendar2MonthFill','');// eslint-disable-next-line\nexport var BIconCalendar2Plus=/*#__PURE__*/makeIcon('Calendar2Plus','');// eslint-disable-next-line\nexport var BIconCalendar2PlusFill=/*#__PURE__*/makeIcon('Calendar2PlusFill','');// eslint-disable-next-line\nexport var BIconCalendar2Range=/*#__PURE__*/makeIcon('Calendar2Range','');// eslint-disable-next-line\nexport var BIconCalendar2RangeFill=/*#__PURE__*/makeIcon('Calendar2RangeFill','');// eslint-disable-next-line\nexport var BIconCalendar2Week=/*#__PURE__*/makeIcon('Calendar2Week','');// eslint-disable-next-line\nexport var BIconCalendar2WeekFill=/*#__PURE__*/makeIcon('Calendar2WeekFill','');// eslint-disable-next-line\nexport var BIconCalendar2X=/*#__PURE__*/makeIcon('Calendar2X','');// eslint-disable-next-line\nexport var BIconCalendar2XFill=/*#__PURE__*/makeIcon('Calendar2XFill','');// eslint-disable-next-line\nexport var BIconCalendar3=/*#__PURE__*/makeIcon('Calendar3','');// eslint-disable-next-line\nexport var BIconCalendar3Event=/*#__PURE__*/makeIcon('Calendar3Event','');// eslint-disable-next-line\nexport var BIconCalendar3EventFill=/*#__PURE__*/makeIcon('Calendar3EventFill','');// eslint-disable-next-line\nexport var BIconCalendar3Fill=/*#__PURE__*/makeIcon('Calendar3Fill','');// eslint-disable-next-line\nexport var BIconCalendar3Range=/*#__PURE__*/makeIcon('Calendar3Range','');// eslint-disable-next-line\nexport var BIconCalendar3RangeFill=/*#__PURE__*/makeIcon('Calendar3RangeFill','');// eslint-disable-next-line\nexport var BIconCalendar3Week=/*#__PURE__*/makeIcon('Calendar3Week','');// eslint-disable-next-line\nexport var BIconCalendar3WeekFill=/*#__PURE__*/makeIcon('Calendar3WeekFill','');// eslint-disable-next-line\nexport var BIconCalendar4=/*#__PURE__*/makeIcon('Calendar4','');// eslint-disable-next-line\nexport var BIconCalendar4Event=/*#__PURE__*/makeIcon('Calendar4Event','');// eslint-disable-next-line\nexport var BIconCalendar4Range=/*#__PURE__*/makeIcon('Calendar4Range','');// eslint-disable-next-line\nexport var BIconCalendar4Week=/*#__PURE__*/makeIcon('Calendar4Week','');// eslint-disable-next-line\nexport var BIconCalendarCheck=/*#__PURE__*/makeIcon('CalendarCheck','');// eslint-disable-next-line\nexport var BIconCalendarCheckFill=/*#__PURE__*/makeIcon('CalendarCheckFill','');// eslint-disable-next-line\nexport var BIconCalendarDate=/*#__PURE__*/makeIcon('CalendarDate','');// eslint-disable-next-line\nexport var BIconCalendarDateFill=/*#__PURE__*/makeIcon('CalendarDateFill','');// eslint-disable-next-line\nexport var BIconCalendarDay=/*#__PURE__*/makeIcon('CalendarDay','');// eslint-disable-next-line\nexport var BIconCalendarDayFill=/*#__PURE__*/makeIcon('CalendarDayFill','');// eslint-disable-next-line\nexport var BIconCalendarEvent=/*#__PURE__*/makeIcon('CalendarEvent','');// eslint-disable-next-line\nexport var BIconCalendarEventFill=/*#__PURE__*/makeIcon('CalendarEventFill','');// eslint-disable-next-line\nexport var BIconCalendarFill=/*#__PURE__*/makeIcon('CalendarFill','');// eslint-disable-next-line\nexport var BIconCalendarMinus=/*#__PURE__*/makeIcon('CalendarMinus','');// eslint-disable-next-line\nexport var BIconCalendarMinusFill=/*#__PURE__*/makeIcon('CalendarMinusFill','');// eslint-disable-next-line\nexport var BIconCalendarMonth=/*#__PURE__*/makeIcon('CalendarMonth','');// eslint-disable-next-line\nexport var BIconCalendarMonthFill=/*#__PURE__*/makeIcon('CalendarMonthFill','');// eslint-disable-next-line\nexport var BIconCalendarPlus=/*#__PURE__*/makeIcon('CalendarPlus','');// eslint-disable-next-line\nexport var BIconCalendarPlusFill=/*#__PURE__*/makeIcon('CalendarPlusFill','');// eslint-disable-next-line\nexport var BIconCalendarRange=/*#__PURE__*/makeIcon('CalendarRange','');// eslint-disable-next-line\nexport var BIconCalendarRangeFill=/*#__PURE__*/makeIcon('CalendarRangeFill','');// eslint-disable-next-line\nexport var BIconCalendarWeek=/*#__PURE__*/makeIcon('CalendarWeek','');// eslint-disable-next-line\nexport var BIconCalendarWeekFill=/*#__PURE__*/makeIcon('CalendarWeekFill','');// eslint-disable-next-line\nexport var BIconCalendarX=/*#__PURE__*/makeIcon('CalendarX','');// eslint-disable-next-line\nexport var BIconCalendarXFill=/*#__PURE__*/makeIcon('CalendarXFill','');// eslint-disable-next-line\nexport var BIconCamera=/*#__PURE__*/makeIcon('Camera','');// eslint-disable-next-line\nexport var BIconCamera2=/*#__PURE__*/makeIcon('Camera2','');// eslint-disable-next-line\nexport var BIconCameraFill=/*#__PURE__*/makeIcon('CameraFill','');// eslint-disable-next-line\nexport var BIconCameraReels=/*#__PURE__*/makeIcon('CameraReels','');// eslint-disable-next-line\nexport var BIconCameraReelsFill=/*#__PURE__*/makeIcon('CameraReelsFill','');// eslint-disable-next-line\nexport var BIconCameraVideo=/*#__PURE__*/makeIcon('CameraVideo','');// eslint-disable-next-line\nexport var BIconCameraVideoFill=/*#__PURE__*/makeIcon('CameraVideoFill','');// eslint-disable-next-line\nexport var BIconCameraVideoOff=/*#__PURE__*/makeIcon('CameraVideoOff','');// eslint-disable-next-line\nexport var BIconCameraVideoOffFill=/*#__PURE__*/makeIcon('CameraVideoOffFill','');// eslint-disable-next-line\nexport var BIconCapslock=/*#__PURE__*/makeIcon('Capslock','');// eslint-disable-next-line\nexport var BIconCapslockFill=/*#__PURE__*/makeIcon('CapslockFill','');// eslint-disable-next-line\nexport var BIconCardChecklist=/*#__PURE__*/makeIcon('CardChecklist','');// eslint-disable-next-line\nexport var BIconCardHeading=/*#__PURE__*/makeIcon('CardHeading','');// eslint-disable-next-line\nexport var BIconCardImage=/*#__PURE__*/makeIcon('CardImage','');// eslint-disable-next-line\nexport var BIconCardList=/*#__PURE__*/makeIcon('CardList','');// eslint-disable-next-line\nexport var BIconCardText=/*#__PURE__*/makeIcon('CardText','');// eslint-disable-next-line\nexport var BIconCaretDown=/*#__PURE__*/makeIcon('CaretDown','');// eslint-disable-next-line\nexport var BIconCaretDownFill=/*#__PURE__*/makeIcon('CaretDownFill','');// eslint-disable-next-line\nexport var BIconCaretDownSquare=/*#__PURE__*/makeIcon('CaretDownSquare','');// eslint-disable-next-line\nexport var BIconCaretDownSquareFill=/*#__PURE__*/makeIcon('CaretDownSquareFill','');// eslint-disable-next-line\nexport var BIconCaretLeft=/*#__PURE__*/makeIcon('CaretLeft','');// eslint-disable-next-line\nexport var BIconCaretLeftFill=/*#__PURE__*/makeIcon('CaretLeftFill','');// eslint-disable-next-line\nexport var BIconCaretLeftSquare=/*#__PURE__*/makeIcon('CaretLeftSquare','');// eslint-disable-next-line\nexport var BIconCaretLeftSquareFill=/*#__PURE__*/makeIcon('CaretLeftSquareFill','');// eslint-disable-next-line\nexport var BIconCaretRight=/*#__PURE__*/makeIcon('CaretRight','');// eslint-disable-next-line\nexport var BIconCaretRightFill=/*#__PURE__*/makeIcon('CaretRightFill','');// eslint-disable-next-line\nexport var BIconCaretRightSquare=/*#__PURE__*/makeIcon('CaretRightSquare','');// eslint-disable-next-line\nexport var BIconCaretRightSquareFill=/*#__PURE__*/makeIcon('CaretRightSquareFill','');// eslint-disable-next-line\nexport var BIconCaretUp=/*#__PURE__*/makeIcon('CaretUp','');// eslint-disable-next-line\nexport var BIconCaretUpFill=/*#__PURE__*/makeIcon('CaretUpFill','');// eslint-disable-next-line\nexport var BIconCaretUpSquare=/*#__PURE__*/makeIcon('CaretUpSquare','');// eslint-disable-next-line\nexport var BIconCaretUpSquareFill=/*#__PURE__*/makeIcon('CaretUpSquareFill','');// eslint-disable-next-line\nexport var BIconCart=/*#__PURE__*/makeIcon('Cart','');// eslint-disable-next-line\nexport var BIconCart2=/*#__PURE__*/makeIcon('Cart2','');// eslint-disable-next-line\nexport var BIconCart3=/*#__PURE__*/makeIcon('Cart3','');// eslint-disable-next-line\nexport var BIconCart4=/*#__PURE__*/makeIcon('Cart4','');// eslint-disable-next-line\nexport var BIconCartCheck=/*#__PURE__*/makeIcon('CartCheck','');// eslint-disable-next-line\nexport var BIconCartCheckFill=/*#__PURE__*/makeIcon('CartCheckFill','');// eslint-disable-next-line\nexport var BIconCartDash=/*#__PURE__*/makeIcon('CartDash','');// eslint-disable-next-line\nexport var BIconCartDashFill=/*#__PURE__*/makeIcon('CartDashFill','');// eslint-disable-next-line\nexport var BIconCartFill=/*#__PURE__*/makeIcon('CartFill','');// eslint-disable-next-line\nexport var BIconCartPlus=/*#__PURE__*/makeIcon('CartPlus','');// eslint-disable-next-line\nexport var BIconCartPlusFill=/*#__PURE__*/makeIcon('CartPlusFill','');// eslint-disable-next-line\nexport var BIconCartX=/*#__PURE__*/makeIcon('CartX','');// eslint-disable-next-line\nexport var BIconCartXFill=/*#__PURE__*/makeIcon('CartXFill','');// eslint-disable-next-line\nexport var BIconCash=/*#__PURE__*/makeIcon('Cash','');// eslint-disable-next-line\nexport var BIconCashCoin=/*#__PURE__*/makeIcon('CashCoin','');// eslint-disable-next-line\nexport var BIconCashStack=/*#__PURE__*/makeIcon('CashStack','');// eslint-disable-next-line\nexport var BIconCast=/*#__PURE__*/makeIcon('Cast','');// eslint-disable-next-line\nexport var BIconChat=/*#__PURE__*/makeIcon('Chat','');// eslint-disable-next-line\nexport var BIconChatDots=/*#__PURE__*/makeIcon('ChatDots','');// eslint-disable-next-line\nexport var BIconChatDotsFill=/*#__PURE__*/makeIcon('ChatDotsFill','');// eslint-disable-next-line\nexport var BIconChatFill=/*#__PURE__*/makeIcon('ChatFill','');// eslint-disable-next-line\nexport var BIconChatLeft=/*#__PURE__*/makeIcon('ChatLeft','');// eslint-disable-next-line\nexport var BIconChatLeftDots=/*#__PURE__*/makeIcon('ChatLeftDots','');// eslint-disable-next-line\nexport var BIconChatLeftDotsFill=/*#__PURE__*/makeIcon('ChatLeftDotsFill','');// eslint-disable-next-line\nexport var BIconChatLeftFill=/*#__PURE__*/makeIcon('ChatLeftFill','');// eslint-disable-next-line\nexport var BIconChatLeftQuote=/*#__PURE__*/makeIcon('ChatLeftQuote','');// eslint-disable-next-line\nexport var BIconChatLeftQuoteFill=/*#__PURE__*/makeIcon('ChatLeftQuoteFill','');// eslint-disable-next-line\nexport var BIconChatLeftText=/*#__PURE__*/makeIcon('ChatLeftText','');// eslint-disable-next-line\nexport var BIconChatLeftTextFill=/*#__PURE__*/makeIcon('ChatLeftTextFill','');// eslint-disable-next-line\nexport var BIconChatQuote=/*#__PURE__*/makeIcon('ChatQuote','');// eslint-disable-next-line\nexport var BIconChatQuoteFill=/*#__PURE__*/makeIcon('ChatQuoteFill','');// eslint-disable-next-line\nexport var BIconChatRight=/*#__PURE__*/makeIcon('ChatRight','');// eslint-disable-next-line\nexport var BIconChatRightDots=/*#__PURE__*/makeIcon('ChatRightDots','');// eslint-disable-next-line\nexport var BIconChatRightDotsFill=/*#__PURE__*/makeIcon('ChatRightDotsFill','');// eslint-disable-next-line\nexport var BIconChatRightFill=/*#__PURE__*/makeIcon('ChatRightFill','');// eslint-disable-next-line\nexport var BIconChatRightQuote=/*#__PURE__*/makeIcon('ChatRightQuote','');// eslint-disable-next-line\nexport var BIconChatRightQuoteFill=/*#__PURE__*/makeIcon('ChatRightQuoteFill','');// eslint-disable-next-line\nexport var BIconChatRightText=/*#__PURE__*/makeIcon('ChatRightText','');// eslint-disable-next-line\nexport var BIconChatRightTextFill=/*#__PURE__*/makeIcon('ChatRightTextFill','');// eslint-disable-next-line\nexport var BIconChatSquare=/*#__PURE__*/makeIcon('ChatSquare','');// eslint-disable-next-line\nexport var BIconChatSquareDots=/*#__PURE__*/makeIcon('ChatSquareDots','');// eslint-disable-next-line\nexport var BIconChatSquareDotsFill=/*#__PURE__*/makeIcon('ChatSquareDotsFill','');// eslint-disable-next-line\nexport var BIconChatSquareFill=/*#__PURE__*/makeIcon('ChatSquareFill','');// eslint-disable-next-line\nexport var BIconChatSquareQuote=/*#__PURE__*/makeIcon('ChatSquareQuote','');// eslint-disable-next-line\nexport var BIconChatSquareQuoteFill=/*#__PURE__*/makeIcon('ChatSquareQuoteFill','');// eslint-disable-next-line\nexport var BIconChatSquareText=/*#__PURE__*/makeIcon('ChatSquareText','');// eslint-disable-next-line\nexport var BIconChatSquareTextFill=/*#__PURE__*/makeIcon('ChatSquareTextFill','');// eslint-disable-next-line\nexport var BIconChatText=/*#__PURE__*/makeIcon('ChatText','');// eslint-disable-next-line\nexport var BIconChatTextFill=/*#__PURE__*/makeIcon('ChatTextFill','');// eslint-disable-next-line\nexport var BIconCheck=/*#__PURE__*/makeIcon('Check','');// eslint-disable-next-line\nexport var BIconCheck2=/*#__PURE__*/makeIcon('Check2','');// eslint-disable-next-line\nexport var BIconCheck2All=/*#__PURE__*/makeIcon('Check2All','');// eslint-disable-next-line\nexport var BIconCheck2Circle=/*#__PURE__*/makeIcon('Check2Circle','');// eslint-disable-next-line\nexport var BIconCheck2Square=/*#__PURE__*/makeIcon('Check2Square','');// eslint-disable-next-line\nexport var BIconCheckAll=/*#__PURE__*/makeIcon('CheckAll','');// eslint-disable-next-line\nexport var BIconCheckCircle=/*#__PURE__*/makeIcon('CheckCircle','');// eslint-disable-next-line\nexport var BIconCheckCircleFill=/*#__PURE__*/makeIcon('CheckCircleFill','');// eslint-disable-next-line\nexport var BIconCheckLg=/*#__PURE__*/makeIcon('CheckLg','');// eslint-disable-next-line\nexport var BIconCheckSquare=/*#__PURE__*/makeIcon('CheckSquare','');// eslint-disable-next-line\nexport var BIconCheckSquareFill=/*#__PURE__*/makeIcon('CheckSquareFill','');// eslint-disable-next-line\nexport var BIconChevronBarContract=/*#__PURE__*/makeIcon('ChevronBarContract','');// eslint-disable-next-line\nexport var BIconChevronBarDown=/*#__PURE__*/makeIcon('ChevronBarDown','');// eslint-disable-next-line\nexport var BIconChevronBarExpand=/*#__PURE__*/makeIcon('ChevronBarExpand','');// eslint-disable-next-line\nexport var BIconChevronBarLeft=/*#__PURE__*/makeIcon('ChevronBarLeft','');// eslint-disable-next-line\nexport var BIconChevronBarRight=/*#__PURE__*/makeIcon('ChevronBarRight','');// eslint-disable-next-line\nexport var BIconChevronBarUp=/*#__PURE__*/makeIcon('ChevronBarUp','');// eslint-disable-next-line\nexport var BIconChevronCompactDown=/*#__PURE__*/makeIcon('ChevronCompactDown','');// eslint-disable-next-line\nexport var BIconChevronCompactLeft=/*#__PURE__*/makeIcon('ChevronCompactLeft','');// eslint-disable-next-line\nexport var BIconChevronCompactRight=/*#__PURE__*/makeIcon('ChevronCompactRight','');// eslint-disable-next-line\nexport var BIconChevronCompactUp=/*#__PURE__*/makeIcon('ChevronCompactUp','');// eslint-disable-next-line\nexport var BIconChevronContract=/*#__PURE__*/makeIcon('ChevronContract','');// eslint-disable-next-line\nexport var BIconChevronDoubleDown=/*#__PURE__*/makeIcon('ChevronDoubleDown','');// eslint-disable-next-line\nexport var BIconChevronDoubleLeft=/*#__PURE__*/makeIcon('ChevronDoubleLeft','');// eslint-disable-next-line\nexport var BIconChevronDoubleRight=/*#__PURE__*/makeIcon('ChevronDoubleRight','');// eslint-disable-next-line\nexport var BIconChevronDoubleUp=/*#__PURE__*/makeIcon('ChevronDoubleUp','');// eslint-disable-next-line\nexport var BIconChevronDown=/*#__PURE__*/makeIcon('ChevronDown','');// eslint-disable-next-line\nexport var BIconChevronExpand=/*#__PURE__*/makeIcon('ChevronExpand','');// eslint-disable-next-line\nexport var BIconChevronLeft=/*#__PURE__*/makeIcon('ChevronLeft','');// eslint-disable-next-line\nexport var BIconChevronRight=/*#__PURE__*/makeIcon('ChevronRight','');// eslint-disable-next-line\nexport var BIconChevronUp=/*#__PURE__*/makeIcon('ChevronUp','');// eslint-disable-next-line\nexport var BIconCircle=/*#__PURE__*/makeIcon('Circle','');// eslint-disable-next-line\nexport var BIconCircleFill=/*#__PURE__*/makeIcon('CircleFill','');// eslint-disable-next-line\nexport var BIconCircleHalf=/*#__PURE__*/makeIcon('CircleHalf','');// eslint-disable-next-line\nexport var BIconCircleSquare=/*#__PURE__*/makeIcon('CircleSquare','');// eslint-disable-next-line\nexport var BIconClipboard=/*#__PURE__*/makeIcon('Clipboard','');// eslint-disable-next-line\nexport var BIconClipboardCheck=/*#__PURE__*/makeIcon('ClipboardCheck','');// eslint-disable-next-line\nexport var BIconClipboardData=/*#__PURE__*/makeIcon('ClipboardData','');// eslint-disable-next-line\nexport var BIconClipboardMinus=/*#__PURE__*/makeIcon('ClipboardMinus','');// eslint-disable-next-line\nexport var BIconClipboardPlus=/*#__PURE__*/makeIcon('ClipboardPlus','');// eslint-disable-next-line\nexport var BIconClipboardX=/*#__PURE__*/makeIcon('ClipboardX','');// eslint-disable-next-line\nexport var BIconClock=/*#__PURE__*/makeIcon('Clock','');// eslint-disable-next-line\nexport var BIconClockFill=/*#__PURE__*/makeIcon('ClockFill','');// eslint-disable-next-line\nexport var BIconClockHistory=/*#__PURE__*/makeIcon('ClockHistory','');// eslint-disable-next-line\nexport var BIconCloud=/*#__PURE__*/makeIcon('Cloud','');// eslint-disable-next-line\nexport var BIconCloudArrowDown=/*#__PURE__*/makeIcon('CloudArrowDown','');// eslint-disable-next-line\nexport var BIconCloudArrowDownFill=/*#__PURE__*/makeIcon('CloudArrowDownFill','');// eslint-disable-next-line\nexport var BIconCloudArrowUp=/*#__PURE__*/makeIcon('CloudArrowUp','');// eslint-disable-next-line\nexport var BIconCloudArrowUpFill=/*#__PURE__*/makeIcon('CloudArrowUpFill','');// eslint-disable-next-line\nexport var BIconCloudCheck=/*#__PURE__*/makeIcon('CloudCheck','');// eslint-disable-next-line\nexport var BIconCloudCheckFill=/*#__PURE__*/makeIcon('CloudCheckFill','');// eslint-disable-next-line\nexport var BIconCloudDownload=/*#__PURE__*/makeIcon('CloudDownload','');// eslint-disable-next-line\nexport var BIconCloudDownloadFill=/*#__PURE__*/makeIcon('CloudDownloadFill','');// eslint-disable-next-line\nexport var BIconCloudDrizzle=/*#__PURE__*/makeIcon('CloudDrizzle','');// eslint-disable-next-line\nexport var BIconCloudDrizzleFill=/*#__PURE__*/makeIcon('CloudDrizzleFill','');// eslint-disable-next-line\nexport var BIconCloudFill=/*#__PURE__*/makeIcon('CloudFill','');// eslint-disable-next-line\nexport var BIconCloudFog=/*#__PURE__*/makeIcon('CloudFog','');// eslint-disable-next-line\nexport var BIconCloudFog2=/*#__PURE__*/makeIcon('CloudFog2','');// eslint-disable-next-line\nexport var BIconCloudFog2Fill=/*#__PURE__*/makeIcon('CloudFog2Fill','');// eslint-disable-next-line\nexport var BIconCloudFogFill=/*#__PURE__*/makeIcon('CloudFogFill','');// eslint-disable-next-line\nexport var BIconCloudHail=/*#__PURE__*/makeIcon('CloudHail','');// eslint-disable-next-line\nexport var BIconCloudHailFill=/*#__PURE__*/makeIcon('CloudHailFill','');// eslint-disable-next-line\nexport var BIconCloudHaze=/*#__PURE__*/makeIcon('CloudHaze','');// eslint-disable-next-line\nexport var BIconCloudHaze1=/*#__PURE__*/makeIcon('CloudHaze1','');// eslint-disable-next-line\nexport var BIconCloudHaze2Fill=/*#__PURE__*/makeIcon('CloudHaze2Fill','');// eslint-disable-next-line\nexport var BIconCloudHazeFill=/*#__PURE__*/makeIcon('CloudHazeFill','');// eslint-disable-next-line\nexport var BIconCloudLightning=/*#__PURE__*/makeIcon('CloudLightning','');// eslint-disable-next-line\nexport var BIconCloudLightningFill=/*#__PURE__*/makeIcon('CloudLightningFill','');// eslint-disable-next-line\nexport var BIconCloudLightningRain=/*#__PURE__*/makeIcon('CloudLightningRain','');// eslint-disable-next-line\nexport var BIconCloudLightningRainFill=/*#__PURE__*/makeIcon('CloudLightningRainFill','');// eslint-disable-next-line\nexport var BIconCloudMinus=/*#__PURE__*/makeIcon('CloudMinus','');// eslint-disable-next-line\nexport var BIconCloudMinusFill=/*#__PURE__*/makeIcon('CloudMinusFill','');// eslint-disable-next-line\nexport var BIconCloudMoon=/*#__PURE__*/makeIcon('CloudMoon','');// eslint-disable-next-line\nexport var BIconCloudMoonFill=/*#__PURE__*/makeIcon('CloudMoonFill','');// eslint-disable-next-line\nexport var BIconCloudPlus=/*#__PURE__*/makeIcon('CloudPlus','');// eslint-disable-next-line\nexport var BIconCloudPlusFill=/*#__PURE__*/makeIcon('CloudPlusFill','');// eslint-disable-next-line\nexport var BIconCloudRain=/*#__PURE__*/makeIcon('CloudRain','');// eslint-disable-next-line\nexport var BIconCloudRainFill=/*#__PURE__*/makeIcon('CloudRainFill','');// eslint-disable-next-line\nexport var BIconCloudRainHeavy=/*#__PURE__*/makeIcon('CloudRainHeavy','');// eslint-disable-next-line\nexport var BIconCloudRainHeavyFill=/*#__PURE__*/makeIcon('CloudRainHeavyFill','');// eslint-disable-next-line\nexport var BIconCloudSlash=/*#__PURE__*/makeIcon('CloudSlash','');// eslint-disable-next-line\nexport var BIconCloudSlashFill=/*#__PURE__*/makeIcon('CloudSlashFill','');// eslint-disable-next-line\nexport var BIconCloudSleet=/*#__PURE__*/makeIcon('CloudSleet','');// eslint-disable-next-line\nexport var BIconCloudSleetFill=/*#__PURE__*/makeIcon('CloudSleetFill','');// eslint-disable-next-line\nexport var BIconCloudSnow=/*#__PURE__*/makeIcon('CloudSnow','');// eslint-disable-next-line\nexport var BIconCloudSnowFill=/*#__PURE__*/makeIcon('CloudSnowFill','');// eslint-disable-next-line\nexport var BIconCloudSun=/*#__PURE__*/makeIcon('CloudSun','');// eslint-disable-next-line\nexport var BIconCloudSunFill=/*#__PURE__*/makeIcon('CloudSunFill','');// eslint-disable-next-line\nexport var BIconCloudUpload=/*#__PURE__*/makeIcon('CloudUpload','');// eslint-disable-next-line\nexport var BIconCloudUploadFill=/*#__PURE__*/makeIcon('CloudUploadFill','');// eslint-disable-next-line\nexport var BIconClouds=/*#__PURE__*/makeIcon('Clouds','');// eslint-disable-next-line\nexport var BIconCloudsFill=/*#__PURE__*/makeIcon('CloudsFill','');// eslint-disable-next-line\nexport var BIconCloudy=/*#__PURE__*/makeIcon('Cloudy','');// eslint-disable-next-line\nexport var BIconCloudyFill=/*#__PURE__*/makeIcon('CloudyFill','');// eslint-disable-next-line\nexport var BIconCode=/*#__PURE__*/makeIcon('Code','');// eslint-disable-next-line\nexport var BIconCodeSlash=/*#__PURE__*/makeIcon('CodeSlash','');// eslint-disable-next-line\nexport var BIconCodeSquare=/*#__PURE__*/makeIcon('CodeSquare','');// eslint-disable-next-line\nexport var BIconCoin=/*#__PURE__*/makeIcon('Coin','');// eslint-disable-next-line\nexport var BIconCollection=/*#__PURE__*/makeIcon('Collection','');// eslint-disable-next-line\nexport var BIconCollectionFill=/*#__PURE__*/makeIcon('CollectionFill','');// eslint-disable-next-line\nexport var BIconCollectionPlay=/*#__PURE__*/makeIcon('CollectionPlay','');// eslint-disable-next-line\nexport var BIconCollectionPlayFill=/*#__PURE__*/makeIcon('CollectionPlayFill','');// eslint-disable-next-line\nexport var BIconColumns=/*#__PURE__*/makeIcon('Columns','');// eslint-disable-next-line\nexport var BIconColumnsGap=/*#__PURE__*/makeIcon('ColumnsGap','');// eslint-disable-next-line\nexport var BIconCommand=/*#__PURE__*/makeIcon('Command','');// eslint-disable-next-line\nexport var BIconCompass=/*#__PURE__*/makeIcon('Compass','');// eslint-disable-next-line\nexport var BIconCompassFill=/*#__PURE__*/makeIcon('CompassFill','');// eslint-disable-next-line\nexport var BIconCone=/*#__PURE__*/makeIcon('Cone','');// eslint-disable-next-line\nexport var BIconConeStriped=/*#__PURE__*/makeIcon('ConeStriped','');// eslint-disable-next-line\nexport var BIconController=/*#__PURE__*/makeIcon('Controller','');// eslint-disable-next-line\nexport var BIconCpu=/*#__PURE__*/makeIcon('Cpu','');// eslint-disable-next-line\nexport var BIconCpuFill=/*#__PURE__*/makeIcon('CpuFill','');// eslint-disable-next-line\nexport var BIconCreditCard=/*#__PURE__*/makeIcon('CreditCard','');// eslint-disable-next-line\nexport var BIconCreditCard2Back=/*#__PURE__*/makeIcon('CreditCard2Back','');// eslint-disable-next-line\nexport var BIconCreditCard2BackFill=/*#__PURE__*/makeIcon('CreditCard2BackFill','');// eslint-disable-next-line\nexport var BIconCreditCard2Front=/*#__PURE__*/makeIcon('CreditCard2Front','');// eslint-disable-next-line\nexport var BIconCreditCard2FrontFill=/*#__PURE__*/makeIcon('CreditCard2FrontFill','');// eslint-disable-next-line\nexport var BIconCreditCardFill=/*#__PURE__*/makeIcon('CreditCardFill','');// eslint-disable-next-line\nexport var BIconCrop=/*#__PURE__*/makeIcon('Crop','');// eslint-disable-next-line\nexport var BIconCup=/*#__PURE__*/makeIcon('Cup','');// eslint-disable-next-line\nexport var BIconCupFill=/*#__PURE__*/makeIcon('CupFill','');// eslint-disable-next-line\nexport var BIconCupStraw=/*#__PURE__*/makeIcon('CupStraw','');// eslint-disable-next-line\nexport var BIconCurrencyBitcoin=/*#__PURE__*/makeIcon('CurrencyBitcoin','');// eslint-disable-next-line\nexport var BIconCurrencyDollar=/*#__PURE__*/makeIcon('CurrencyDollar','');// eslint-disable-next-line\nexport var BIconCurrencyEuro=/*#__PURE__*/makeIcon('CurrencyEuro','');// eslint-disable-next-line\nexport var BIconCurrencyExchange=/*#__PURE__*/makeIcon('CurrencyExchange','');// eslint-disable-next-line\nexport var BIconCurrencyPound=/*#__PURE__*/makeIcon('CurrencyPound','');// eslint-disable-next-line\nexport var BIconCurrencyYen=/*#__PURE__*/makeIcon('CurrencyYen','');// eslint-disable-next-line\nexport var BIconCursor=/*#__PURE__*/makeIcon('Cursor','');// eslint-disable-next-line\nexport var BIconCursorFill=/*#__PURE__*/makeIcon('CursorFill','');// eslint-disable-next-line\nexport var BIconCursorText=/*#__PURE__*/makeIcon('CursorText','');// eslint-disable-next-line\nexport var BIconDash=/*#__PURE__*/makeIcon('Dash','');// eslint-disable-next-line\nexport var BIconDashCircle=/*#__PURE__*/makeIcon('DashCircle','');// eslint-disable-next-line\nexport var BIconDashCircleDotted=/*#__PURE__*/makeIcon('DashCircleDotted','');// eslint-disable-next-line\nexport var BIconDashCircleFill=/*#__PURE__*/makeIcon('DashCircleFill','');// eslint-disable-next-line\nexport var BIconDashLg=/*#__PURE__*/makeIcon('DashLg','');// eslint-disable-next-line\nexport var BIconDashSquare=/*#__PURE__*/makeIcon('DashSquare','');// eslint-disable-next-line\nexport var BIconDashSquareDotted=/*#__PURE__*/makeIcon('DashSquareDotted','');// eslint-disable-next-line\nexport var BIconDashSquareFill=/*#__PURE__*/makeIcon('DashSquareFill','');// eslint-disable-next-line\nexport var BIconDiagram2=/*#__PURE__*/makeIcon('Diagram2','');// eslint-disable-next-line\nexport var BIconDiagram2Fill=/*#__PURE__*/makeIcon('Diagram2Fill','');// eslint-disable-next-line\nexport var BIconDiagram3=/*#__PURE__*/makeIcon('Diagram3','');// eslint-disable-next-line\nexport var BIconDiagram3Fill=/*#__PURE__*/makeIcon('Diagram3Fill','');// eslint-disable-next-line\nexport var BIconDiamond=/*#__PURE__*/makeIcon('Diamond','');// eslint-disable-next-line\nexport var BIconDiamondFill=/*#__PURE__*/makeIcon('DiamondFill','');// eslint-disable-next-line\nexport var BIconDiamondHalf=/*#__PURE__*/makeIcon('DiamondHalf','');// eslint-disable-next-line\nexport var BIconDice1=/*#__PURE__*/makeIcon('Dice1','');// eslint-disable-next-line\nexport var BIconDice1Fill=/*#__PURE__*/makeIcon('Dice1Fill','');// eslint-disable-next-line\nexport var BIconDice2=/*#__PURE__*/makeIcon('Dice2','');// eslint-disable-next-line\nexport var BIconDice2Fill=/*#__PURE__*/makeIcon('Dice2Fill','');// eslint-disable-next-line\nexport var BIconDice3=/*#__PURE__*/makeIcon('Dice3','');// eslint-disable-next-line\nexport var BIconDice3Fill=/*#__PURE__*/makeIcon('Dice3Fill','');// eslint-disable-next-line\nexport var BIconDice4=/*#__PURE__*/makeIcon('Dice4','');// eslint-disable-next-line\nexport var BIconDice4Fill=/*#__PURE__*/makeIcon('Dice4Fill','');// eslint-disable-next-line\nexport var BIconDice5=/*#__PURE__*/makeIcon('Dice5','');// eslint-disable-next-line\nexport var BIconDice5Fill=/*#__PURE__*/makeIcon('Dice5Fill','');// eslint-disable-next-line\nexport var BIconDice6=/*#__PURE__*/makeIcon('Dice6','');// eslint-disable-next-line\nexport var BIconDice6Fill=/*#__PURE__*/makeIcon('Dice6Fill','');// eslint-disable-next-line\nexport var BIconDisc=/*#__PURE__*/makeIcon('Disc','');// eslint-disable-next-line\nexport var BIconDiscFill=/*#__PURE__*/makeIcon('DiscFill','');// eslint-disable-next-line\nexport var BIconDiscord=/*#__PURE__*/makeIcon('Discord','');// eslint-disable-next-line\nexport var BIconDisplay=/*#__PURE__*/makeIcon('Display','');// eslint-disable-next-line\nexport var BIconDisplayFill=/*#__PURE__*/makeIcon('DisplayFill','');// eslint-disable-next-line\nexport var BIconDistributeHorizontal=/*#__PURE__*/makeIcon('DistributeHorizontal','');// eslint-disable-next-line\nexport var BIconDistributeVertical=/*#__PURE__*/makeIcon('DistributeVertical','');// eslint-disable-next-line\nexport var BIconDoorClosed=/*#__PURE__*/makeIcon('DoorClosed','');// eslint-disable-next-line\nexport var BIconDoorClosedFill=/*#__PURE__*/makeIcon('DoorClosedFill','');// eslint-disable-next-line\nexport var BIconDoorOpen=/*#__PURE__*/makeIcon('DoorOpen','');// eslint-disable-next-line\nexport var BIconDoorOpenFill=/*#__PURE__*/makeIcon('DoorOpenFill','');// eslint-disable-next-line\nexport var BIconDot=/*#__PURE__*/makeIcon('Dot','');// eslint-disable-next-line\nexport var BIconDownload=/*#__PURE__*/makeIcon('Download','');// eslint-disable-next-line\nexport var BIconDroplet=/*#__PURE__*/makeIcon('Droplet','');// eslint-disable-next-line\nexport var BIconDropletFill=/*#__PURE__*/makeIcon('DropletFill','');// eslint-disable-next-line\nexport var BIconDropletHalf=/*#__PURE__*/makeIcon('DropletHalf','');// eslint-disable-next-line\nexport var BIconEarbuds=/*#__PURE__*/makeIcon('Earbuds','');// eslint-disable-next-line\nexport var BIconEasel=/*#__PURE__*/makeIcon('Easel','');// eslint-disable-next-line\nexport var BIconEaselFill=/*#__PURE__*/makeIcon('EaselFill','');// eslint-disable-next-line\nexport var BIconEgg=/*#__PURE__*/makeIcon('Egg','');// eslint-disable-next-line\nexport var BIconEggFill=/*#__PURE__*/makeIcon('EggFill','');// eslint-disable-next-line\nexport var BIconEggFried=/*#__PURE__*/makeIcon('EggFried','');// eslint-disable-next-line\nexport var BIconEject=/*#__PURE__*/makeIcon('Eject','');// eslint-disable-next-line\nexport var BIconEjectFill=/*#__PURE__*/makeIcon('EjectFill','');// eslint-disable-next-line\nexport var BIconEmojiAngry=/*#__PURE__*/makeIcon('EmojiAngry','');// eslint-disable-next-line\nexport var BIconEmojiAngryFill=/*#__PURE__*/makeIcon('EmojiAngryFill','');// eslint-disable-next-line\nexport var BIconEmojiDizzy=/*#__PURE__*/makeIcon('EmojiDizzy','');// eslint-disable-next-line\nexport var BIconEmojiDizzyFill=/*#__PURE__*/makeIcon('EmojiDizzyFill','');// eslint-disable-next-line\nexport var BIconEmojiExpressionless=/*#__PURE__*/makeIcon('EmojiExpressionless','');// eslint-disable-next-line\nexport var BIconEmojiExpressionlessFill=/*#__PURE__*/makeIcon('EmojiExpressionlessFill','');// eslint-disable-next-line\nexport var BIconEmojiFrown=/*#__PURE__*/makeIcon('EmojiFrown','');// eslint-disable-next-line\nexport var BIconEmojiFrownFill=/*#__PURE__*/makeIcon('EmojiFrownFill','');// eslint-disable-next-line\nexport var BIconEmojiHeartEyes=/*#__PURE__*/makeIcon('EmojiHeartEyes','');// eslint-disable-next-line\nexport var BIconEmojiHeartEyesFill=/*#__PURE__*/makeIcon('EmojiHeartEyesFill','');// eslint-disable-next-line\nexport var BIconEmojiLaughing=/*#__PURE__*/makeIcon('EmojiLaughing','');// eslint-disable-next-line\nexport var BIconEmojiLaughingFill=/*#__PURE__*/makeIcon('EmojiLaughingFill','');// eslint-disable-next-line\nexport var BIconEmojiNeutral=/*#__PURE__*/makeIcon('EmojiNeutral','');// eslint-disable-next-line\nexport var BIconEmojiNeutralFill=/*#__PURE__*/makeIcon('EmojiNeutralFill','');// eslint-disable-next-line\nexport var BIconEmojiSmile=/*#__PURE__*/makeIcon('EmojiSmile','');// eslint-disable-next-line\nexport var BIconEmojiSmileFill=/*#__PURE__*/makeIcon('EmojiSmileFill','');// eslint-disable-next-line\nexport var BIconEmojiSmileUpsideDown=/*#__PURE__*/makeIcon('EmojiSmileUpsideDown','');// eslint-disable-next-line\nexport var BIconEmojiSmileUpsideDownFill=/*#__PURE__*/makeIcon('EmojiSmileUpsideDownFill','');// eslint-disable-next-line\nexport var BIconEmojiSunglasses=/*#__PURE__*/makeIcon('EmojiSunglasses','');// eslint-disable-next-line\nexport var BIconEmojiSunglassesFill=/*#__PURE__*/makeIcon('EmojiSunglassesFill','');// eslint-disable-next-line\nexport var BIconEmojiWink=/*#__PURE__*/makeIcon('EmojiWink','');// eslint-disable-next-line\nexport var BIconEmojiWinkFill=/*#__PURE__*/makeIcon('EmojiWinkFill','');// eslint-disable-next-line\nexport var BIconEnvelope=/*#__PURE__*/makeIcon('Envelope','');// eslint-disable-next-line\nexport var BIconEnvelopeFill=/*#__PURE__*/makeIcon('EnvelopeFill','');// eslint-disable-next-line\nexport var BIconEnvelopeOpen=/*#__PURE__*/makeIcon('EnvelopeOpen','');// eslint-disable-next-line\nexport var BIconEnvelopeOpenFill=/*#__PURE__*/makeIcon('EnvelopeOpenFill','');// eslint-disable-next-line\nexport var BIconEraser=/*#__PURE__*/makeIcon('Eraser','');// eslint-disable-next-line\nexport var BIconEraserFill=/*#__PURE__*/makeIcon('EraserFill','');// eslint-disable-next-line\nexport var BIconExclamation=/*#__PURE__*/makeIcon('Exclamation','');// eslint-disable-next-line\nexport var BIconExclamationCircle=/*#__PURE__*/makeIcon('ExclamationCircle','');// eslint-disable-next-line\nexport var BIconExclamationCircleFill=/*#__PURE__*/makeIcon('ExclamationCircleFill','');// eslint-disable-next-line\nexport var BIconExclamationDiamond=/*#__PURE__*/makeIcon('ExclamationDiamond','');// eslint-disable-next-line\nexport var BIconExclamationDiamondFill=/*#__PURE__*/makeIcon('ExclamationDiamondFill','');// eslint-disable-next-line\nexport var BIconExclamationLg=/*#__PURE__*/makeIcon('ExclamationLg','');// eslint-disable-next-line\nexport var BIconExclamationOctagon=/*#__PURE__*/makeIcon('ExclamationOctagon','');// eslint-disable-next-line\nexport var BIconExclamationOctagonFill=/*#__PURE__*/makeIcon('ExclamationOctagonFill','');// eslint-disable-next-line\nexport var BIconExclamationSquare=/*#__PURE__*/makeIcon('ExclamationSquare','');// eslint-disable-next-line\nexport var BIconExclamationSquareFill=/*#__PURE__*/makeIcon('ExclamationSquareFill','');// eslint-disable-next-line\nexport var BIconExclamationTriangle=/*#__PURE__*/makeIcon('ExclamationTriangle','');// eslint-disable-next-line\nexport var BIconExclamationTriangleFill=/*#__PURE__*/makeIcon('ExclamationTriangleFill','');// eslint-disable-next-line\nexport var BIconExclude=/*#__PURE__*/makeIcon('Exclude','');// eslint-disable-next-line\nexport var BIconEye=/*#__PURE__*/makeIcon('Eye','');// eslint-disable-next-line\nexport var BIconEyeFill=/*#__PURE__*/makeIcon('EyeFill','');// eslint-disable-next-line\nexport var BIconEyeSlash=/*#__PURE__*/makeIcon('EyeSlash','');// eslint-disable-next-line\nexport var BIconEyeSlashFill=/*#__PURE__*/makeIcon('EyeSlashFill','');// eslint-disable-next-line\nexport var BIconEyedropper=/*#__PURE__*/makeIcon('Eyedropper','');// eslint-disable-next-line\nexport var BIconEyeglasses=/*#__PURE__*/makeIcon('Eyeglasses','');// eslint-disable-next-line\nexport var BIconFacebook=/*#__PURE__*/makeIcon('Facebook','');// eslint-disable-next-line\nexport var BIconFile=/*#__PURE__*/makeIcon('File','');// eslint-disable-next-line\nexport var BIconFileArrowDown=/*#__PURE__*/makeIcon('FileArrowDown','');// eslint-disable-next-line\nexport var BIconFileArrowDownFill=/*#__PURE__*/makeIcon('FileArrowDownFill','');// eslint-disable-next-line\nexport var BIconFileArrowUp=/*#__PURE__*/makeIcon('FileArrowUp','');// eslint-disable-next-line\nexport var BIconFileArrowUpFill=/*#__PURE__*/makeIcon('FileArrowUpFill','');// eslint-disable-next-line\nexport var BIconFileBarGraph=/*#__PURE__*/makeIcon('FileBarGraph','');// eslint-disable-next-line\nexport var BIconFileBarGraphFill=/*#__PURE__*/makeIcon('FileBarGraphFill','');// eslint-disable-next-line\nexport var BIconFileBinary=/*#__PURE__*/makeIcon('FileBinary','');// eslint-disable-next-line\nexport var BIconFileBinaryFill=/*#__PURE__*/makeIcon('FileBinaryFill','');// eslint-disable-next-line\nexport var BIconFileBreak=/*#__PURE__*/makeIcon('FileBreak','');// eslint-disable-next-line\nexport var BIconFileBreakFill=/*#__PURE__*/makeIcon('FileBreakFill','');// eslint-disable-next-line\nexport var BIconFileCheck=/*#__PURE__*/makeIcon('FileCheck','');// eslint-disable-next-line\nexport var BIconFileCheckFill=/*#__PURE__*/makeIcon('FileCheckFill','');// eslint-disable-next-line\nexport var BIconFileCode=/*#__PURE__*/makeIcon('FileCode','');// eslint-disable-next-line\nexport var BIconFileCodeFill=/*#__PURE__*/makeIcon('FileCodeFill','');// eslint-disable-next-line\nexport var BIconFileDiff=/*#__PURE__*/makeIcon('FileDiff','');// eslint-disable-next-line\nexport var BIconFileDiffFill=/*#__PURE__*/makeIcon('FileDiffFill','');// eslint-disable-next-line\nexport var BIconFileEarmark=/*#__PURE__*/makeIcon('FileEarmark','');// eslint-disable-next-line\nexport var BIconFileEarmarkArrowDown=/*#__PURE__*/makeIcon('FileEarmarkArrowDown','');// eslint-disable-next-line\nexport var BIconFileEarmarkArrowDownFill=/*#__PURE__*/makeIcon('FileEarmarkArrowDownFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkArrowUp=/*#__PURE__*/makeIcon('FileEarmarkArrowUp','');// eslint-disable-next-line\nexport var BIconFileEarmarkArrowUpFill=/*#__PURE__*/makeIcon('FileEarmarkArrowUpFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkBarGraph=/*#__PURE__*/makeIcon('FileEarmarkBarGraph','');// eslint-disable-next-line\nexport var BIconFileEarmarkBarGraphFill=/*#__PURE__*/makeIcon('FileEarmarkBarGraphFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkBinary=/*#__PURE__*/makeIcon('FileEarmarkBinary','');// eslint-disable-next-line\nexport var BIconFileEarmarkBinaryFill=/*#__PURE__*/makeIcon('FileEarmarkBinaryFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkBreak=/*#__PURE__*/makeIcon('FileEarmarkBreak','');// eslint-disable-next-line\nexport var BIconFileEarmarkBreakFill=/*#__PURE__*/makeIcon('FileEarmarkBreakFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkCheck=/*#__PURE__*/makeIcon('FileEarmarkCheck','');// eslint-disable-next-line\nexport var BIconFileEarmarkCheckFill=/*#__PURE__*/makeIcon('FileEarmarkCheckFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkCode=/*#__PURE__*/makeIcon('FileEarmarkCode','');// eslint-disable-next-line\nexport var BIconFileEarmarkCodeFill=/*#__PURE__*/makeIcon('FileEarmarkCodeFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkDiff=/*#__PURE__*/makeIcon('FileEarmarkDiff','');// eslint-disable-next-line\nexport var BIconFileEarmarkDiffFill=/*#__PURE__*/makeIcon('FileEarmarkDiffFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkEasel=/*#__PURE__*/makeIcon('FileEarmarkEasel','');// eslint-disable-next-line\nexport var BIconFileEarmarkEaselFill=/*#__PURE__*/makeIcon('FileEarmarkEaselFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkExcel=/*#__PURE__*/makeIcon('FileEarmarkExcel','');// eslint-disable-next-line\nexport var BIconFileEarmarkExcelFill=/*#__PURE__*/makeIcon('FileEarmarkExcelFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkFill=/*#__PURE__*/makeIcon('FileEarmarkFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkFont=/*#__PURE__*/makeIcon('FileEarmarkFont','');// eslint-disable-next-line\nexport var BIconFileEarmarkFontFill=/*#__PURE__*/makeIcon('FileEarmarkFontFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkImage=/*#__PURE__*/makeIcon('FileEarmarkImage','');// eslint-disable-next-line\nexport var BIconFileEarmarkImageFill=/*#__PURE__*/makeIcon('FileEarmarkImageFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkLock=/*#__PURE__*/makeIcon('FileEarmarkLock','');// eslint-disable-next-line\nexport var BIconFileEarmarkLock2=/*#__PURE__*/makeIcon('FileEarmarkLock2','');// eslint-disable-next-line\nexport var BIconFileEarmarkLock2Fill=/*#__PURE__*/makeIcon('FileEarmarkLock2Fill','');// eslint-disable-next-line\nexport var BIconFileEarmarkLockFill=/*#__PURE__*/makeIcon('FileEarmarkLockFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkMedical=/*#__PURE__*/makeIcon('FileEarmarkMedical','');// eslint-disable-next-line\nexport var BIconFileEarmarkMedicalFill=/*#__PURE__*/makeIcon('FileEarmarkMedicalFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkMinus=/*#__PURE__*/makeIcon('FileEarmarkMinus','');// eslint-disable-next-line\nexport var BIconFileEarmarkMinusFill=/*#__PURE__*/makeIcon('FileEarmarkMinusFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkMusic=/*#__PURE__*/makeIcon('FileEarmarkMusic','');// eslint-disable-next-line\nexport var BIconFileEarmarkMusicFill=/*#__PURE__*/makeIcon('FileEarmarkMusicFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkPdf=/*#__PURE__*/makeIcon('FileEarmarkPdf','');// eslint-disable-next-line\nexport var BIconFileEarmarkPdfFill=/*#__PURE__*/makeIcon('FileEarmarkPdfFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkPerson=/*#__PURE__*/makeIcon('FileEarmarkPerson','');// eslint-disable-next-line\nexport var BIconFileEarmarkPersonFill=/*#__PURE__*/makeIcon('FileEarmarkPersonFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkPlay=/*#__PURE__*/makeIcon('FileEarmarkPlay','');// eslint-disable-next-line\nexport var BIconFileEarmarkPlayFill=/*#__PURE__*/makeIcon('FileEarmarkPlayFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkPlus=/*#__PURE__*/makeIcon('FileEarmarkPlus','');// eslint-disable-next-line\nexport var BIconFileEarmarkPlusFill=/*#__PURE__*/makeIcon('FileEarmarkPlusFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkPost=/*#__PURE__*/makeIcon('FileEarmarkPost','');// eslint-disable-next-line\nexport var BIconFileEarmarkPostFill=/*#__PURE__*/makeIcon('FileEarmarkPostFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkPpt=/*#__PURE__*/makeIcon('FileEarmarkPpt','');// eslint-disable-next-line\nexport var BIconFileEarmarkPptFill=/*#__PURE__*/makeIcon('FileEarmarkPptFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkRichtext=/*#__PURE__*/makeIcon('FileEarmarkRichtext','');// eslint-disable-next-line\nexport var BIconFileEarmarkRichtextFill=/*#__PURE__*/makeIcon('FileEarmarkRichtextFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkRuled=/*#__PURE__*/makeIcon('FileEarmarkRuled','');// eslint-disable-next-line\nexport var BIconFileEarmarkRuledFill=/*#__PURE__*/makeIcon('FileEarmarkRuledFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkSlides=/*#__PURE__*/makeIcon('FileEarmarkSlides','');// eslint-disable-next-line\nexport var BIconFileEarmarkSlidesFill=/*#__PURE__*/makeIcon('FileEarmarkSlidesFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkSpreadsheet=/*#__PURE__*/makeIcon('FileEarmarkSpreadsheet','');// eslint-disable-next-line\nexport var BIconFileEarmarkSpreadsheetFill=/*#__PURE__*/makeIcon('FileEarmarkSpreadsheetFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkText=/*#__PURE__*/makeIcon('FileEarmarkText','');// eslint-disable-next-line\nexport var BIconFileEarmarkTextFill=/*#__PURE__*/makeIcon('FileEarmarkTextFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkWord=/*#__PURE__*/makeIcon('FileEarmarkWord','');// eslint-disable-next-line\nexport var BIconFileEarmarkWordFill=/*#__PURE__*/makeIcon('FileEarmarkWordFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkX=/*#__PURE__*/makeIcon('FileEarmarkX','');// eslint-disable-next-line\nexport var BIconFileEarmarkXFill=/*#__PURE__*/makeIcon('FileEarmarkXFill','');// eslint-disable-next-line\nexport var BIconFileEarmarkZip=/*#__PURE__*/makeIcon('FileEarmarkZip','');// eslint-disable-next-line\nexport var BIconFileEarmarkZipFill=/*#__PURE__*/makeIcon('FileEarmarkZipFill','');// eslint-disable-next-line\nexport var BIconFileEasel=/*#__PURE__*/makeIcon('FileEasel','');// eslint-disable-next-line\nexport var BIconFileEaselFill=/*#__PURE__*/makeIcon('FileEaselFill','');// eslint-disable-next-line\nexport var BIconFileExcel=/*#__PURE__*/makeIcon('FileExcel','');// eslint-disable-next-line\nexport var BIconFileExcelFill=/*#__PURE__*/makeIcon('FileExcelFill','');// eslint-disable-next-line\nexport var BIconFileFill=/*#__PURE__*/makeIcon('FileFill','');// eslint-disable-next-line\nexport var BIconFileFont=/*#__PURE__*/makeIcon('FileFont','');// eslint-disable-next-line\nexport var BIconFileFontFill=/*#__PURE__*/makeIcon('FileFontFill','');// eslint-disable-next-line\nexport var BIconFileImage=/*#__PURE__*/makeIcon('FileImage','');// eslint-disable-next-line\nexport var BIconFileImageFill=/*#__PURE__*/makeIcon('FileImageFill','');// eslint-disable-next-line\nexport var BIconFileLock=/*#__PURE__*/makeIcon('FileLock','');// eslint-disable-next-line\nexport var BIconFileLock2=/*#__PURE__*/makeIcon('FileLock2','');// eslint-disable-next-line\nexport var BIconFileLock2Fill=/*#__PURE__*/makeIcon('FileLock2Fill','');// eslint-disable-next-line\nexport var BIconFileLockFill=/*#__PURE__*/makeIcon('FileLockFill','');// eslint-disable-next-line\nexport var BIconFileMedical=/*#__PURE__*/makeIcon('FileMedical','');// eslint-disable-next-line\nexport var BIconFileMedicalFill=/*#__PURE__*/makeIcon('FileMedicalFill','');// eslint-disable-next-line\nexport var BIconFileMinus=/*#__PURE__*/makeIcon('FileMinus','');// eslint-disable-next-line\nexport var BIconFileMinusFill=/*#__PURE__*/makeIcon('FileMinusFill','');// eslint-disable-next-line\nexport var BIconFileMusic=/*#__PURE__*/makeIcon('FileMusic','');// eslint-disable-next-line\nexport var BIconFileMusicFill=/*#__PURE__*/makeIcon('FileMusicFill','');// eslint-disable-next-line\nexport var BIconFilePdf=/*#__PURE__*/makeIcon('FilePdf','');// eslint-disable-next-line\nexport var BIconFilePdfFill=/*#__PURE__*/makeIcon('FilePdfFill','');// eslint-disable-next-line\nexport var BIconFilePerson=/*#__PURE__*/makeIcon('FilePerson','');// eslint-disable-next-line\nexport var BIconFilePersonFill=/*#__PURE__*/makeIcon('FilePersonFill','');// eslint-disable-next-line\nexport var BIconFilePlay=/*#__PURE__*/makeIcon('FilePlay','');// eslint-disable-next-line\nexport var BIconFilePlayFill=/*#__PURE__*/makeIcon('FilePlayFill','');// eslint-disable-next-line\nexport var BIconFilePlus=/*#__PURE__*/makeIcon('FilePlus','');// eslint-disable-next-line\nexport var BIconFilePlusFill=/*#__PURE__*/makeIcon('FilePlusFill','');// eslint-disable-next-line\nexport var BIconFilePost=/*#__PURE__*/makeIcon('FilePost','');// eslint-disable-next-line\nexport var BIconFilePostFill=/*#__PURE__*/makeIcon('FilePostFill','');// eslint-disable-next-line\nexport var BIconFilePpt=/*#__PURE__*/makeIcon('FilePpt','');// eslint-disable-next-line\nexport var BIconFilePptFill=/*#__PURE__*/makeIcon('FilePptFill','');// eslint-disable-next-line\nexport var BIconFileRichtext=/*#__PURE__*/makeIcon('FileRichtext','');// eslint-disable-next-line\nexport var BIconFileRichtextFill=/*#__PURE__*/makeIcon('FileRichtextFill','');// eslint-disable-next-line\nexport var BIconFileRuled=/*#__PURE__*/makeIcon('FileRuled','');// eslint-disable-next-line\nexport var BIconFileRuledFill=/*#__PURE__*/makeIcon('FileRuledFill','');// eslint-disable-next-line\nexport var BIconFileSlides=/*#__PURE__*/makeIcon('FileSlides','');// eslint-disable-next-line\nexport var BIconFileSlidesFill=/*#__PURE__*/makeIcon('FileSlidesFill','');// eslint-disable-next-line\nexport var BIconFileSpreadsheet=/*#__PURE__*/makeIcon('FileSpreadsheet','');// eslint-disable-next-line\nexport var BIconFileSpreadsheetFill=/*#__PURE__*/makeIcon('FileSpreadsheetFill','');// eslint-disable-next-line\nexport var BIconFileText=/*#__PURE__*/makeIcon('FileText','');// eslint-disable-next-line\nexport var BIconFileTextFill=/*#__PURE__*/makeIcon('FileTextFill','');// eslint-disable-next-line\nexport var BIconFileWord=/*#__PURE__*/makeIcon('FileWord','');// eslint-disable-next-line\nexport var BIconFileWordFill=/*#__PURE__*/makeIcon('FileWordFill','');// eslint-disable-next-line\nexport var BIconFileX=/*#__PURE__*/makeIcon('FileX','');// eslint-disable-next-line\nexport var BIconFileXFill=/*#__PURE__*/makeIcon('FileXFill','');// eslint-disable-next-line\nexport var BIconFileZip=/*#__PURE__*/makeIcon('FileZip','');// eslint-disable-next-line\nexport var BIconFileZipFill=/*#__PURE__*/makeIcon('FileZipFill','');// eslint-disable-next-line\nexport var BIconFiles=/*#__PURE__*/makeIcon('Files','');// eslint-disable-next-line\nexport var BIconFilesAlt=/*#__PURE__*/makeIcon('FilesAlt','');// eslint-disable-next-line\nexport var BIconFilm=/*#__PURE__*/makeIcon('Film','');// eslint-disable-next-line\nexport var BIconFilter=/*#__PURE__*/makeIcon('Filter','');// eslint-disable-next-line\nexport var BIconFilterCircle=/*#__PURE__*/makeIcon('FilterCircle','');// eslint-disable-next-line\nexport var BIconFilterCircleFill=/*#__PURE__*/makeIcon('FilterCircleFill','');// eslint-disable-next-line\nexport var BIconFilterLeft=/*#__PURE__*/makeIcon('FilterLeft','');// eslint-disable-next-line\nexport var BIconFilterRight=/*#__PURE__*/makeIcon('FilterRight','');// eslint-disable-next-line\nexport var BIconFilterSquare=/*#__PURE__*/makeIcon('FilterSquare','');// eslint-disable-next-line\nexport var BIconFilterSquareFill=/*#__PURE__*/makeIcon('FilterSquareFill','');// eslint-disable-next-line\nexport var BIconFlag=/*#__PURE__*/makeIcon('Flag','');// eslint-disable-next-line\nexport var BIconFlagFill=/*#__PURE__*/makeIcon('FlagFill','');// eslint-disable-next-line\nexport var BIconFlower1=/*#__PURE__*/makeIcon('Flower1','');// eslint-disable-next-line\nexport var BIconFlower2=/*#__PURE__*/makeIcon('Flower2','');// eslint-disable-next-line\nexport var BIconFlower3=/*#__PURE__*/makeIcon('Flower3','');// eslint-disable-next-line\nexport var BIconFolder=/*#__PURE__*/makeIcon('Folder','');// eslint-disable-next-line\nexport var BIconFolder2=/*#__PURE__*/makeIcon('Folder2','');// eslint-disable-next-line\nexport var BIconFolder2Open=/*#__PURE__*/makeIcon('Folder2Open','');// eslint-disable-next-line\nexport var BIconFolderCheck=/*#__PURE__*/makeIcon('FolderCheck','');// eslint-disable-next-line\nexport var BIconFolderFill=/*#__PURE__*/makeIcon('FolderFill','');// eslint-disable-next-line\nexport var BIconFolderMinus=/*#__PURE__*/makeIcon('FolderMinus','');// eslint-disable-next-line\nexport var BIconFolderPlus=/*#__PURE__*/makeIcon('FolderPlus','');// eslint-disable-next-line\nexport var BIconFolderSymlink=/*#__PURE__*/makeIcon('FolderSymlink','');// eslint-disable-next-line\nexport var BIconFolderSymlinkFill=/*#__PURE__*/makeIcon('FolderSymlinkFill','');// eslint-disable-next-line\nexport var BIconFolderX=/*#__PURE__*/makeIcon('FolderX','');// eslint-disable-next-line\nexport var BIconFonts=/*#__PURE__*/makeIcon('Fonts','');// eslint-disable-next-line\nexport var BIconForward=/*#__PURE__*/makeIcon('Forward','');// eslint-disable-next-line\nexport var BIconForwardFill=/*#__PURE__*/makeIcon('ForwardFill','');// eslint-disable-next-line\nexport var BIconFront=/*#__PURE__*/makeIcon('Front','');// eslint-disable-next-line\nexport var BIconFullscreen=/*#__PURE__*/makeIcon('Fullscreen','');// eslint-disable-next-line\nexport var BIconFullscreenExit=/*#__PURE__*/makeIcon('FullscreenExit','');// eslint-disable-next-line\nexport var BIconFunnel=/*#__PURE__*/makeIcon('Funnel','');// eslint-disable-next-line\nexport var BIconFunnelFill=/*#__PURE__*/makeIcon('FunnelFill','');// eslint-disable-next-line\nexport var BIconGear=/*#__PURE__*/makeIcon('Gear','');// eslint-disable-next-line\nexport var BIconGearFill=/*#__PURE__*/makeIcon('GearFill','');// eslint-disable-next-line\nexport var BIconGearWide=/*#__PURE__*/makeIcon('GearWide','');// eslint-disable-next-line\nexport var BIconGearWideConnected=/*#__PURE__*/makeIcon('GearWideConnected','');// eslint-disable-next-line\nexport var BIconGem=/*#__PURE__*/makeIcon('Gem','');// eslint-disable-next-line\nexport var BIconGenderAmbiguous=/*#__PURE__*/makeIcon('GenderAmbiguous','');// eslint-disable-next-line\nexport var BIconGenderFemale=/*#__PURE__*/makeIcon('GenderFemale','');// eslint-disable-next-line\nexport var BIconGenderMale=/*#__PURE__*/makeIcon('GenderMale','');// eslint-disable-next-line\nexport var BIconGenderTrans=/*#__PURE__*/makeIcon('GenderTrans','');// eslint-disable-next-line\nexport var BIconGeo=/*#__PURE__*/makeIcon('Geo','');// eslint-disable-next-line\nexport var BIconGeoAlt=/*#__PURE__*/makeIcon('GeoAlt','');// eslint-disable-next-line\nexport var BIconGeoAltFill=/*#__PURE__*/makeIcon('GeoAltFill','');// eslint-disable-next-line\nexport var BIconGeoFill=/*#__PURE__*/makeIcon('GeoFill','');// eslint-disable-next-line\nexport var BIconGift=/*#__PURE__*/makeIcon('Gift','');// eslint-disable-next-line\nexport var BIconGiftFill=/*#__PURE__*/makeIcon('GiftFill','');// eslint-disable-next-line\nexport var BIconGithub=/*#__PURE__*/makeIcon('Github','');// eslint-disable-next-line\nexport var BIconGlobe=/*#__PURE__*/makeIcon('Globe','');// eslint-disable-next-line\nexport var BIconGlobe2=/*#__PURE__*/makeIcon('Globe2','');// eslint-disable-next-line\nexport var BIconGoogle=/*#__PURE__*/makeIcon('Google','');// eslint-disable-next-line\nexport var BIconGraphDown=/*#__PURE__*/makeIcon('GraphDown','');// eslint-disable-next-line\nexport var BIconGraphUp=/*#__PURE__*/makeIcon('GraphUp','');// eslint-disable-next-line\nexport var BIconGrid=/*#__PURE__*/makeIcon('Grid','');// eslint-disable-next-line\nexport var BIconGrid1x2=/*#__PURE__*/makeIcon('Grid1x2','');// eslint-disable-next-line\nexport var BIconGrid1x2Fill=/*#__PURE__*/makeIcon('Grid1x2Fill','');// eslint-disable-next-line\nexport var BIconGrid3x2=/*#__PURE__*/makeIcon('Grid3x2','');// eslint-disable-next-line\nexport var BIconGrid3x2Gap=/*#__PURE__*/makeIcon('Grid3x2Gap','');// eslint-disable-next-line\nexport var BIconGrid3x2GapFill=/*#__PURE__*/makeIcon('Grid3x2GapFill','');// eslint-disable-next-line\nexport var BIconGrid3x3=/*#__PURE__*/makeIcon('Grid3x3','');// eslint-disable-next-line\nexport var BIconGrid3x3Gap=/*#__PURE__*/makeIcon('Grid3x3Gap','');// eslint-disable-next-line\nexport var BIconGrid3x3GapFill=/*#__PURE__*/makeIcon('Grid3x3GapFill','');// eslint-disable-next-line\nexport var BIconGridFill=/*#__PURE__*/makeIcon('GridFill','');// eslint-disable-next-line\nexport var BIconGripHorizontal=/*#__PURE__*/makeIcon('GripHorizontal','');// eslint-disable-next-line\nexport var BIconGripVertical=/*#__PURE__*/makeIcon('GripVertical','');// eslint-disable-next-line\nexport var BIconHammer=/*#__PURE__*/makeIcon('Hammer','');// eslint-disable-next-line\nexport var BIconHandIndex=/*#__PURE__*/makeIcon('HandIndex','');// eslint-disable-next-line\nexport var BIconHandIndexFill=/*#__PURE__*/makeIcon('HandIndexFill','');// eslint-disable-next-line\nexport var BIconHandIndexThumb=/*#__PURE__*/makeIcon('HandIndexThumb','');// eslint-disable-next-line\nexport var BIconHandIndexThumbFill=/*#__PURE__*/makeIcon('HandIndexThumbFill','');// eslint-disable-next-line\nexport var BIconHandThumbsDown=/*#__PURE__*/makeIcon('HandThumbsDown','');// eslint-disable-next-line\nexport var BIconHandThumbsDownFill=/*#__PURE__*/makeIcon('HandThumbsDownFill','');// eslint-disable-next-line\nexport var BIconHandThumbsUp=/*#__PURE__*/makeIcon('HandThumbsUp','');// eslint-disable-next-line\nexport var BIconHandThumbsUpFill=/*#__PURE__*/makeIcon('HandThumbsUpFill','');// eslint-disable-next-line\nexport var BIconHandbag=/*#__PURE__*/makeIcon('Handbag','');// eslint-disable-next-line\nexport var BIconHandbagFill=/*#__PURE__*/makeIcon('HandbagFill','');// eslint-disable-next-line\nexport var BIconHash=/*#__PURE__*/makeIcon('Hash','');// eslint-disable-next-line\nexport var BIconHdd=/*#__PURE__*/makeIcon('Hdd','');// eslint-disable-next-line\nexport var BIconHddFill=/*#__PURE__*/makeIcon('HddFill','');// eslint-disable-next-line\nexport var BIconHddNetwork=/*#__PURE__*/makeIcon('HddNetwork','');// eslint-disable-next-line\nexport var BIconHddNetworkFill=/*#__PURE__*/makeIcon('HddNetworkFill','');// eslint-disable-next-line\nexport var BIconHddRack=/*#__PURE__*/makeIcon('HddRack','');// eslint-disable-next-line\nexport var BIconHddRackFill=/*#__PURE__*/makeIcon('HddRackFill','');// eslint-disable-next-line\nexport var BIconHddStack=/*#__PURE__*/makeIcon('HddStack','');// eslint-disable-next-line\nexport var BIconHddStackFill=/*#__PURE__*/makeIcon('HddStackFill','');// eslint-disable-next-line\nexport var BIconHeadphones=/*#__PURE__*/makeIcon('Headphones','');// eslint-disable-next-line\nexport var BIconHeadset=/*#__PURE__*/makeIcon('Headset','');// eslint-disable-next-line\nexport var BIconHeadsetVr=/*#__PURE__*/makeIcon('HeadsetVr','');// eslint-disable-next-line\nexport var BIconHeart=/*#__PURE__*/makeIcon('Heart','');// eslint-disable-next-line\nexport var BIconHeartFill=/*#__PURE__*/makeIcon('HeartFill','');// eslint-disable-next-line\nexport var BIconHeartHalf=/*#__PURE__*/makeIcon('HeartHalf','');// eslint-disable-next-line\nexport var BIconHeptagon=/*#__PURE__*/makeIcon('Heptagon','');// eslint-disable-next-line\nexport var BIconHeptagonFill=/*#__PURE__*/makeIcon('HeptagonFill','');// eslint-disable-next-line\nexport var BIconHeptagonHalf=/*#__PURE__*/makeIcon('HeptagonHalf','');// eslint-disable-next-line\nexport var BIconHexagon=/*#__PURE__*/makeIcon('Hexagon','');// eslint-disable-next-line\nexport var BIconHexagonFill=/*#__PURE__*/makeIcon('HexagonFill','');// eslint-disable-next-line\nexport var BIconHexagonHalf=/*#__PURE__*/makeIcon('HexagonHalf','');// eslint-disable-next-line\nexport var BIconHourglass=/*#__PURE__*/makeIcon('Hourglass','');// eslint-disable-next-line\nexport var BIconHourglassBottom=/*#__PURE__*/makeIcon('HourglassBottom','');// eslint-disable-next-line\nexport var BIconHourglassSplit=/*#__PURE__*/makeIcon('HourglassSplit','');// eslint-disable-next-line\nexport var BIconHourglassTop=/*#__PURE__*/makeIcon('HourglassTop','');// eslint-disable-next-line\nexport var BIconHouse=/*#__PURE__*/makeIcon('House','');// eslint-disable-next-line\nexport var BIconHouseDoor=/*#__PURE__*/makeIcon('HouseDoor','');// eslint-disable-next-line\nexport var BIconHouseDoorFill=/*#__PURE__*/makeIcon('HouseDoorFill','');// eslint-disable-next-line\nexport var BIconHouseFill=/*#__PURE__*/makeIcon('HouseFill','');// eslint-disable-next-line\nexport var BIconHr=/*#__PURE__*/makeIcon('Hr','');// eslint-disable-next-line\nexport var BIconHurricane=/*#__PURE__*/makeIcon('Hurricane','');// eslint-disable-next-line\nexport var BIconImage=/*#__PURE__*/makeIcon('Image','');// eslint-disable-next-line\nexport var BIconImageAlt=/*#__PURE__*/makeIcon('ImageAlt','');// eslint-disable-next-line\nexport var BIconImageFill=/*#__PURE__*/makeIcon('ImageFill','');// eslint-disable-next-line\nexport var BIconImages=/*#__PURE__*/makeIcon('Images','');// eslint-disable-next-line\nexport var BIconInbox=/*#__PURE__*/makeIcon('Inbox','');// eslint-disable-next-line\nexport var BIconInboxFill=/*#__PURE__*/makeIcon('InboxFill','');// eslint-disable-next-line\nexport var BIconInboxes=/*#__PURE__*/makeIcon('Inboxes','');// eslint-disable-next-line\nexport var BIconInboxesFill=/*#__PURE__*/makeIcon('InboxesFill','');// eslint-disable-next-line\nexport var BIconInfo=/*#__PURE__*/makeIcon('Info','');// eslint-disable-next-line\nexport var BIconInfoCircle=/*#__PURE__*/makeIcon('InfoCircle','');// eslint-disable-next-line\nexport var BIconInfoCircleFill=/*#__PURE__*/makeIcon('InfoCircleFill','');// eslint-disable-next-line\nexport var BIconInfoLg=/*#__PURE__*/makeIcon('InfoLg','');// eslint-disable-next-line\nexport var BIconInfoSquare=/*#__PURE__*/makeIcon('InfoSquare','');// eslint-disable-next-line\nexport var BIconInfoSquareFill=/*#__PURE__*/makeIcon('InfoSquareFill','');// eslint-disable-next-line\nexport var BIconInputCursor=/*#__PURE__*/makeIcon('InputCursor','');// eslint-disable-next-line\nexport var BIconInputCursorText=/*#__PURE__*/makeIcon('InputCursorText','');// eslint-disable-next-line\nexport var BIconInstagram=/*#__PURE__*/makeIcon('Instagram','');// eslint-disable-next-line\nexport var BIconIntersect=/*#__PURE__*/makeIcon('Intersect','');// eslint-disable-next-line\nexport var BIconJournal=/*#__PURE__*/makeIcon('Journal','');// eslint-disable-next-line\nexport var BIconJournalAlbum=/*#__PURE__*/makeIcon('JournalAlbum','');// eslint-disable-next-line\nexport var BIconJournalArrowDown=/*#__PURE__*/makeIcon('JournalArrowDown','');// eslint-disable-next-line\nexport var BIconJournalArrowUp=/*#__PURE__*/makeIcon('JournalArrowUp','');// eslint-disable-next-line\nexport var BIconJournalBookmark=/*#__PURE__*/makeIcon('JournalBookmark','');// eslint-disable-next-line\nexport var BIconJournalBookmarkFill=/*#__PURE__*/makeIcon('JournalBookmarkFill','');// eslint-disable-next-line\nexport var BIconJournalCheck=/*#__PURE__*/makeIcon('JournalCheck','');// eslint-disable-next-line\nexport var BIconJournalCode=/*#__PURE__*/makeIcon('JournalCode','');// eslint-disable-next-line\nexport var BIconJournalMedical=/*#__PURE__*/makeIcon('JournalMedical','');// eslint-disable-next-line\nexport var BIconJournalMinus=/*#__PURE__*/makeIcon('JournalMinus','');// eslint-disable-next-line\nexport var BIconJournalPlus=/*#__PURE__*/makeIcon('JournalPlus','');// eslint-disable-next-line\nexport var BIconJournalRichtext=/*#__PURE__*/makeIcon('JournalRichtext','');// eslint-disable-next-line\nexport var BIconJournalText=/*#__PURE__*/makeIcon('JournalText','');// eslint-disable-next-line\nexport var BIconJournalX=/*#__PURE__*/makeIcon('JournalX','');// eslint-disable-next-line\nexport var BIconJournals=/*#__PURE__*/makeIcon('Journals','');// eslint-disable-next-line\nexport var BIconJoystick=/*#__PURE__*/makeIcon('Joystick','');// eslint-disable-next-line\nexport var BIconJustify=/*#__PURE__*/makeIcon('Justify','');// eslint-disable-next-line\nexport var BIconJustifyLeft=/*#__PURE__*/makeIcon('JustifyLeft','');// eslint-disable-next-line\nexport var BIconJustifyRight=/*#__PURE__*/makeIcon('JustifyRight','');// eslint-disable-next-line\nexport var BIconKanban=/*#__PURE__*/makeIcon('Kanban','');// eslint-disable-next-line\nexport var BIconKanbanFill=/*#__PURE__*/makeIcon('KanbanFill','');// eslint-disable-next-line\nexport var BIconKey=/*#__PURE__*/makeIcon('Key','');// eslint-disable-next-line\nexport var BIconKeyFill=/*#__PURE__*/makeIcon('KeyFill','');// eslint-disable-next-line\nexport var BIconKeyboard=/*#__PURE__*/makeIcon('Keyboard','');// eslint-disable-next-line\nexport var BIconKeyboardFill=/*#__PURE__*/makeIcon('KeyboardFill','');// eslint-disable-next-line\nexport var BIconLadder=/*#__PURE__*/makeIcon('Ladder','');// eslint-disable-next-line\nexport var BIconLamp=/*#__PURE__*/makeIcon('Lamp','');// eslint-disable-next-line\nexport var BIconLampFill=/*#__PURE__*/makeIcon('LampFill','');// eslint-disable-next-line\nexport var BIconLaptop=/*#__PURE__*/makeIcon('Laptop','');// eslint-disable-next-line\nexport var BIconLaptopFill=/*#__PURE__*/makeIcon('LaptopFill','');// eslint-disable-next-line\nexport var BIconLayerBackward=/*#__PURE__*/makeIcon('LayerBackward','');// eslint-disable-next-line\nexport var BIconLayerForward=/*#__PURE__*/makeIcon('LayerForward','');// eslint-disable-next-line\nexport var BIconLayers=/*#__PURE__*/makeIcon('Layers','');// eslint-disable-next-line\nexport var BIconLayersFill=/*#__PURE__*/makeIcon('LayersFill','');// eslint-disable-next-line\nexport var BIconLayersHalf=/*#__PURE__*/makeIcon('LayersHalf','');// eslint-disable-next-line\nexport var BIconLayoutSidebar=/*#__PURE__*/makeIcon('LayoutSidebar','');// eslint-disable-next-line\nexport var BIconLayoutSidebarInset=/*#__PURE__*/makeIcon('LayoutSidebarInset','');// eslint-disable-next-line\nexport var BIconLayoutSidebarInsetReverse=/*#__PURE__*/makeIcon('LayoutSidebarInsetReverse','');// eslint-disable-next-line\nexport var BIconLayoutSidebarReverse=/*#__PURE__*/makeIcon('LayoutSidebarReverse','');// eslint-disable-next-line\nexport var BIconLayoutSplit=/*#__PURE__*/makeIcon('LayoutSplit','');// eslint-disable-next-line\nexport var BIconLayoutTextSidebar=/*#__PURE__*/makeIcon('LayoutTextSidebar','');// eslint-disable-next-line\nexport var BIconLayoutTextSidebarReverse=/*#__PURE__*/makeIcon('LayoutTextSidebarReverse','');// eslint-disable-next-line\nexport var BIconLayoutTextWindow=/*#__PURE__*/makeIcon('LayoutTextWindow','');// eslint-disable-next-line\nexport var BIconLayoutTextWindowReverse=/*#__PURE__*/makeIcon('LayoutTextWindowReverse','');// eslint-disable-next-line\nexport var BIconLayoutThreeColumns=/*#__PURE__*/makeIcon('LayoutThreeColumns','');// eslint-disable-next-line\nexport var BIconLayoutWtf=/*#__PURE__*/makeIcon('LayoutWtf','');// eslint-disable-next-line\nexport var BIconLifePreserver=/*#__PURE__*/makeIcon('LifePreserver','');// eslint-disable-next-line\nexport var BIconLightbulb=/*#__PURE__*/makeIcon('Lightbulb','');// eslint-disable-next-line\nexport var BIconLightbulbFill=/*#__PURE__*/makeIcon('LightbulbFill','');// eslint-disable-next-line\nexport var BIconLightbulbOff=/*#__PURE__*/makeIcon('LightbulbOff','');// eslint-disable-next-line\nexport var BIconLightbulbOffFill=/*#__PURE__*/makeIcon('LightbulbOffFill','');// eslint-disable-next-line\nexport var BIconLightning=/*#__PURE__*/makeIcon('Lightning','');// eslint-disable-next-line\nexport var BIconLightningCharge=/*#__PURE__*/makeIcon('LightningCharge','');// eslint-disable-next-line\nexport var BIconLightningChargeFill=/*#__PURE__*/makeIcon('LightningChargeFill','');// eslint-disable-next-line\nexport var BIconLightningFill=/*#__PURE__*/makeIcon('LightningFill','');// eslint-disable-next-line\nexport var BIconLink=/*#__PURE__*/makeIcon('Link','');// eslint-disable-next-line\nexport var BIconLink45deg=/*#__PURE__*/makeIcon('Link45deg','');// eslint-disable-next-line\nexport var BIconLinkedin=/*#__PURE__*/makeIcon('Linkedin','');// eslint-disable-next-line\nexport var BIconList=/*#__PURE__*/makeIcon('List','');// eslint-disable-next-line\nexport var BIconListCheck=/*#__PURE__*/makeIcon('ListCheck','');// eslint-disable-next-line\nexport var BIconListNested=/*#__PURE__*/makeIcon('ListNested','');// eslint-disable-next-line\nexport var BIconListOl=/*#__PURE__*/makeIcon('ListOl','');// eslint-disable-next-line\nexport var BIconListStars=/*#__PURE__*/makeIcon('ListStars','');// eslint-disable-next-line\nexport var BIconListTask=/*#__PURE__*/makeIcon('ListTask','');// eslint-disable-next-line\nexport var BIconListUl=/*#__PURE__*/makeIcon('ListUl','');// eslint-disable-next-line\nexport var BIconLock=/*#__PURE__*/makeIcon('Lock','');// eslint-disable-next-line\nexport var BIconLockFill=/*#__PURE__*/makeIcon('LockFill','');// eslint-disable-next-line\nexport var BIconMailbox=/*#__PURE__*/makeIcon('Mailbox','');// eslint-disable-next-line\nexport var BIconMailbox2=/*#__PURE__*/makeIcon('Mailbox2','');// eslint-disable-next-line\nexport var BIconMap=/*#__PURE__*/makeIcon('Map','');// eslint-disable-next-line\nexport var BIconMapFill=/*#__PURE__*/makeIcon('MapFill','');// eslint-disable-next-line\nexport var BIconMarkdown=/*#__PURE__*/makeIcon('Markdown','');// eslint-disable-next-line\nexport var BIconMarkdownFill=/*#__PURE__*/makeIcon('MarkdownFill','');// eslint-disable-next-line\nexport var BIconMask=/*#__PURE__*/makeIcon('Mask','');// eslint-disable-next-line\nexport var BIconMastodon=/*#__PURE__*/makeIcon('Mastodon','');// eslint-disable-next-line\nexport var BIconMegaphone=/*#__PURE__*/makeIcon('Megaphone','');// eslint-disable-next-line\nexport var BIconMegaphoneFill=/*#__PURE__*/makeIcon('MegaphoneFill','');// eslint-disable-next-line\nexport var BIconMenuApp=/*#__PURE__*/makeIcon('MenuApp','');// eslint-disable-next-line\nexport var BIconMenuAppFill=/*#__PURE__*/makeIcon('MenuAppFill','');// eslint-disable-next-line\nexport var BIconMenuButton=/*#__PURE__*/makeIcon('MenuButton','');// eslint-disable-next-line\nexport var BIconMenuButtonFill=/*#__PURE__*/makeIcon('MenuButtonFill','');// eslint-disable-next-line\nexport var BIconMenuButtonWide=/*#__PURE__*/makeIcon('MenuButtonWide','');// eslint-disable-next-line\nexport var BIconMenuButtonWideFill=/*#__PURE__*/makeIcon('MenuButtonWideFill','');// eslint-disable-next-line\nexport var BIconMenuDown=/*#__PURE__*/makeIcon('MenuDown','');// eslint-disable-next-line\nexport var BIconMenuUp=/*#__PURE__*/makeIcon('MenuUp','');// eslint-disable-next-line\nexport var BIconMessenger=/*#__PURE__*/makeIcon('Messenger','');// eslint-disable-next-line\nexport var BIconMic=/*#__PURE__*/makeIcon('Mic','');// eslint-disable-next-line\nexport var BIconMicFill=/*#__PURE__*/makeIcon('MicFill','');// eslint-disable-next-line\nexport var BIconMicMute=/*#__PURE__*/makeIcon('MicMute','');// eslint-disable-next-line\nexport var BIconMicMuteFill=/*#__PURE__*/makeIcon('MicMuteFill','');// eslint-disable-next-line\nexport var BIconMinecart=/*#__PURE__*/makeIcon('Minecart','');// eslint-disable-next-line\nexport var BIconMinecartLoaded=/*#__PURE__*/makeIcon('MinecartLoaded','');// eslint-disable-next-line\nexport var BIconMoisture=/*#__PURE__*/makeIcon('Moisture','');// eslint-disable-next-line\nexport var BIconMoon=/*#__PURE__*/makeIcon('Moon','');// eslint-disable-next-line\nexport var BIconMoonFill=/*#__PURE__*/makeIcon('MoonFill','');// eslint-disable-next-line\nexport var BIconMoonStars=/*#__PURE__*/makeIcon('MoonStars','');// eslint-disable-next-line\nexport var BIconMoonStarsFill=/*#__PURE__*/makeIcon('MoonStarsFill','');// eslint-disable-next-line\nexport var BIconMouse=/*#__PURE__*/makeIcon('Mouse','');// eslint-disable-next-line\nexport var BIconMouse2=/*#__PURE__*/makeIcon('Mouse2','');// eslint-disable-next-line\nexport var BIconMouse2Fill=/*#__PURE__*/makeIcon('Mouse2Fill','');// eslint-disable-next-line\nexport var BIconMouse3=/*#__PURE__*/makeIcon('Mouse3','');// eslint-disable-next-line\nexport var BIconMouse3Fill=/*#__PURE__*/makeIcon('Mouse3Fill','');// eslint-disable-next-line\nexport var BIconMouseFill=/*#__PURE__*/makeIcon('MouseFill','');// eslint-disable-next-line\nexport var BIconMusicNote=/*#__PURE__*/makeIcon('MusicNote','');// eslint-disable-next-line\nexport var BIconMusicNoteBeamed=/*#__PURE__*/makeIcon('MusicNoteBeamed','');// eslint-disable-next-line\nexport var BIconMusicNoteList=/*#__PURE__*/makeIcon('MusicNoteList','');// eslint-disable-next-line\nexport var BIconMusicPlayer=/*#__PURE__*/makeIcon('MusicPlayer','');// eslint-disable-next-line\nexport var BIconMusicPlayerFill=/*#__PURE__*/makeIcon('MusicPlayerFill','');// eslint-disable-next-line\nexport var BIconNewspaper=/*#__PURE__*/makeIcon('Newspaper','');// eslint-disable-next-line\nexport var BIconNodeMinus=/*#__PURE__*/makeIcon('NodeMinus','');// eslint-disable-next-line\nexport var BIconNodeMinusFill=/*#__PURE__*/makeIcon('NodeMinusFill','');// eslint-disable-next-line\nexport var BIconNodePlus=/*#__PURE__*/makeIcon('NodePlus','');// eslint-disable-next-line\nexport var BIconNodePlusFill=/*#__PURE__*/makeIcon('NodePlusFill','');// eslint-disable-next-line\nexport var BIconNut=/*#__PURE__*/makeIcon('Nut','');// eslint-disable-next-line\nexport var BIconNutFill=/*#__PURE__*/makeIcon('NutFill','');// eslint-disable-next-line\nexport var BIconOctagon=/*#__PURE__*/makeIcon('Octagon','');// eslint-disable-next-line\nexport var BIconOctagonFill=/*#__PURE__*/makeIcon('OctagonFill','');// eslint-disable-next-line\nexport var BIconOctagonHalf=/*#__PURE__*/makeIcon('OctagonHalf','');// eslint-disable-next-line\nexport var BIconOption=/*#__PURE__*/makeIcon('Option','');// eslint-disable-next-line\nexport var BIconOutlet=/*#__PURE__*/makeIcon('Outlet','');// eslint-disable-next-line\nexport var BIconPaintBucket=/*#__PURE__*/makeIcon('PaintBucket','');// eslint-disable-next-line\nexport var BIconPalette=/*#__PURE__*/makeIcon('Palette','');// eslint-disable-next-line\nexport var BIconPalette2=/*#__PURE__*/makeIcon('Palette2','');// eslint-disable-next-line\nexport var BIconPaletteFill=/*#__PURE__*/makeIcon('PaletteFill','');// eslint-disable-next-line\nexport var BIconPaperclip=/*#__PURE__*/makeIcon('Paperclip','');// eslint-disable-next-line\nexport var BIconParagraph=/*#__PURE__*/makeIcon('Paragraph','');// eslint-disable-next-line\nexport var BIconPatchCheck=/*#__PURE__*/makeIcon('PatchCheck','');// eslint-disable-next-line\nexport var BIconPatchCheckFill=/*#__PURE__*/makeIcon('PatchCheckFill','');// eslint-disable-next-line\nexport var BIconPatchExclamation=/*#__PURE__*/makeIcon('PatchExclamation','');// eslint-disable-next-line\nexport var BIconPatchExclamationFill=/*#__PURE__*/makeIcon('PatchExclamationFill','');// eslint-disable-next-line\nexport var BIconPatchMinus=/*#__PURE__*/makeIcon('PatchMinus','');// eslint-disable-next-line\nexport var BIconPatchMinusFill=/*#__PURE__*/makeIcon('PatchMinusFill','');// eslint-disable-next-line\nexport var BIconPatchPlus=/*#__PURE__*/makeIcon('PatchPlus','');// eslint-disable-next-line\nexport var BIconPatchPlusFill=/*#__PURE__*/makeIcon('PatchPlusFill','');// eslint-disable-next-line\nexport var BIconPatchQuestion=/*#__PURE__*/makeIcon('PatchQuestion','');// eslint-disable-next-line\nexport var BIconPatchQuestionFill=/*#__PURE__*/makeIcon('PatchQuestionFill','');// eslint-disable-next-line\nexport var BIconPause=/*#__PURE__*/makeIcon('Pause','');// eslint-disable-next-line\nexport var BIconPauseBtn=/*#__PURE__*/makeIcon('PauseBtn','');// eslint-disable-next-line\nexport var BIconPauseBtnFill=/*#__PURE__*/makeIcon('PauseBtnFill','');// eslint-disable-next-line\nexport var BIconPauseCircle=/*#__PURE__*/makeIcon('PauseCircle','');// eslint-disable-next-line\nexport var BIconPauseCircleFill=/*#__PURE__*/makeIcon('PauseCircleFill','');// eslint-disable-next-line\nexport var BIconPauseFill=/*#__PURE__*/makeIcon('PauseFill','');// eslint-disable-next-line\nexport var BIconPeace=/*#__PURE__*/makeIcon('Peace','');// eslint-disable-next-line\nexport var BIconPeaceFill=/*#__PURE__*/makeIcon('PeaceFill','');// eslint-disable-next-line\nexport var BIconPen=/*#__PURE__*/makeIcon('Pen','');// eslint-disable-next-line\nexport var BIconPenFill=/*#__PURE__*/makeIcon('PenFill','');// eslint-disable-next-line\nexport var BIconPencil=/*#__PURE__*/makeIcon('Pencil','');// eslint-disable-next-line\nexport var BIconPencilFill=/*#__PURE__*/makeIcon('PencilFill','');// eslint-disable-next-line\nexport var BIconPencilSquare=/*#__PURE__*/makeIcon('PencilSquare','');// eslint-disable-next-line\nexport var BIconPentagon=/*#__PURE__*/makeIcon('Pentagon','');// eslint-disable-next-line\nexport var BIconPentagonFill=/*#__PURE__*/makeIcon('PentagonFill','');// eslint-disable-next-line\nexport var BIconPentagonHalf=/*#__PURE__*/makeIcon('PentagonHalf','');// eslint-disable-next-line\nexport var BIconPeople=/*#__PURE__*/makeIcon('People','');// eslint-disable-next-line\nexport var BIconPeopleFill=/*#__PURE__*/makeIcon('PeopleFill','');// eslint-disable-next-line\nexport var BIconPercent=/*#__PURE__*/makeIcon('Percent','');// eslint-disable-next-line\nexport var BIconPerson=/*#__PURE__*/makeIcon('Person','');// eslint-disable-next-line\nexport var BIconPersonBadge=/*#__PURE__*/makeIcon('PersonBadge','');// eslint-disable-next-line\nexport var BIconPersonBadgeFill=/*#__PURE__*/makeIcon('PersonBadgeFill','');// eslint-disable-next-line\nexport var BIconPersonBoundingBox=/*#__PURE__*/makeIcon('PersonBoundingBox','');// eslint-disable-next-line\nexport var BIconPersonCheck=/*#__PURE__*/makeIcon('PersonCheck','');// eslint-disable-next-line\nexport var BIconPersonCheckFill=/*#__PURE__*/makeIcon('PersonCheckFill','');// eslint-disable-next-line\nexport var BIconPersonCircle=/*#__PURE__*/makeIcon('PersonCircle','');// eslint-disable-next-line\nexport var BIconPersonDash=/*#__PURE__*/makeIcon('PersonDash','');// eslint-disable-next-line\nexport var BIconPersonDashFill=/*#__PURE__*/makeIcon('PersonDashFill','');// eslint-disable-next-line\nexport var BIconPersonFill=/*#__PURE__*/makeIcon('PersonFill','');// eslint-disable-next-line\nexport var BIconPersonLinesFill=/*#__PURE__*/makeIcon('PersonLinesFill','');// eslint-disable-next-line\nexport var BIconPersonPlus=/*#__PURE__*/makeIcon('PersonPlus','');// eslint-disable-next-line\nexport var BIconPersonPlusFill=/*#__PURE__*/makeIcon('PersonPlusFill','');// eslint-disable-next-line\nexport var BIconPersonSquare=/*#__PURE__*/makeIcon('PersonSquare','');// eslint-disable-next-line\nexport var BIconPersonX=/*#__PURE__*/makeIcon('PersonX','');// eslint-disable-next-line\nexport var BIconPersonXFill=/*#__PURE__*/makeIcon('PersonXFill','');// eslint-disable-next-line\nexport var BIconPhone=/*#__PURE__*/makeIcon('Phone','');// eslint-disable-next-line\nexport var BIconPhoneFill=/*#__PURE__*/makeIcon('PhoneFill','');// eslint-disable-next-line\nexport var BIconPhoneLandscape=/*#__PURE__*/makeIcon('PhoneLandscape','');// eslint-disable-next-line\nexport var BIconPhoneLandscapeFill=/*#__PURE__*/makeIcon('PhoneLandscapeFill','');// eslint-disable-next-line\nexport var BIconPhoneVibrate=/*#__PURE__*/makeIcon('PhoneVibrate','');// eslint-disable-next-line\nexport var BIconPhoneVibrateFill=/*#__PURE__*/makeIcon('PhoneVibrateFill','');// eslint-disable-next-line\nexport var BIconPieChart=/*#__PURE__*/makeIcon('PieChart','');// eslint-disable-next-line\nexport var BIconPieChartFill=/*#__PURE__*/makeIcon('PieChartFill','');// eslint-disable-next-line\nexport var BIconPiggyBank=/*#__PURE__*/makeIcon('PiggyBank','');// eslint-disable-next-line\nexport var BIconPiggyBankFill=/*#__PURE__*/makeIcon('PiggyBankFill','');// eslint-disable-next-line\nexport var BIconPin=/*#__PURE__*/makeIcon('Pin','');// eslint-disable-next-line\nexport var BIconPinAngle=/*#__PURE__*/makeIcon('PinAngle','');// eslint-disable-next-line\nexport var BIconPinAngleFill=/*#__PURE__*/makeIcon('PinAngleFill','');// eslint-disable-next-line\nexport var BIconPinFill=/*#__PURE__*/makeIcon('PinFill','');// eslint-disable-next-line\nexport var BIconPinMap=/*#__PURE__*/makeIcon('PinMap','');// eslint-disable-next-line\nexport var BIconPinMapFill=/*#__PURE__*/makeIcon('PinMapFill','');// eslint-disable-next-line\nexport var BIconPip=/*#__PURE__*/makeIcon('Pip','');// eslint-disable-next-line\nexport var BIconPipFill=/*#__PURE__*/makeIcon('PipFill','');// eslint-disable-next-line\nexport var BIconPlay=/*#__PURE__*/makeIcon('Play','');// eslint-disable-next-line\nexport var BIconPlayBtn=/*#__PURE__*/makeIcon('PlayBtn','');// eslint-disable-next-line\nexport var BIconPlayBtnFill=/*#__PURE__*/makeIcon('PlayBtnFill','');// eslint-disable-next-line\nexport var BIconPlayCircle=/*#__PURE__*/makeIcon('PlayCircle','');// eslint-disable-next-line\nexport var BIconPlayCircleFill=/*#__PURE__*/makeIcon('PlayCircleFill','');// eslint-disable-next-line\nexport var BIconPlayFill=/*#__PURE__*/makeIcon('PlayFill','');// eslint-disable-next-line\nexport var BIconPlug=/*#__PURE__*/makeIcon('Plug','');// eslint-disable-next-line\nexport var BIconPlugFill=/*#__PURE__*/makeIcon('PlugFill','');// eslint-disable-next-line\nexport var BIconPlus=/*#__PURE__*/makeIcon('Plus','');// eslint-disable-next-line\nexport var BIconPlusCircle=/*#__PURE__*/makeIcon('PlusCircle','');// eslint-disable-next-line\nexport var BIconPlusCircleDotted=/*#__PURE__*/makeIcon('PlusCircleDotted','');// eslint-disable-next-line\nexport var BIconPlusCircleFill=/*#__PURE__*/makeIcon('PlusCircleFill','');// eslint-disable-next-line\nexport var BIconPlusLg=/*#__PURE__*/makeIcon('PlusLg','');// eslint-disable-next-line\nexport var BIconPlusSquare=/*#__PURE__*/makeIcon('PlusSquare','');// eslint-disable-next-line\nexport var BIconPlusSquareDotted=/*#__PURE__*/makeIcon('PlusSquareDotted','');// eslint-disable-next-line\nexport var BIconPlusSquareFill=/*#__PURE__*/makeIcon('PlusSquareFill','');// eslint-disable-next-line\nexport var BIconPower=/*#__PURE__*/makeIcon('Power','');// eslint-disable-next-line\nexport var BIconPrinter=/*#__PURE__*/makeIcon('Printer','');// eslint-disable-next-line\nexport var BIconPrinterFill=/*#__PURE__*/makeIcon('PrinterFill','');// eslint-disable-next-line\nexport var BIconPuzzle=/*#__PURE__*/makeIcon('Puzzle','');// eslint-disable-next-line\nexport var BIconPuzzleFill=/*#__PURE__*/makeIcon('PuzzleFill','');// eslint-disable-next-line\nexport var BIconQuestion=/*#__PURE__*/makeIcon('Question','');// eslint-disable-next-line\nexport var BIconQuestionCircle=/*#__PURE__*/makeIcon('QuestionCircle','');// eslint-disable-next-line\nexport var BIconQuestionCircleFill=/*#__PURE__*/makeIcon('QuestionCircleFill','');// eslint-disable-next-line\nexport var BIconQuestionDiamond=/*#__PURE__*/makeIcon('QuestionDiamond','');// eslint-disable-next-line\nexport var BIconQuestionDiamondFill=/*#__PURE__*/makeIcon('QuestionDiamondFill','');// eslint-disable-next-line\nexport var BIconQuestionLg=/*#__PURE__*/makeIcon('QuestionLg','');// eslint-disable-next-line\nexport var BIconQuestionOctagon=/*#__PURE__*/makeIcon('QuestionOctagon','');// eslint-disable-next-line\nexport var BIconQuestionOctagonFill=/*#__PURE__*/makeIcon('QuestionOctagonFill','');// eslint-disable-next-line\nexport var BIconQuestionSquare=/*#__PURE__*/makeIcon('QuestionSquare','');// eslint-disable-next-line\nexport var BIconQuestionSquareFill=/*#__PURE__*/makeIcon('QuestionSquareFill','');// eslint-disable-next-line\nexport var BIconRainbow=/*#__PURE__*/makeIcon('Rainbow','');// eslint-disable-next-line\nexport var BIconReceipt=/*#__PURE__*/makeIcon('Receipt','');// eslint-disable-next-line\nexport var BIconReceiptCutoff=/*#__PURE__*/makeIcon('ReceiptCutoff','');// eslint-disable-next-line\nexport var BIconReception0=/*#__PURE__*/makeIcon('Reception0','');// eslint-disable-next-line\nexport var BIconReception1=/*#__PURE__*/makeIcon('Reception1','');// eslint-disable-next-line\nexport var BIconReception2=/*#__PURE__*/makeIcon('Reception2','');// eslint-disable-next-line\nexport var BIconReception3=/*#__PURE__*/makeIcon('Reception3','');// eslint-disable-next-line\nexport var BIconReception4=/*#__PURE__*/makeIcon('Reception4','');// eslint-disable-next-line\nexport var BIconRecord=/*#__PURE__*/makeIcon('Record','');// eslint-disable-next-line\nexport var BIconRecord2=/*#__PURE__*/makeIcon('Record2','');// eslint-disable-next-line\nexport var BIconRecord2Fill=/*#__PURE__*/makeIcon('Record2Fill','');// eslint-disable-next-line\nexport var BIconRecordBtn=/*#__PURE__*/makeIcon('RecordBtn','');// eslint-disable-next-line\nexport var BIconRecordBtnFill=/*#__PURE__*/makeIcon('RecordBtnFill','');// eslint-disable-next-line\nexport var BIconRecordCircle=/*#__PURE__*/makeIcon('RecordCircle','');// eslint-disable-next-line\nexport var BIconRecordCircleFill=/*#__PURE__*/makeIcon('RecordCircleFill','');// eslint-disable-next-line\nexport var BIconRecordFill=/*#__PURE__*/makeIcon('RecordFill','');// eslint-disable-next-line\nexport var BIconRecycle=/*#__PURE__*/makeIcon('Recycle','');// eslint-disable-next-line\nexport var BIconReddit=/*#__PURE__*/makeIcon('Reddit','');// eslint-disable-next-line\nexport var BIconReply=/*#__PURE__*/makeIcon('Reply','');// eslint-disable-next-line\nexport var BIconReplyAll=/*#__PURE__*/makeIcon('ReplyAll','');// eslint-disable-next-line\nexport var BIconReplyAllFill=/*#__PURE__*/makeIcon('ReplyAllFill','');// eslint-disable-next-line\nexport var BIconReplyFill=/*#__PURE__*/makeIcon('ReplyFill','');// eslint-disable-next-line\nexport var BIconRss=/*#__PURE__*/makeIcon('Rss','');// eslint-disable-next-line\nexport var BIconRssFill=/*#__PURE__*/makeIcon('RssFill','');// eslint-disable-next-line\nexport var BIconRulers=/*#__PURE__*/makeIcon('Rulers','');// eslint-disable-next-line\nexport var BIconSafe=/*#__PURE__*/makeIcon('Safe','');// eslint-disable-next-line\nexport var BIconSafe2=/*#__PURE__*/makeIcon('Safe2','');// eslint-disable-next-line\nexport var BIconSafe2Fill=/*#__PURE__*/makeIcon('Safe2Fill','');// eslint-disable-next-line\nexport var BIconSafeFill=/*#__PURE__*/makeIcon('SafeFill','');// eslint-disable-next-line\nexport var BIconSave=/*#__PURE__*/makeIcon('Save','');// eslint-disable-next-line\nexport var BIconSave2=/*#__PURE__*/makeIcon('Save2','');// eslint-disable-next-line\nexport var BIconSave2Fill=/*#__PURE__*/makeIcon('Save2Fill','');// eslint-disable-next-line\nexport var BIconSaveFill=/*#__PURE__*/makeIcon('SaveFill','');// eslint-disable-next-line\nexport var BIconScissors=/*#__PURE__*/makeIcon('Scissors','');// eslint-disable-next-line\nexport var BIconScrewdriver=/*#__PURE__*/makeIcon('Screwdriver','');// eslint-disable-next-line\nexport var BIconSdCard=/*#__PURE__*/makeIcon('SdCard','');// eslint-disable-next-line\nexport var BIconSdCardFill=/*#__PURE__*/makeIcon('SdCardFill','');// eslint-disable-next-line\nexport var BIconSearch=/*#__PURE__*/makeIcon('Search','');// eslint-disable-next-line\nexport var BIconSegmentedNav=/*#__PURE__*/makeIcon('SegmentedNav','');// eslint-disable-next-line\nexport var BIconServer=/*#__PURE__*/makeIcon('Server','');// eslint-disable-next-line\nexport var BIconShare=/*#__PURE__*/makeIcon('Share','');// eslint-disable-next-line\nexport var BIconShareFill=/*#__PURE__*/makeIcon('ShareFill','');// eslint-disable-next-line\nexport var BIconShield=/*#__PURE__*/makeIcon('Shield','');// eslint-disable-next-line\nexport var BIconShieldCheck=/*#__PURE__*/makeIcon('ShieldCheck','');// eslint-disable-next-line\nexport var BIconShieldExclamation=/*#__PURE__*/makeIcon('ShieldExclamation','');// eslint-disable-next-line\nexport var BIconShieldFill=/*#__PURE__*/makeIcon('ShieldFill','');// eslint-disable-next-line\nexport var BIconShieldFillCheck=/*#__PURE__*/makeIcon('ShieldFillCheck','');// eslint-disable-next-line\nexport var BIconShieldFillExclamation=/*#__PURE__*/makeIcon('ShieldFillExclamation','');// eslint-disable-next-line\nexport var BIconShieldFillMinus=/*#__PURE__*/makeIcon('ShieldFillMinus','');// eslint-disable-next-line\nexport var BIconShieldFillPlus=/*#__PURE__*/makeIcon('ShieldFillPlus','');// eslint-disable-next-line\nexport var BIconShieldFillX=/*#__PURE__*/makeIcon('ShieldFillX','');// eslint-disable-next-line\nexport var BIconShieldLock=/*#__PURE__*/makeIcon('ShieldLock','');// eslint-disable-next-line\nexport var BIconShieldLockFill=/*#__PURE__*/makeIcon('ShieldLockFill','');// eslint-disable-next-line\nexport var BIconShieldMinus=/*#__PURE__*/makeIcon('ShieldMinus','');// eslint-disable-next-line\nexport var BIconShieldPlus=/*#__PURE__*/makeIcon('ShieldPlus','');// eslint-disable-next-line\nexport var BIconShieldShaded=/*#__PURE__*/makeIcon('ShieldShaded','');// eslint-disable-next-line\nexport var BIconShieldSlash=/*#__PURE__*/makeIcon('ShieldSlash','');// eslint-disable-next-line\nexport var BIconShieldSlashFill=/*#__PURE__*/makeIcon('ShieldSlashFill','');// eslint-disable-next-line\nexport var BIconShieldX=/*#__PURE__*/makeIcon('ShieldX','');// eslint-disable-next-line\nexport var BIconShift=/*#__PURE__*/makeIcon('Shift','');// eslint-disable-next-line\nexport var BIconShiftFill=/*#__PURE__*/makeIcon('ShiftFill','');// eslint-disable-next-line\nexport var BIconShop=/*#__PURE__*/makeIcon('Shop','');// eslint-disable-next-line\nexport var BIconShopWindow=/*#__PURE__*/makeIcon('ShopWindow','');// eslint-disable-next-line\nexport var BIconShuffle=/*#__PURE__*/makeIcon('Shuffle','');// eslint-disable-next-line\nexport var BIconSignpost=/*#__PURE__*/makeIcon('Signpost','');// eslint-disable-next-line\nexport var BIconSignpost2=/*#__PURE__*/makeIcon('Signpost2','');// eslint-disable-next-line\nexport var BIconSignpost2Fill=/*#__PURE__*/makeIcon('Signpost2Fill','');// eslint-disable-next-line\nexport var BIconSignpostFill=/*#__PURE__*/makeIcon('SignpostFill','');// eslint-disable-next-line\nexport var BIconSignpostSplit=/*#__PURE__*/makeIcon('SignpostSplit','');// eslint-disable-next-line\nexport var BIconSignpostSplitFill=/*#__PURE__*/makeIcon('SignpostSplitFill','');// eslint-disable-next-line\nexport var BIconSim=/*#__PURE__*/makeIcon('Sim','');// eslint-disable-next-line\nexport var BIconSimFill=/*#__PURE__*/makeIcon('SimFill','');// eslint-disable-next-line\nexport var BIconSkipBackward=/*#__PURE__*/makeIcon('SkipBackward','');// eslint-disable-next-line\nexport var BIconSkipBackwardBtn=/*#__PURE__*/makeIcon('SkipBackwardBtn','');// eslint-disable-next-line\nexport var BIconSkipBackwardBtnFill=/*#__PURE__*/makeIcon('SkipBackwardBtnFill','');// eslint-disable-next-line\nexport var BIconSkipBackwardCircle=/*#__PURE__*/makeIcon('SkipBackwardCircle','');// eslint-disable-next-line\nexport var BIconSkipBackwardCircleFill=/*#__PURE__*/makeIcon('SkipBackwardCircleFill','');// eslint-disable-next-line\nexport var BIconSkipBackwardFill=/*#__PURE__*/makeIcon('SkipBackwardFill','');// eslint-disable-next-line\nexport var BIconSkipEnd=/*#__PURE__*/makeIcon('SkipEnd','');// eslint-disable-next-line\nexport var BIconSkipEndBtn=/*#__PURE__*/makeIcon('SkipEndBtn','');// eslint-disable-next-line\nexport var BIconSkipEndBtnFill=/*#__PURE__*/makeIcon('SkipEndBtnFill','');// eslint-disable-next-line\nexport var BIconSkipEndCircle=/*#__PURE__*/makeIcon('SkipEndCircle','');// eslint-disable-next-line\nexport var BIconSkipEndCircleFill=/*#__PURE__*/makeIcon('SkipEndCircleFill','');// eslint-disable-next-line\nexport var BIconSkipEndFill=/*#__PURE__*/makeIcon('SkipEndFill','');// eslint-disable-next-line\nexport var BIconSkipForward=/*#__PURE__*/makeIcon('SkipForward','');// eslint-disable-next-line\nexport var BIconSkipForwardBtn=/*#__PURE__*/makeIcon('SkipForwardBtn','');// eslint-disable-next-line\nexport var BIconSkipForwardBtnFill=/*#__PURE__*/makeIcon('SkipForwardBtnFill','');// eslint-disable-next-line\nexport var BIconSkipForwardCircle=/*#__PURE__*/makeIcon('SkipForwardCircle','');// eslint-disable-next-line\nexport var BIconSkipForwardCircleFill=/*#__PURE__*/makeIcon('SkipForwardCircleFill','');// eslint-disable-next-line\nexport var BIconSkipForwardFill=/*#__PURE__*/makeIcon('SkipForwardFill','');// eslint-disable-next-line\nexport var BIconSkipStart=/*#__PURE__*/makeIcon('SkipStart','');// eslint-disable-next-line\nexport var BIconSkipStartBtn=/*#__PURE__*/makeIcon('SkipStartBtn','');// eslint-disable-next-line\nexport var BIconSkipStartBtnFill=/*#__PURE__*/makeIcon('SkipStartBtnFill','');// eslint-disable-next-line\nexport var BIconSkipStartCircle=/*#__PURE__*/makeIcon('SkipStartCircle','');// eslint-disable-next-line\nexport var BIconSkipStartCircleFill=/*#__PURE__*/makeIcon('SkipStartCircleFill','');// eslint-disable-next-line\nexport var BIconSkipStartFill=/*#__PURE__*/makeIcon('SkipStartFill','');// eslint-disable-next-line\nexport var BIconSkype=/*#__PURE__*/makeIcon('Skype','');// eslint-disable-next-line\nexport var BIconSlack=/*#__PURE__*/makeIcon('Slack','');// eslint-disable-next-line\nexport var BIconSlash=/*#__PURE__*/makeIcon('Slash','');// eslint-disable-next-line\nexport var BIconSlashCircle=/*#__PURE__*/makeIcon('SlashCircle','');// eslint-disable-next-line\nexport var BIconSlashCircleFill=/*#__PURE__*/makeIcon('SlashCircleFill','');// eslint-disable-next-line\nexport var BIconSlashLg=/*#__PURE__*/makeIcon('SlashLg','');// eslint-disable-next-line\nexport var BIconSlashSquare=/*#__PURE__*/makeIcon('SlashSquare','');// eslint-disable-next-line\nexport var BIconSlashSquareFill=/*#__PURE__*/makeIcon('SlashSquareFill','');// eslint-disable-next-line\nexport var BIconSliders=/*#__PURE__*/makeIcon('Sliders','');// eslint-disable-next-line\nexport var BIconSmartwatch=/*#__PURE__*/makeIcon('Smartwatch','');// eslint-disable-next-line\nexport var BIconSnow=/*#__PURE__*/makeIcon('Snow','');// eslint-disable-next-line\nexport var BIconSnow2=/*#__PURE__*/makeIcon('Snow2','');// eslint-disable-next-line\nexport var BIconSnow3=/*#__PURE__*/makeIcon('Snow3','');// eslint-disable-next-line\nexport var BIconSortAlphaDown=/*#__PURE__*/makeIcon('SortAlphaDown','');// eslint-disable-next-line\nexport var BIconSortAlphaDownAlt=/*#__PURE__*/makeIcon('SortAlphaDownAlt','');// eslint-disable-next-line\nexport var BIconSortAlphaUp=/*#__PURE__*/makeIcon('SortAlphaUp','');// eslint-disable-next-line\nexport var BIconSortAlphaUpAlt=/*#__PURE__*/makeIcon('SortAlphaUpAlt','');// eslint-disable-next-line\nexport var BIconSortDown=/*#__PURE__*/makeIcon('SortDown','');// eslint-disable-next-line\nexport var BIconSortDownAlt=/*#__PURE__*/makeIcon('SortDownAlt','');// eslint-disable-next-line\nexport var BIconSortNumericDown=/*#__PURE__*/makeIcon('SortNumericDown','');// eslint-disable-next-line\nexport var BIconSortNumericDownAlt=/*#__PURE__*/makeIcon('SortNumericDownAlt','');// eslint-disable-next-line\nexport var BIconSortNumericUp=/*#__PURE__*/makeIcon('SortNumericUp','');// eslint-disable-next-line\nexport var BIconSortNumericUpAlt=/*#__PURE__*/makeIcon('SortNumericUpAlt','');// eslint-disable-next-line\nexport var BIconSortUp=/*#__PURE__*/makeIcon('SortUp','');// eslint-disable-next-line\nexport var BIconSortUpAlt=/*#__PURE__*/makeIcon('SortUpAlt','');// eslint-disable-next-line\nexport var BIconSoundwave=/*#__PURE__*/makeIcon('Soundwave','');// eslint-disable-next-line\nexport var BIconSpeaker=/*#__PURE__*/makeIcon('Speaker','');// eslint-disable-next-line\nexport var BIconSpeakerFill=/*#__PURE__*/makeIcon('SpeakerFill','');// eslint-disable-next-line\nexport var BIconSpeedometer=/*#__PURE__*/makeIcon('Speedometer','');// eslint-disable-next-line\nexport var BIconSpeedometer2=/*#__PURE__*/makeIcon('Speedometer2','');// eslint-disable-next-line\nexport var BIconSpellcheck=/*#__PURE__*/makeIcon('Spellcheck','');// eslint-disable-next-line\nexport var BIconSquare=/*#__PURE__*/makeIcon('Square','');// eslint-disable-next-line\nexport var BIconSquareFill=/*#__PURE__*/makeIcon('SquareFill','');// eslint-disable-next-line\nexport var BIconSquareHalf=/*#__PURE__*/makeIcon('SquareHalf','');// eslint-disable-next-line\nexport var BIconStack=/*#__PURE__*/makeIcon('Stack','');// eslint-disable-next-line\nexport var BIconStar=/*#__PURE__*/makeIcon('Star','');// eslint-disable-next-line\nexport var BIconStarFill=/*#__PURE__*/makeIcon('StarFill','');// eslint-disable-next-line\nexport var BIconStarHalf=/*#__PURE__*/makeIcon('StarHalf','');// eslint-disable-next-line\nexport var BIconStars=/*#__PURE__*/makeIcon('Stars','');// eslint-disable-next-line\nexport var BIconStickies=/*#__PURE__*/makeIcon('Stickies','');// eslint-disable-next-line\nexport var BIconStickiesFill=/*#__PURE__*/makeIcon('StickiesFill','');// eslint-disable-next-line\nexport var BIconSticky=/*#__PURE__*/makeIcon('Sticky','');// eslint-disable-next-line\nexport var BIconStickyFill=/*#__PURE__*/makeIcon('StickyFill','');// eslint-disable-next-line\nexport var BIconStop=/*#__PURE__*/makeIcon('Stop','');// eslint-disable-next-line\nexport var BIconStopBtn=/*#__PURE__*/makeIcon('StopBtn','');// eslint-disable-next-line\nexport var BIconStopBtnFill=/*#__PURE__*/makeIcon('StopBtnFill','');// eslint-disable-next-line\nexport var BIconStopCircle=/*#__PURE__*/makeIcon('StopCircle','');// eslint-disable-next-line\nexport var BIconStopCircleFill=/*#__PURE__*/makeIcon('StopCircleFill','');// eslint-disable-next-line\nexport var BIconStopFill=/*#__PURE__*/makeIcon('StopFill','');// eslint-disable-next-line\nexport var BIconStoplights=/*#__PURE__*/makeIcon('Stoplights','');// eslint-disable-next-line\nexport var BIconStoplightsFill=/*#__PURE__*/makeIcon('StoplightsFill','');// eslint-disable-next-line\nexport var BIconStopwatch=/*#__PURE__*/makeIcon('Stopwatch','');// eslint-disable-next-line\nexport var BIconStopwatchFill=/*#__PURE__*/makeIcon('StopwatchFill','');// eslint-disable-next-line\nexport var BIconSubtract=/*#__PURE__*/makeIcon('Subtract','');// eslint-disable-next-line\nexport var BIconSuitClub=/*#__PURE__*/makeIcon('SuitClub','');// eslint-disable-next-line\nexport var BIconSuitClubFill=/*#__PURE__*/makeIcon('SuitClubFill','');// eslint-disable-next-line\nexport var BIconSuitDiamond=/*#__PURE__*/makeIcon('SuitDiamond','');// eslint-disable-next-line\nexport var BIconSuitDiamondFill=/*#__PURE__*/makeIcon('SuitDiamondFill','');// eslint-disable-next-line\nexport var BIconSuitHeart=/*#__PURE__*/makeIcon('SuitHeart','');// eslint-disable-next-line\nexport var BIconSuitHeartFill=/*#__PURE__*/makeIcon('SuitHeartFill','');// eslint-disable-next-line\nexport var BIconSuitSpade=/*#__PURE__*/makeIcon('SuitSpade','');// eslint-disable-next-line\nexport var BIconSuitSpadeFill=/*#__PURE__*/makeIcon('SuitSpadeFill','');// eslint-disable-next-line\nexport var BIconSun=/*#__PURE__*/makeIcon('Sun','');// eslint-disable-next-line\nexport var BIconSunFill=/*#__PURE__*/makeIcon('SunFill','');// eslint-disable-next-line\nexport var BIconSunglasses=/*#__PURE__*/makeIcon('Sunglasses','');// eslint-disable-next-line\nexport var BIconSunrise=/*#__PURE__*/makeIcon('Sunrise','');// eslint-disable-next-line\nexport var BIconSunriseFill=/*#__PURE__*/makeIcon('SunriseFill','');// eslint-disable-next-line\nexport var BIconSunset=/*#__PURE__*/makeIcon('Sunset','');// eslint-disable-next-line\nexport var BIconSunsetFill=/*#__PURE__*/makeIcon('SunsetFill','');// eslint-disable-next-line\nexport var BIconSymmetryHorizontal=/*#__PURE__*/makeIcon('SymmetryHorizontal','');// eslint-disable-next-line\nexport var BIconSymmetryVertical=/*#__PURE__*/makeIcon('SymmetryVertical','');// eslint-disable-next-line\nexport var BIconTable=/*#__PURE__*/makeIcon('Table','');// eslint-disable-next-line\nexport var BIconTablet=/*#__PURE__*/makeIcon('Tablet','');// eslint-disable-next-line\nexport var BIconTabletFill=/*#__PURE__*/makeIcon('TabletFill','');// eslint-disable-next-line\nexport var BIconTabletLandscape=/*#__PURE__*/makeIcon('TabletLandscape','');// eslint-disable-next-line\nexport var BIconTabletLandscapeFill=/*#__PURE__*/makeIcon('TabletLandscapeFill','');// eslint-disable-next-line\nexport var BIconTag=/*#__PURE__*/makeIcon('Tag','');// eslint-disable-next-line\nexport var BIconTagFill=/*#__PURE__*/makeIcon('TagFill','');// eslint-disable-next-line\nexport var BIconTags=/*#__PURE__*/makeIcon('Tags','');// eslint-disable-next-line\nexport var BIconTagsFill=/*#__PURE__*/makeIcon('TagsFill','');// eslint-disable-next-line\nexport var BIconTelegram=/*#__PURE__*/makeIcon('Telegram','');// eslint-disable-next-line\nexport var BIconTelephone=/*#__PURE__*/makeIcon('Telephone','');// eslint-disable-next-line\nexport var BIconTelephoneFill=/*#__PURE__*/makeIcon('TelephoneFill','');// eslint-disable-next-line\nexport var BIconTelephoneForward=/*#__PURE__*/makeIcon('TelephoneForward','');// eslint-disable-next-line\nexport var BIconTelephoneForwardFill=/*#__PURE__*/makeIcon('TelephoneForwardFill','');// eslint-disable-next-line\nexport var BIconTelephoneInbound=/*#__PURE__*/makeIcon('TelephoneInbound','');// eslint-disable-next-line\nexport var BIconTelephoneInboundFill=/*#__PURE__*/makeIcon('TelephoneInboundFill','');// eslint-disable-next-line\nexport var BIconTelephoneMinus=/*#__PURE__*/makeIcon('TelephoneMinus','');// eslint-disable-next-line\nexport var BIconTelephoneMinusFill=/*#__PURE__*/makeIcon('TelephoneMinusFill','');// eslint-disable-next-line\nexport var BIconTelephoneOutbound=/*#__PURE__*/makeIcon('TelephoneOutbound','');// eslint-disable-next-line\nexport var BIconTelephoneOutboundFill=/*#__PURE__*/makeIcon('TelephoneOutboundFill','');// eslint-disable-next-line\nexport var BIconTelephonePlus=/*#__PURE__*/makeIcon('TelephonePlus','');// eslint-disable-next-line\nexport var BIconTelephonePlusFill=/*#__PURE__*/makeIcon('TelephonePlusFill','');// eslint-disable-next-line\nexport var BIconTelephoneX=/*#__PURE__*/makeIcon('TelephoneX','');// eslint-disable-next-line\nexport var BIconTelephoneXFill=/*#__PURE__*/makeIcon('TelephoneXFill','');// eslint-disable-next-line\nexport var BIconTerminal=/*#__PURE__*/makeIcon('Terminal','');// eslint-disable-next-line\nexport var BIconTerminalFill=/*#__PURE__*/makeIcon('TerminalFill','');// eslint-disable-next-line\nexport var BIconTextCenter=/*#__PURE__*/makeIcon('TextCenter','');// eslint-disable-next-line\nexport var BIconTextIndentLeft=/*#__PURE__*/makeIcon('TextIndentLeft','');// eslint-disable-next-line\nexport var BIconTextIndentRight=/*#__PURE__*/makeIcon('TextIndentRight','');// eslint-disable-next-line\nexport var BIconTextLeft=/*#__PURE__*/makeIcon('TextLeft','');// eslint-disable-next-line\nexport var BIconTextParagraph=/*#__PURE__*/makeIcon('TextParagraph','');// eslint-disable-next-line\nexport var BIconTextRight=/*#__PURE__*/makeIcon('TextRight','');// eslint-disable-next-line\nexport var BIconTextarea=/*#__PURE__*/makeIcon('Textarea','');// eslint-disable-next-line\nexport var BIconTextareaResize=/*#__PURE__*/makeIcon('TextareaResize','');// eslint-disable-next-line\nexport var BIconTextareaT=/*#__PURE__*/makeIcon('TextareaT','');// eslint-disable-next-line\nexport var BIconThermometer=/*#__PURE__*/makeIcon('Thermometer','');// eslint-disable-next-line\nexport var BIconThermometerHalf=/*#__PURE__*/makeIcon('ThermometerHalf','');// eslint-disable-next-line\nexport var BIconThermometerHigh=/*#__PURE__*/makeIcon('ThermometerHigh','');// eslint-disable-next-line\nexport var BIconThermometerLow=/*#__PURE__*/makeIcon('ThermometerLow','');// eslint-disable-next-line\nexport var BIconThermometerSnow=/*#__PURE__*/makeIcon('ThermometerSnow','');// eslint-disable-next-line\nexport var BIconThermometerSun=/*#__PURE__*/makeIcon('ThermometerSun','');// eslint-disable-next-line\nexport var BIconThreeDots=/*#__PURE__*/makeIcon('ThreeDots','');// eslint-disable-next-line\nexport var BIconThreeDotsVertical=/*#__PURE__*/makeIcon('ThreeDotsVertical','');// eslint-disable-next-line\nexport var BIconToggle2Off=/*#__PURE__*/makeIcon('Toggle2Off','');// eslint-disable-next-line\nexport var BIconToggle2On=/*#__PURE__*/makeIcon('Toggle2On','');// eslint-disable-next-line\nexport var BIconToggleOff=/*#__PURE__*/makeIcon('ToggleOff','');// eslint-disable-next-line\nexport var BIconToggleOn=/*#__PURE__*/makeIcon('ToggleOn','');// eslint-disable-next-line\nexport var BIconToggles=/*#__PURE__*/makeIcon('Toggles','');// eslint-disable-next-line\nexport var BIconToggles2=/*#__PURE__*/makeIcon('Toggles2','');// eslint-disable-next-line\nexport var BIconTools=/*#__PURE__*/makeIcon('Tools','');// eslint-disable-next-line\nexport var BIconTornado=/*#__PURE__*/makeIcon('Tornado','');// eslint-disable-next-line\nexport var BIconTranslate=/*#__PURE__*/makeIcon('Translate','');// eslint-disable-next-line\nexport var BIconTrash=/*#__PURE__*/makeIcon('Trash','');// eslint-disable-next-line\nexport var BIconTrash2=/*#__PURE__*/makeIcon('Trash2','');// eslint-disable-next-line\nexport var BIconTrash2Fill=/*#__PURE__*/makeIcon('Trash2Fill','');// eslint-disable-next-line\nexport var BIconTrashFill=/*#__PURE__*/makeIcon('TrashFill','');// eslint-disable-next-line\nexport var BIconTree=/*#__PURE__*/makeIcon('Tree','');// eslint-disable-next-line\nexport var BIconTreeFill=/*#__PURE__*/makeIcon('TreeFill','');// eslint-disable-next-line\nexport var BIconTriangle=/*#__PURE__*/makeIcon('Triangle','');// eslint-disable-next-line\nexport var BIconTriangleFill=/*#__PURE__*/makeIcon('TriangleFill','');// eslint-disable-next-line\nexport var BIconTriangleHalf=/*#__PURE__*/makeIcon('TriangleHalf','');// eslint-disable-next-line\nexport var BIconTrophy=/*#__PURE__*/makeIcon('Trophy','');// eslint-disable-next-line\nexport var BIconTrophyFill=/*#__PURE__*/makeIcon('TrophyFill','');// eslint-disable-next-line\nexport var BIconTropicalStorm=/*#__PURE__*/makeIcon('TropicalStorm','');// eslint-disable-next-line\nexport var BIconTruck=/*#__PURE__*/makeIcon('Truck','');// eslint-disable-next-line\nexport var BIconTruckFlatbed=/*#__PURE__*/makeIcon('TruckFlatbed','');// eslint-disable-next-line\nexport var BIconTsunami=/*#__PURE__*/makeIcon('Tsunami','');// eslint-disable-next-line\nexport var BIconTv=/*#__PURE__*/makeIcon('Tv','');// eslint-disable-next-line\nexport var BIconTvFill=/*#__PURE__*/makeIcon('TvFill','');// eslint-disable-next-line\nexport var BIconTwitch=/*#__PURE__*/makeIcon('Twitch','');// eslint-disable-next-line\nexport var BIconTwitter=/*#__PURE__*/makeIcon('Twitter','');// eslint-disable-next-line\nexport var BIconType=/*#__PURE__*/makeIcon('Type','');// eslint-disable-next-line\nexport var BIconTypeBold=/*#__PURE__*/makeIcon('TypeBold','');// eslint-disable-next-line\nexport var BIconTypeH1=/*#__PURE__*/makeIcon('TypeH1','');// eslint-disable-next-line\nexport var BIconTypeH2=/*#__PURE__*/makeIcon('TypeH2','');// eslint-disable-next-line\nexport var BIconTypeH3=/*#__PURE__*/makeIcon('TypeH3','');// eslint-disable-next-line\nexport var BIconTypeItalic=/*#__PURE__*/makeIcon('TypeItalic','');// eslint-disable-next-line\nexport var BIconTypeStrikethrough=/*#__PURE__*/makeIcon('TypeStrikethrough','');// eslint-disable-next-line\nexport var BIconTypeUnderline=/*#__PURE__*/makeIcon('TypeUnderline','');// eslint-disable-next-line\nexport var BIconUiChecks=/*#__PURE__*/makeIcon('UiChecks','');// eslint-disable-next-line\nexport var BIconUiChecksGrid=/*#__PURE__*/makeIcon('UiChecksGrid','');// eslint-disable-next-line\nexport var BIconUiRadios=/*#__PURE__*/makeIcon('UiRadios','');// eslint-disable-next-line\nexport var BIconUiRadiosGrid=/*#__PURE__*/makeIcon('UiRadiosGrid','');// eslint-disable-next-line\nexport var BIconUmbrella=/*#__PURE__*/makeIcon('Umbrella','');// eslint-disable-next-line\nexport var BIconUmbrellaFill=/*#__PURE__*/makeIcon('UmbrellaFill','');// eslint-disable-next-line\nexport var BIconUnion=/*#__PURE__*/makeIcon('Union','');// eslint-disable-next-line\nexport var BIconUnlock=/*#__PURE__*/makeIcon('Unlock','');// eslint-disable-next-line\nexport var BIconUnlockFill=/*#__PURE__*/makeIcon('UnlockFill','');// eslint-disable-next-line\nexport var BIconUpc=/*#__PURE__*/makeIcon('Upc','');// eslint-disable-next-line\nexport var BIconUpcScan=/*#__PURE__*/makeIcon('UpcScan','');// eslint-disable-next-line\nexport var BIconUpload=/*#__PURE__*/makeIcon('Upload','');// eslint-disable-next-line\nexport var BIconVectorPen=/*#__PURE__*/makeIcon('VectorPen','');// eslint-disable-next-line\nexport var BIconViewList=/*#__PURE__*/makeIcon('ViewList','');// eslint-disable-next-line\nexport var BIconViewStacked=/*#__PURE__*/makeIcon('ViewStacked','');// eslint-disable-next-line\nexport var BIconVinyl=/*#__PURE__*/makeIcon('Vinyl','');// eslint-disable-next-line\nexport var BIconVinylFill=/*#__PURE__*/makeIcon('VinylFill','');// eslint-disable-next-line\nexport var BIconVoicemail=/*#__PURE__*/makeIcon('Voicemail','');// eslint-disable-next-line\nexport var BIconVolumeDown=/*#__PURE__*/makeIcon('VolumeDown','');// eslint-disable-next-line\nexport var BIconVolumeDownFill=/*#__PURE__*/makeIcon('VolumeDownFill','');// eslint-disable-next-line\nexport var BIconVolumeMute=/*#__PURE__*/makeIcon('VolumeMute','');// eslint-disable-next-line\nexport var BIconVolumeMuteFill=/*#__PURE__*/makeIcon('VolumeMuteFill','');// eslint-disable-next-line\nexport var BIconVolumeOff=/*#__PURE__*/makeIcon('VolumeOff','');// eslint-disable-next-line\nexport var BIconVolumeOffFill=/*#__PURE__*/makeIcon('VolumeOffFill','');// eslint-disable-next-line\nexport var BIconVolumeUp=/*#__PURE__*/makeIcon('VolumeUp','');// eslint-disable-next-line\nexport var BIconVolumeUpFill=/*#__PURE__*/makeIcon('VolumeUpFill','');// eslint-disable-next-line\nexport var BIconVr=/*#__PURE__*/makeIcon('Vr','');// eslint-disable-next-line\nexport var BIconWallet=/*#__PURE__*/makeIcon('Wallet','');// eslint-disable-next-line\nexport var BIconWallet2=/*#__PURE__*/makeIcon('Wallet2','');// eslint-disable-next-line\nexport var BIconWalletFill=/*#__PURE__*/makeIcon('WalletFill','');// eslint-disable-next-line\nexport var BIconWatch=/*#__PURE__*/makeIcon('Watch','');// eslint-disable-next-line\nexport var BIconWater=/*#__PURE__*/makeIcon('Water','');// eslint-disable-next-line\nexport var BIconWhatsapp=/*#__PURE__*/makeIcon('Whatsapp','');// eslint-disable-next-line\nexport var BIconWifi=/*#__PURE__*/makeIcon('Wifi','');// eslint-disable-next-line\nexport var BIconWifi1=/*#__PURE__*/makeIcon('Wifi1','');// eslint-disable-next-line\nexport var BIconWifi2=/*#__PURE__*/makeIcon('Wifi2','');// eslint-disable-next-line\nexport var BIconWifiOff=/*#__PURE__*/makeIcon('WifiOff','');// eslint-disable-next-line\nexport var BIconWind=/*#__PURE__*/makeIcon('Wind','');// eslint-disable-next-line\nexport var BIconWindow=/*#__PURE__*/makeIcon('Window','');// eslint-disable-next-line\nexport var BIconWindowDock=/*#__PURE__*/makeIcon('WindowDock','');// eslint-disable-next-line\nexport var BIconWindowSidebar=/*#__PURE__*/makeIcon('WindowSidebar','');// eslint-disable-next-line\nexport var BIconWrench=/*#__PURE__*/makeIcon('Wrench','');// eslint-disable-next-line\nexport var BIconX=/*#__PURE__*/makeIcon('X','');// eslint-disable-next-line\nexport var BIconXCircle=/*#__PURE__*/makeIcon('XCircle','');// eslint-disable-next-line\nexport var BIconXCircleFill=/*#__PURE__*/makeIcon('XCircleFill','');// eslint-disable-next-line\nexport var BIconXDiamond=/*#__PURE__*/makeIcon('XDiamond','');// eslint-disable-next-line\nexport var BIconXDiamondFill=/*#__PURE__*/makeIcon('XDiamondFill','');// eslint-disable-next-line\nexport var BIconXLg=/*#__PURE__*/makeIcon('XLg','');// eslint-disable-next-line\nexport var BIconXOctagon=/*#__PURE__*/makeIcon('XOctagon','');// eslint-disable-next-line\nexport var BIconXOctagonFill=/*#__PURE__*/makeIcon('XOctagonFill','');// eslint-disable-next-line\nexport var BIconXSquare=/*#__PURE__*/makeIcon('XSquare','');// eslint-disable-next-line\nexport var BIconXSquareFill=/*#__PURE__*/makeIcon('XSquareFill','');// eslint-disable-next-line\nexport var BIconYoutube=/*#__PURE__*/makeIcon('Youtube','');// eslint-disable-next-line\nexport var BIconZoomIn=/*#__PURE__*/makeIcon('ZoomIn','');// eslint-disable-next-line\nexport var BIconZoomOut=/*#__PURE__*/makeIcon('ZoomOut','');// --- END AUTO-GENERATED FILE ---","exports.f = Object.getOwnPropertySymbols;\n","var path = require('../internals/path');\nvar has = require('../internals/has');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (NAME) {\n var Symbol = path.Symbol || (path.Symbol = {});\n if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {\n value: wrappedWellKnownSymbolModule.f(NAME)\n });\n};\n","//! moment.js locale configuration\n//! locale : Swahili [sw]\n//! author : Fahad Kassim : https://github.com/fadsel\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var sw = moment.defineLocale('sw', {\n months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),\n weekdays: 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split(\n '_'\n ),\n weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),\n weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'hh:mm A',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[leo saa] LT',\n nextDay: '[kesho saa] LT',\n nextWeek: '[wiki ijayo] dddd [saat] LT',\n lastDay: '[jana] LT',\n lastWeek: '[wiki iliyopita] dddd [saat] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: '%s baadaye',\n past: 'tokea %s',\n s: 'hivi punde',\n ss: 'sekunde %d',\n m: 'dakika moja',\n mm: 'dakika %d',\n h: 'saa limoja',\n hh: 'masaa %d',\n d: 'siku moja',\n dd: 'siku %d',\n M: 'mwezi mmoja',\n MM: 'miezi %d',\n y: 'mwaka mmoja',\n yy: 'miaka %d',\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7, // The week that contains Jan 7th is the first week of the year.\n },\n });\n\n return sw;\n\n})));\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.\r\n/** Indicates the severity of a log message.\r\n *\r\n * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.\r\n */\r\nexport var LogLevel;\r\n(function (LogLevel) {\r\n /** Log level for very low severity diagnostic messages. */\r\n LogLevel[LogLevel[\"Trace\"] = 0] = \"Trace\";\r\n /** Log level for low severity diagnostic messages. */\r\n LogLevel[LogLevel[\"Debug\"] = 1] = \"Debug\";\r\n /** Log level for informational diagnostic messages. */\r\n LogLevel[LogLevel[\"Information\"] = 2] = \"Information\";\r\n /** Log level for diagnostic messages that indicate a non-fatal problem. */\r\n LogLevel[LogLevel[\"Warning\"] = 3] = \"Warning\";\r\n /** Log level for diagnostic messages that indicate a failure in the current operation. */\r\n LogLevel[LogLevel[\"Error\"] = 4] = \"Error\";\r\n /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */\r\n LogLevel[LogLevel[\"Critical\"] = 5] = \"Critical\";\r\n /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */\r\n LogLevel[LogLevel[\"None\"] = 6] = \"None\";\r\n})(LogLevel || (LogLevel = {}));\r\n//# sourceMappingURL=ILogger.js.map","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nimport { RX_NUMBER } from '../constants/regex';\nimport { File } from '../constants/safe-types'; // --- Convenience inspection utilities ---\n\nexport var toType = function toType(value) {\n return _typeof(value);\n};\nexport var toRawType = function toRawType(value) {\n return Object.prototype.toString.call(value).slice(8, -1);\n};\nexport var toRawTypeLC = function toRawTypeLC(value) {\n return toRawType(value).toLowerCase();\n};\nexport var isUndefined = function isUndefined(value) {\n return value === undefined;\n};\nexport var isNull = function isNull(value) {\n return value === null;\n};\nexport var isEmptyString = function isEmptyString(value) {\n return value === '';\n};\nexport var isUndefinedOrNull = function isUndefinedOrNull(value) {\n return isUndefined(value) || isNull(value);\n};\nexport var isUndefinedOrNullOrEmpty = function isUndefinedOrNullOrEmpty(value) {\n return isUndefinedOrNull(value) || isEmptyString(value);\n};\nexport var isFunction = function isFunction(value) {\n return toType(value) === 'function';\n};\nexport var isBoolean = function isBoolean(value) {\n return toType(value) === 'boolean';\n};\nexport var isString = function isString(value) {\n return toType(value) === 'string';\n};\nexport var isNumber = function isNumber(value) {\n return toType(value) === 'number';\n};\nexport var isNumeric = function isNumeric(value) {\n return RX_NUMBER.test(String(value));\n};\nexport var isPrimitive = function isPrimitive(value) {\n return isBoolean(value) || isString(value) || isNumber(value);\n};\nexport var isArray = function isArray(value) {\n return Array.isArray(value);\n}; // Quick object check\n// This is primarily used to tell Objects from primitive values\n// when we know the value is a JSON-compliant type\n// Note object could be a complex type like array, Date, etc.\n\nexport var isObject = function isObject(obj) {\n return obj !== null && _typeof(obj) === 'object';\n}; // Strict object type check\n// Only returns true for plain JavaScript objects\n\nexport var isPlainObject = function isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n};\nexport var isDate = function isDate(value) {\n return value instanceof Date;\n};\nexport var isEvent = function isEvent(value) {\n return value instanceof Event;\n};\nexport var isFile = function isFile(value) {\n return value instanceof File;\n};\nexport var isRegExp = function isRegExp(value) {\n return toRawType(value) === 'RegExp';\n};\nexport var isPromise = function isPromise(value) {\n return !isUndefinedOrNull(value) && isFunction(value.then) && isFunction(value.catch);\n};","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n/** A logger that does nothing when log messages are sent to it. */\r\nvar NullLogger = /** @class */ (function () {\r\n function NullLogger() {\r\n }\r\n /** @inheritDoc */\r\n // tslint:disable-next-line\r\n NullLogger.prototype.log = function (_logLevel, _message) {\r\n };\r\n /** The singleton instance of the {@link @aspnet/signalr.NullLogger}. */\r\n NullLogger.instance = new NullLogger();\r\n return NullLogger;\r\n}());\r\nexport { NullLogger };\r\n//# sourceMappingURL=Loggers.js.map","/**\n * vee-validate v3.4.3\n * (c) 2020 Abdelrahman Awad\n * @license MIT\n */\nimport Vue from 'vue';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\nfunction isNaN(value) {\r\n // NaN is the one value that does not equal itself.\r\n // eslint-disable-next-line\r\n return value !== value;\r\n}\r\nfunction isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}\r\nfunction isEmptyArray(arr) {\r\n return Array.isArray(arr) && arr.length === 0;\r\n}\r\nvar isObject = function (obj) {\r\n return obj !== null && obj && typeof obj === 'object' && !Array.isArray(obj);\r\n};\r\n/**\r\n * A reference comparison function with NaN support\r\n */\r\nfunction isRefEqual(lhs, rhs) {\r\n if (isNaN(lhs) && isNaN(rhs)) {\r\n return true;\r\n }\r\n return lhs === rhs;\r\n}\r\n/**\r\n * Shallow object comparison.\r\n */\r\nfunction isEqual(lhs, rhs) {\r\n if (lhs instanceof RegExp && rhs instanceof RegExp) {\r\n return isEqual(lhs.source, rhs.source) && isEqual(lhs.flags, rhs.flags);\r\n }\r\n if (Array.isArray(lhs) && Array.isArray(rhs)) {\r\n if (lhs.length !== rhs.length)\r\n return false;\r\n for (var i = 0; i < lhs.length; i++) {\r\n if (!isEqual(lhs[i], rhs[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n // if both are objects, compare each key recursively.\r\n if (isObject(lhs) && isObject(rhs)) {\r\n return (Object.keys(lhs).every(function (key) {\r\n return isEqual(lhs[key], rhs[key]);\r\n }) &&\r\n Object.keys(rhs).every(function (key) {\r\n return isEqual(lhs[key], rhs[key]);\r\n }));\r\n }\r\n return isRefEqual(lhs, rhs);\r\n}\r\n// Checks if a given value is not an empty string or null or undefined.\r\nfunction isSpecified(val) {\r\n if (val === '') {\r\n return false;\r\n }\r\n return !isNullOrUndefined(val);\r\n}\r\nfunction isCallable(fn) {\r\n return typeof fn === 'function';\r\n}\r\nfunction isLocator(value) {\r\n return isCallable(value) && !!value.__locatorRef;\r\n}\n\nfunction findIndex(arrayLike, predicate) {\r\n var array = Array.isArray(arrayLike) ? arrayLike : toArray(arrayLike);\r\n if (isCallable(array.findIndex)) {\r\n return array.findIndex(predicate);\r\n }\r\n /* istanbul ignore next */\r\n for (var i = 0; i < array.length; i++) {\r\n if (predicate(array[i], i)) {\r\n return i;\r\n }\r\n }\r\n /* istanbul ignore next */\r\n return -1;\r\n}\r\n/**\r\n * finds the first element that satisfies the predicate callback, polyfills array.find\r\n */\r\nfunction find(arrayLike, predicate) {\r\n var array = Array.isArray(arrayLike) ? arrayLike : toArray(arrayLike);\r\n var idx = findIndex(array, predicate);\r\n return idx === -1 ? undefined : array[idx];\r\n}\r\nfunction includes(collection, item) {\r\n return collection.indexOf(item) !== -1;\r\n}\r\n/**\r\n * Converts an array-like object to array, provides a simple polyfill for Array.from\r\n */\r\nfunction toArray(arrayLike) {\r\n if (isCallable(Array.from)) {\r\n return Array.from(arrayLike);\r\n }\r\n /* istanbul ignore next */\r\n return _copyArray(arrayLike);\r\n}\r\n/* istanbul ignore next */\r\nfunction _copyArray(arrayLike) {\r\n var array = [];\r\n var length = arrayLike.length;\r\n for (var i = 0; i < length; i++) {\r\n array.push(arrayLike[i]);\r\n }\r\n return array;\r\n}\r\nfunction values(obj) {\r\n if (isCallable(Object.values)) {\r\n return Object.values(obj);\r\n }\r\n // fallback to keys()\r\n /* istanbul ignore next */\r\n return Object.keys(obj).map(function (k) { return obj[k]; });\r\n}\r\nfunction merge(target, source) {\r\n Object.keys(source).forEach(function (key) {\r\n if (isObject(source[key])) {\r\n if (!target[key]) {\r\n target[key] = {};\r\n }\r\n merge(target[key], source[key]);\r\n return;\r\n }\r\n target[key] = source[key];\r\n });\r\n return target;\r\n}\n\nfunction createFlags() {\r\n return {\r\n untouched: true,\r\n touched: false,\r\n dirty: false,\r\n pristine: true,\r\n valid: false,\r\n invalid: false,\r\n validated: false,\r\n pending: false,\r\n required: false,\r\n changed: false,\r\n passed: false,\r\n failed: false\r\n };\r\n}\n\nfunction identity(x) {\r\n return x;\r\n}\r\nfunction debounce(fn, wait, token) {\r\n if (wait === void 0) { wait = 0; }\r\n if (token === void 0) { token = { cancelled: false }; }\r\n if (wait === 0) {\r\n return fn;\r\n }\r\n var timeout;\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var later = function () {\r\n timeout = undefined;\r\n // check if the fn call was cancelled.\r\n if (!token.cancelled)\r\n fn.apply(void 0, args);\r\n };\r\n // because we might want to use Node.js setTimout for SSR.\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n };\r\n}\n\n/**\r\n * Emits a warning to the console\r\n */\r\nfunction warn(message) {\r\n console.warn(\"[vee-validate] \" + message);\r\n}\r\n/**\r\n * Replaces placeholder values in a string with their actual values\r\n */\r\nfunction interpolate(template, values) {\r\n return template.replace(/{([^}]+)}/g, function (_, p) {\r\n return p in values ? values[p] : \"{\" + p + \"}\";\r\n });\r\n}\n\nvar RULES = {};\r\nfunction normalizeSchema(schema) {\r\n var _a;\r\n if ((_a = schema.params) === null || _a === void 0 ? void 0 : _a.length) {\r\n schema.params = schema.params.map(function (param) {\r\n if (typeof param === 'string') {\r\n return { name: param };\r\n }\r\n return param;\r\n });\r\n }\r\n return schema;\r\n}\r\nvar RuleContainer = /** @class */ (function () {\r\n function RuleContainer() {\r\n }\r\n RuleContainer.extend = function (name, schema) {\r\n // if rule already exists, overwrite it.\r\n var rule = normalizeSchema(schema);\r\n if (RULES[name]) {\r\n RULES[name] = merge(RULES[name], schema);\r\n return;\r\n }\r\n RULES[name] = __assign({ lazy: false, computesRequired: false }, rule);\r\n };\r\n RuleContainer.isLazy = function (name) {\r\n var _a;\r\n return !!((_a = RULES[name]) === null || _a === void 0 ? void 0 : _a.lazy);\r\n };\r\n RuleContainer.isRequireRule = function (name) {\r\n var _a;\r\n return !!((_a = RULES[name]) === null || _a === void 0 ? void 0 : _a.computesRequired);\r\n };\r\n RuleContainer.getRuleDefinition = function (ruleName) {\r\n return RULES[ruleName];\r\n };\r\n return RuleContainer;\r\n}());\r\n/**\r\n * Adds a custom validator to the list of validation rules.\r\n */\r\nfunction extend(name, schema) {\r\n // makes sure new rules are properly formatted.\r\n guardExtend(name, schema);\r\n // Full schema object.\r\n if (typeof schema === 'object') {\r\n RuleContainer.extend(name, schema);\r\n return;\r\n }\r\n RuleContainer.extend(name, {\r\n validate: schema\r\n });\r\n}\r\n/**\r\n * Guards from extension violations.\r\n */\r\nfunction guardExtend(name, validator) {\r\n if (isCallable(validator)) {\r\n return;\r\n }\r\n if (isCallable(validator.validate)) {\r\n return;\r\n }\r\n if (RuleContainer.getRuleDefinition(name)) {\r\n return;\r\n }\r\n throw new Error(\"Extension Error: The validator '\" + name + \"' must be a function or have a 'validate' method.\");\r\n}\n\nvar DEFAULT_CONFIG = {\r\n defaultMessage: \"{_field_} is not valid.\",\r\n skipOptional: true,\r\n classes: {\r\n touched: 'touched',\r\n untouched: 'untouched',\r\n valid: 'valid',\r\n invalid: 'invalid',\r\n pristine: 'pristine',\r\n dirty: 'dirty' // control has been interacted with\r\n },\r\n bails: true,\r\n mode: 'aggressive',\r\n useConstraintAttrs: true\r\n};\r\nvar currentConfig = __assign({}, DEFAULT_CONFIG);\r\nvar getConfig = function () { return currentConfig; };\r\nvar setConfig = function (newConf) {\r\n currentConfig = __assign(__assign({}, currentConfig), newConf);\r\n};\r\nvar configure = function (cfg) {\r\n setConfig(cfg);\r\n};\n\n/**\r\n * Normalizes the given rules expression.\r\n */\r\nfunction normalizeRules(rules) {\r\n // if falsy value return an empty object.\r\n var acc = {};\r\n Object.defineProperty(acc, '_$$isNormalized', {\r\n value: true,\r\n writable: false,\r\n enumerable: false,\r\n configurable: false\r\n });\r\n if (!rules) {\r\n return acc;\r\n }\r\n // Object is already normalized, skip.\r\n if (isObject(rules) && rules._$$isNormalized) {\r\n return rules;\r\n }\r\n if (isObject(rules)) {\r\n return Object.keys(rules).reduce(function (prev, curr) {\r\n var params = [];\r\n if (rules[curr] === true) {\r\n params = [];\r\n }\r\n else if (Array.isArray(rules[curr])) {\r\n params = rules[curr];\r\n }\r\n else if (isObject(rules[curr])) {\r\n params = rules[curr];\r\n }\r\n else {\r\n params = [rules[curr]];\r\n }\r\n if (rules[curr] !== false) {\r\n prev[curr] = buildParams(curr, params);\r\n }\r\n return prev;\r\n }, acc);\r\n }\r\n /* istanbul ignore if */\r\n if (typeof rules !== 'string') {\r\n warn('rules must be either a string or an object.');\r\n return acc;\r\n }\r\n return rules.split('|').reduce(function (prev, rule) {\r\n var parsedRule = parseRule(rule);\r\n if (!parsedRule.name) {\r\n return prev;\r\n }\r\n prev[parsedRule.name] = buildParams(parsedRule.name, parsedRule.params);\r\n return prev;\r\n }, acc);\r\n}\r\nfunction buildParams(ruleName, provided) {\r\n var ruleSchema = RuleContainer.getRuleDefinition(ruleName);\r\n if (!ruleSchema) {\r\n return provided;\r\n }\r\n var params = {};\r\n if (!ruleSchema.params && !Array.isArray(provided)) {\r\n throw new Error('You provided an object params to a rule that has no defined schema.');\r\n }\r\n // Rule probably uses an array for their args, keep it as is.\r\n if (Array.isArray(provided) && !ruleSchema.params) {\r\n return provided;\r\n }\r\n var definedParams;\r\n // collect the params schema.\r\n if (!ruleSchema.params || (ruleSchema.params.length < provided.length && Array.isArray(provided))) {\r\n var lastDefinedParam_1;\r\n // collect any additional parameters in the last item.\r\n definedParams = provided.map(function (_, idx) {\r\n var _a;\r\n var param = (_a = ruleSchema.params) === null || _a === void 0 ? void 0 : _a[idx];\r\n lastDefinedParam_1 = param || lastDefinedParam_1;\r\n if (!param) {\r\n param = lastDefinedParam_1;\r\n }\r\n return param;\r\n });\r\n }\r\n else {\r\n definedParams = ruleSchema.params;\r\n }\r\n // Match the provided array length with a temporary schema.\r\n for (var i = 0; i < definedParams.length; i++) {\r\n var options = definedParams[i];\r\n var value = options.default;\r\n // if the provided is an array, map element value.\r\n if (Array.isArray(provided)) {\r\n if (i in provided) {\r\n value = provided[i];\r\n }\r\n }\r\n else {\r\n // If the param exists in the provided object.\r\n if (options.name in provided) {\r\n value = provided[options.name];\r\n // if the provided is the first param value.\r\n }\r\n else if (definedParams.length === 1) {\r\n value = provided;\r\n }\r\n }\r\n // if the param is a target, resolve the target value.\r\n if (options.isTarget) {\r\n value = createLocator(value, options.cast);\r\n }\r\n // A target param using interpolation\r\n if (typeof value === 'string' && value[0] === '@') {\r\n value = createLocator(value.slice(1), options.cast);\r\n }\r\n // If there is a transformer defined.\r\n if (!isLocator(value) && options.cast) {\r\n value = options.cast(value);\r\n }\r\n // already been set, probably multiple values.\r\n if (params[options.name]) {\r\n params[options.name] = Array.isArray(params[options.name]) ? params[options.name] : [params[options.name]];\r\n params[options.name].push(value);\r\n }\r\n else {\r\n // set the value.\r\n params[options.name] = value;\r\n }\r\n }\r\n return params;\r\n}\r\n/**\r\n * Parses a rule string expression.\r\n */\r\nvar parseRule = function (rule) {\r\n var params = [];\r\n var name = rule.split(':')[0];\r\n if (includes(rule, ':')) {\r\n params = rule\r\n .split(':')\r\n .slice(1)\r\n .join(':')\r\n .split(',');\r\n }\r\n return { name: name, params: params };\r\n};\r\nfunction createLocator(value, castFn) {\r\n var locator = function (crossTable) {\r\n var val = crossTable[value];\r\n return castFn ? castFn(val) : val;\r\n };\r\n locator.__locatorRef = value;\r\n return locator;\r\n}\r\nfunction extractLocators(params) {\r\n if (Array.isArray(params)) {\r\n return params.filter(function (param) {\r\n return isLocator(param) || (typeof param === 'string' && param[0] === '@');\r\n });\r\n }\r\n return Object.keys(params)\r\n .filter(function (key) { return isLocator(params[key]); })\r\n .map(function (key) { return params[key]; });\r\n}\n\n/**\r\n * Validates a value against the rules.\r\n */\r\nfunction validate(value, rules, options) {\r\n if (options === void 0) { options = {}; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var shouldBail, skipIfEmpty, field, result, errors, failedRules, regenerateMap;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n shouldBail = options === null || options === void 0 ? void 0 : options.bails;\r\n skipIfEmpty = options === null || options === void 0 ? void 0 : options.skipIfEmpty;\r\n field = {\r\n name: (options === null || options === void 0 ? void 0 : options.name) || '{field}',\r\n rules: normalizeRules(rules),\r\n bails: shouldBail !== null && shouldBail !== void 0 ? shouldBail : true,\r\n skipIfEmpty: skipIfEmpty !== null && skipIfEmpty !== void 0 ? skipIfEmpty : true,\r\n forceRequired: false,\r\n crossTable: (options === null || options === void 0 ? void 0 : options.values) || {},\r\n names: (options === null || options === void 0 ? void 0 : options.names) || {},\r\n customMessages: (options === null || options === void 0 ? void 0 : options.customMessages) || {}\r\n };\r\n return [4 /*yield*/, _validate(field, value, options)];\r\n case 1:\r\n result = _a.sent();\r\n errors = [];\r\n failedRules = {};\r\n regenerateMap = {};\r\n result.errors.forEach(function (e) {\r\n var msg = e.msg();\r\n errors.push(msg);\r\n failedRules[e.rule] = msg;\r\n regenerateMap[e.rule] = e.msg;\r\n });\r\n return [2 /*return*/, {\r\n valid: result.valid,\r\n errors: errors,\r\n failedRules: failedRules,\r\n regenerateMap: regenerateMap\r\n }];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Starts the validation process.\r\n */\r\nfunction _validate(field, value, _a) {\r\n var _b = (_a === void 0 ? {} : _a).isInitial, isInitial = _b === void 0 ? false : _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _c, shouldSkip, errors, rules, length, i, rule, result;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0: return [4 /*yield*/, _shouldSkip(field, value)];\r\n case 1:\r\n _c = _d.sent(), shouldSkip = _c.shouldSkip, errors = _c.errors;\r\n if (shouldSkip) {\r\n return [2 /*return*/, {\r\n valid: !errors.length,\r\n errors: errors\r\n }];\r\n }\r\n rules = Object.keys(field.rules).filter(function (rule) { return !RuleContainer.isRequireRule(rule); });\r\n length = rules.length;\r\n i = 0;\r\n _d.label = 2;\r\n case 2:\r\n if (!(i < length)) return [3 /*break*/, 5];\r\n if (isInitial && RuleContainer.isLazy(rules[i])) {\r\n return [3 /*break*/, 4];\r\n }\r\n rule = rules[i];\r\n return [4 /*yield*/, _test(field, value, {\r\n name: rule,\r\n params: field.rules[rule]\r\n })];\r\n case 3:\r\n result = _d.sent();\r\n if (!result.valid && result.error) {\r\n errors.push(result.error);\r\n if (field.bails) {\r\n return [2 /*return*/, {\r\n valid: false,\r\n errors: errors\r\n }];\r\n }\r\n }\r\n _d.label = 4;\r\n case 4:\r\n i++;\r\n return [3 /*break*/, 2];\r\n case 5: return [2 /*return*/, {\r\n valid: !errors.length,\r\n errors: errors\r\n }];\r\n }\r\n });\r\n });\r\n}\r\nfunction _shouldSkip(field, value) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var requireRules, length, errors, isEmpty, isEmptyAndOptional, isRequired, i, rule, result;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n requireRules = Object.keys(field.rules).filter(RuleContainer.isRequireRule);\r\n length = requireRules.length;\r\n errors = [];\r\n isEmpty = isNullOrUndefined(value) || value === '' || isEmptyArray(value);\r\n isEmptyAndOptional = isEmpty && field.skipIfEmpty;\r\n isRequired = false;\r\n i = 0;\r\n _a.label = 1;\r\n case 1:\r\n if (!(i < length)) return [3 /*break*/, 4];\r\n rule = requireRules[i];\r\n return [4 /*yield*/, _test(field, value, {\r\n name: rule,\r\n params: field.rules[rule]\r\n })];\r\n case 2:\r\n result = _a.sent();\r\n if (!isObject(result)) {\r\n throw new Error('Require rules has to return an object (see docs)');\r\n }\r\n if (result.required) {\r\n isRequired = true;\r\n }\r\n if (!result.valid && result.error) {\r\n errors.push(result.error);\r\n // Exit early as the field is required and failed validation.\r\n if (field.bails) {\r\n return [2 /*return*/, {\r\n shouldSkip: true,\r\n errors: errors\r\n }];\r\n }\r\n }\r\n _a.label = 3;\r\n case 3:\r\n i++;\r\n return [3 /*break*/, 1];\r\n case 4:\r\n if (isEmpty && !isRequired && !field.skipIfEmpty) {\r\n return [2 /*return*/, {\r\n shouldSkip: false,\r\n errors: errors\r\n }];\r\n }\r\n // field is configured to run through the pipeline regardless\r\n if (!field.bails && !isEmptyAndOptional) {\r\n return [2 /*return*/, {\r\n shouldSkip: false,\r\n errors: errors\r\n }];\r\n }\r\n // skip if the field is not required and has an empty value.\r\n return [2 /*return*/, {\r\n shouldSkip: !isRequired && isEmpty,\r\n errors: errors\r\n }];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Tests a single input value against a rule.\r\n */\r\nfunction _test(field, value, rule) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var ruleSchema, normalizedValue, params, result, values_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n ruleSchema = RuleContainer.getRuleDefinition(rule.name);\r\n if (!ruleSchema || !ruleSchema.validate) {\r\n throw new Error(\"No such validator '\" + rule.name + \"' exists.\");\r\n }\r\n normalizedValue = ruleSchema.castValue ? ruleSchema.castValue(value) : value;\r\n params = fillTargetValues(rule.params, field.crossTable);\r\n return [4 /*yield*/, ruleSchema.validate(normalizedValue, params)];\r\n case 1:\r\n result = _a.sent();\r\n if (typeof result === 'string') {\r\n values_1 = __assign(__assign({}, (params || {})), { _field_: field.name, _value_: value, _rule_: rule.name });\r\n return [2 /*return*/, {\r\n valid: false,\r\n error: { rule: rule.name, msg: function () { return interpolate(result, values_1); } }\r\n }];\r\n }\r\n if (!isObject(result)) {\r\n result = { valid: result };\r\n }\r\n return [2 /*return*/, {\r\n valid: result.valid,\r\n required: result.required,\r\n error: result.valid ? undefined : _generateFieldError(field, value, ruleSchema, rule.name, params)\r\n }];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * Generates error messages.\r\n */\r\nfunction _generateFieldError(field, value, ruleSchema, ruleName, params) {\r\n var _a;\r\n var message = (_a = field.customMessages[ruleName]) !== null && _a !== void 0 ? _a : ruleSchema.message;\r\n var ruleTargets = _getRuleTargets(field, ruleSchema, ruleName);\r\n var _b = _getUserTargets(field, ruleSchema, ruleName, message), userTargets = _b.userTargets, userMessage = _b.userMessage;\r\n var values = __assign(__assign(__assign(__assign({}, (params || {})), { _field_: field.name, _value_: value, _rule_: ruleName }), ruleTargets), userTargets);\r\n return {\r\n msg: function () { return _normalizeMessage(userMessage || getConfig().defaultMessage, field.name, values); },\r\n rule: ruleName\r\n };\r\n}\r\nfunction _getRuleTargets(field, ruleSchema, ruleName) {\r\n var params = ruleSchema.params;\r\n if (!params) {\r\n return {};\r\n }\r\n var numTargets = params.filter(function (param) { return param.isTarget; }).length;\r\n if (numTargets <= 0) {\r\n return {};\r\n }\r\n var names = {};\r\n var ruleConfig = field.rules[ruleName];\r\n if (!Array.isArray(ruleConfig) && isObject(ruleConfig)) {\r\n ruleConfig = params.map(function (param) {\r\n return ruleConfig[param.name];\r\n });\r\n }\r\n for (var index = 0; index < params.length; index++) {\r\n var param = params[index];\r\n var key = ruleConfig[index];\r\n if (!isLocator(key)) {\r\n continue;\r\n }\r\n key = key.__locatorRef;\r\n var name_1 = field.names[key] || key;\r\n names[param.name] = name_1;\r\n names[\"_\" + param.name + \"_\"] = field.crossTable[key];\r\n }\r\n return names;\r\n}\r\nfunction _getUserTargets(field, ruleSchema, ruleName, userMessage) {\r\n var userTargets = {};\r\n var rules = field.rules[ruleName];\r\n var params = ruleSchema.params || [];\r\n // early return if no rules\r\n if (!rules) {\r\n return {};\r\n }\r\n // check all rules to convert targets\r\n Object.keys(rules).forEach(function (key, index) {\r\n // get the rule\r\n var rule = rules[key];\r\n if (!isLocator(rule)) {\r\n return {};\r\n }\r\n // get associated parameter\r\n var param = params[index];\r\n if (!param) {\r\n return {};\r\n }\r\n // grab the name of the target\r\n var name = rule.__locatorRef;\r\n userTargets[param.name] = field.names[name] || name;\r\n userTargets[\"_\" + param.name + \"_\"] = field.crossTable[name];\r\n });\r\n return {\r\n userTargets: userTargets,\r\n userMessage: userMessage\r\n };\r\n}\r\nfunction _normalizeMessage(template, field, values) {\r\n if (typeof template === 'function') {\r\n return template(field, values);\r\n }\r\n return interpolate(template, __assign(__assign({}, values), { _field_: field }));\r\n}\r\nfunction fillTargetValues(params, crossTable) {\r\n if (Array.isArray(params)) {\r\n return params.map(function (param) {\r\n var targetPart = typeof param === 'string' && param[0] === '@' ? param.slice(1) : param;\r\n if (targetPart in crossTable) {\r\n return crossTable[targetPart];\r\n }\r\n return param;\r\n });\r\n }\r\n var values = {};\r\n var normalize = function (value) {\r\n if (isLocator(value)) {\r\n return value(crossTable);\r\n }\r\n return value;\r\n };\r\n Object.keys(params).forEach(function (param) {\r\n values[param] = normalize(params[param]);\r\n });\r\n return values;\r\n}\n\nvar aggressive = function () { return ({\r\n on: ['input', 'blur']\r\n}); };\r\nvar lazy = function () { return ({\r\n on: ['change', 'blur']\r\n}); };\r\nvar eager = function (_a) {\r\n var errors = _a.errors;\r\n if (errors.length) {\r\n return {\r\n on: ['input', 'change']\r\n };\r\n }\r\n return {\r\n on: ['change', 'blur']\r\n };\r\n};\r\nvar passive = function () { return ({\r\n on: []\r\n}); };\r\nvar modes = {\r\n aggressive: aggressive,\r\n eager: eager,\r\n passive: passive,\r\n lazy: lazy\r\n};\r\nvar setInteractionMode = function (mode, implementation) {\r\n setConfig({ mode: mode });\r\n if (!implementation) {\r\n return;\r\n }\r\n if (!isCallable(implementation)) {\r\n throw new Error('A mode implementation must be a function');\r\n }\r\n modes[mode] = implementation;\r\n};\n\nvar EVENT_BUS = new Vue();\r\nfunction localeChanged() {\r\n EVENT_BUS.$emit('change:locale');\r\n}\n\nvar Dictionary = /** @class */ (function () {\r\n function Dictionary(locale, dictionary) {\r\n this.container = {};\r\n this.locale = locale;\r\n this.merge(dictionary);\r\n }\r\n Dictionary.prototype.resolve = function (field, rule, values) {\r\n return this.format(this.locale, field, rule, values);\r\n };\r\n Dictionary.prototype.format = function (locale, field, rule, values) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h;\r\n var message;\r\n // find if specific message for that field was specified.\r\n message = ((_c = (_b = (_a = this.container[locale]) === null || _a === void 0 ? void 0 : _a.fields) === null || _b === void 0 ? void 0 : _b[field]) === null || _c === void 0 ? void 0 : _c[rule]) || ((_e = (_d = this.container[locale]) === null || _d === void 0 ? void 0 : _d.messages) === null || _e === void 0 ? void 0 : _e[rule]);\r\n if (!message) {\r\n message = '{_field_} is not valid';\r\n }\r\n field = (_h = (_g = (_f = this.container[locale]) === null || _f === void 0 ? void 0 : _f.names) === null || _g === void 0 ? void 0 : _g[field]) !== null && _h !== void 0 ? _h : field;\r\n return isCallable(message) ? message(field, values) : interpolate(message, __assign(__assign({}, values), { _field_: field }));\r\n };\r\n Dictionary.prototype.merge = function (dictionary) {\r\n merge(this.container, dictionary);\r\n };\r\n Dictionary.prototype.hasRule = function (name) {\r\n var _a, _b;\r\n return !!((_b = (_a = this.container[this.locale]) === null || _a === void 0 ? void 0 : _a.messages) === null || _b === void 0 ? void 0 : _b[name]);\r\n };\r\n return Dictionary;\r\n}());\r\nvar DICTIONARY;\r\nfunction localize(locale, dictionary) {\r\n var _a;\r\n if (!DICTIONARY) {\r\n DICTIONARY = new Dictionary('en', {});\r\n setConfig({\r\n defaultMessage: function (field, values) {\r\n return DICTIONARY.resolve(field, values === null || values === void 0 ? void 0 : values._rule_, values || {});\r\n }\r\n });\r\n }\r\n if (typeof locale === 'string') {\r\n DICTIONARY.locale = locale;\r\n if (dictionary) {\r\n DICTIONARY.merge((_a = {}, _a[locale] = dictionary, _a));\r\n }\r\n localeChanged();\r\n return;\r\n }\r\n DICTIONARY.merge(locale);\r\n}\n\nvar isEvent = function (evt) {\r\n if (!evt) {\r\n return false;\r\n }\r\n if (typeof Event !== 'undefined' && isCallable(Event) && evt instanceof Event) {\r\n return true;\r\n }\r\n // this is for IE\r\n /* istanbul ignore next */\r\n if (evt && evt.srcElement) {\r\n return true;\r\n }\r\n return false;\r\n};\r\nfunction normalizeEventValue(value) {\r\n var _a, _b;\r\n if (!isEvent(value)) {\r\n return value;\r\n }\r\n var input = value.target;\r\n if (input.type === 'file' && input.files) {\r\n return toArray(input.files);\r\n }\r\n // If the input has a `v-model.number` modifier applied.\r\n if ((_a = input._vModifiers) === null || _a === void 0 ? void 0 : _a.number) {\r\n // as per the spec the v-model.number uses parseFloat\r\n var valueAsNumber = parseFloat(input.value);\r\n if (isNaN(valueAsNumber)) {\r\n return input.value;\r\n }\r\n return valueAsNumber;\r\n }\r\n if ((_b = input._vModifiers) === null || _b === void 0 ? void 0 : _b.trim) {\r\n var trimmedValue = typeof input.value === 'string' ? input.value.trim() : input.value;\r\n return trimmedValue;\r\n }\r\n return input.value;\r\n}\n\nvar isTextInput = function (vnode) {\r\n var _a;\r\n var attrs = ((_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs) || vnode.elm;\r\n // it will fallback to being a text input per browsers spec.\r\n if (vnode.tag === 'input' && (!attrs || !attrs.type)) {\r\n return true;\r\n }\r\n if (vnode.tag === 'textarea') {\r\n return true;\r\n }\r\n return includes(['text', 'password', 'search', 'email', 'tel', 'url', 'number'], attrs === null || attrs === void 0 ? void 0 : attrs.type);\r\n};\r\n// export const isCheckboxOrRadioInput = (vnode: VNode): boolean => {\r\n// const attrs = (vnode.data && vnode.data.attrs) || vnode.elm;\r\n// return includes(['radio', 'checkbox'], attrs && attrs.type);\r\n// };\r\n// Gets the model object on the vnode.\r\nfunction findModel(vnode) {\r\n if (!vnode.data) {\r\n return undefined;\r\n }\r\n // Component Model\r\n // THIS IS NOT TYPED IN OFFICIAL VUE TYPINGS\r\n // eslint-disable-next-line\r\n var nonStandardVNodeData = vnode.data;\r\n if ('model' in nonStandardVNodeData) {\r\n return nonStandardVNodeData.model;\r\n }\r\n if (!vnode.data.directives) {\r\n return undefined;\r\n }\r\n return find(vnode.data.directives, function (d) { return d.name === 'model'; });\r\n}\r\nfunction findValue(vnode) {\r\n var _a, _b;\r\n var model = findModel(vnode);\r\n if (model) {\r\n return { value: model.value };\r\n }\r\n var config = findModelConfig(vnode);\r\n var prop = (config === null || config === void 0 ? void 0 : config.prop) || 'value';\r\n if (((_a = vnode.componentOptions) === null || _a === void 0 ? void 0 : _a.propsData) && prop in vnode.componentOptions.propsData) {\r\n var propsDataWithValue = vnode.componentOptions.propsData;\r\n return { value: propsDataWithValue[prop] };\r\n }\r\n if (((_b = vnode.data) === null || _b === void 0 ? void 0 : _b.domProps) && 'value' in vnode.data.domProps) {\r\n return { value: vnode.data.domProps.value };\r\n }\r\n return undefined;\r\n}\r\nfunction extractChildren(vnode) {\r\n if (Array.isArray(vnode)) {\r\n return vnode;\r\n }\r\n if (Array.isArray(vnode.children)) {\r\n return vnode.children;\r\n }\r\n /* istanbul ignore next */\r\n if (vnode.componentOptions && Array.isArray(vnode.componentOptions.children)) {\r\n return vnode.componentOptions.children;\r\n }\r\n return [];\r\n}\r\nfunction findInputNodes(vnode) {\r\n if (!Array.isArray(vnode) && findValue(vnode) !== undefined) {\r\n return [vnode];\r\n }\r\n var children = extractChildren(vnode);\r\n return children.reduce(function (nodes, node) {\r\n var candidates = findInputNodes(node);\r\n if (candidates.length) {\r\n nodes.push.apply(nodes, candidates);\r\n }\r\n return nodes;\r\n }, []);\r\n}\r\n// Resolves v-model config if exists.\r\nfunction findModelConfig(vnode) {\r\n /* istanbul ignore next */\r\n if (!vnode.componentOptions)\r\n return null;\r\n // This is also not typed in the standard Vue TS.\r\n return vnode.componentOptions.Ctor.options.model;\r\n}\r\n// Adds a listener to vnode listener object.\r\nfunction mergeVNodeListeners(obj, eventName, handler) {\r\n // no listener at all.\r\n if (isNullOrUndefined(obj[eventName])) {\r\n obj[eventName] = [handler];\r\n return;\r\n }\r\n // Is an invoker.\r\n if (isCallable(obj[eventName]) && obj[eventName].fns) {\r\n var invoker = obj[eventName];\r\n invoker.fns = Array.isArray(invoker.fns) ? invoker.fns : [invoker.fns];\r\n if (!includes(invoker.fns, handler)) {\r\n invoker.fns.push(handler);\r\n }\r\n return;\r\n }\r\n if (isCallable(obj[eventName])) {\r\n var prev = obj[eventName];\r\n obj[eventName] = [prev];\r\n }\r\n if (Array.isArray(obj[eventName]) && !includes(obj[eventName], handler)) {\r\n obj[eventName].push(handler);\r\n }\r\n}\r\n// Adds a listener to a native HTML vnode.\r\nfunction addNativeNodeListener(node, eventName, handler) {\r\n /* istanbul ignore next */\r\n if (!node.data) {\r\n node.data = {};\r\n }\r\n if (isNullOrUndefined(node.data.on)) {\r\n node.data.on = {};\r\n }\r\n mergeVNodeListeners(node.data.on, eventName, handler);\r\n}\r\n// Adds a listener to a Vue component vnode.\r\nfunction addComponentNodeListener(node, eventName, handler) {\r\n /* istanbul ignore next */\r\n if (!node.componentOptions) {\r\n return;\r\n }\r\n /* istanbul ignore next */\r\n if (!node.componentOptions.listeners) {\r\n node.componentOptions.listeners = {};\r\n }\r\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\r\n}\r\nfunction addVNodeListener(vnode, eventName, handler) {\r\n if (vnode.componentOptions) {\r\n addComponentNodeListener(vnode, eventName, handler);\r\n return;\r\n }\r\n addNativeNodeListener(vnode, eventName, handler);\r\n}\r\n// Determines if `change` should be used over `input` for listeners.\r\nfunction getInputEventName(vnode, model) {\r\n var _a;\r\n // Is a component.\r\n if (vnode.componentOptions) {\r\n var event_1 = (findModelConfig(vnode) || { event: 'input' }).event;\r\n return event_1;\r\n }\r\n // Lazy Models typically use change event\r\n if ((_a = model === null || model === void 0 ? void 0 : model.modifiers) === null || _a === void 0 ? void 0 : _a.lazy) {\r\n return 'change';\r\n }\r\n // is a textual-type input.\r\n if (isTextInput(vnode)) {\r\n return 'input';\r\n }\r\n return 'change';\r\n}\r\nfunction isHTMLNode(node) {\r\n return includes(['input', 'select', 'textarea'], node.tag);\r\n}\r\n// TODO: Type this one properly.\r\nfunction normalizeSlots(slots, ctx) {\r\n var acc = [];\r\n return Object.keys(slots).reduce(function (arr, key) {\r\n slots[key].forEach(function (vnode) {\r\n if (!vnode.context) {\r\n slots[key].context = ctx;\r\n if (!vnode.data) {\r\n vnode.data = {};\r\n }\r\n vnode.data.slot = key;\r\n }\r\n });\r\n return arr.concat(slots[key]);\r\n }, acc);\r\n}\r\nfunction resolveTextualRules(vnode) {\r\n var _a;\r\n var attrs = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs;\r\n var rules = {};\r\n if (!attrs)\r\n return rules;\r\n if (attrs.type === 'email' && RuleContainer.getRuleDefinition('email')) {\r\n rules.email = ['multiple' in attrs];\r\n }\r\n if (attrs.pattern && RuleContainer.getRuleDefinition('regex')) {\r\n rules.regex = attrs.pattern;\r\n }\r\n if (attrs.maxlength >= 0 && RuleContainer.getRuleDefinition('max')) {\r\n rules.max = attrs.maxlength;\r\n }\r\n if (attrs.minlength >= 0 && RuleContainer.getRuleDefinition('min')) {\r\n rules.min = attrs.minlength;\r\n }\r\n if (attrs.type === 'number') {\r\n if (isSpecified(attrs.min) && RuleContainer.getRuleDefinition('min_value')) {\r\n rules.min_value = Number(attrs.min);\r\n }\r\n if (isSpecified(attrs.max) && RuleContainer.getRuleDefinition('max_value')) {\r\n rules.max_value = Number(attrs.max);\r\n }\r\n }\r\n return rules;\r\n}\r\nfunction resolveRules(vnode) {\r\n var _a;\r\n var htmlTags = ['input', 'select', 'textarea'];\r\n var attrs = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs;\r\n if (!includes(htmlTags, vnode.tag) || !attrs) {\r\n return {};\r\n }\r\n var rules = {};\r\n if ('required' in attrs && attrs.required !== false && RuleContainer.getRuleDefinition('required')) {\r\n rules.required = attrs.type === 'checkbox' ? [true] : true;\r\n }\r\n if (isTextInput(vnode)) {\r\n return normalizeRules(__assign(__assign({}, rules), resolveTextualRules(vnode)));\r\n }\r\n return normalizeRules(rules);\r\n}\r\nfunction normalizeChildren(context, slotProps) {\r\n if (context.$scopedSlots.default) {\r\n return context.$scopedSlots.default(slotProps) || [];\r\n }\r\n return context.$slots.default || [];\r\n}\n\n/**\r\n * Determines if a provider needs to run validation.\r\n */\r\nfunction shouldValidate(ctx, value) {\r\n // when an immediate/initial validation is needed and wasn't done before.\r\n if (!ctx._ignoreImmediate && ctx.immediate) {\r\n return true;\r\n }\r\n // when the value changes for whatever reason.\r\n if (!isRefEqual(ctx.value, value) && ctx.normalizedEvents.length) {\r\n return true;\r\n }\r\n // when it needs validation due to props/cross-fields changes.\r\n if (ctx._needsValidation) {\r\n return true;\r\n }\r\n // when the initial value is undefined and the field wasn't rendered yet.\r\n if (!ctx.initialized && value === undefined) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction createValidationCtx(ctx) {\r\n return __assign(__assign({}, ctx.flags), { errors: ctx.errors, classes: ctx.classes, failedRules: ctx.failedRules, reset: function () { return ctx.reset(); }, validate: function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return ctx.validate.apply(ctx, args);\r\n }, ariaInput: {\r\n 'aria-invalid': ctx.flags.invalid ? 'true' : 'false',\r\n 'aria-required': ctx.isRequired ? 'true' : 'false',\r\n 'aria-errormessage': \"vee_\" + ctx.id\r\n }, ariaMsg: {\r\n id: \"vee_\" + ctx.id,\r\n 'aria-live': ctx.errors.length ? 'assertive' : 'off'\r\n } });\r\n}\r\nfunction onRenderUpdate(vm, value) {\r\n if (!vm.initialized) {\r\n vm.initialValue = value;\r\n }\r\n var validateNow = shouldValidate(vm, value);\r\n vm._needsValidation = false;\r\n vm.value = value;\r\n vm._ignoreImmediate = true;\r\n if (!validateNow) {\r\n return;\r\n }\r\n var validate = function () {\r\n if (vm.immediate || vm.flags.validated) {\r\n return triggerThreadSafeValidation(vm);\r\n }\r\n vm.validateSilent();\r\n };\r\n if (vm.initialized) {\r\n validate();\r\n return;\r\n }\r\n vm.$once('hook:mounted', function () { return validate(); });\r\n}\r\nfunction computeModeSetting(ctx) {\r\n var compute = (isCallable(ctx.mode) ? ctx.mode : modes[ctx.mode]);\r\n return compute(ctx);\r\n}\r\nfunction triggerThreadSafeValidation(vm) {\r\n var pendingPromise = vm.validateSilent();\r\n // avoids race conditions between successive validations.\r\n vm._pendingValidation = pendingPromise;\r\n return pendingPromise.then(function (result) {\r\n if (pendingPromise === vm._pendingValidation) {\r\n vm.applyResult(result);\r\n vm._pendingValidation = undefined;\r\n }\r\n return result;\r\n });\r\n}\r\n// Creates the common handlers for a validatable context.\r\nfunction createCommonHandlers(vm) {\r\n if (!vm.$veeOnInput) {\r\n vm.$veeOnInput = function (e) {\r\n vm.syncValue(e); // track and keep the value updated.\r\n vm.setFlags({ dirty: true, pristine: false });\r\n };\r\n }\r\n var onInput = vm.$veeOnInput;\r\n if (!vm.$veeOnBlur) {\r\n vm.$veeOnBlur = function () {\r\n vm.setFlags({ touched: true, untouched: false });\r\n };\r\n }\r\n // Blur event listener.\r\n var onBlur = vm.$veeOnBlur;\r\n var onValidate = vm.$veeHandler;\r\n var mode = computeModeSetting(vm);\r\n // Handle debounce changes.\r\n if (!onValidate || vm.$veeDebounce !== vm.debounce) {\r\n onValidate = debounce(function () {\r\n vm.$nextTick(function () {\r\n if (!vm._pendingReset) {\r\n triggerThreadSafeValidation(vm);\r\n }\r\n vm._pendingReset = false;\r\n });\r\n }, mode.debounce || vm.debounce);\r\n // Cache the handler so we don't create it each time.\r\n vm.$veeHandler = onValidate;\r\n // cache the debounce value so we detect if it was changed.\r\n vm.$veeDebounce = vm.debounce;\r\n }\r\n return { onInput: onInput, onBlur: onBlur, onValidate: onValidate };\r\n}\r\n// Adds all plugin listeners to the vnode.\r\nfunction addListeners(vm, node) {\r\n var value = findValue(node);\r\n // cache the input eventName.\r\n vm._inputEventName = vm._inputEventName || getInputEventName(node, findModel(node));\r\n onRenderUpdate(vm, value === null || value === void 0 ? void 0 : value.value);\r\n var _a = createCommonHandlers(vm), onInput = _a.onInput, onBlur = _a.onBlur, onValidate = _a.onValidate;\r\n addVNodeListener(node, vm._inputEventName, onInput);\r\n addVNodeListener(node, 'blur', onBlur);\r\n // add the validation listeners.\r\n vm.normalizedEvents.forEach(function (evt) {\r\n addVNodeListener(node, evt, onValidate);\r\n });\r\n vm.initialized = true;\r\n}\n\nvar PROVIDER_COUNTER = 0;\r\nfunction data() {\r\n var errors = [];\r\n var fieldName = '';\r\n var defaultValues = {\r\n errors: errors,\r\n value: undefined,\r\n initialized: false,\r\n initialValue: undefined,\r\n flags: createFlags(),\r\n failedRules: {},\r\n isActive: true,\r\n fieldName: fieldName,\r\n id: ''\r\n };\r\n return defaultValues;\r\n}\r\nvar ValidationProvider = Vue.extend({\r\n inject: {\r\n $_veeObserver: {\r\n from: '$_veeObserver',\r\n default: function () {\r\n if (!this.$vnode.context.$_veeObserver) {\r\n this.$vnode.context.$_veeObserver = createObserver();\r\n }\r\n return this.$vnode.context.$_veeObserver;\r\n }\r\n }\r\n },\r\n props: {\r\n vid: {\r\n type: String,\r\n default: ''\r\n },\r\n name: {\r\n type: String,\r\n default: null\r\n },\r\n mode: {\r\n type: [String, Function],\r\n default: function () {\r\n return getConfig().mode;\r\n }\r\n },\r\n rules: {\r\n type: [Object, String],\r\n default: null\r\n },\r\n immediate: {\r\n type: Boolean,\r\n default: false\r\n },\r\n bails: {\r\n type: Boolean,\r\n default: function () { return getConfig().bails; }\r\n },\r\n skipIfEmpty: {\r\n type: Boolean,\r\n default: function () { return getConfig().skipOptional; }\r\n },\r\n debounce: {\r\n type: Number,\r\n default: 0\r\n },\r\n tag: {\r\n type: String,\r\n default: 'span'\r\n },\r\n slim: {\r\n type: Boolean,\r\n default: false\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n customMessages: {\r\n type: Object,\r\n default: function () {\r\n return {};\r\n }\r\n },\r\n detectInput: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n watch: {\r\n rules: {\r\n deep: true,\r\n handler: function (val, oldVal) {\r\n this._needsValidation = !isEqual(val, oldVal);\r\n }\r\n }\r\n },\r\n data: data,\r\n computed: {\r\n fieldDeps: function () {\r\n var _this = this;\r\n return Object.keys(this.normalizedRules).reduce(function (acc, rule) {\r\n var deps = extractLocators(_this.normalizedRules[rule]).map(function (dep) {\r\n return isLocator(dep) ? dep.__locatorRef : dep.slice(1);\r\n });\r\n acc.push.apply(acc, deps);\r\n deps.forEach(function (depName) {\r\n watchCrossFieldDep(_this, depName);\r\n });\r\n return acc;\r\n }, []);\r\n },\r\n normalizedEvents: function () {\r\n var _this = this;\r\n var on = computeModeSetting(this).on;\r\n return (on || []).map(function (e) {\r\n if (e === 'input') {\r\n return _this._inputEventName;\r\n }\r\n return e;\r\n });\r\n },\r\n isRequired: function () {\r\n var rules = __assign(__assign({}, this._resolvedRules), this.normalizedRules);\r\n var isRequired = Object.keys(rules).some(RuleContainer.isRequireRule);\r\n this.flags.required = !!isRequired;\r\n return isRequired;\r\n },\r\n classes: function () {\r\n var names = getConfig().classes;\r\n return computeClassObj(names, this.flags);\r\n },\r\n normalizedRules: function () {\r\n return normalizeRules(this.rules);\r\n }\r\n },\r\n mounted: function () {\r\n var _this = this;\r\n var onLocaleChanged = function () {\r\n if (!_this.flags.validated) {\r\n return;\r\n }\r\n var regenerateMap = _this._regenerateMap;\r\n if (regenerateMap) {\r\n var errors_1 = [];\r\n var failedRules_1 = {};\r\n Object.keys(regenerateMap).forEach(function (rule) {\r\n var msg = regenerateMap[rule]();\r\n errors_1.push(msg);\r\n failedRules_1[rule] = msg;\r\n });\r\n _this.applyResult({ errors: errors_1, failedRules: failedRules_1, regenerateMap: regenerateMap });\r\n return;\r\n }\r\n _this.validate();\r\n };\r\n EVENT_BUS.$on('change:locale', onLocaleChanged);\r\n this.$on('hook:beforeDestroy', function () {\r\n EVENT_BUS.$off('change:locale', onLocaleChanged);\r\n });\r\n },\r\n render: function (h) {\r\n var _this = this;\r\n this.registerField();\r\n var ctx = createValidationCtx(this);\r\n var children = normalizeChildren(this, ctx);\r\n // Automatic v-model detection\r\n if (this.detectInput) {\r\n var inputs = findInputNodes(children);\r\n if (inputs.length) {\r\n inputs.forEach(function (input, idx) {\r\n var _a, _b, _c, _d, _e, _f;\r\n // If the elements are not checkboxes and there are more input nodes\r\n if (!includes(['checkbox', 'radio'], (_b = (_a = input.data) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b.type) && idx > 0) {\r\n return;\r\n }\r\n var resolved = getConfig().useConstraintAttrs ? resolveRules(input) : {};\r\n if (!isEqual(_this._resolvedRules, resolved)) {\r\n _this._needsValidation = true;\r\n }\r\n if (isHTMLNode(input)) {\r\n _this.fieldName = ((_d = (_c = input.data) === null || _c === void 0 ? void 0 : _c.attrs) === null || _d === void 0 ? void 0 : _d.name) || ((_f = (_e = input.data) === null || _e === void 0 ? void 0 : _e.attrs) === null || _f === void 0 ? void 0 : _f.id);\r\n }\r\n _this._resolvedRules = resolved;\r\n addListeners(_this, input);\r\n });\r\n }\r\n }\r\n return this.slim && children.length <= 1 ? children[0] : h(this.tag, children);\r\n },\r\n beforeDestroy: function () {\r\n // cleanup reference.\r\n this.$_veeObserver.unobserve(this.id);\r\n },\r\n activated: function () {\r\n this.isActive = true;\r\n },\r\n deactivated: function () {\r\n this.isActive = false;\r\n },\r\n methods: {\r\n setFlags: function (flags) {\r\n var _this = this;\r\n Object.keys(flags).forEach(function (flag) {\r\n _this.flags[flag] = flags[flag];\r\n });\r\n },\r\n syncValue: function (v) {\r\n var value = normalizeEventValue(v);\r\n this.value = value;\r\n this.flags.changed = this.initialValue !== value;\r\n },\r\n reset: function () {\r\n var _this = this;\r\n this.errors = [];\r\n this.initialValue = this.value;\r\n var flags = createFlags();\r\n flags.required = this.isRequired;\r\n this.setFlags(flags);\r\n this.failedRules = {};\r\n this.validateSilent();\r\n this._pendingValidation = undefined;\r\n this._pendingReset = true;\r\n setTimeout(function () {\r\n _this._pendingReset = false;\r\n }, this.debounce);\r\n },\r\n validate: function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (args.length > 0) {\r\n this.syncValue(args[0]);\r\n }\r\n return [2 /*return*/, triggerThreadSafeValidation(this)];\r\n });\r\n });\r\n },\r\n validateSilent: function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var rules, result;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.setFlags({ pending: true });\r\n rules = __assign(__assign({}, this._resolvedRules), this.normalizedRules);\r\n Object.defineProperty(rules, '_$$isNormalized', {\r\n value: true,\r\n writable: false,\r\n enumerable: false,\r\n configurable: false\r\n });\r\n return [4 /*yield*/, validate(this.value, rules, __assign(__assign({ name: this.name || this.fieldName }, createLookup(this)), { bails: this.bails, skipIfEmpty: this.skipIfEmpty, isInitial: !this.initialized, customMessages: this.customMessages }))];\r\n case 1:\r\n result = _a.sent();\r\n this.setFlags({\r\n pending: false,\r\n valid: result.valid,\r\n invalid: !result.valid\r\n });\r\n return [2 /*return*/, result];\r\n }\r\n });\r\n });\r\n },\r\n setErrors: function (errors) {\r\n this.applyResult({ errors: errors, failedRules: {} });\r\n },\r\n applyResult: function (_a) {\r\n var errors = _a.errors, failedRules = _a.failedRules, regenerateMap = _a.regenerateMap;\r\n this.errors = errors;\r\n this._regenerateMap = regenerateMap;\r\n this.failedRules = __assign({}, (failedRules || {}));\r\n this.setFlags({\r\n valid: !errors.length,\r\n passed: !errors.length,\r\n invalid: !!errors.length,\r\n failed: !!errors.length,\r\n validated: true,\r\n changed: this.value !== this.initialValue\r\n });\r\n },\r\n registerField: function () {\r\n updateRenderingContextRefs(this);\r\n }\r\n }\r\n});\r\nfunction computeClassObj(names, flags) {\r\n var acc = {};\r\n var keys = Object.keys(flags);\r\n var length = keys.length;\r\n var _loop_1 = function (i) {\r\n var flag = keys[i];\r\n var className = (names && names[flag]) || flag;\r\n var value = flags[flag];\r\n if (isNullOrUndefined(value)) {\r\n return \"continue\";\r\n }\r\n if ((flag === 'valid' || flag === 'invalid') && !flags.validated) {\r\n return \"continue\";\r\n }\r\n if (typeof className === 'string') {\r\n acc[className] = value;\r\n }\r\n else if (Array.isArray(className)) {\r\n className.forEach(function (cls) {\r\n acc[cls] = value;\r\n });\r\n }\r\n };\r\n for (var i = 0; i < length; i++) {\r\n _loop_1(i);\r\n }\r\n return acc;\r\n}\r\nfunction createLookup(vm) {\r\n var providers = vm.$_veeObserver.refs;\r\n var reduced = {\r\n names: {},\r\n values: {}\r\n };\r\n return vm.fieldDeps.reduce(function (acc, depName) {\r\n if (!providers[depName]) {\r\n return acc;\r\n }\r\n acc.values[depName] = providers[depName].value;\r\n acc.names[depName] = providers[depName].name;\r\n return acc;\r\n }, reduced);\r\n}\r\nfunction extractId(vm) {\r\n if (vm.vid) {\r\n return vm.vid;\r\n }\r\n if (vm.name) {\r\n return vm.name;\r\n }\r\n if (vm.id) {\r\n return vm.id;\r\n }\r\n if (vm.fieldName) {\r\n return vm.fieldName;\r\n }\r\n PROVIDER_COUNTER++;\r\n return \"_vee_\" + PROVIDER_COUNTER;\r\n}\r\nfunction updateRenderingContextRefs(vm) {\r\n var providedId = extractId(vm);\r\n var id = vm.id;\r\n // Nothing has changed.\r\n if (!vm.isActive || (id === providedId && vm.$_veeObserver.refs[id])) {\r\n return;\r\n }\r\n // vid was changed.\r\n if (id !== providedId && vm.$_veeObserver.refs[id] === vm) {\r\n vm.$_veeObserver.unobserve(id);\r\n }\r\n vm.id = providedId;\r\n vm.$_veeObserver.observe(vm);\r\n}\r\nfunction createObserver() {\r\n return {\r\n refs: {},\r\n observe: function (vm) {\r\n this.refs[vm.id] = vm;\r\n },\r\n unobserve: function (id) {\r\n delete this.refs[id];\r\n }\r\n };\r\n}\r\nfunction watchCrossFieldDep(ctx, depName, withHooks) {\r\n if (withHooks === void 0) { withHooks = true; }\r\n var providers = ctx.$_veeObserver.refs;\r\n if (!ctx._veeWatchers) {\r\n ctx._veeWatchers = {};\r\n }\r\n if (!providers[depName] && withHooks) {\r\n return ctx.$once('hook:mounted', function () {\r\n watchCrossFieldDep(ctx, depName, false);\r\n });\r\n }\r\n if (!isCallable(ctx._veeWatchers[depName]) && providers[depName]) {\r\n ctx._veeWatchers[depName] = providers[depName].$watch('value', function () {\r\n if (ctx.flags.validated) {\r\n ctx._needsValidation = true;\r\n ctx.validate();\r\n }\r\n });\r\n }\r\n}\n\nvar FLAGS_STRATEGIES = [\r\n ['pristine', 'every'],\r\n ['dirty', 'some'],\r\n ['touched', 'some'],\r\n ['untouched', 'every'],\r\n ['valid', 'every'],\r\n ['invalid', 'some'],\r\n ['pending', 'some'],\r\n ['validated', 'every'],\r\n ['changed', 'some'],\r\n ['passed', 'every'],\r\n ['failed', 'some']\r\n];\r\nvar OBSERVER_COUNTER = 0;\r\nfunction data$1() {\r\n var refs = {};\r\n var errors = {};\r\n var flags = createObserverFlags();\r\n var fields = {};\r\n // FIXME: Not sure of this one can be typed, circular type reference.\r\n var observers = [];\r\n return {\r\n id: '',\r\n refs: refs,\r\n observers: observers,\r\n errors: errors,\r\n flags: flags,\r\n fields: fields\r\n };\r\n}\r\nfunction provideSelf() {\r\n return {\r\n $_veeObserver: this\r\n };\r\n}\r\nvar ValidationObserver = Vue.extend({\r\n name: 'ValidationObserver',\r\n provide: provideSelf,\r\n inject: {\r\n $_veeObserver: {\r\n from: '$_veeObserver',\r\n default: function () {\r\n if (!this.$vnode.context.$_veeObserver) {\r\n return null;\r\n }\r\n return this.$vnode.context.$_veeObserver;\r\n }\r\n }\r\n },\r\n props: {\r\n tag: {\r\n type: String,\r\n default: 'span'\r\n },\r\n vid: {\r\n type: String,\r\n default: function () {\r\n return \"obs_\" + OBSERVER_COUNTER++;\r\n }\r\n },\r\n slim: {\r\n type: Boolean,\r\n default: false\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n data: data$1,\r\n created: function () {\r\n var _this = this;\r\n this.id = this.vid;\r\n register(this);\r\n var onChange = debounce(function (_a) {\r\n var errors = _a.errors, flags = _a.flags, fields = _a.fields;\r\n _this.errors = errors;\r\n _this.flags = flags;\r\n _this.fields = fields;\r\n }, 16);\r\n this.$watch(computeObserverState, onChange);\r\n },\r\n activated: function () {\r\n register(this);\r\n },\r\n deactivated: function () {\r\n unregister(this);\r\n },\r\n beforeDestroy: function () {\r\n unregister(this);\r\n },\r\n render: function (h) {\r\n var children = normalizeChildren(this, prepareSlotProps(this));\r\n return this.slim && children.length <= 1 ? children[0] : h(this.tag, { on: this.$listeners }, children);\r\n },\r\n methods: {\r\n observe: function (subscriber, kind) {\r\n var _a;\r\n if (kind === void 0) { kind = 'provider'; }\r\n if (kind === 'observer') {\r\n this.observers.push(subscriber);\r\n return;\r\n }\r\n this.refs = __assign(__assign({}, this.refs), (_a = {}, _a[subscriber.id] = subscriber, _a));\r\n },\r\n unobserve: function (id, kind) {\r\n if (kind === void 0) { kind = 'provider'; }\r\n if (kind === 'provider') {\r\n var provider = this.refs[id];\r\n if (!provider) {\r\n return;\r\n }\r\n this.$delete(this.refs, id);\r\n return;\r\n }\r\n var idx = findIndex(this.observers, function (o) { return o.id === id; });\r\n if (idx !== -1) {\r\n this.observers.splice(idx, 1);\r\n }\r\n },\r\n validateWithInfo: function (_a) {\r\n var _b = (_a === void 0 ? {} : _a).silent, silent = _b === void 0 ? false : _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var results, isValid, _c, errors, flags, fields;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0: return [4 /*yield*/, Promise.all(__spreadArrays(values(this.refs)\r\n .filter(function (r) { return !r.disabled; })\r\n .map(function (ref) { return ref[silent ? 'validateSilent' : 'validate']().then(function (r) { return r.valid; }); }), this.observers.filter(function (o) { return !o.disabled; }).map(function (obs) { return obs.validate({ silent: silent }); })))];\r\n case 1:\r\n results = _d.sent();\r\n isValid = results.every(function (r) { return r; });\r\n _c = computeObserverState.call(this), errors = _c.errors, flags = _c.flags, fields = _c.fields;\r\n this.errors = errors;\r\n this.flags = flags;\r\n this.fields = fields;\r\n return [2 /*return*/, {\r\n errors: errors,\r\n flags: flags,\r\n fields: fields,\r\n isValid: isValid\r\n }];\r\n }\r\n });\r\n });\r\n },\r\n validate: function (_a) {\r\n var _b = (_a === void 0 ? {} : _a).silent, silent = _b === void 0 ? false : _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var isValid;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0: return [4 /*yield*/, this.validateWithInfo({ silent: silent })];\r\n case 1:\r\n isValid = (_c.sent()).isValid;\r\n return [2 /*return*/, isValid];\r\n }\r\n });\r\n });\r\n },\r\n handleSubmit: function (cb) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var isValid;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.validate()];\r\n case 1:\r\n isValid = _a.sent();\r\n if (!isValid || !cb) {\r\n return [2 /*return*/];\r\n }\r\n return [2 /*return*/, cb()];\r\n }\r\n });\r\n });\r\n },\r\n reset: function () {\r\n return __spreadArrays(values(this.refs), this.observers).forEach(function (ref) { return ref.reset(); });\r\n },\r\n setErrors: function (errors) {\r\n var _this = this;\r\n Object.keys(errors).forEach(function (key) {\r\n var provider = _this.refs[key];\r\n if (!provider)\r\n return;\r\n var errorArr = errors[key] || [];\r\n errorArr = typeof errorArr === 'string' ? [errorArr] : errorArr;\r\n provider.setErrors(errorArr);\r\n });\r\n this.observers.forEach(function (observer) {\r\n observer.setErrors(errors);\r\n });\r\n }\r\n }\r\n});\r\nfunction unregister(vm) {\r\n if (vm.$_veeObserver) {\r\n vm.$_veeObserver.unobserve(vm.id, 'observer');\r\n }\r\n}\r\nfunction register(vm) {\r\n if (vm.$_veeObserver) {\r\n vm.$_veeObserver.observe(vm, 'observer');\r\n }\r\n}\r\nfunction prepareSlotProps(vm) {\r\n return __assign(__assign({}, vm.flags), { errors: vm.errors, fields: vm.fields, validate: vm.validate, validateWithInfo: vm.validateWithInfo, passes: vm.handleSubmit, handleSubmit: vm.handleSubmit, reset: vm.reset });\r\n}\r\n// Creates a modified version of validation flags\r\nfunction createObserverFlags() {\r\n return __assign(__assign({}, createFlags()), { valid: true, invalid: false });\r\n}\r\nfunction computeObserverState() {\r\n var vms = __spreadArrays(values(this.refs), this.observers);\r\n var errors = {};\r\n var flags = createObserverFlags();\r\n var fields = {};\r\n var length = vms.length;\r\n for (var i = 0; i < length; i++) {\r\n var vm = vms[i];\r\n // validation provider\r\n if (Array.isArray(vm.errors)) {\r\n errors[vm.id] = vm.errors;\r\n fields[vm.id] = __assign({ id: vm.id, name: vm.name, failedRules: vm.failedRules }, vm.flags);\r\n continue;\r\n }\r\n // Nested observer, merge errors and fields\r\n errors = __assign(__assign({}, errors), vm.errors);\r\n fields = __assign(__assign({}, fields), vm.fields);\r\n }\r\n FLAGS_STRATEGIES.forEach(function (_a) {\r\n var flag = _a[0], method = _a[1];\r\n flags[flag] = vms[method](function (vm) { return vm.flags[flag]; });\r\n });\r\n return { errors: errors, flags: flags, fields: fields };\r\n}\n\nfunction withValidation(component, mapProps) {\r\n var _a;\r\n if (mapProps === void 0) { mapProps = identity; }\r\n var options = 'options' in component ? component.options : component;\r\n var providerOpts = ValidationProvider.options;\r\n var hoc = {\r\n name: (options.name || 'AnonymousHoc') + \"WithValidation\",\r\n props: __assign({}, providerOpts.props),\r\n data: providerOpts.data,\r\n computed: __assign({}, providerOpts.computed),\r\n methods: __assign({}, providerOpts.methods),\r\n beforeDestroy: providerOpts.beforeDestroy,\r\n inject: providerOpts.inject\r\n };\r\n var eventName = ((_a = options === null || options === void 0 ? void 0 : options.model) === null || _a === void 0 ? void 0 : _a.event) || 'input';\r\n hoc.render = function (h) {\r\n var _a;\r\n this.registerField();\r\n var vctx = createValidationCtx(this);\r\n var listeners = __assign({}, this.$listeners);\r\n var model = findModel(this.$vnode);\r\n this._inputEventName = this._inputEventName || getInputEventName(this.$vnode, model);\r\n var value = findValue(this.$vnode);\r\n onRenderUpdate(this, value === null || value === void 0 ? void 0 : value.value);\r\n var _b = createCommonHandlers(this), onInput = _b.onInput, onBlur = _b.onBlur, onValidate = _b.onValidate;\r\n mergeVNodeListeners(listeners, eventName, onInput);\r\n mergeVNodeListeners(listeners, 'blur', onBlur);\r\n this.normalizedEvents.forEach(function (evt) {\r\n mergeVNodeListeners(listeners, evt, onValidate);\r\n });\r\n // Props are any attrs not associated with ValidationProvider Plus the model prop.\r\n // WARNING: Accidental prop overwrite will probably happen.\r\n var prop = (findModelConfig(this.$vnode) || { prop: 'value' }).prop;\r\n var props = __assign(__assign(__assign({}, this.$attrs), (_a = {}, _a[prop] = model === null || model === void 0 ? void 0 : model.value, _a)), mapProps(vctx));\r\n return h(options, {\r\n attrs: this.$attrs,\r\n props: props,\r\n on: listeners,\r\n scopedSlots: this.$scopedSlots\r\n }, normalizeSlots(this.$slots, this.$vnode.context));\r\n };\r\n return hoc;\r\n}\n\nvar version = '3.4.3';\n\nexport { ValidationObserver, ValidationProvider, configure, extend, localeChanged, localize, normalizeRules, setInteractionMode, validate, version, withValidation };\n","//! moment.js locale configuration\n//! locale : Slovak [sk]\n//! author : Martin Minka : https://github.com/k2s\n//! based on work of petrbela : https://github.com/petrbela\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(\n '_'\n ),\n monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');\n function plural(n) {\n return n > 1 && n < 5;\n }\n function translate(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's': // a few seconds / in a few seconds / a few seconds ago\n return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';\n case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'sekundy' : 'sekúnd');\n } else {\n return result + 'sekundami';\n }\n case 'm': // a minute / in a minute / a minute ago\n return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';\n case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'minúty' : 'minút');\n } else {\n return result + 'minútami';\n }\n case 'h': // an hour / in an hour / an hour ago\n return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';\n case 'hh': // 9 hours / in 9 hours / 9 hours ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'hodiny' : 'hodín');\n } else {\n return result + 'hodinami';\n }\n case 'd': // a day / in a day / a day ago\n return withoutSuffix || isFuture ? 'deň' : 'dňom';\n case 'dd': // 9 days / in 9 days / 9 days ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'dni' : 'dní');\n } else {\n return result + 'dňami';\n }\n case 'M': // a month / in a month / a month ago\n return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';\n case 'MM': // 9 months / in 9 months / 9 months ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'mesiace' : 'mesiacov');\n } else {\n return result + 'mesiacmi';\n }\n case 'y': // a year / in a year / a year ago\n return withoutSuffix || isFuture ? 'rok' : 'rokom';\n case 'yy': // 9 years / in 9 years / 9 years ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'roky' : 'rokov');\n } else {\n return result + 'rokmi';\n }\n }\n }\n\n var sk = moment.defineLocale('sk', {\n months: months,\n monthsShort: monthsShort,\n weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),\n weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),\n weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY H:mm',\n LLLL: 'dddd D. MMMM YYYY H:mm',\n },\n calendar: {\n sameDay: '[dnes o] LT',\n nextDay: '[zajtra o] LT',\n nextWeek: function () {\n switch (this.day()) {\n case 0:\n return '[v nedeľu o] LT';\n case 1:\n case 2:\n return '[v] dddd [o] LT';\n case 3:\n return '[v stredu o] LT';\n case 4:\n return '[vo štvrtok o] LT';\n case 5:\n return '[v piatok o] LT';\n case 6:\n return '[v sobotu o] LT';\n }\n },\n lastDay: '[včera o] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n return '[minulú nedeľu o] LT';\n case 1:\n case 2:\n return '[minulý] dddd [o] LT';\n case 3:\n return '[minulú stredu o] LT';\n case 4:\n case 5:\n return '[minulý] dddd [o] LT';\n case 6:\n return '[minulú sobotu o] LT';\n }\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: 'za %s',\n past: 'pred %s',\n s: translate,\n ss: translate,\n m: translate,\n mm: translate,\n h: translate,\n hh: translate,\n d: translate,\n dd: translate,\n M: translate,\n MM: translate,\n y: translate,\n yy: translate,\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return sk;\n\n})));\n","var anObject = require('../internals/an-object');\nvar defineProperties = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n /* global ActiveXObject */\n activeXDocument = document.domain && new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : defineProperties(result, Properties);\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $find = require('../internals/array-iteration').find;\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar FIND = 'find';\nvar SKIPS_HOLES = true;\n\nvar USES_TO_LENGTH = arrayMethodUsesToLength(FIND);\n\n// Shouldn't skip holes\nif (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });\n\n// `Array.prototype.find` method\n// https://tc39.es/ecma262/#sec-array.prototype.find\n$({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables(FIND);\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {\n createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return nativeIterator.call(this); };\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);\n }\n Iterators[NAME] = defaultIterator;\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n return methods;\n};\n","var instances = 'ej2_instances';\nvar uid = 0;\nvar isBlazorPlatform = false;\n/**\n * Function to check whether the platform is blazor or not.\n *\n * @returns {void} result\n * @private\n */\nexport function disableBlazorMode() {\n isBlazorPlatform = false;\n}\n/**\n * Create Instance from constructor function with desired parameters.\n *\n * @param {Function} classFunction - Class function to which need to create instance\n * @param {any[]} params - Parameters need to passed while creating instance\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function createInstance(classFunction, params) {\n var arrayParam = params;\n arrayParam.unshift(undefined);\n return new (Function.prototype.bind.apply(classFunction, arrayParam));\n}\n/**\n * To run a callback function immediately after the browser has completed other operations.\n *\n * @param {Function} handler - callback function to be triggered.\n * @returns {Function} ?\n * @private\n */\nexport function setImmediate(handler) {\n var unbind;\n // eslint-disable-next-line\n var num = new Uint16Array(5);\n var intCrypto = window.msCrypto || window.crypto;\n intCrypto.getRandomValues(num);\n var secret = 'ej2' + combineArray(num);\n // eslint-disable-next-line\n var messageHandler = function (event) {\n if (event.source === window && typeof event.data === 'string' && event.data.length <= 32 && event.data === secret) {\n handler();\n unbind();\n }\n };\n window.addEventListener('message', messageHandler, false);\n window.postMessage(secret, '*');\n return unbind = function () {\n window.removeEventListener('message', messageHandler);\n handler = messageHandler = secret = undefined;\n };\n}\n/**\n * To get nameSpace value from the desired object.\n *\n * @param {string} nameSpace - String value to the get the inner object\n * @param {any} obj - Object to get the inner object value.\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function getValue(nameSpace, obj) {\n // eslint-disable-next-line\n var value = obj;\n var splits = nameSpace.replace(/\\[/g, '.').replace(/\\]/g, '').split('.');\n for (var i = 0; i < splits.length && !isUndefined(value); i++) {\n value = value[splits[i]];\n }\n return value;\n}\n/**\n * To set value for the nameSpace in desired object.\n *\n * @param {string} nameSpace - String value to the get the inner object\n * @param {any} value - Value that you need to set.\n * @param {any} obj - Object to get the inner object value.\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function setValue(nameSpace, value, obj) {\n var keys = nameSpace.replace(/\\[/g, '.').replace(/\\]/g, '').split('.');\n // eslint-disable-next-line\n var start = obj || {};\n // eslint-disable-next-line\n var fromObj = start;\n var i;\n var length = keys.length;\n var key;\n for (i = 0; i < length; i++) {\n key = keys[i];\n if (i + 1 === length) {\n fromObj[key] = value === undefined ? {} : value;\n }\n else if (isNullOrUndefined(fromObj[key])) {\n fromObj[key] = {};\n }\n fromObj = fromObj[key];\n }\n return start;\n}\n/**\n * Delete an item from Object\n *\n * @param {any} obj - Object in which we need to delete an item.\n * @param {string} key - String value to the get the inner object\n * @returns {void} ?\n * @private\n */\n// eslint-disable-next-line\nexport function deleteObject(obj, key) {\n delete obj[key];\n}\n/**\n * Check weather the given argument is only object.\n *\n * @param {any} obj - Object which is need to check.\n * @returns {boolean} ?\n * @private\n */\n// eslint-disable-next-line\nexport function isObject(obj) {\n var objCon = {};\n return (!isNullOrUndefined(obj) && obj.constructor === objCon.constructor);\n}\n/**\n * To get enum value by giving the string.\n *\n * @param {any} enumObject - Enum object.\n * @param {string} enumValue - Enum value to be searched\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function getEnumValue(enumObject, enumValue) {\n // eslint-disable-next-line\n return enumObject[enumValue];\n}\n/**\n * Merge the source object into destination object.\n *\n * @param {any} source - source object which is going to merge with destination object\n * @param {any} destination - object need to be merged\n * @returns {void} ?\n * @private\n */\nexport function merge(source, destination) {\n if (!isNullOrUndefined(destination)) {\n var temrObj = source;\n var tempProp = destination;\n var keys = Object.keys(destination);\n var deepmerge = 'deepMerge';\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (!isNullOrUndefined(temrObj[deepmerge]) && (temrObj[deepmerge].indexOf(key) !== -1) &&\n (isObject(tempProp[key]) || Array.isArray(tempProp[key]))) {\n extend(temrObj[key], temrObj[key], tempProp[key], true);\n }\n else {\n temrObj[key] = tempProp[key];\n }\n }\n }\n}\n/**\n * Extend the two object with newer one.\n *\n * @param {any} copied - Resultant object after merged\n * @param {Object} first - First object need to merge\n * @param {Object} second - Second object need to merge\n * @param {boolean} deep ?\n * @returns {Object} ?\n * @private\n */\nexport function extend(copied, first, second, deep) {\n var result = copied && typeof copied === 'object' ? copied : {};\n var length = arguments.length;\n if (deep) {\n length = length - 1;\n }\n var _loop_1 = function (i) {\n // eslint-disable-next-line\n if (!arguments_1[i]) {\n return \"continue\";\n }\n // eslint-disable-next-line\n var obj1 = arguments_1[i];\n Object.keys(obj1).forEach(function (key) {\n var src = result[key];\n var copy = obj1[key];\n var clone;\n var isArrayChanged = Array.isArray(copy) && Array.isArray(src) && (copy.length !== src.length);\n // eslint-disable-next-line\n var blazorEventExtend = isBlazor() ? (!(src instanceof Event) && !isArrayChanged) : true;\n if (deep && blazorEventExtend && (isObject(copy) || Array.isArray(copy))) {\n if (isObject(copy)) {\n clone = src ? src : {};\n // eslint-disable-next-line\n if (Array.isArray(clone) && clone.hasOwnProperty('isComplexArray')) {\n extend(clone, {}, copy, deep);\n }\n else {\n result[key] = extend(clone, {}, copy, deep);\n }\n }\n else {\n /* istanbul ignore next */\n clone = isBlazor() ? src && Object.keys(copy).length : src ? src : [];\n result[key] = extend([], clone, copy, deep);\n }\n }\n else {\n result[key] = copy;\n }\n });\n };\n var arguments_1 = arguments;\n for (var i = 1; i < length; i++) {\n _loop_1(i);\n }\n return result;\n}\n/**\n * To check whether the object is null or undefined.\n *\n * @param {Object} value - To check the object is null or undefined\n * @returns {boolean} ?\n * @private\n */\nexport function isNullOrUndefined(value) {\n return value === undefined || value === null;\n}\n/**\n * To check whether the object is undefined.\n *\n * @param {Object} value - To check the object is undefined\n * @returns {boolean} ?\n * @private\n */\nexport function isUndefined(value) {\n return ('undefined' === typeof value);\n}\n/**\n * To return the generated unique name\n *\n * @param {string} definedName - To concatenate the unique id to provided name\n * @returns {string} ?\n * @private\n */\nexport function getUniqueID(definedName) {\n return definedName + '_' + uid++;\n}\n/**\n * It limits the rate at which a function can fire. The function will fire only once every provided second instead of as quickly.\n *\n * @param {Function} eventFunction - Specifies the function to run when the event occurs\n * @param {number} delay - A number that specifies the milliseconds for function delay call option\n * @returns {Function} ?\n * @private\n */\nexport function debounce(eventFunction, delay) {\n // eslint-disable-next-line\n var out;\n return function () {\n var _this = this;\n // eslint-disable-next-line\n var args = arguments;\n var later = function () {\n out = null;\n return eventFunction.apply(_this, args);\n };\n clearTimeout(out);\n out = setTimeout(later, delay);\n };\n}\n/**\n * To convert the object to string for query url\n *\n * @param {Object} data ?\n * @returns {string} ?\n * @private\n */\n// eslint-disable-next-line\nexport function queryParams(data) {\n var array = [];\n var keys = Object.keys(data);\n for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {\n var key = keys_2[_i];\n array.push(encodeURIComponent(key) + '=' + encodeURIComponent('' + data[key]));\n }\n return array.join('&');\n}\n/**\n * To check whether the given array contains object.\n *\n * @param {any} value - Specifies the T type array to be checked.\n * @returns {boolean} ?\n * @private\n */\nexport function isObjectArray(value) {\n var parser = Object.prototype.toString;\n if (parser.call(value) === '[object Array]') {\n if (parser.call(value[0]) === '[object Object]') {\n return true;\n }\n }\n return false;\n}\n/**\n * To check whether the child element is descendant to parent element or parent and child are same element.\n *\n * @param {Element} child - Specifies the child element to compare with parent.\n * @param {Element} parent - Specifies the parent element.\n * @returns {boolean} ?\n * @private\n */\nexport function compareElementParent(child, parent) {\n var node = child;\n if (node === parent) {\n return true;\n }\n else if (node === document || !node) {\n return false;\n }\n else {\n return compareElementParent(node.parentNode, parent);\n }\n}\n/**\n * To throw custom error message.\n *\n * @param {string} message - Specifies the error message to be thrown.\n * @returns {void} ?\n * @private\n */\nexport function throwError(message) {\n try {\n throw new Error(message);\n }\n catch (e) {\n // eslint-disable-next-line\n throw e.message + '\\n' + e.stack;\n }\n}\n/**\n * This function is used to print given element\n *\n * @param {Element} element - Specifies the print content element.\n * @param {Window} printWindow - Specifies the print window.\n * @returns {Window} ?\n * @private\n */\nexport function print(element, printWindow) {\n var div = document.createElement('div');\n var links = [].slice.call(document.getElementsByTagName('head')[0].querySelectorAll('base, link, style'));\n var blinks = [].slice.call(document.getElementsByTagName('body')[0].querySelectorAll('link, style'));\n if (blinks.length) {\n for (var l = 0, len = blinks.length; l < len; l++) {\n links.push(blinks[l]);\n }\n }\n var reference = '';\n if (isNullOrUndefined(printWindow)) {\n printWindow = window.open('', 'print', 'height=452,width=1024,tabbar=no');\n }\n div.appendChild(element.cloneNode(true));\n for (var i = 0, len = links.length; i < len; i++) {\n reference += links[i].outerHTML;\n }\n printWindow.document.write(' ' + reference + '' + div.innerHTML +\n '' + '');\n printWindow.document.close();\n printWindow.focus();\n // eslint-disable-next-line\n var interval = setInterval(function () {\n if (printWindow.ready) {\n printWindow.print();\n printWindow.close();\n clearInterval(interval);\n }\n }, 500);\n return printWindow;\n}\n/**\n * Function to normalize the units applied to the element.\n *\n * @param {number|string} value ?\n * @returns {string} result\n * @private\n */\nexport function formatUnit(value) {\n var result = value + '';\n if (result.match(/auto|cm|mm|in|px|pt|pc|%|em|ex|ch|rem|vw|vh|vmin|vmax/)) {\n return result;\n }\n return result + 'px';\n}\n/**\n * Function to check whether the platform is blazor or not.\n *\n * @returns {void} result\n * @private\n */\nexport function enableBlazorMode() {\n isBlazorPlatform = true;\n}\n/**\n * Function to check whether the platform is blazor or not.\n *\n * @returns {boolean} result\n * @private\n */\nexport function isBlazor() {\n return isBlazorPlatform;\n}\n/**\n * Function to convert xPath to DOM element in blazor platform\n *\n * @returns {HTMLElement} result\n * @param {HTMLElement | object} element ?\n * @private\n */\nexport function getElement(element) {\n var xPath = 'xPath';\n if (!(element instanceof Node) && isBlazor() && !isNullOrUndefined(element[xPath])) {\n return document.evaluate(element[xPath], document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n }\n return element;\n}\n/**\n * Function to fetch the Instances of a HTML element for the given component.\n *\n * @param {string | HTMLElement} element ?\n * @param {any} component ?\n * @returns {Object} ?\n * @private\n */\n// eslint-disable-next-line\nexport function getInstance(element, component) {\n // eslint-disable-next-line\n var elem = (typeof (element) === 'string') ? document.querySelector(element) : element;\n if (elem[instances]) {\n for (var _i = 0, _a = elem[instances]; _i < _a.length; _i++) {\n var inst = _a[_i];\n if (inst instanceof component) {\n return inst;\n }\n }\n }\n return null;\n}\n/**\n * Function to add instances for the given element.\n *\n * @param {string | HTMLElement} element ?\n * @param {Object} instance ?\n * @returns {void} ?\n * @private\n */\nexport function addInstance(element, instance) {\n // eslint-disable-next-line\n var elem = (typeof (element) === 'string') ? document.querySelector(element) : element;\n if (elem[instances]) {\n elem[instances].push(instance);\n }\n else {\n elem[instances] = [instance];\n }\n}\n/**\n * Function to generate the unique id.\n *\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function uniqueID() {\n if ((typeof window) === 'undefined') {\n return;\n }\n // eslint-disable-next-line\n var num = new Uint16Array(5);\n var intCrypto = window.msCrypto || window.crypto;\n return intCrypto.getRandomValues(num);\n}\n/**\n *\n * @param {Int16Array} num ?\n * @returns {string} ?\n */\nfunction combineArray(num) {\n var ret = '';\n for (var i = 0; i < 5; i++) {\n ret += (i ? ',' : '') + num[i];\n }\n return ret;\n}\n","/**\n * Parser\n */\nvar defaultNumberingSystem = {\n 'latn': {\n '_digits': '0123456789',\n '_type': 'numeric'\n }\n};\nimport { isUndefined, getValue, isBlazor } from '../util';\nvar defaultNumberSymbols = {\n 'decimal': '.',\n 'group': ',',\n 'percentSign': '%',\n 'plusSign': '+',\n 'minusSign': '-',\n 'infinity': '∞',\n 'nan': 'NaN',\n 'exponential': 'E'\n};\nvar latnNumberSystem = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\n/**\n * Interface for parser base\n *\n * @private\n */\nvar ParserBase = /** @class */ (function () {\n function ParserBase() {\n }\n /**\n * Returns the cldr object for the culture specifies\n *\n * @param {Object} obj - Specifies the object from which culture object to be acquired.\n * @param {string} cName - Specifies the culture name.\n * @returns {Object} ?\n */\n ParserBase.getMainObject = function (obj, cName) {\n var value = isBlazor() ? cName : 'main.' + cName;\n return getValue(value, obj);\n };\n /**\n * Returns the numbering system object from given cldr data.\n *\n * @param {Object} obj - Specifies the object from which number system is acquired.\n * @returns {Object} ?\n */\n ParserBase.getNumberingSystem = function (obj) {\n return getValue('supplemental.numberingSystems', obj) || this.numberingSystems;\n };\n /**\n * Returns the reverse of given object keys or keys specified.\n *\n * @param {Object} prop - Specifies the object to be reversed.\n * @param {number[]} keys - Optional parameter specifies the custom keyList for reversal.\n * @returns {Object} ?\n */\n ParserBase.reverseObject = function (prop, keys) {\n var propKeys = keys || Object.keys(prop);\n var res = {};\n for (var _i = 0, propKeys_1 = propKeys; _i < propKeys_1.length; _i++) {\n var key = propKeys_1[_i];\n // eslint-disable-next-line\n if (!res.hasOwnProperty(prop[key])) {\n // eslint-disable-next-line\n res[prop[key]] = key;\n }\n }\n return res;\n };\n /**\n * Returns the symbol regex by skipping the escape sequence.\n *\n * @param {string[]} props - Specifies the array values to be skipped.\n * @returns {RegExp} ?\n */\n ParserBase.getSymbolRegex = function (props) {\n var regexStr = props.map(function (str) {\n return str.replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, '\\\\$1');\n }).join('|');\n return new RegExp(regexStr, 'g');\n };\n /**\n *\n * @param {Object} prop ?\n * @returns {Object} ?\n */\n ParserBase.getSymbolMatch = function (prop) {\n var matchKeys = Object.keys(defaultNumberSymbols);\n var ret = {};\n for (var _i = 0, matchKeys_1 = matchKeys; _i < matchKeys_1.length; _i++) {\n var key = matchKeys_1[_i];\n // eslint-disable-next-line\n ret[prop[key]] = defaultNumberSymbols[key];\n }\n return ret;\n };\n /**\n * Returns regex string for provided value\n *\n * @param {string} val ?\n * @returns {string} ?\n */\n ParserBase.constructRegex = function (val) {\n var len = val.length;\n var ret = '';\n for (var i = 0; i < len; i++) {\n if (i !== len - 1) {\n ret += val[i] + '|';\n }\n else {\n ret += val[i];\n }\n }\n return ret;\n };\n /**\n * Returns the replaced value of matching regex and obj mapper.\n *\n * @param {string} value - Specifies the values to be replaced.\n * @param {RegExp} regex - Specifies the regex to search.\n * @param {Object} obj - Specifies the object matcher to be replace value parts.\n * @returns {string} ?\n */\n ParserBase.convertValueParts = function (value, regex, obj) {\n return value.replace(regex, function (str) {\n // eslint-disable-next-line\n return obj[str];\n });\n };\n /**\n * Returns default numbering system object for formatting from cldr data\n *\n * @param {Object} obj ?\n * @returns {NumericObject} ?\n */\n ParserBase.getDefaultNumberingSystem = function (obj) {\n var ret = {};\n ret.obj = getValue('numbers', obj);\n ret.nSystem = getValue('defaultNumberingSystem', ret.obj);\n return ret;\n };\n /**\n * Returns the replaced value of matching regex and obj mapper.\n *\n * @param {Object} curObj ?\n * @param {Object} numberSystem ?\n * @param {boolean} needSymbols ?\n * @param {boolean} blazorMode ?\n * @returns {Object} ?\n */\n ParserBase.getCurrentNumericOptions = function (curObj, numberSystem, needSymbols, blazorMode) {\n var ret = {};\n var cur = this.getDefaultNumberingSystem(curObj);\n if (!isUndefined(cur.nSystem) || blazorMode) {\n var digits = blazorMode ? getValue('obj.mapperDigits', cur) : getValue(cur.nSystem + '._digits', numberSystem);\n if (!isUndefined(digits)) {\n ret.numericPair = this.reverseObject(digits, latnNumberSystem);\n ret.numberParseRegex = new RegExp(this.constructRegex(digits), 'g');\n ret.numericRegex = '[' + digits[0] + '-' + digits[9] + ']';\n if (needSymbols) {\n ret.numericRegex = digits[0] + '-' + digits[9];\n ret.symbolNumberSystem = getValue(blazorMode ? 'numberSymbols' : 'symbols-numberSystem-' + cur.nSystem, cur.obj);\n ret.symbolMatch = this.getSymbolMatch(ret.symbolNumberSystem);\n ret.numberSystem = cur.nSystem;\n }\n }\n }\n return ret;\n };\n /**\n * Returns number mapper object for the provided cldr data\n *\n * @param {Object} curObj ?\n * @param {Object} numberSystem ?\n * @param {boolean} isNumber ?\n * @returns {NumberMapper} ?\n */\n // eslint-disable-next-line\n ParserBase.getNumberMapper = function (curObj, numberSystem, isNumber) {\n var ret = { mapper: {} };\n var cur = this.getDefaultNumberingSystem(curObj);\n if (!isUndefined(cur.nSystem)) {\n ret.numberSystem = cur.nSystem;\n ret.numberSymbols = getValue('symbols-numberSystem-' + cur.nSystem, cur.obj);\n ret.timeSeparator = getValue('timeSeparator', ret.numberSymbols);\n var digits = getValue(cur.nSystem + '._digits', numberSystem);\n if (!isUndefined(digits)) {\n for (var _i = 0, latnNumberSystem_1 = latnNumberSystem; _i < latnNumberSystem_1.length; _i++) {\n var i = latnNumberSystem_1[_i];\n // eslint-disable-next-line\n ret.mapper[i] = digits[i];\n }\n }\n }\n return ret;\n };\n ParserBase.nPair = 'numericPair';\n ParserBase.nRegex = 'numericRegex';\n ParserBase.numberingSystems = defaultNumberingSystem;\n return ParserBase;\n}());\nexport { ParserBase };\n/**\n * @private\n */\nvar blazorCurrencyData = {\n 'DJF': 'Fdj',\n 'ERN': 'Nfk',\n 'ETB': 'Br',\n 'NAD': '$',\n 'ZAR': 'R',\n 'XAF': 'FCFA',\n 'GHS': 'GH₵',\n 'XDR': 'XDR',\n 'AED': 'د.إ.',\n 'BHD': 'د.ب.',\n 'DZD': 'د.ج.',\n 'EGP': 'ج.م.',\n 'ILS': '₪',\n 'IQD': 'د.ع.',\n 'JOD': 'د.ا.',\n 'KMF': 'CF',\n 'KWD': 'د.ك.',\n 'LBP': 'ل.ل.',\n 'LYD': 'د.ل.',\n 'MAD': 'د.م.',\n 'MRU': 'أ.م.',\n 'OMR': 'ر.ع.',\n 'QAR': 'ر.ق.',\n 'SAR': 'ر.س.',\n 'SDG': 'ج.س.',\n 'SOS': 'S',\n 'SSP': '£',\n 'SYP': 'ل.س.',\n 'TND': 'د.ت.',\n 'YER': 'ر.ي.',\n 'CLP': '$',\n 'INR': '₹',\n 'TZS': 'TSh',\n 'EUR': '€',\n 'AZN': '₼',\n 'RUB': '₽',\n 'BYN': 'Br',\n 'ZMW': 'K',\n 'BGN': 'лв.',\n 'NGN': '₦',\n 'XOF': 'CFA',\n 'BDT': '৳',\n 'CNY': '¥',\n 'BAM': 'КМ',\n 'UGX': 'USh',\n 'USD': '$',\n 'CZK': 'Kč',\n 'GBP': '£',\n 'DKK': 'kr.',\n 'KES': 'Ksh',\n 'CHF': 'CHF',\n 'MVR': 'ރ.',\n 'BTN': 'Nu.',\n 'XCD': 'EC$',\n 'AUD': '$',\n 'BBD': '$',\n 'BIF': 'FBu',\n 'BMD': '$',\n 'BSD': '$',\n 'BWP': 'P',\n 'BZD': '$',\n 'CAD': '$',\n 'NZD': '$',\n 'FJD': '$',\n 'FKP': '£',\n 'GIP': '£',\n 'GMD': 'D',\n 'GYD': '$',\n 'HKD': '$',\n 'IDR': 'Rp',\n 'JMD': '$',\n 'KYD': '$',\n 'LRD': '$',\n 'MGA': 'Ar',\n 'MOP': 'MOP$',\n 'MUR': 'Rs',\n 'MWK': 'MK',\n 'MYR': 'RM',\n 'PGK': 'K',\n 'PHP': '₱',\n 'PKR': 'Rs',\n 'RWF': 'RF',\n 'SBD': '$',\n 'SCR': 'SR',\n 'SEK': 'kr',\n 'SGD': '$',\n 'SHP': '£',\n 'SLL': 'Le',\n 'ANG': 'NAf.',\n 'SZL': 'E',\n 'TOP': 'T$',\n 'TTD': '$',\n 'VUV': 'VT',\n 'WST': 'WS$',\n 'ARS': '$',\n 'BOB': 'Bs',\n 'BRL': 'R$',\n 'COP': '$',\n 'CRC': '₡',\n 'CUP': '$',\n 'DOP': '$',\n 'GTQ': 'Q',\n 'HNL': 'L',\n 'MXN': '$',\n 'NIO': 'C$',\n 'PAB': 'B/.',\n 'PEN': 'S/',\n 'PYG': '₲',\n 'UYU': '$',\n 'VES': 'Bs.S',\n 'IRR': 'ريال',\n 'GNF': 'FG',\n 'CDF': 'FC',\n 'HTG': 'G',\n 'XPF': 'FCFP',\n 'HRK': 'kn',\n 'HUF': 'Ft',\n 'AMD': '֏',\n 'ISK': 'kr',\n 'JPY': '¥',\n 'GEL': '₾',\n 'CVE': '',\n 'KZT': '₸',\n 'KHR': '៛',\n 'KPW': '₩',\n 'KRW': '₩',\n 'KGS': 'сом',\n 'AOA': 'Kz',\n 'LAK': '₭',\n 'MZN': 'MTn',\n 'MKD': 'ден',\n 'MNT': '₮',\n 'BND': '$',\n 'MMK': 'K',\n 'NOK': 'kr',\n 'NPR': 'रु',\n 'AWG': 'Afl.',\n 'SRD': '$',\n 'PLN': 'zł',\n 'AFN': '؋',\n 'STN': 'Db',\n 'MDL': 'L',\n 'RON': 'lei',\n 'UAH': '₴',\n 'LKR': 'රු.',\n 'ALL': 'Lekë',\n 'RSD': 'дин.',\n 'TJS': 'смн',\n 'THB': '฿',\n 'TMT': 'm.',\n 'TRY': '₺',\n 'UZS': 'сўм',\n 'VND': '₫',\n 'TWD': 'NT$'\n};\n/**\n *\n * @param {string} currencyCode ?\n * @returns {string} ?\n */\nexport function getBlazorCurrencySymbol(currencyCode) {\n return getValue(currencyCode || '', blazorCurrencyData);\n}\n","/***\n * Hijri parser\n */\n// eslint-disable-next-line\nexport var HijriParser;\n(function (HijriParser) {\n var dateCorrection = [28607, 28636, 28665, 28695, 28724, 28754, 28783, 28813, 28843, 28872, 28901, 28931, 28960, 28990,\n 29019, 29049, 29078, 29108, 29137, 29167, 29196, 29226, 29255, 29285, 29315, 29345, 29375, 29404, 29434, 29463, 29492, 29522,\n 29551, 29580, 29610, 29640, 29669, 29699, 29729, 29759, 29788, 29818, 29847, 29876, 29906, 29935, 29964, 29994, 30023, 30053,\n 30082, 30112, 30141, 30171, 30200, 30230, 30259, 30289, 30318, 30348, 30378, 30408, 30437, 30467, 30496, 30526, 30555, 30585,\n 30614, 30644, 30673, 30703, 30732, 30762, 30791, 30821, 30850, 30880, 30909, 30939, 30968, 30998, 31027, 31057, 31086, 31116,\n 31145, 31175, 31204, 31234, 31263, 31293, 31322, 31352, 31381, 31411, 31441, 31471, 31500, 31530, 31559, 31589, 31618, 31648,\n 31676, 31706, 31736, 31766, 31795, 31825, 31854, 31884, 31913, 31943, 31972, 32002, 32031, 32061, 32090, 32120, 32150, 32180,\n 32209, 32239, 32268, 32298, 32327, 32357, 32386, 32416, 32445, 32475, 32504, 32534, 32563, 32593, 32622, 32652, 32681, 32711,\n 32740, 32770, 32799, 32829, 32858, 32888, 32917, 32947, 32976, 33006, 33035, 33065, 33094, 33124, 33153, 33183, 33213, 33243,\n 33272, 33302, 33331, 33361, 33390, 33420, 33450, 33479, 33509, 33539, 33568, 33598, 33627, 33657, 33686, 33716, 33745, 33775,\n 33804, 33834, 33863, 33893, 33922, 33952, 33981, 34011, 34040, 34069, 34099, 34128, 34158, 34187, 34217, 34247, 34277, 34306,\n 34336, 34365, 34395, 34424, 34454, 34483, 34512, 34542, 34571, 34601, 34631, 34660, 34690, 34719, 34749, 34778, 34808, 34837,\n 34867, 34896, 34926, 34955, 34985, 35015, 35044, 35074, 35103, 35133, 35162, 35192, 35222, 35251, 35280, 35310, 35340, 35370,\n 35399, 35429, 35458, 35488, 35517, 35547, 35576, 35605, 35635, 35665, 35694, 35723, 35753, 35782, 35811, 35841, 35871, 35901,\n 35930, 35960, 35989, 36019, 36048, 36078, 36107, 36136, 36166, 36195, 36225, 36254, 36284, 36314, 36343, 36373, 36403, 36433,\n 36462, 36492, 36521, 36551, 36580, 36610, 36639, 36669, 36698, 36728, 36757, 36786, 36816, 36845, 36875, 36904, 36934, 36963,\n 36993, 37022, 37052, 37081, 37111, 37141, 37170, 37200, 37229, 37259, 37288, 37318, 37347, 37377, 37406, 37436, 37465, 37495,\n 37524, 37554, 37584, 37613, 37643, 37672, 37701, 37731, 37760, 37790, 37819, 37849, 37878, 37908, 37938, 37967, 37997, 38027,\n 38056, 38085, 38115, 38144, 38174, 38203, 38233, 38262, 38292, 38322, 38351, 38381, 38410, 38440, 38469, 38499, 38528, 38558,\n 38587, 38617, 38646, 38676, 38705, 38735, 38764, 38794, 38823, 38853, 38882, 38912, 38941, 38971, 39001, 39030, 39059, 39089,\n 39118, 39148, 39178, 39208, 39237, 39267, 39297, 39326, 39355, 39385, 39414, 39444, 39473, 39503, 39532, 39562, 39592, 39621,\n 39650, 39680, 39709, 39739, 39768, 39798, 39827, 39857, 39886, 39916, 39946, 39975, 40005, 40035, 40064, 40094, 40123, 40153,\n 40182, 40212, 40241, 40271, 40300, 40330, 40359, 40389, 40418, 40448, 40477, 40507, 40536, 40566, 40595, 40625, 40655, 40685,\n 40714, 40744, 40773, 40803, 40832, 40862, 40892, 40921, 40951, 40980, 41009, 41039, 41068, 41098, 41127, 41157, 41186, 41216,\n 41245, 41275, 41304, 41334, 41364, 41393, 41422, 41452, 41481, 41511, 41540, 41570, 41599, 41629, 41658, 41688, 41718, 41748,\n 41777, 41807, 41836, 41865, 41894, 41924, 41953, 41983, 42012, 42042, 42072, 42102, 42131, 42161, 42190, 42220, 42249, 42279,\n 42308, 42337, 42367, 42397, 42426, 42456, 42485, 42515, 42545, 42574, 42604, 42633, 42662, 42692, 42721, 42751, 42780, 42810,\n 42839, 42869, 42899, 42929, 42958, 42988, 43017, 43046, 43076, 43105, 43135, 43164, 43194, 43223, 43253, 43283, 43312, 43342,\n 43371, 43401, 43430, 43460, 43489, 43519, 43548, 43578, 43607, 43637, 43666, 43696, 43726, 43755, 43785, 43814, 43844, 43873,\n 43903, 43932, 43962, 43991, 44021, 44050, 44080, 44109, 44139, 44169, 44198, 44228, 44258, 44287, 44317, 44346, 44375, 44405,\n 44434, 44464, 44493, 44523, 44553, 44582, 44612, 44641, 44671, 44700, 44730, 44759, 44788, 44818, 44847, 44877, 44906, 44936,\n 44966, 44996, 45025, 45055, 45084, 45114, 45143, 45172, 45202, 45231, 45261, 45290, 45320, 45350, 45380, 45409, 45439, 45468,\n 45498, 45527, 45556, 45586, 45615, 45644, 45674, 45704, 45733, 45763, 45793, 45823, 45852, 45882, 45911, 45940, 45970, 45999,\n 46028, 46058, 46088, 46117, 46147, 46177, 46206, 46236, 46265, 46295, 46324, 46354, 46383, 46413, 46442, 46472, 46501, 46531,\n 46560, 46590, 46620, 46649, 46679, 46708, 46738, 46767, 46797, 46826, 46856, 46885, 46915, 46944, 46974, 47003, 47033, 47063,\n 47092, 47122, 47151, 47181, 47210, 47240, 47269, 47298, 47328, 47357, 47387, 47417, 47446, 47476, 47506, 47535, 47565, 47594,\n 47624, 47653, 47682, 47712, 47741, 47771, 47800, 47830, 47860, 47890, 47919, 47949, 47978, 48008, 48037, 48066, 48096, 48125,\n 48155, 48184, 48214, 48244, 48273, 48303, 48333, 48362, 48392, 48421, 48450, 48480, 48509, 48538, 48568, 48598, 48627, 48657,\n 48687, 48717, 48746, 48776, 48805, 48834, 48864, 48893, 48922, 48952, 48982, 49011, 49041, 49071, 49100, 49130, 49160, 49189,\n 49218, 49248, 49277, 49306, 49336, 49365, 49395, 49425, 49455, 49484, 49514, 49543, 49573, 49602, 49632, 49661, 49690, 49720,\n 49749, 49779, 49809, 49838, 49868, 49898, 49927, 49957, 49986, 50016, 50045, 50075, 50104, 50133, 50163, 50192, 50222, 50252,\n 50281, 50311, 50340, 50370, 50400, 50429, 50459, 50488, 50518, 50547, 50576, 50606, 50635, 50665, 50694, 50724, 50754, 50784,\n 50813, 50843, 50872, 50902, 50931, 50960, 50990, 51019, 51049, 51078, 51108, 51138, 51167, 51197, 51227, 51256, 51286, 51315,\n 51345, 51374, 51403, 51433, 51462, 51492, 51522, 51552, 51582, 51611, 51641, 51670, 51699, 51729, 51758, 51787, 51816, 51846,\n 51876, 51906, 51936, 51965, 51995, 52025, 52054, 52083, 52113, 52142, 52171, 52200, 52230, 52260, 52290, 52319, 52349, 52379,\n 52408, 52438, 52467, 52497, 52526, 52555, 52585, 52614, 52644, 52673, 52703, 52733, 52762, 52792, 52822, 52851, 52881, 52910,\n 52939, 52969, 52998, 53028, 53057, 53087, 53116, 53146, 53176, 53205, 53235, 53264, 53294, 53324, 53353, 53383, 53412, 53441,\n 53471, 53500, 53530, 53559, 53589, 53619, 53648, 53678, 53708, 53737, 53767, 53796, 53825, 53855, 53884, 53913, 53943, 53973,\n 54003, 54032, 54062, 54092, 54121, 54151, 54180, 54209, 54239, 54268, 54297, 54327, 54357, 54387, 54416, 54446, 54476, 54505,\n 54535, 54564, 54593, 54623, 54652, 54681, 54711, 54741, 54770, 54800, 54830, 54859, 54889, 54919, 54948, 54977, 55007, 55036,\n 55066, 55095, 55125, 55154, 55184, 55213, 55243, 55273, 55302, 55332, 55361, 55391, 55420, 55450, 55479, 55508, 55538, 55567,\n 55597, 55627, 55657, 55686, 55716, 55745, 55775, 55804, 55834, 55863, 55892, 55922, 55951, 55981, 56011, 56040, 56070, 56100,\n 56129, 56159, 56188, 56218, 56247, 56276, 56306, 56335, 56365, 56394, 56424, 56454, 56483, 56513, 56543, 56572, 56601, 56631,\n 56660, 56690, 56719, 56749, 56778, 56808, 56837, 56867, 56897, 56926, 56956, 56985, 57015, 57044, 57074, 57103, 57133, 57162,\n 57192, 57221, 57251, 57280, 57310, 57340, 57369, 57399, 57429, 57458, 57487, 57517, 57546, 57576, 57605, 57634, 57664, 57694,\n 57723, 57753, 57783, 57813, 57842, 57871, 57901, 57930, 57959, 57989, 58018, 58048, 58077, 58107, 58137, 58167, 58196, 58226,\n 58255, 58285, 58314, 58343, 58373, 58402, 58432, 58461, 58491, 58521, 58551, 58580, 58610, 58639, 58669, 58698, 58727, 58757,\n 58786, 58816, 58845, 58875, 58905, 58934, 58964, 58994, 59023, 59053, 59082, 59111, 59141, 59170, 59200, 59229, 59259, 59288,\n 59318, 59348, 59377, 59407, 59436, 59466, 59495, 59525, 59554, 59584, 59613, 59643, 59672, 59702, 59731, 59761, 59791, 59820,\n 59850, 59879, 59909, 59939, 59968, 59997, 60027, 60056, 60086, 60115, 60145, 60174, 60204, 60234, 60264, 60293, 60323, 60352,\n 60381, 60411, 60440, 60469, 60499, 60528, 60558, 60588, 60618, 60648, 60677, 60707, 60736, 60765, 60795, 60824, 60853, 60883,\n 60912, 60942, 60972, 61002, 61031, 61061, 61090, 61120, 61149, 61179, 61208, 61237, 61267, 61296, 61326, 61356, 61385, 61415,\n 61445, 61474, 61504, 61533, 61563, 61592, 61621, 61651, 61680, 61710, 61739, 61769, 61799, 61828, 61858, 61888, 61917, 61947,\n 61976, 62006, 62035, 62064, 62094, 62123, 62153, 62182, 62212, 62242, 62271, 62301, 62331, 62360, 62390, 62419, 62448, 62478,\n 62507, 62537, 62566, 62596, 62625, 62655, 62685, 62715, 62744, 62774, 62803, 62832, 62862, 62891, 62921, 62950, 62980, 63009,\n 63039, 63069, 63099, 63128, 63157, 63187, 63216, 63246, 63275, 63305, 63334, 63363, 63393, 63423, 63453, 63482, 63512, 63541,\n 63571, 63600, 63630, 63659, 63689, 63718, 63747, 63777, 63807, 63836, 63866, 63895, 63925, 63955, 63984, 64014, 64043, 64073,\n 64102, 64131, 64161, 64190, 64220, 64249, 64279, 64309, 64339, 64368, 64398, 64427, 64457, 64486, 64515, 64545, 64574, 64603,\n 64633, 64663, 64692, 64722, 64752, 64782, 64811, 64841, 64870, 64899, 64929, 64958, 64987, 65017, 65047, 65076, 65106, 65136,\n 65166, 65195, 65225, 65254, 65283, 65313, 65342, 65371, 65401, 65431, 65460, 65490, 65520, 65549, 65579, 65608, 65638, 65667,\n 65697, 65726, 65755, 65785, 65815, 65844, 65874, 65903, 65933, 65963, 65992, 66022, 66051, 66081, 66110, 66140, 66169, 66199,\n 66228, 66258, 66287, 66317, 66346, 66376, 66405, 66435, 66465, 66494, 66524, 66553, 66583, 66612, 66641, 66671, 66700, 66730,\n 66760, 66789, 66819, 66849, 66878, 66908, 66937, 66967, 66996, 67025, 67055, 67084, 67114, 67143, 67173, 67203, 67233, 67262,\n 67292, 67321, 67351, 67380, 67409, 67439, 67468, 67497, 67527, 67557, 67587, 67617, 67646, 67676, 67705, 67735, 67764, 67793,\n 67823, 67852, 67882, 67911, 67941, 67971, 68000, 68030, 68060, 68089, 68119, 68148, 68177, 68207, 68236, 68266, 68295, 68325,\n 68354, 68384, 68414, 68443, 68473, 68502, 68532, 68561, 68591, 68620, 68650, 68679, 68708, 68738, 68768, 68797, 68827, 68857,\n 68886, 68916, 68946, 68975, 69004, 69034, 69063, 69092, 69122, 69152, 69181, 69211, 69240, 69270, 69300, 69330, 69359, 69388,\n 69418, 69447, 69476, 69506, 69535, 69565, 69595, 69624, 69654, 69684, 69713, 69743, 69772, 69802, 69831, 69861, 69890, 69919,\n 69949, 69978, 70008, 70038, 70067, 70097, 70126, 70156, 70186, 70215, 70245, 70274, 70303, 70333, 70362, 70392, 70421, 70451,\n 70481, 70510, 70540, 70570, 70599, 70629, 70658, 70687, 70717, 70746, 70776, 70805, 70835, 70864, 70894, 70924, 70954, 70983,\n 71013, 71042, 71071, 71101, 71130, 71159, 71189, 71218, 71248, 71278, 71308, 71337, 71367, 71397, 71426, 71455, 71485, 71514,\n 71543, 71573, 71602, 71632, 71662, 71691, 71721, 71751, 71781, 71810, 71839, 71869, 71898, 71927, 71957, 71986, 72016, 72046,\n 72075, 72105, 72135, 72164, 72194, 72223, 72253, 72282, 72311, 72341, 72370, 72400, 72429, 72459, 72489, 72518, 72548, 72577,\n 72607, 72637, 72666, 72695, 72725, 72754, 72784, 72813, 72843, 72872, 72902, 72931, 72961, 72991, 73020, 73050, 73080, 73109,\n 73139, 73168, 73197, 73227, 73256, 73286, 73315, 73345, 73375, 73404, 73434, 73464, 73493, 73523, 73552, 73581, 73611, 73640,\n 73669, 73699, 73729, 73758, 73788, 73818, 73848, 73877, 73907, 73936, 73965, 73995, 74024, 74053, 74083, 74113, 74142, 74172,\n 74202, 74231, 74261, 74291, 74320, 74349, 74379, 74408, 74437, 74467, 74497, 74526, 74556, 74586, 74615, 74645, 74675, 74704,\n 74733, 74763, 74792, 74822, 74851, 74881, 74910, 74940, 74969, 74999, 75029, 75058, 75088, 75117, 75147, 75176, 75206, 75235,\n 75264, 75294, 75323, 75353, 75383, 75412, 75442, 75472, 75501, 75531, 75560, 75590, 75619, 75648, 75678, 75707, 75737, 75766,\n 75796, 75826, 75856, 75885, 75915, 75944, 75974, 76003, 76032, 76062, 76091, 76121, 76150, 76180, 76210, 76239, 76269, 76299,\n 76328, 76358, 76387, 76416, 76446, 76475, 76505, 76534, 76564, 76593, 76623, 76653, 76682, 76712, 76741, 76771, 76801, 76830,\n 76859, 76889, 76918, 76948, 76977, 77007, 77036, 77066, 77096, 77125, 77155, 77185, 77214, 77243, 77273, 77302, 77332, 77361,\n 77390, 77420, 77450, 77479, 77509, 77539, 77569, 77598, 77627, 77657, 77686, 77715, 77745, 77774, 77804, 77833, 77863, 77893,\n 77923, 77952, 77982, 78011, 78041, 78070, 78099, 78129, 78158, 78188, 78217, 78247, 78277, 78307, 78336, 78366, 78395, 78425,\n 78454, 78483, 78513, 78542, 78572, 78601, 78631, 78661, 78690, 78720, 78750, 78779, 78808, 78838, 78867, 78897, 78926, 78956,\n 78985, 79015, 79044, 79074, 79104, 79133, 79163, 79192, 79222, 79251, 79281, 79310, 79340, 79369, 79399, 79428, 79458, 79487,\n 79517, 79546, 79576, 79606, 79635, 79665, 79695, 79724, 79753, 79783, 79812, 79841, 79871, 79900, 79930, 79960, 79990\n ];\n /**\n *\n * @param {Date} gDate ?\n * @returns {Object} ?\n */\n function getHijriDate(gDate) {\n var day = gDate.getDate();\n var month = gDate.getMonth();\n var year = gDate.getFullYear();\n var tMonth = month + 1;\n var tYear = year;\n if (tMonth < 3) {\n tYear -= 1;\n tMonth += 12;\n }\n var yPrefix = Math.floor(tYear / 100.);\n var julilanOffset = yPrefix - Math.floor(yPrefix / 4.) - 2;\n var julianNumber = Math.floor(365.25 * (tYear + 4716)) + Math.floor(30.6001 * (tMonth + 1)) + day - julilanOffset - 1524;\n yPrefix = Math.floor((julianNumber - 1867216.25) / 36524.25);\n julilanOffset = yPrefix - Math.floor(yPrefix / 4.) + 1;\n var b = julianNumber + julilanOffset + 1524;\n var c = Math.floor((b - 122.1) / 365.25);\n var d = Math.floor(365.25 * c);\n var tempMonth = Math.floor((b - d) / 30.6001);\n day = (b - d) - Math.floor(30.6001 * tempMonth);\n month = Math.floor((b - d) / 20.6001);\n if (month > 13) {\n c += 1;\n month -= 12;\n }\n month -= 1;\n year = c - 4716;\n var modifiedJulianDate = julianNumber - 2400000;\n // date calculation for year after 2077\n var iyear = 10631. / 30.;\n var z = julianNumber - 1948084;\n var cyc = Math.floor(z / 10631.);\n z = z - 10631 * cyc;\n var j = Math.floor((z - 0.1335) / iyear);\n var iy = 30 * cyc + j;\n z = z - Math.floor(j * iyear + 0.1335);\n var im = Math.floor((z + 28.5001) / 29.5);\n /* istanbul ignore next */\n if (im === 13) {\n im = 12;\n }\n var tempDay = z - Math.floor(29.5001 * im - 29);\n var i = 0;\n for (; i < dateCorrection.length; i++) {\n if (dateCorrection[i] > modifiedJulianDate) {\n break;\n }\n }\n var iln = i + 16260;\n var ii = Math.floor((iln - 1) / 12);\n var hYear = ii + 1;\n var hmonth = iln - 12 * ii;\n var hDate = modifiedJulianDate - dateCorrection[i - 1] + 1;\n if ((hDate + '').length > 2) {\n hDate = tempDay;\n hmonth = im;\n hYear = iy;\n }\n return { year: hYear, month: hmonth, date: hDate };\n }\n HijriParser.getHijriDate = getHijriDate;\n /**\n *\n * @param {number} year ?\n * @param {number} month ?\n * @param {number} day ?\n * @returns {Date} ?\n */\n function toGregorian(year, month, day) {\n var iy = year;\n var im = month;\n var id = day;\n var ii = iy - 1;\n var iln = (ii * 12) + 1 + (im - 1);\n var i = iln - 16260;\n var mcjdn = id + dateCorrection[i - 1] - 1;\n var julianDate = mcjdn + 2400000;\n var z = Math.floor(julianDate + 0.5);\n var a = Math.floor((z - 1867216.25) / 36524.25);\n a = z + 1 + a - Math.floor(a / 4);\n var b = a + 1524;\n var c = Math.floor((b - 122.1) / 365.25);\n var d = Math.floor(365.25 * c);\n var e = Math.floor((b - d) / 30.6001);\n var gDay = b - d - Math.floor(e * 30.6001);\n var gMonth = e - (e > 13.5 ? 13 : 1);\n var gYear = c - (gMonth > 2.5 ? 4716 : 4715);\n /* istanbul ignore next */\n if (gYear <= 0) {\n gMonth--;\n } // No year zero\n return new Date(gYear + '/' + (gMonth) + '/' + gDay);\n }\n HijriParser.toGregorian = toGregorian;\n})(HijriParser || (HijriParser = {}));\n","import { ParserBase as parser } from './parser-base';\nimport { IntlBase as base } from './intl-base';\nimport { isUndefined, throwError, getValue, isBlazor } from '../util';\nimport { HijriParser } from '../hijri-parser';\nimport { isNullOrUndefined, extend } from '../util';\nvar abbreviateRegexGlobal = /\\/MMMMM|MMMM|MMM|a|LLLL|LLL|EEEEE|EEEE|E|K|cccc|ccc|WW|W|G+|z+/gi;\nvar standalone = 'stand-alone';\nvar weekdayKey = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\nexport var basicPatterns = ['short', 'medium', 'long', 'full'];\nvar timeSetter = {\n m: 'getMinutes',\n h: 'getHours',\n H: 'getHours',\n s: 'getSeconds',\n d: 'getDate',\n f: 'getMilliseconds'\n};\nexport var datePartMatcher = {\n 'M': 'month',\n 'd': 'day',\n 'E': 'weekday',\n 'c': 'weekday',\n 'y': 'year',\n 'm': 'minute',\n 'h': 'hour',\n 'H': 'hour',\n 's': 'second',\n 'L': 'month',\n 'a': 'designator',\n 'z': 'timeZone',\n 'Z': 'timeZone',\n 'G': 'era',\n 'f': 'milliseconds'\n};\nvar timeSeparator = 'timeSeparator';\n/* tslint:disable no-any */\n/**\n * Date Format is a framework provides support for date formatting.\n *\n * @private\n */\nvar DateFormat = /** @class */ (function () {\n function DateFormat() {\n }\n /**\n * Returns the formatter function for given skeleton.\n *\n * @param {string} culture - Specifies the culture name to be which formatting.\n * @param {DateFormatOptions} option - Specific the format in which date will format.\n * @param {Object} cldr - Specifies the global cldr data collection.\n * @returns {Function} ?\n */\n DateFormat.dateFormat = function (culture, option, cldr) {\n var _this = this;\n var dependable = base.getDependables(cldr, culture, option.calendar);\n var numObject = getValue('parserObject.numbers', dependable);\n var dateObject = dependable.dateObject;\n var formatOptions = { isIslamic: base.islamicRegex.test(option.calendar) };\n if (isBlazor() && option.isServerRendered) {\n option = base.compareBlazorDateFormats(option, culture);\n }\n var resPattern = option.format ||\n base.getResultantPattern(option.skeleton, dependable.dateObject, option.type, false, isBlazor() ? culture : '');\n formatOptions.dateSeperator = isBlazor() ? getValue('dateSeperator', dateObject) : base.getDateSeparator(dependable.dateObject);\n if (isUndefined(resPattern)) {\n throwError('Format options or type given must be invalid');\n }\n else {\n resPattern = base.ConvertDateToWeekFormat(resPattern);\n if (isBlazor()) {\n resPattern = resPattern.replace(/tt/, 'a');\n }\n formatOptions.pattern = resPattern;\n formatOptions.numMapper = isBlazor() ?\n extend({}, numObject) : parser.getNumberMapper(dependable.parserObject, parser.getNumberingSystem(cldr));\n var patternMatch = resPattern.match(abbreviateRegexGlobal) || [];\n for (var _i = 0, patternMatch_1 = patternMatch; _i < patternMatch_1.length; _i++) {\n var str = patternMatch_1[_i];\n var len = str.length;\n var char = str[0];\n if (char === 'K') {\n char = 'h';\n }\n switch (char) {\n case 'E':\n case 'c':\n if (isBlazor()) {\n // eslint-disable-next-line\n formatOptions.weekday = getValue('days.' + base.monthIndex[len], dateObject);\n }\n else {\n // eslint-disable-next-line\n formatOptions.weekday = dependable.dateObject[base.days][standalone][base.monthIndex[len]];\n }\n break;\n case 'M':\n case 'L':\n if (isBlazor()) {\n // eslint-disable-next-line\n formatOptions.month = getValue('months.' + base.monthIndex[len], dateObject);\n }\n else {\n // eslint-disable-next-line\n formatOptions.month = dependable.dateObject[base.month][standalone][base.monthIndex[len]];\n }\n break;\n case 'a':\n formatOptions.designator = isBlazor() ?\n getValue('dayPeriods', dateObject) : getValue('dayPeriods.format.wide', dateObject);\n break;\n case 'G':\n // eslint-disable-next-line\n var eText = (len <= 3) ? 'eraAbbr' : (len === 4) ? 'eraNames' : 'eraNarrow';\n formatOptions.era = isBlazor() ? getValue('eras', dateObject) : getValue('eras.' + eText, dependable.dateObject);\n break;\n case 'z':\n formatOptions.timeZone = getValue('dates.timeZoneNames', dependable.parserObject);\n break;\n }\n }\n }\n return function (value) {\n if (isNaN(value.getDate())) {\n return null;\n }\n return _this.intDateFormatter(value, formatOptions);\n };\n };\n /**\n * Returns formatted date string based on options passed.\n *\n * @param {Date} value ?\n * @param {FormatOptions} options ?\n * @returns {string} ?\n */\n DateFormat.intDateFormatter = function (value, options) {\n var pattern = options.pattern;\n var ret = '';\n var matches = pattern.match(base.dateParseRegex);\n var dObject = this.getCurrentDateValue(value, options.isIslamic);\n for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) {\n var match = matches_1[_i];\n var length_1 = match.length;\n var char = match[0];\n if (char === 'K') {\n char = 'h';\n }\n var curval = void 0;\n var curvalstr = '';\n var isNumber = void 0;\n var processNumber = void 0;\n var curstr = '';\n switch (char) {\n case 'M':\n case 'L':\n curval = dObject.month;\n if (length_1 > 2) {\n // eslint-disable-next-line\n ret += options.month[curval];\n }\n else {\n isNumber = true;\n }\n break;\n case 'E':\n case 'c':\n // eslint-disable-next-line\n ret += options.weekday[weekdayKey[value.getDay()]];\n break;\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'd':\n case 'f':\n isNumber = true;\n if (char === 'd') {\n curval = dObject.date;\n }\n else if (char === 'f') {\n isNumber = false;\n processNumber = true;\n // eslint-disable-next-line\n curvalstr = value[timeSetter[char]]().toString();\n curvalstr = curvalstr.substring(0, length_1);\n var curlength = curvalstr.length;\n if (length_1 !== curlength) {\n if (length_1 > 3) {\n continue;\n }\n for (var i = 0; i < length_1 - curlength; i++) {\n curvalstr = '0' + curvalstr.toString();\n }\n }\n curstr += curvalstr;\n }\n else {\n // eslint-disable-next-line\n curval = value[timeSetter[char]]();\n }\n if (char === 'h') {\n curval = curval % 12 || 12;\n }\n break;\n case 'y':\n processNumber = true;\n curstr += dObject.year;\n if (length_1 === 2) {\n curstr = curstr.substr(curstr.length - 2);\n }\n break;\n case 'a':\n // eslint-disable-next-line\n var desig = value.getHours() < 12 ? 'am' : 'pm';\n // eslint-disable-next-line\n ret += options.designator[desig];\n break;\n case 'G':\n // eslint-disable-next-line\n var dec = value.getFullYear() < 0 ? 0 : 1;\n // eslint-disable-next-line\n var retu = options.era[dec];\n if (isNullOrUndefined(retu)) {\n // eslint-disable-next-line\n retu = options.era[dec ? 0 : 1];\n }\n ret += retu || '';\n break;\n case '\\'':\n ret += (match === '\\'\\'') ? '\\'' : match.replace(/'/g, '');\n break;\n case 'z':\n // eslint-disable-next-line\n var timezone = value.getTimezoneOffset();\n // eslint-disable-next-line\n var pattern_1 = (length_1 < 4) ? '+H;-H' : options.timeZone.hourFormat;\n pattern_1 = pattern_1.replace(/:/g, options.numMapper.timeSeparator);\n if (timezone === 0) {\n ret += options.timeZone.gmtZeroFormat;\n }\n else {\n processNumber = true;\n curstr = this.getTimeZoneValue(timezone, pattern_1);\n }\n curstr = options.timeZone.gmtFormat.replace(/\\{0\\}/, curstr);\n break;\n case ':':\n // eslint-disable-next-line\n ret += options.numMapper.numberSymbols[timeSeparator];\n break;\n case '/':\n ret += options.dateSeperator;\n break;\n case 'W':\n isNumber = true;\n curval = base.getWeekOfYear(value);\n break;\n default:\n ret += match;\n }\n if (isNumber) {\n processNumber = true;\n curstr = this.checkTwodigitNumber(curval, length_1);\n }\n if (processNumber) {\n ret += parser.convertValueParts(curstr, base.latnParseRegex, options.numMapper.mapper);\n }\n }\n return ret;\n };\n DateFormat.getCurrentDateValue = function (value, isIslamic) {\n if (isIslamic) {\n return HijriParser.getHijriDate(value);\n }\n return { year: value.getFullYear(), month: value.getMonth() + 1, date: value.getDate() };\n };\n /**\n * Returns two digit numbers for given value and length\n *\n * @param {number} val ?\n * @param {number} len ?\n * @returns {string} ?\n */\n DateFormat.checkTwodigitNumber = function (val, len) {\n var ret = val + '';\n if (len === 2 && ret.length !== 2) {\n return '0' + ret;\n }\n return ret;\n };\n /**\n * Returns the value of the Time Zone.\n *\n * @param {number} tVal ?\n * @param {string} pattern ?\n * @returns {string} ?\n * @private\n */\n DateFormat.getTimeZoneValue = function (tVal, pattern) {\n var _this = this;\n var splt = pattern.split(';');\n var curPattern = splt[tVal > 0 ? 1 : 0];\n var no = Math.abs(tVal);\n return curPattern = curPattern.replace(/HH?|mm/g, function (str) {\n var len = str.length;\n var ishour = str.indexOf('H') !== -1;\n return _this.checkTwodigitNumber(Math.floor(ishour ? (no / 60) : (no % 60)), len);\n });\n };\n return DateFormat;\n}());\nexport { DateFormat };\n","import { isUndefined, throwError, isNullOrUndefined, extend, isBlazor, getValue } from '../util';\nimport { defaultCurrencyCode } from '../internationalization';\nimport { IntlBase as base } from './intl-base';\nimport { ParserBase as parser } from './parser-base';\nvar errorText = {\n 'ms': 'minimumSignificantDigits',\n 'ls': 'maximumSignificantDigits',\n 'mf': 'minimumFractionDigits',\n 'lf': 'maximumFractionDigits',\n};\nvar integerError = 'minimumIntegerDigits';\nvar percentSign = 'percentSign';\nvar minusSign = 'minusSign';\nvar spaceRegex = /\\s/;\nvar mapper = ['infinity', 'nan', 'group', 'decimal', 'exponential'];\nvar infinity = 'infinity';\nvar nan = 'nan';\n/**\n * Module for number formatting.\n *\n * @private\n */\nvar NumberFormat = /** @class */ (function () {\n function NumberFormat() {\n }\n /**\n * Returns the formatter function for given skeleton.\n *\n * @param {string} culture - Specifies the culture name to be which formatting.\n * @param {NumberFormatOptions} option - Specific the format in which number will format.\n * @param {Object} cldr - Specifies the global cldr data collection.\n * @returns {Function} ?\n */\n NumberFormat.numberFormatter = function (culture, option, cldr) {\n var _this = this;\n var fOptions = extend({}, option);\n var cOptions = {};\n var dOptions = {};\n var symbolPattern;\n var dependable = base.getDependables(cldr, culture, '', true);\n var numObject = dependable.numericObject;\n dOptions.numberMapper = isBlazor() ? extend({}, numObject) :\n parser.getNumberMapper(dependable.parserObject, parser.getNumberingSystem(cldr), true);\n dOptions.currencySymbol = isBlazor() ? getValue('currencySymbol', numObject) : base.getCurrencySymbol(dependable.numericObject, fOptions.currency || defaultCurrencyCode, option.altSymbol);\n /* eslint-disable @typescript-eslint/no-explicit-any */\n dOptions.percentSymbol = isBlazor() ? getValue('numberSymbols.percentSign', numObject) :\n dOptions.numberMapper.numberSymbols[percentSign];\n dOptions.minusSymbol = isBlazor() ? getValue('numberSymbols.minusSign', numObject) :\n dOptions.numberMapper.numberSymbols[minusSign];\n var symbols = dOptions.numberMapper.numberSymbols;\n if ((option.format) && !(base.formatRegex.test(option.format))) {\n cOptions = base.customFormat(option.format, dOptions, dependable.numericObject);\n }\n else {\n extend(fOptions, base.getProperNumericSkeleton(option.format || 'N'));\n fOptions.isCurrency = fOptions.type === 'currency';\n fOptions.isPercent = fOptions.type === 'percent';\n if (!isBlazor()) {\n symbolPattern = base.getSymbolPattern(fOptions.type, dOptions.numberMapper.numberSystem, dependable.numericObject, fOptions.isAccount);\n }\n fOptions.groupOne = this.checkValueRange(fOptions.maximumSignificantDigits, fOptions.minimumSignificantDigits, true);\n this.checkValueRange(fOptions.maximumFractionDigits, fOptions.minimumFractionDigits, false, true);\n if (!isUndefined(fOptions.fractionDigits)) {\n fOptions.minimumFractionDigits = fOptions.maximumFractionDigits = fOptions.fractionDigits;\n }\n if (isUndefined(fOptions.useGrouping)) {\n fOptions.useGrouping = true;\n }\n if (fOptions.isCurrency && !isBlazor()) {\n symbolPattern = symbolPattern.replace(/\\u00A4/g, base.defaultCurrency);\n }\n if (!isBlazor()) {\n var split = symbolPattern.split(';');\n cOptions.nData = base.getFormatData(split[1] || '-' + split[0], true, dOptions.currencySymbol);\n cOptions.pData = base.getFormatData(split[0], false, dOptions.currencySymbol);\n if (fOptions.useGrouping) {\n fOptions.groupSeparator = symbols[mapper[2]];\n fOptions.groupData = this.getGroupingDetails(split[0]);\n }\n }\n else {\n cOptions.nData = extend({}, {}, getValue(fOptions.type + 'nData', numObject));\n cOptions.pData = extend({}, {}, getValue(fOptions.type + 'pData', numObject));\n if (fOptions.type === 'currency' && option.currency) {\n base.replaceBlazorCurrency([cOptions.pData, cOptions.nData], dOptions.currencySymbol, option.currency);\n }\n }\n var minFrac = isUndefined(fOptions.minimumFractionDigits);\n if (minFrac) {\n fOptions.minimumFractionDigits = cOptions.nData.minimumFraction;\n }\n if (isUndefined(fOptions.maximumFractionDigits)) {\n var mval = cOptions.nData.maximumFraction;\n fOptions.maximumFractionDigits = isUndefined(mval) && fOptions.isPercent ? 0 : mval;\n }\n var mfrac = fOptions.minimumFractionDigits;\n var lfrac = fOptions.maximumFractionDigits;\n if (!isUndefined(mfrac) && !isUndefined(lfrac)) {\n if (mfrac > lfrac) {\n fOptions.maximumFractionDigits = mfrac;\n }\n }\n }\n extend(cOptions.nData, fOptions);\n extend(cOptions.pData, fOptions);\n return function (value) {\n if (isNaN(value)) {\n return symbols[mapper[1]];\n }\n else if (!isFinite(value)) {\n return symbols[mapper[0]];\n }\n return _this.intNumberFormatter(value, cOptions, dOptions);\n };\n };\n /**\n * Returns grouping details for the pattern provided\n *\n * @param {string} pattern ?\n * @returns {GroupDetails} ?\n */\n NumberFormat.getGroupingDetails = function (pattern) {\n var ret = {};\n var match = pattern.match(base.negativeDataRegex);\n if (match && match[4]) {\n var pattern_1 = match[4];\n var p = pattern_1.lastIndexOf(',');\n if (p !== -1) {\n var temp = pattern_1.split('.')[0];\n ret.primary = (temp.length - p) - 1;\n var s = pattern_1.lastIndexOf(',', p - 1);\n if (s !== -1) {\n ret.secondary = p - 1 - s;\n }\n }\n }\n return ret;\n };\n /**\n * Returns if the provided integer range is valid.\n *\n * @param {number} val1 ?\n * @param {number} val2 ?\n * @param {boolean} checkbothExist ?\n * @param {boolean} isFraction ?\n * @returns {boolean} ?\n */\n NumberFormat.checkValueRange = function (val1, val2, checkbothExist, isFraction) {\n var decide = isFraction ? 'f' : 's';\n var dint = 0;\n var str1 = errorText['l' + decide];\n // eslint-disable-next-line\n var str2 = errorText['m' + decide];\n if (!isUndefined(val1)) {\n this.checkRange(val1, str1, isFraction);\n dint++;\n }\n if (!isUndefined(val2)) {\n this.checkRange(val2, str2, isFraction);\n dint++;\n }\n if (dint === 2) {\n if (val1 < val2) {\n throwError(str2 + 'specified must be less than the' + str1);\n }\n else {\n return true;\n }\n }\n else if (checkbothExist && dint === 1) {\n throwError('Both' + str2 + 'and' + str2 + 'must be present');\n }\n return false;\n };\n /**\n * Check if the provided fraction range is valid\n *\n * @param {number} val ?\n * @param {string} text ?\n * @param {boolean} isFraction ?\n * @returns {void} ?\n */\n NumberFormat.checkRange = function (val, text, isFraction) {\n var range = isFraction ? [0, 20] : [1, 21];\n if (val < range[0] || val > range[1]) {\n throwError(text + 'value must be within the range' + range[0] + 'to' + range[1]);\n }\n };\n /**\n * Returns formatted numeric string for provided formatting options\n *\n * @param {number} value ?\n * @param {base.GenericFormatOptions} fOptions ?\n * @param {CommonOptions} dOptions ?\n * @returns {string} ?\n */\n NumberFormat.intNumberFormatter = function (value, fOptions, dOptions) {\n var curData;\n if (isUndefined(fOptions.nData.type)) {\n return undefined;\n }\n else {\n if (value < 0) {\n value = value * -1;\n curData = fOptions.nData;\n }\n else if (value === 0) {\n curData = fOptions.zeroData || fOptions.pData;\n }\n else {\n curData = fOptions.pData;\n }\n var fValue = '';\n if (curData.isPercent) {\n value = value * 100;\n }\n if (curData.groupOne) {\n fValue = this.processSignificantDigits(value, curData.minimumSignificantDigits, curData.maximumSignificantDigits);\n }\n else {\n fValue = this.processFraction(value, curData.minimumFractionDigits, curData.maximumFractionDigits);\n if (curData.minimumIntegerDigits) {\n fValue = this.processMinimumIntegers(fValue, curData.minimumIntegerDigits);\n }\n }\n if (curData.type === 'scientific') {\n fValue = value.toExponential(curData.maximumFractionDigits);\n fValue = fValue.replace('e', dOptions.numberMapper.numberSymbols[mapper[4]]);\n }\n fValue = fValue.replace('.', dOptions.numberMapper.numberSymbols[mapper[3]]);\n if (curData.useGrouping) {\n /* eslint-disable @typescript-eslint/no-explicit-any */\n fValue = this.groupNumbers(fValue, curData.groupData.primary, curData.groupSeparator || ',', dOptions.numberMapper.numberSymbols[mapper[3]] || '.', curData.groupData.secondary);\n }\n fValue = parser.convertValueParts(fValue, base.latnParseRegex, dOptions.numberMapper.mapper);\n if (curData.nlead === 'N/A') {\n return curData.nlead;\n }\n else {\n return curData.nlead + fValue + curData.nend;\n }\n }\n };\n /**\n * Returns significant digits processed numeric string\n *\n * @param {number} value ?\n * @param {number} min ?\n * @param {number} max ?\n * @returns {string} ?\n */\n NumberFormat.processSignificantDigits = function (value, min, max) {\n var temp = value + '';\n var tn;\n var length = temp.length;\n if (length < min) {\n return value.toPrecision(min);\n }\n else {\n temp = value.toPrecision(max);\n tn = +temp;\n return tn + '';\n }\n };\n /**\n * Returns grouped numeric string\n *\n * @param {string} val ?\n * @param {number} level1 ?\n * @param {string} sep ?\n * @param {string} decimalSymbol ?\n * @param {number} level2 ?\n * @returns {string} ?\n */\n NumberFormat.groupNumbers = function (val, level1, sep, decimalSymbol, level2) {\n var flag = !isNullOrUndefined(level2) && level2 !== 0;\n var split = val.split(decimalSymbol);\n var prefix = split[0];\n var length = prefix.length;\n var str = '';\n while (length > level1) {\n str = prefix.slice(length - level1, length) + (str.length ?\n (sep + str) : '');\n length -= level1;\n if (flag) {\n level1 = level2;\n flag = false;\n }\n }\n split[0] = prefix.slice(0, length) + (str.length ? sep : '') + str;\n return split.join(decimalSymbol);\n };\n /**\n * Returns fraction processed numeric string\n *\n * @param {number} value ?\n * @param {number} min ?\n * @param {number} max ?\n * @returns {string} ?\n */\n NumberFormat.processFraction = function (value, min, max) {\n var temp = (value + '').split('.')[1];\n var length = temp ? temp.length : 0;\n if (min && length < min) {\n var ret = '';\n if (length === 0) {\n ret = value.toFixed(min);\n }\n else {\n ret += value;\n for (var j = 0; j < min - length; j++) {\n ret += '0';\n }\n return ret;\n }\n return value.toFixed(min);\n }\n else if (!isNullOrUndefined(max) && (length > max || max === 0)) {\n return value.toFixed(max);\n }\n return value + '';\n };\n /**\n * Returns integer processed numeric string\n *\n * @param {string} value ?\n * @param {number} min ?\n * @returns {string} ?\n */\n NumberFormat.processMinimumIntegers = function (value, min) {\n var temp = value.split('.');\n var lead = temp[0];\n var len = lead.length;\n if (len < min) {\n for (var i = 0; i < min - len; i++) {\n lead = '0' + lead;\n }\n temp[0] = lead;\n }\n return temp.join('.');\n };\n return NumberFormat;\n}());\nexport { NumberFormat };\n","import { IntlBase as base } from './intl-base';\nimport { ParserBase as parser } from './parser-base';\nimport { isUndefined, throwError, getValue, isNullOrUndefined, isBlazor } from '../util';\nimport { datePartMatcher } from './date-formatter';\nimport { HijriParser } from '../hijri-parser';\nvar standalone = 'stand-alone';\nvar latnRegex = /^[0-9]*$/;\nvar timeSetter = {\n minute: 'setMinutes',\n hour: 'setHours',\n second: 'setSeconds',\n day: 'setDate',\n month: 'setMonth',\n milliseconds: 'setMilliseconds'\n};\nvar month = 'months';\n/* tslint:disable no-any */\n/**\n * Date Parser.\n *\n * @private\n */\nvar DateParser = /** @class */ (function () {\n function DateParser() {\n }\n /**\n * Returns the parser function for given skeleton.\n *\n * @param {string} culture - Specifies the culture name to be which formatting.\n * @param {DateFormatOptions} option - Specific the format in which string date will be parsed.\n * @param {Object} cldr - Specifies the global cldr data collection.\n * @returns {Function} ?\n */\n DateParser.dateParser = function (culture, option, cldr) {\n var _this = this;\n var dependable = base.getDependables(cldr, culture, option.calendar);\n var numOptions = parser.getCurrentNumericOptions(dependable.parserObject, parser.getNumberingSystem(cldr), false, isBlazor());\n var parseOptions = {};\n if (isBlazor() && option.isServerRendered) {\n option = base.compareBlazorDateFormats(option, culture);\n }\n var resPattern = option.format ||\n base.getResultantPattern(option.skeleton, dependable.dateObject, option.type, false, isBlazor() ? culture : '');\n var regexString = '';\n var hourOnly;\n if (isUndefined(resPattern)) {\n throwError('Format options or type given must be invalid');\n }\n else {\n resPattern = base.ConvertDateToWeekFormat(resPattern);\n parseOptions = { isIslamic: base.islamicRegex.test(option.calendar), pattern: resPattern, evalposition: {}, culture: culture };\n var patternMatch = resPattern.match(base.dateParseRegex) || [];\n var length_1 = patternMatch.length;\n var gmtCorrection = 0;\n var zCorrectTemp = 0;\n var isgmtTraversed = false;\n var nRegx = numOptions.numericRegex;\n // eslint-disable-next-line\n var numMapper = isBlazor() ? dependable.parserObject.numbers :\n parser.getNumberMapper(dependable.parserObject, parser.getNumberingSystem(cldr));\n for (var i = 0; i < length_1; i++) {\n var str = patternMatch[i];\n var len = str.length;\n var char = (str[0] === 'K') ? 'h' : str[0];\n var isNumber = void 0;\n var canUpdate = void 0;\n // eslint-disable-next-line\n var charKey = datePartMatcher[char];\n var optional = (len === 2) ? '' : '?';\n if (isgmtTraversed) {\n gmtCorrection = zCorrectTemp;\n isgmtTraversed = false;\n }\n switch (char) {\n case 'E':\n case 'c':\n // eslint-disable-next-line\n var weekData = void 0;\n if (isBlazor()) {\n // eslint-disable-next-line\n weekData = getValue('days.' + base.monthIndex[len], dependable.dateObject);\n }\n else {\n // eslint-disable-next-line\n weekData = dependable.dateObject[base.days][standalone][base.monthIndex[len]];\n }\n // eslint-disable-next-line\n var weekObject = parser.reverseObject(weekData);\n // tslint:enable\n regexString += '(' + Object.keys(weekObject).join('|') + ')';\n break;\n case 'M':\n case 'L':\n case 'd':\n case 'm':\n case 's':\n case 'h':\n case 'H':\n case 'f':\n canUpdate = true;\n if ((char === 'M' || char === 'L') && len > 2) {\n var monthData = void 0;\n if (isBlazor()) {\n // eslint-disable-next-line\n monthData = getValue('months.' + base.monthIndex[len], dependable.dateObject);\n }\n else {\n // eslint-disable-next-line\n monthData = dependable.dateObject[month][standalone][base.monthIndex[len]];\n }\n // eslint-disable-next-line\n parseOptions[charKey] = parser.reverseObject(monthData);\n // eslint-disable-next-line\n regexString += '(' + Object.keys(parseOptions[charKey]).join('|') + ')';\n }\n else if (char === 'f') {\n if (len > 3) {\n continue;\n }\n isNumber = true;\n regexString += '(' + nRegx + nRegx + '?' + nRegx + '?' + ')';\n }\n else {\n isNumber = true;\n regexString += '(' + nRegx + nRegx + optional + ')';\n }\n if (char === 'h') {\n parseOptions.hour12 = true;\n }\n break;\n case 'W':\n // eslint-disable-next-line\n var opt = len === 1 ? '?' : '';\n regexString += '(' + nRegx + opt + nRegx + ')';\n break;\n case 'y':\n canUpdate = isNumber = true;\n if (len === 2) {\n regexString += '(' + nRegx + nRegx + ')';\n }\n else {\n regexString += '(' + nRegx + '{' + len + ',})';\n }\n break;\n case 'a':\n canUpdate = true;\n // eslint-disable-next-line\n var periodValur = isBlazor() ?\n getValue('dayPeriods', dependable.dateObject) :\n getValue('dayPeriods.format.wide', dependable.dateObject);\n // eslint-disable-next-line\n parseOptions[charKey] = parser.reverseObject(periodValur);\n // eslint-disable-next-line\n regexString += '(' + Object.keys(parseOptions[charKey]).join('|') + ')';\n break;\n case 'G':\n canUpdate = true;\n // eslint-disable-next-line\n var eText = (len <= 3) ? 'eraAbbr' : (len === 4) ? 'eraNames' : 'eraNarrow';\n // eslint-disable-next-line\n parseOptions[charKey] = parser.reverseObject(isBlazor() ?\n getValue('eras', dependable.dateObject) : getValue('eras.' + eText, dependable.dateObject));\n // eslint-disable-next-line\n regexString += '(' + Object.keys(parseOptions[charKey]).join('|') + '?)';\n break;\n case 'z':\n // eslint-disable-next-line\n var tval = new Date().getTimezoneOffset();\n canUpdate = (tval !== 0);\n // eslint-disable-next-line\n parseOptions[charKey] = getValue('dates.timeZoneNames', dependable.parserObject);\n // eslint-disable-next-line\n var tzone = parseOptions[charKey];\n hourOnly = (len < 4);\n // eslint-disable-next-line\n var hpattern = hourOnly ? '+H;-H' : tzone.hourFormat;\n hpattern = hpattern.replace(/:/g, numMapper.timeSeparator);\n regexString += '(' + this.parseTimeZoneRegx(hpattern, tzone, nRegx) + ')?';\n isgmtTraversed = true;\n zCorrectTemp = hourOnly ? 6 : 12;\n break;\n case '\\'':\n // eslint-disable-next-line\n var iString = str.replace(/'/g, '');\n regexString += '(' + iString + ')?';\n break;\n default:\n regexString += '([\\\\D])';\n break;\n }\n if (canUpdate) {\n parseOptions.evalposition[charKey] = { isNumber: isNumber, pos: i + 1 + gmtCorrection, hourOnly: hourOnly };\n }\n if (i === length_1 - 1 && !isNullOrUndefined(regexString)) {\n parseOptions.parserRegex = new RegExp('^' + regexString + '$', 'i');\n }\n }\n }\n return function (value) {\n var parsedDateParts = _this.internalDateParse(value, parseOptions, numOptions);\n if (isNullOrUndefined(parsedDateParts) || !Object.keys(parsedDateParts).length) {\n return null;\n }\n if (parseOptions.isIslamic) {\n var dobj = {};\n var tYear = parsedDateParts.year;\n var tDate = parsedDateParts.day;\n var tMonth = parsedDateParts.month;\n var ystrig = tYear ? (tYear + '') : '';\n var is2DigitYear = (ystrig.length === 2);\n if (!tYear || !tMonth || !tDate || is2DigitYear) {\n dobj = HijriParser.getHijriDate(new Date());\n }\n if (is2DigitYear) {\n tYear = parseInt((dobj.year + '').slice(0, 2) + ystrig, 10);\n }\n // tslint:disable-next-line\n var dateObject = HijriParser.toGregorian(tYear || dobj.year, tMonth || dobj.month, tDate || dobj.date);\n parsedDateParts.year = dateObject.getFullYear();\n parsedDateParts.month = dateObject.getMonth() + 1;\n parsedDateParts.day = dateObject.getDate();\n }\n return _this.getDateObject(parsedDateParts);\n };\n };\n /* tslint:disable */\n /**\n * Returns date object for provided date options\n *\n * @param {DateParts} options ?\n * @param {Date} value ?\n * @returns {Date} ?\n */\n DateParser.getDateObject = function (options, value) {\n var res = value || new Date();\n res.setMilliseconds(0);\n var tKeys = ['hour', 'minute', 'second', 'milliseconds', 'month', 'day'];\n var y = options.year;\n var desig = options.designator;\n var tzone = options.timeZone;\n if (!isUndefined(y)) {\n var len = (y + '').length;\n if (len <= 2) {\n var century = Math.floor(res.getFullYear() / 100) * 100;\n y += century;\n }\n res.setFullYear(y);\n }\n for (var _i = 0, tKeys_1 = tKeys; _i < tKeys_1.length; _i++) {\n var key = tKeys_1[_i];\n // eslint-disable-next-line\n var tValue = options[key];\n if (isUndefined(tValue) && key === 'day') {\n res.setDate(1);\n }\n if (!isUndefined(tValue)) {\n if (key === 'month') {\n tValue -= 1;\n if (tValue < 0 || tValue > 11) {\n return new Date('invalid');\n }\n var pDate = res.getDate();\n res.setDate(1);\n // eslint-disable-next-line\n res[timeSetter[key]](tValue);\n var lDate = new Date(res.getFullYear(), tValue + 1, 0).getDate();\n res.setDate(pDate < lDate ? pDate : lDate);\n }\n else {\n if (key === 'day') {\n var lastDay = new Date(res.getFullYear(), res.getMonth() + 1, 0).getDate();\n if ((tValue < 1 || tValue > lastDay)) {\n return null;\n }\n }\n // eslint-disable-next-line\n res[timeSetter[key]](tValue);\n }\n }\n }\n if (!isUndefined(desig)) {\n var hour = res.getHours();\n if (desig === 'pm') {\n res.setHours(hour + (hour === 12 ? 0 : 12));\n }\n else if (hour === 12) {\n res.setHours(0);\n }\n }\n if (!isUndefined(tzone)) {\n var tzValue = tzone - res.getTimezoneOffset();\n if (tzValue !== 0) {\n res.setMinutes(res.getMinutes() + tzValue);\n }\n }\n return res;\n };\n /**\n * Returns date parsing options for provided value along with parse and numeric options\n *\n * @param {string} value ?\n * @param {ParseOptions} parseOptions ?\n * @param {NumericOptions} num ?\n * @returns {DateParts} ?\n */\n DateParser.internalDateParse = function (value, parseOptions, num) {\n var matches = value.match(parseOptions.parserRegex);\n var retOptions = { 'hour': 0, 'minute': 0, 'second': 0 };\n if (isNullOrUndefined(matches)) {\n return null;\n }\n else {\n var props = Object.keys(parseOptions.evalposition);\n for (var _i = 0, props_1 = props; _i < props_1.length; _i++) {\n var prop = props_1[_i];\n var curObject = parseOptions.evalposition[prop];\n var matchString = matches[curObject.pos];\n if (curObject.isNumber) {\n // eslint-disable-next-line\n retOptions[prop] = this.internalNumberParser(matchString, num);\n }\n else {\n if (prop === 'timeZone' && !isUndefined(matchString)) {\n var pos = curObject.pos;\n var val = void 0;\n var tmatch = matches[pos + 1];\n var flag = !isUndefined(tmatch);\n if (curObject.hourOnly) {\n val = this.getZoneValue(flag, tmatch, matches[pos + 4], num) * 60;\n }\n else {\n val = this.getZoneValue(flag, tmatch, matches[pos + 7], num) * 60;\n val += this.getZoneValue(flag, matches[pos + 4], matches[pos + 10], num);\n }\n if (!isNullOrUndefined(val)) {\n retOptions[prop] = val;\n }\n }\n else {\n // eslint-disable-next-line\n matchString = ((prop === 'month') && (!parseOptions.isIslamic) && (parseOptions.culture === 'en' || parseOptions.culture === 'en-GB' || parseOptions.culture === 'en-US'))\n ? matchString[0].toUpperCase() + matchString.substring(1).toLowerCase() : matchString;\n // eslint-disable-next-line\n retOptions[prop] = parseOptions[prop][matchString];\n }\n }\n }\n if (parseOptions.hour12) {\n retOptions.hour12 = true;\n }\n }\n return retOptions;\n };\n /**\n * Returns parsed number for provided Numeric string and Numeric Options\n *\n * @param {string} value ?\n * @param {NumericOptions} option ?\n * @returns {number} ?\n */\n DateParser.internalNumberParser = function (value, option) {\n value = parser.convertValueParts(value, option.numberParseRegex, option.numericPair);\n if (latnRegex.test(value)) {\n return +value;\n }\n return null;\n };\n /**\n * Returns parsed time zone RegExp for provided hour format and time zone\n *\n * @param {string} hourFormat ?\n * @param {base.TimeZoneOptions} tZone ?\n * @param {string} nRegex ?\n * @returns {string} ?\n */\n DateParser.parseTimeZoneRegx = function (hourFormat, tZone, nRegex) {\n var pattern = tZone.gmtFormat;\n var ret;\n var cRegex = '(' + nRegex + ')' + '(' + nRegex + ')';\n var splitStr;\n ret = hourFormat.replace('+', '\\\\+');\n if (hourFormat.indexOf('HH') !== -1) {\n ret = ret.replace(/HH|mm/g, '(' + cRegex + ')');\n }\n else {\n ret = ret.replace(/H|m/g, '(' + cRegex + '?)');\n }\n // eslint-disable-next-line\n splitStr = (ret.split(';').map(function (str) {\n return pattern.replace('{0}', str);\n }));\n ret = splitStr.join('|') + '|' + tZone.gmtZeroFormat;\n return ret;\n };\n /**\n * Returns zone based value.\n *\n * @param {boolean} flag ?\n * @param {string} val1 ?\n * @param {string} val2 ?\n * @param {NumericOptions} num ?\n * @returns {number} ?\n */\n DateParser.getZoneValue = function (flag, val1, val2, num) {\n var ival = flag ? val1 : val2;\n if (!ival) {\n return 0;\n }\n var value = this.internalNumberParser(ival, num);\n if (flag) {\n return -value;\n }\n return value;\n };\n return DateParser;\n}());\nexport { DateParser };\n","import { extend, isNullOrUndefined, isBlazor, getValue } from '../util';\nimport { ParserBase as parser } from './parser-base';\nimport { IntlBase as base } from './intl-base';\nvar parseRegex = /^([^0-9]*)(([0-9,]*[0-9]+)(\\.[0-9]+)?)([Ee][+-]?[0-9]+)?([^0-9]*)$/;\nvar groupRegex = /,/g;\nvar keys = ['minusSign', 'infinity'];\n/**\n * Module for Number Parser.\n *\n * @private\n */\nvar NumberParser = /** @class */ (function () {\n function NumberParser() {\n }\n /**\n * Returns the parser function for given skeleton.\n *\n * @param {string} culture - Specifies the culture name to be which formatting.\n * @param {NumberFormatOptions} option - Specific the format in which number will parsed.\n * @param {Object} cldr - Specifies the global cldr data collection.\n * @returns {Function} ?\n */\n NumberParser.numberParser = function (culture, option, cldr) {\n var _this = this;\n var dependable = base.getDependables(cldr, culture, '', true);\n var parseOptions = { custom: true };\n var numOptions;\n if ((base.formatRegex.test(option.format)) || !(option.format)) {\n extend(parseOptions, base.getProperNumericSkeleton(option.format || 'N'));\n parseOptions.custom = false;\n if (!parseOptions.fractionDigits) {\n if (option.maximumFractionDigits) {\n parseOptions.maximumFractionDigits = option.maximumFractionDigits;\n }\n }\n }\n else {\n extend(parseOptions, base.customFormat(option.format, null, null));\n }\n var numbers = getValue('numbers', dependable.parserObject);\n // eslint-disable-next-line\n numOptions = parser.getCurrentNumericOptions(dependable.parserObject, parser.getNumberingSystem(cldr), true, isBlazor());\n parseOptions.symbolRegex = parser.getSymbolRegex(Object.keys(numOptions.symbolMatch));\n // eslint-disable-next-line\n parseOptions.infinity = numOptions.symbolNumberSystem[keys[1]];\n var symbolpattern;\n if (!isBlazor()) {\n symbolpattern = base.getSymbolPattern(parseOptions.type, numOptions.numberSystem, dependable.numericObject, parseOptions.isAccount);\n if (symbolpattern) {\n symbolpattern = symbolpattern.replace(/\\u00A4/g, base.defaultCurrency);\n var split = symbolpattern.split(';');\n parseOptions.nData = base.getFormatData(split[1] || '-' + split[0], true, '');\n parseOptions.pData = base.getFormatData(split[0], true, '');\n }\n }\n else {\n parseOptions.nData = extend({}, {}, getValue(parseOptions.type + 'nData', numbers));\n parseOptions.pData = extend({}, {}, getValue(parseOptions.type + 'pData', numbers));\n if (parseOptions.type === 'currency' && option.currency) {\n base.replaceBlazorCurrency([parseOptions.pData, parseOptions.nData], getValue('currencySymbol', numbers), option.currency);\n }\n }\n return function (value) {\n return _this.getParsedNumber(value, parseOptions, numOptions);\n };\n };\n /**\n * Returns parsed number for the provided formatting options\n *\n * @param {string} value ?\n * @param {NumericParts} options ?\n * @param {NumericOptions} numOptions ?\n * @returns {number} ?\n */\n NumberParser.getParsedNumber = function (value, options, numOptions) {\n var isNegative;\n var isPercent;\n var tempValue;\n var lead;\n var end;\n var ret;\n if (value.indexOf(options.infinity) !== -1) {\n return Infinity;\n }\n else {\n value = parser.convertValueParts(value, options.symbolRegex, numOptions.symbolMatch);\n value = parser.convertValueParts(value, numOptions.numberParseRegex, numOptions.numericPair);\n value = value.indexOf('-') !== -1 ? value.replace('-.', '-0.') : value;\n if (value.indexOf('.') === 0) {\n value = '0' + value;\n }\n var matches = value.match(parseRegex);\n if (isNullOrUndefined(matches)) {\n return NaN;\n }\n lead = matches[1];\n tempValue = matches[2];\n var exponent = matches[5];\n end = matches[6];\n isNegative = options.custom ? ((lead === options.nData.nlead) && (end === options.nData.nend)) :\n ((lead.indexOf(options.nData.nlead) !== -1) && (end.indexOf(options.nData.nend) !== -1));\n isPercent = isNegative ?\n options.nData.isPercent :\n options.pData.isPercent;\n tempValue = tempValue.replace(groupRegex, '');\n if (exponent) {\n tempValue += exponent;\n }\n ret = +tempValue;\n if (options.type === 'percent' || isPercent) {\n ret = ret / 100;\n }\n if (options.custom || options.fractionDigits) {\n ret = parseFloat(ret.toFixed(options.custom ?\n (isNegative ? options.nData.maximumFractionDigits : options.pData.maximumFractionDigits) : options.fractionDigits));\n }\n if (options.maximumFractionDigits) {\n ret = this.convertMaxFracDigits(tempValue, options, ret, isNegative);\n }\n if (isNegative) {\n ret *= -1;\n }\n return ret;\n }\n };\n NumberParser.convertMaxFracDigits = function (value, options, ret, isNegative) {\n var decimalSplitValue = value.split('.');\n if (decimalSplitValue[1] && decimalSplitValue[1].length > options.maximumFractionDigits) {\n ret = +(ret.toFixed(options.custom ?\n (isNegative ? options.nData.maximumFractionDigits : options.pData.maximumFractionDigits) : options.maximumFractionDigits));\n }\n return ret;\n };\n return NumberParser;\n}());\nexport { NumberParser };\n","import { isNullOrUndefined, getValue, extend, isBlazor } from './util';\nvar Observer = /** @class */ (function () {\n function Observer(context) {\n this.ranArray = [];\n this.boundedEvents = {};\n if (isNullOrUndefined(context)) {\n return;\n }\n this.context = context;\n }\n /**\n * To attach handler for given property in current context.\n *\n * @param {string} property - specifies the name of the event.\n * @param {Function} handler - Specifies the handler function to be called while event notified.\n * @param {Object} context - Specifies the context binded to the handler.\n * @param {string} id - specifies the random generated id.\n * @returns {void}\n */\n Observer.prototype.on = function (property, handler, context, id) {\n if (isNullOrUndefined(handler)) {\n return;\n }\n var cntxt = context || this.context;\n if (this.notExist(property)) {\n this.boundedEvents[property] = [{ handler: handler, context: cntxt }];\n return;\n }\n if (!isNullOrUndefined(id)) {\n if (this.ranArray.indexOf(id) === -1) {\n this.ranArray.push(id);\n this.boundedEvents[property].push({ handler: handler, context: cntxt, id: id });\n }\n }\n else if (!this.isHandlerPresent(this.boundedEvents[property], handler)) {\n this.boundedEvents[property].push({ handler: handler, context: cntxt });\n }\n };\n /**\n * To remove handlers from a event attached using on() function.\n *\n * @param {string} property - specifies the name of the event.\n * @param {Function} handler - Optional argument specifies the handler function to be called while event notified.\n * @param {string} id - specifies the random generated id.\n * @returns {void} ?\n */\n Observer.prototype.off = function (property, handler, id) {\n if (this.notExist(property)) {\n return;\n }\n var curObject = getValue(property, this.boundedEvents);\n if (handler) {\n for (var i = 0; i < curObject.length; i++) {\n if (id) {\n if (curObject[i].id === id) {\n curObject.splice(i, 1);\n var indexLocation = this.ranArray.indexOf(id);\n if (indexLocation !== -1) {\n this.ranArray.splice(indexLocation, 1);\n }\n break;\n }\n }\n else if (handler === curObject[i].handler) {\n curObject.splice(i, 1);\n break;\n }\n }\n }\n else {\n delete this.boundedEvents[property];\n }\n };\n /**\n * To notify the handlers in the specified event.\n *\n * @param {string} property - Specifies the event to be notify.\n * @param {Object} argument - Additional parameters to pass while calling the handler.\n * @param {Function} successHandler - this function will invoke after event successfully triggered\n * @param {Function} errorHandler - this function will invoke after event if it was failure to call.\n * @returns {void} ?\n */\n Observer.prototype.notify = function (property, argument, successHandler, errorHandler) {\n if (this.notExist(property)) {\n if (successHandler) {\n successHandler.call(this, argument);\n }\n return;\n }\n if (argument) {\n argument.name = property;\n }\n var blazor = 'Blazor';\n var curObject = getValue(property, this.boundedEvents).slice(0);\n if (window[blazor]) {\n return this.blazorCallback(curObject, argument, successHandler, errorHandler, 0);\n }\n else {\n for (var _i = 0, curObject_1 = curObject; _i < curObject_1.length; _i++) {\n var cur = curObject_1[_i];\n cur.handler.call(cur.context, argument);\n }\n if (successHandler) {\n successHandler.call(this, argument);\n }\n }\n };\n Observer.prototype.blazorCallback = function (objs, argument, successHandler, errorHandler, index) {\n var _this = this;\n var isTrigger = index === objs.length - 1;\n if (index < objs.length) {\n var obj_1 = objs[index];\n var promise = obj_1.handler.call(obj_1.context, argument);\n if (promise && typeof promise.then === 'function') {\n if (!successHandler) {\n return promise;\n }\n promise.then(function (data) {\n data = typeof data === 'string' && _this.isJson(data) ? JSON.parse(data, _this.dateReviver) : data;\n extend(argument, argument, data, true);\n if (successHandler && isTrigger) {\n successHandler.call(obj_1.context, argument);\n }\n else {\n return _this.blazorCallback(objs, argument, successHandler, errorHandler, index + 1);\n }\n }).catch(function (data) {\n if (errorHandler) {\n errorHandler.call(obj_1.context, typeof data === 'string' &&\n _this.isJson(data) ? JSON.parse(data, _this.dateReviver) : data);\n }\n });\n }\n else if (successHandler && isTrigger) {\n successHandler.call(obj_1.context, argument);\n }\n else {\n return this.blazorCallback(objs, argument, successHandler, errorHandler, index + 1);\n }\n }\n };\n // eslint-disable-next-line\n Observer.prototype.dateReviver = function (key, value) {\n var dPattern = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}/;\n if (isBlazor && typeof value === 'string' && value.match(dPattern) !== null) {\n return (new Date(value));\n }\n return (value);\n };\n Observer.prototype.isJson = function (value) {\n try {\n JSON.parse(value);\n }\n catch (e) {\n return false;\n }\n return true;\n };\n /**\n * To destroy handlers in the event\n *\n * @returns {void} ?\n */\n Observer.prototype.destroy = function () {\n this.boundedEvents = this.context = undefined;\n };\n /**\n * Returns if the property exists.\n *\n * @param {string} prop ?\n * @returns {boolean} ?\n */\n Observer.prototype.notExist = function (prop) {\n // eslint-disable-next-line\n return this.boundedEvents.hasOwnProperty(prop) === false || this.boundedEvents[prop].length <= 0;\n };\n /**\n * Returns if the handler is present.\n *\n * @param {BoundOptions[]} boundedEvents ?\n * @param {Function} handler ?\n * @returns {boolean} ?\n */\n Observer.prototype.isHandlerPresent = function (boundedEvents, handler) {\n for (var _i = 0, boundedEvents_1 = boundedEvents; _i < boundedEvents_1.length; _i++) {\n var cur = boundedEvents_1[_i];\n if (cur.handler === handler) {\n return true;\n }\n }\n return false;\n };\n return Observer;\n}());\nexport { Observer };\n","import { DateFormat } from './intl/date-formatter';\nimport { NumberFormat } from './intl/number-formatter';\nimport { DateParser } from './intl/date-parser';\nimport { NumberParser } from './intl/number-parser';\nimport { IntlBase } from './intl/intl-base';\nimport { extend, getValue, isBlazor } from './util';\nimport { Observer } from './observer';\n/**\n * Specifies the observer used for external change detection.\n */\nexport var onIntlChange = new Observer();\n/**\n * Specifies the default rtl status for EJ2 components.\n */\nexport var rightToLeft = false;\n/**\n * Specifies the CLDR data loaded for internationalization functionalities.\n *\n * @private\n */\nexport var cldrData = {};\n/**\n * Specifies the default culture value to be considered.\n *\n * @private\n */\nexport var defaultCulture = 'en-US';\n/**\n * Specifies default currency code to be considered\n *\n * @private\n */\nexport var defaultCurrencyCode = 'USD';\nvar mapper = ['numericObject', 'dateObject'];\n/**\n * Internationalization class provides support to parse and format the number and date object to the desired format.\n * ```typescript\n * // To set the culture globally\n * setCulture('en-GB');\n *\n * // To set currency code globally\n * setCurrencyCode('EUR');\n *\n * //Load cldr data\n * loadCldr(gregorainData);\n * loadCldr(timeZoneData);\n * loadCldr(numbersData);\n * loadCldr(numberSystemData);\n *\n * // To use formatter in component side\n * let Intl:Internationalization = new Internationalization();\n *\n * // Date formatting\n * let dateFormatter: Function = Intl.getDateFormat({skeleton:'long',type:'dateTime'});\n * dateFormatter(new Date('11/2/2016'));\n * dateFormatter(new Date('25/2/2030'));\n * Intl.formatDate(new Date(),{skeleton:'E'});\n *\n * //Number formatting\n * let numberFormatter: Function = Intl.getNumberFormat({skeleton:'C5'})\n * numberFormatter(24563334);\n * Intl.formatNumber(123123,{skeleton:'p2'});\n *\n * // Date parser\n * let dateParser: Function = Intl.getDateParser({skeleton:'short',type:'time'});\n * dateParser('10:30 PM');\n * Intl.parseDate('10',{skeleton:'H'});\n * ```\n */\nvar Internationalization = /** @class */ (function () {\n function Internationalization(cultureName) {\n if (cultureName) {\n this.culture = cultureName;\n }\n }\n /**\n * Returns the format function for given options.\n *\n * @param {DateFormatOptions} options - Specifies the format options in which the format function will return.\n * @returns {Function} ?\n */\n Internationalization.prototype.getDateFormat = function (options) {\n return DateFormat.dateFormat(this.getCulture(), options || { type: 'date', skeleton: 'short' }, cldrData);\n };\n /**\n * Returns the format function for given options.\n *\n * @param {NumberFormatOptions} options - Specifies the format options in which the format function will return.\n * @returns {Function} ?\n */\n Internationalization.prototype.getNumberFormat = function (options) {\n if (options && !options.currency) {\n options.currency = defaultCurrencyCode;\n }\n if (isBlazor() && options && !options.format) {\n options.minimumFractionDigits = 0;\n }\n return NumberFormat.numberFormatter(this.getCulture(), options || {}, cldrData);\n };\n /**\n * Returns the parser function for given options.\n *\n * @param {DateFormatOptions} options - Specifies the format options in which the parser function will return.\n * @returns {Function} ?\n */\n Internationalization.prototype.getDateParser = function (options) {\n return DateParser.dateParser(this.getCulture(), options || { skeleton: 'short', type: 'date' }, cldrData);\n };\n /**\n * Returns the parser function for given options.\n *\n * @param {NumberFormatOptions} options - Specifies the format options in which the parser function will return.\n * @returns {Function} ?\n */\n Internationalization.prototype.getNumberParser = function (options) {\n if (isBlazor() && options && !options.format) {\n options.minimumFractionDigits = 0;\n }\n return NumberParser.numberParser(this.getCulture(), options || { format: 'N' }, cldrData);\n };\n /**\n * Returns the formatted string based on format options.\n *\n * @param {number} value - Specifies the number to format.\n * @param {NumberFormatOptions} option - Specifies the format options in which the number will be formatted.\n * @returns {string} ?\n */\n Internationalization.prototype.formatNumber = function (value, option) {\n return this.getNumberFormat(option)(value);\n };\n /**\n * Returns the formatted date string based on format options.\n *\n * @param {Date} value - Specifies the number to format.\n * @param {DateFormatOptions} option - Specifies the format options in which the number will be formatted.\n * @returns {string} ?\n */\n Internationalization.prototype.formatDate = function (value, option) {\n return this.getDateFormat(option)(value);\n };\n /**\n * Returns the date object for given date string and options.\n *\n * @param {string} value - Specifies the string to parse.\n * @param {DateFormatOptions} option - Specifies the parse options in which the date string will be parsed.\n * @returns {Date} ?\n */\n Internationalization.prototype.parseDate = function (value, option) {\n return this.getDateParser(option)(value);\n };\n /**\n * Returns the number object from the given string value and options.\n *\n * @param {string} value - Specifies the string to parse.\n * @param {NumberFormatOptions} option - Specifies the parse options in which the string number will be parsed.\n * @returns {number} ?\n */\n Internationalization.prototype.parseNumber = function (value, option) {\n return this.getNumberParser(option)(value);\n };\n /**\n * Returns Native Date Time Pattern\n *\n * @param {DateFormatOptions} option - Specifies the parse options for resultant date time pattern.\n * @param {boolean} isExcelFormat - Specifies format value to be converted to excel pattern.\n * @returns {string} ?\n * @private\n */\n Internationalization.prototype.getDatePattern = function (option, isExcelFormat) {\n return IntlBase.getActualDateTimeFormat(this.getCulture(), option, cldrData, isExcelFormat);\n };\n /**\n * Returns Native Number Pattern\n *\n * @param {NumberFormatOptions} option - Specifies the parse options for resultant number pattern.\n * @param {boolean} isExcel ?\n * @returns {string} ?\n * @private\n */\n Internationalization.prototype.getNumberPattern = function (option, isExcel) {\n return IntlBase.getActualNumberFormat(this.getCulture(), option, cldrData, isExcel);\n };\n /**\n * Returns the First Day of the Week\n *\n * @returns {number} ?\n */\n Internationalization.prototype.getFirstDayOfWeek = function () {\n return IntlBase.getWeekData(this.getCulture(), cldrData);\n };\n /**\n * Returns the culture\n *\n * @returns {string} ?\n */\n Internationalization.prototype.getCulture = function () {\n return this.culture || defaultCulture;\n };\n return Internationalization;\n}());\nexport { Internationalization };\n/**\n * Set the default culture to all EJ2 components\n *\n * @param {string} cultureName - Specifies the culture name to be set as default culture.\n * @returns {void} ?\n */\nexport function setCulture(cultureName) {\n defaultCulture = cultureName;\n onIntlChange.notify('notifyExternalChange', { 'locale': defaultCulture });\n}\n/**\n * Set the default currency code to all EJ2 components\n *\n * @param {string} currencyCode Specifies the culture name to be set as default culture.\n * @returns {void} ?\n */\nexport function setCurrencyCode(currencyCode) {\n defaultCurrencyCode = currencyCode;\n onIntlChange.notify('notifyExternalChange', { 'currencyCode': defaultCurrencyCode });\n}\n/**\n * Load the CLDR data into context\n *\n * @param {Object[]} data Specifies the CLDR data's to be used for formatting and parser.\n * @returns {void} ?\n */\nexport function loadCldr() {\n var data = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n data[_i] = arguments[_i];\n }\n for (var _a = 0, data_1 = data; _a < data_1.length; _a++) {\n var obj = data_1[_a];\n extend(cldrData, obj, {}, true);\n }\n}\n/**\n * To enable or disable RTL functionality for all components globally.\n *\n * @param {boolean} status - Optional argument Specifies the status value to enable or disable rtl option.\n * @returns {void} ?\n */\nexport function enableRtl(status) {\n if (status === void 0) { status = true; }\n rightToLeft = status;\n onIntlChange.notify('notifyExternalChange', { enableRtl: rightToLeft });\n}\n/**\n * To get the numeric CLDR object for given culture\n *\n * @param {string} locale - Specifies the locale for which numericObject to be returned.\n * @param {string} type ?\n * @returns {Object} ?\n * @ignore\n * @private\n */\nexport function getNumericObject(locale, type) {\n // eslint-disable-next-line\n var numObject = IntlBase.getDependables(cldrData, locale, '', true)[mapper[0]];\n // eslint-disable-next-line\n var dateObject = IntlBase.getDependables(cldrData, locale, '')[mapper[1]];\n var numSystem = getValue('defaultNumberingSystem', numObject);\n var symbPattern = isBlazor() ? getValue('numberSymbols', numObject) : getValue('symbols-numberSystem-' + numSystem, numObject);\n var pattern = IntlBase.getSymbolPattern(type || 'decimal', numSystem, numObject, false);\n return extend(symbPattern, IntlBase.getFormatData(pattern, true, '', true), { 'dateSeparator': IntlBase.getDateSeparator(dateObject) });\n}\n/**\n * To get the numeric CLDR number base object for given culture\n *\n * @param {string} locale - Specifies the locale for which numericObject to be returned.\n * @param {string} currency - Specifies the currency for which numericObject to be returned.\n * @returns {string} ?\n * @ignore\n * @private\n */\nexport function getNumberDependable(locale, currency) {\n // eslint-disable-next-line\n var numObject = IntlBase.getDependables(cldrData, locale, '', true);\n // eslint-disable-next-line\n return IntlBase.getCurrencySymbol(numObject.numericObject, currency);\n}\n/**\n * To get the default date CLDR object.\n *\n * @param {string} mode ?\n * @returns {Object} ?\n * @ignore\n * @private\n */\nexport function getDefaultDateObject(mode) {\n // eslint-disable-next-line\n return IntlBase.getDependables(cldrData, '', mode, false)[mapper[1]];\n}\n","import { defaultCurrencyCode } from '../internationalization';\nimport { getValue, isNullOrUndefined, extend, isBlazor } from '../util';\nimport { ParserBase as parser, getBlazorCurrencySymbol } from './parser-base';\nimport { DateFormat } from './date-formatter';\nimport { NumberFormat } from './number-formatter';\nimport { isUndefined } from '../util';\nexport var blazorCultureFormats = {\n 'en-US': {\n 'd': 'M/d/y',\n 'D': 'EEEE, MMMM d, y',\n 'f': 'EEEE, MMMM d, y h:mm a',\n 'F': 'EEEE, MMMM d, y h:mm:s a',\n 'g': 'M/d/y h:mm a',\n 'G': 'M/d/yyyy h:mm:ss tt',\n 'm': 'MMMM d',\n 'M': 'MMMM d',\n 'r': 'ddd, dd MMM yyyy HH\\':\\'mm\\':\\'ss \\'GMT\\'',\n 'R': 'ddd, dd MMM yyyy HH\\':\\'mm\\':\\'ss \\'GMT\\'',\n 's': 'yyyy\\'-\\'MM\\'-\\'dd\\'T\\'HH\\':\\'mm\\':\\'ss',\n 't': 'h:mm tt',\n 'T': 'h:m:s tt',\n 'u': 'yyyy\\'-\\'MM\\'-\\'dd HH\\':\\'mm\\':\\'ss\\'Z\\'',\n 'U': 'dddd, MMMM d, yyyy h:mm:ss tt',\n 'y': 'MMMM yyyy',\n 'Y': 'MMMM yyyy'\n }\n};\n/**\n * Date base common constants and function for date parser and formatter.\n */\n// eslint-disable-next-line\nexport var IntlBase;\n(function (IntlBase) {\n // tslint:disable-next-line:max-line-length\n IntlBase.negativeDataRegex = /^(('[^']+'|''|[^*#@0,.E])*)(\\*.)?((([#,]*[0,]*0+)(\\.0*[0-9]*#*)?)|([#,]*@+#*))(E\\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/;\n IntlBase.customRegex = /^(('[^']+'|''|[^*#@0,.])*)(\\*.)?((([0#,]*[0,]*[0#]*)(\\.[0#]*)?)|([#,]*@+#*))(E\\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/;\n IntlBase.latnParseRegex = /0|1|2|3|4|5|6|7|8|9/g;\n var fractionRegex = /[0-9]/g;\n IntlBase.defaultCurrency = '$';\n var mapper = ['infinity', 'nan', 'group', 'decimal'];\n var patternRegex = /G|M|L|H|c|'| a|yy|y|EEEE|E/g;\n var patternMatch = {\n 'G': '',\n 'M': 'm',\n 'L': 'm',\n 'H': 'h',\n 'c': 'd',\n '\\'': '\"',\n ' a': ' AM/PM',\n 'yy': 'yy',\n 'y': 'yyyy',\n 'EEEE': 'dddd',\n 'E': 'ddd'\n };\n IntlBase.dateConverterMapper = /dddd|ddd/ig;\n var defaultFirstDay = 'sun';\n IntlBase.islamicRegex = /^islamic/;\n var firstDayMapper = {\n 'sun': 0,\n 'mon': 1,\n 'tue': 2,\n 'wed': 3,\n 'thu': 4,\n 'fri': 5,\n 'sat': 6\n };\n IntlBase.formatRegex = /(^[ncpae]{1})([0-1]?[0-9]|20)?$/i;\n IntlBase.currencyFormatRegex = /(^[ca]{1})([0-1]?[0-9]|20)?$/i;\n IntlBase.curWithoutNumberRegex = /(c|a)$/ig;\n var typeMapper = {\n '$': 'isCurrency',\n '%': 'isPercent',\n '-': 'isNegative',\n 0: 'nlead',\n 1: 'nend'\n };\n IntlBase.dateParseRegex = /([a-z])\\1*|'([^']|'')+'|''|./gi;\n IntlBase.basicPatterns = ['short', 'medium', 'long', 'full'];\n /* tslint:disable:quotemark */\n IntlBase.defaultObject = {\n 'dates': {\n 'calendars': {\n 'gregorian': {\n 'months': {\n 'stand-alone': {\n 'abbreviated': {\n '1': 'Jan',\n '2': 'Feb',\n '3': 'Mar',\n '4': 'Apr',\n '5': 'May',\n '6': 'Jun',\n '7': 'Jul',\n '8': 'Aug',\n '9': 'Sep',\n '10': 'Oct',\n '11': 'Nov',\n '12': 'Dec'\n },\n 'narrow': {\n '1': 'J',\n '2': 'F',\n '3': 'M',\n '4': 'A',\n '5': 'M',\n '6': 'J',\n '7': 'J',\n '8': 'A',\n '9': 'S',\n '10': 'O',\n '11': 'N',\n '12': 'D'\n },\n 'wide': {\n '1': 'January',\n '2': 'February',\n '3': 'March',\n '4': 'April',\n '5': 'May',\n '6': 'June',\n '7': 'July',\n '8': 'August',\n '9': 'September',\n '10': 'October',\n '11': 'November',\n '12': 'December'\n }\n }\n },\n 'days': {\n 'stand-alone': {\n 'abbreviated': {\n 'sun': 'Sun',\n 'mon': 'Mon',\n 'tue': 'Tue',\n 'wed': 'Wed',\n 'thu': 'Thu',\n 'fri': 'Fri',\n 'sat': 'Sat'\n },\n 'narrow': {\n 'sun': 'S',\n 'mon': 'M',\n 'tue': 'T',\n 'wed': 'W',\n 'thu': 'T',\n 'fri': 'F',\n 'sat': 'S'\n },\n 'short': {\n 'sun': 'Su',\n 'mon': 'Mo',\n 'tue': 'Tu',\n 'wed': 'We',\n 'thu': 'Th',\n 'fri': 'Fr',\n 'sat': 'Sa'\n },\n 'wide': {\n 'sun': 'Sunday',\n 'mon': 'Monday',\n 'tue': 'Tuesday',\n 'wed': 'Wednesday',\n 'thu': 'Thursday',\n 'fri': 'Friday',\n 'sat': 'Saturday'\n }\n }\n },\n 'dayPeriods': {\n 'format': {\n 'wide': {\n 'am': 'AM',\n 'pm': 'PM'\n }\n }\n },\n 'eras': {\n 'eraNames': {\n '0': 'Before Christ',\n '0-alt-variant': 'Before Common Era',\n '1': 'Anno Domini',\n '1-alt-variant': 'Common Era'\n },\n 'eraAbbr': {\n '0': 'BC',\n '0-alt-variant': 'BCE',\n '1': 'AD',\n '1-alt-variant': 'CE'\n },\n 'eraNarrow': {\n '0': 'B',\n '0-alt-variant': 'BCE',\n '1': 'A',\n '1-alt-variant': 'CE'\n }\n },\n 'dateFormats': {\n 'full': 'EEEE, MMMM d, y',\n 'long': 'MMMM d, y',\n 'medium': 'MMM d, y',\n 'short': 'M/d/yy'\n },\n 'timeFormats': {\n 'full': 'h:mm:ss a zzzz',\n 'long': 'h:mm:ss a z',\n 'medium': 'h:mm:ss a',\n 'short': 'h:mm a'\n },\n 'dateTimeFormats': {\n 'full': '{1} \\'at\\' {0}',\n 'long': '{1} \\'at\\' {0}',\n 'medium': '{1}, {0}',\n 'short': '{1}, {0}',\n 'availableFormats': {\n 'd': 'd',\n 'E': 'ccc',\n 'Ed': 'd E',\n 'Ehm': 'E h:mm a',\n 'EHm': 'E HH:mm',\n 'Ehms': 'E h:mm:ss a',\n 'EHms': 'E HH:mm:ss',\n 'Gy': 'y G',\n 'GyMMM': 'MMM y G',\n 'GyMMMd': 'MMM d, y G',\n 'GyMMMEd': 'E, MMM d, y G',\n 'h': 'h a',\n 'H': 'HH',\n 'hm': 'h:mm a',\n 'Hm': 'HH:mm',\n 'hms': 'h:mm:ss a',\n 'Hms': 'HH:mm:ss',\n 'hmsv': 'h:mm:ss a v',\n 'Hmsv': 'HH:mm:ss v',\n 'hmv': 'h:mm a v',\n 'Hmv': 'HH:mm v',\n 'M': 'L',\n 'Md': 'M/d',\n 'MEd': 'E, M/d',\n 'MMM': 'LLL',\n 'MMMd': 'MMM d',\n 'MMMEd': 'E, MMM d',\n 'MMMMd': 'MMMM d',\n 'ms': 'mm:ss',\n 'y': 'y',\n 'yM': 'M/y',\n 'yMd': 'M/d/y',\n 'yMEd': 'E, M/d/y',\n 'yMMM': 'MMM y',\n 'yMMMd': 'MMM d, y',\n 'yMMMEd': 'E, MMM d, y',\n 'yMMMM': 'MMMM y'\n }\n }\n },\n 'islamic': {\n 'months': {\n 'stand-alone': {\n 'abbreviated': {\n '1': 'Muh.',\n '2': 'Saf.',\n '3': 'Rab. I',\n '4': 'Rab. II',\n '5': 'Jum. I',\n '6': 'Jum. II',\n '7': 'Raj.',\n '8': 'Sha.',\n '9': 'Ram.',\n '10': 'Shaw.',\n '11': 'Dhuʻl-Q.',\n '12': 'Dhuʻl-H.'\n },\n 'narrow': {\n '1': '1',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9',\n '10': '10',\n '11': '11',\n '12': '12'\n },\n 'wide': {\n '1': 'Muharram',\n '2': 'Safar',\n '3': 'Rabiʻ I',\n '4': 'Rabiʻ II',\n '5': 'Jumada I',\n '6': 'Jumada II',\n '7': 'Rajab',\n '8': 'Shaʻban',\n '9': 'Ramadan',\n '10': 'Shawwal',\n '11': 'Dhuʻl-Qiʻdah',\n '12': 'Dhuʻl-Hijjah'\n }\n }\n },\n 'days': {\n 'stand-alone': {\n 'abbreviated': {\n 'sun': 'Sun',\n 'mon': 'Mon',\n 'tue': 'Tue',\n 'wed': 'Wed',\n 'thu': 'Thu',\n 'fri': 'Fri',\n 'sat': 'Sat'\n },\n 'narrow': {\n 'sun': 'S',\n 'mon': 'M',\n 'tue': 'T',\n 'wed': 'W',\n 'thu': 'T',\n 'fri': 'F',\n 'sat': 'S'\n },\n 'short': {\n 'sun': 'Su',\n 'mon': 'Mo',\n 'tue': 'Tu',\n 'wed': 'We',\n 'thu': 'Th',\n 'fri': 'Fr',\n 'sat': 'Sa'\n },\n 'wide': {\n 'sun': 'Sunday',\n 'mon': 'Monday',\n 'tue': 'Tuesday',\n 'wed': 'Wednesday',\n 'thu': 'Thursday',\n 'fri': 'Friday',\n 'sat': 'Saturday'\n }\n }\n },\n 'dayPeriods': {\n 'format': {\n 'wide': {\n 'am': 'AM',\n 'pm': 'PM'\n }\n }\n },\n 'eras': {\n 'eraNames': {\n '0': 'AH'\n },\n 'eraAbbr': {\n '0': 'AH'\n },\n 'eraNarrow': {\n '0': 'AH'\n }\n },\n 'dateFormats': {\n 'full': 'EEEE, MMMM d, y G',\n 'long': 'MMMM d, y G',\n 'medium': 'MMM d, y G',\n 'short': 'M/d/y GGGGG'\n },\n 'timeFormats': {\n 'full': 'h:mm:ss a zzzz',\n 'long': 'h:mm:ss a z',\n 'medium': 'h:mm:ss a',\n 'short': 'h:mm a'\n },\n 'dateTimeFormats': {\n 'full': '{1} \\'at\\' {0}',\n 'long': '{1} \\'at\\' {0}',\n 'medium': '{1}, {0}',\n 'short': '{1}, {0}',\n 'availableFormats': {\n 'd': 'd',\n 'E': 'ccc',\n 'Ed': 'd E',\n 'Ehm': 'E h:mm a',\n 'EHm': 'E HH:mm',\n 'Ehms': 'E h:mm:ss a',\n 'EHms': 'E HH:mm:ss',\n 'Gy': 'y G',\n 'GyMMM': 'MMM y G',\n 'GyMMMd': 'MMM d, y G',\n 'GyMMMEd': 'E, MMM d, y G',\n 'h': 'h a',\n 'H': 'HH',\n 'hm': 'h:mm a',\n 'Hm': 'HH:mm',\n 'hms': 'h:mm:ss a',\n 'Hms': 'HH:mm:ss',\n 'M': 'L',\n 'Md': 'M/d',\n 'MEd': 'E, M/d',\n 'MMM': 'LLL',\n 'MMMd': 'MMM d',\n 'MMMEd': 'E, MMM d',\n 'MMMMd': 'MMMM d',\n 'ms': 'mm:ss',\n 'y': 'y G',\n 'yyyy': 'y G',\n 'yyyyM': 'M/y GGGGG',\n 'yyyyMd': 'M/d/y GGGGG',\n 'yyyyMEd': 'E, M/d/y GGGGG',\n 'yyyyMMM': 'MMM y G',\n 'yyyyMMMd': 'MMM d, y G',\n 'yyyyMMMEd': 'E, MMM d, y G',\n 'yyyyMMMM': 'MMMM y G',\n 'yyyyQQQ': 'QQQ y G',\n 'yyyyQQQQ': 'QQQQ y G'\n }\n }\n }\n },\n 'timeZoneNames': {\n 'hourFormat': '+HH:mm;-HH:mm',\n 'gmtFormat': 'GMT{0}',\n 'gmtZeroFormat': 'GMT'\n }\n },\n 'numbers': {\n 'currencies': {\n 'USD': {\n 'displayName': 'US Dollar',\n 'symbol': '$',\n 'symbol-alt-narrow': '$'\n },\n 'EUR': {\n 'displayName': 'Euro',\n 'symbol': '€',\n 'symbol-alt-narrow': '€'\n },\n 'GBP': {\n 'displayName': 'British Pound',\n 'symbol-alt-narrow': '£'\n }\n },\n 'defaultNumberingSystem': 'latn',\n 'minimumGroupingDigits': '1',\n 'symbols-numberSystem-latn': {\n 'decimal': '.',\n 'group': ',',\n 'list': ';',\n 'percentSign': '%',\n 'plusSign': '+',\n 'minusSign': '-',\n 'exponential': 'E',\n 'superscriptingExponent': '×',\n 'perMille': '‰',\n 'infinity': '∞',\n 'nan': 'NaN',\n 'timeSeparator': ':'\n },\n 'decimalFormats-numberSystem-latn': {\n 'standard': '#,##0.###'\n },\n 'percentFormats-numberSystem-latn': {\n 'standard': '#,##0%'\n },\n 'currencyFormats-numberSystem-latn': {\n 'standard': '¤#,##0.00',\n 'accounting': '¤#,##0.00;(¤#,##0.00)'\n },\n 'scientificFormats-numberSystem-latn': {\n 'standard': '#E0'\n }\n }\n };\n IntlBase.blazorDefaultObject = {\n 'numbers': {\n 'mapper': {\n '0': '0',\n '1': '1',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9'\n },\n 'mapperDigits': '0123456789',\n 'numberSymbols': {\n 'decimal': '.',\n 'group': ',',\n 'plusSign': '+',\n 'minusSign': '-',\n 'percentSign': '%',\n 'nan': 'NaN',\n 'timeSeparator': ':',\n 'infinity': '∞'\n },\n 'timeSeparator': ':',\n 'currencySymbol': '$',\n 'currencypData': {\n 'nlead': '$',\n 'nend': '',\n 'groupSeparator': ',',\n 'groupData': {\n 'primary': 3\n },\n 'maximumFraction': 2,\n 'minimumFraction': 2\n },\n 'percentpData': {\n 'nlead': '',\n 'nend': '%',\n 'groupSeparator': ',',\n 'groupData': {\n 'primary': 3\n },\n 'maximumFraction': 2,\n 'minimumFraction': 2\n },\n 'percentnData': {\n 'nlead': '-',\n 'nend': '%',\n 'groupSeparator': ',',\n 'groupData': {\n 'primary': 3\n },\n 'maximumFraction': 2,\n 'minimumFraction': 2\n },\n 'currencynData': {\n 'nlead': '($',\n 'nend': ')',\n 'groupSeparator': ',',\n 'groupData': {\n 'primary': 3\n },\n 'maximumFraction': 2,\n 'minimumFraction': 2\n },\n 'decimalnData': {\n 'nlead': '-',\n 'nend': '',\n 'groupData': {\n 'primary': 3\n },\n 'maximumFraction': 2,\n 'minimumFraction': 2\n },\n 'decimalpData': {\n 'nlead': '',\n 'nend': '',\n 'groupData': {\n 'primary': 3\n },\n 'maximumFraction': 2,\n 'minimumFraction': 2\n }\n },\n 'dates': {\n 'dayPeriods': {\n 'am': 'AM',\n 'pm': 'PM'\n },\n 'dateSeperator': '/',\n 'days': {\n 'abbreviated': {\n 'sun': 'Sun',\n 'mon': 'Mon',\n 'tue': 'Tue',\n 'wed': 'Wed',\n 'thu': 'Thu',\n 'fri': 'Fri',\n 'sat': 'Sat'\n },\n 'short': {\n 'sun': 'Su',\n 'mon': 'Mo',\n 'tue': 'Tu',\n 'wed': 'We',\n 'thu': 'Th',\n 'fri': 'Fr',\n 'sat': 'Sa'\n },\n 'wide': {\n 'sun': 'Sunday',\n 'mon': 'Monday',\n 'tue': 'Tuesday',\n 'wed': 'Wednesday',\n 'thu': 'Thursday',\n 'fri': 'Friday',\n 'sat': 'Saturday'\n }\n },\n 'months': {\n 'abbreviated': {\n '1': 'Jan',\n '2': 'Feb',\n '3': 'Mar',\n '4': 'Apr',\n '5': 'May',\n '6': 'Jun',\n '7': 'Jul',\n '8': 'Aug',\n '9': 'Sep',\n '10': 'Oct',\n '11': 'Nov',\n '12': 'Dec'\n },\n 'wide': {\n '1': 'January',\n '2': 'February',\n '3': 'March',\n '4': 'April',\n '5': 'May',\n '6': 'June',\n '7': 'July',\n '8': 'August',\n '9': 'September',\n '10': 'October',\n '11': 'November',\n '12': 'December'\n }\n },\n 'eras': {\n '1': 'AD'\n }\n }\n };\n /* tslint:enable:quotemark */\n IntlBase.monthIndex = {\n 3: 'abbreviated',\n 4: 'wide',\n 5: 'narrow',\n 1: 'abbreviated'\n };\n /**\n *\n */\n IntlBase.month = 'months';\n IntlBase.days = 'days';\n /**\n * Default numerber Object\n */\n IntlBase.patternMatcher = {\n C: 'currency',\n P: 'percent',\n N: 'decimal',\n A: 'currency',\n E: 'scientific'\n };\n /**\n * Returns the resultant pattern based on the skeleton, dateObject and the type provided\n *\n * @private\n * @param {string} skeleton ?\n * @param {Object} dateObject ?\n * @param {string} type ?\n * @param {boolean} isIslamic ?\n * @param {string} blazorCulture ?\n * @returns {string} ?\n */\n function getResultantPattern(skeleton, dateObject, type, isIslamic, blazorCulture) {\n var resPattern;\n var iType = type || 'date';\n if (blazorCulture) {\n resPattern = compareBlazorDateFormats({ skeleton: skeleton }, blazorCulture).format ||\n compareBlazorDateFormats({ skeleton: 'd' }, 'en-US').format;\n }\n else {\n if (IntlBase.basicPatterns.indexOf(skeleton) !== -1) {\n resPattern = getValue(iType + 'Formats.' + skeleton, dateObject);\n if (iType === 'dateTime') {\n var dPattern = getValue('dateFormats.' + skeleton, dateObject);\n var tPattern = getValue('timeFormats.' + skeleton, dateObject);\n resPattern = resPattern.replace('{1}', dPattern).replace('{0}', tPattern);\n }\n }\n else {\n resPattern = getValue('dateTimeFormats.availableFormats.' + skeleton, dateObject);\n }\n if (isUndefined(resPattern) && skeleton === 'yMd') {\n resPattern = 'M/d/y';\n }\n }\n return resPattern;\n }\n IntlBase.getResultantPattern = getResultantPattern;\n /**\n * Returns the dependable object for provided cldr data and culture\n *\n * @private\n * @param {Object} cldr ?\n * @param {string} culture ?\n * @param {string} mode ?\n * @param {boolean} isNumber ?\n * @returns {any} ?\n */\n function getDependables(cldr, culture, mode, isNumber) {\n var ret = {};\n var calendartype = mode || 'gregorian';\n ret.parserObject = parser.getMainObject(cldr, culture) || (isBlazor() ? IntlBase.blazorDefaultObject : IntlBase.defaultObject);\n if (isNumber) {\n ret.numericObject = getValue('numbers', ret.parserObject);\n }\n else {\n var dateString = isBlazor() ? 'dates' : ('dates.calendars.' + calendartype);\n ret.dateObject = getValue(dateString, ret.parserObject);\n }\n return ret;\n }\n IntlBase.getDependables = getDependables;\n /**\n * Returns the symbol pattern for provided parameters\n *\n * @private\n * @param {string} type ?\n * @param {string} numSystem ?\n * @param {Object} obj ?\n * @param {boolean} isAccount ?\n * @returns {string} ?\n */\n function getSymbolPattern(type, numSystem, obj, isAccount) {\n return getValue(type + 'Formats-numberSystem-' +\n numSystem + (isAccount ? '.accounting' : '.standard'), obj) || (isAccount ? getValue(type + 'Formats-numberSystem-' +\n numSystem + '.standard', obj) : '');\n }\n IntlBase.getSymbolPattern = getSymbolPattern;\n /**\n *\n * @param {string} format ?\n * @returns {string} ?\n */\n function ConvertDateToWeekFormat(format) {\n var convertMapper = format.match(IntlBase.dateConverterMapper);\n if (convertMapper && isBlazor()) {\n var tempString = convertMapper[0].length === 3 ? 'EEE' : 'EEEE';\n return format.replace(IntlBase.dateConverterMapper, tempString);\n }\n return format;\n }\n IntlBase.ConvertDateToWeekFormat = ConvertDateToWeekFormat;\n /**\n *\n * @param {DateFormatOptions} formatOptions ?\n * @param {string} culture ?\n * @returns {DateFormatOptions} ?\n */\n function compareBlazorDateFormats(formatOptions, culture) {\n var format = formatOptions.format || formatOptions.skeleton;\n var curFormatMapper = getValue((culture || 'en-US') + '.' + format, blazorCultureFormats);\n if (!curFormatMapper) {\n curFormatMapper = getValue('en-US.' + format, blazorCultureFormats);\n }\n if (curFormatMapper) {\n curFormatMapper = ConvertDateToWeekFormat(curFormatMapper);\n formatOptions.format = curFormatMapper.replace(/tt/, 'a');\n }\n return formatOptions;\n }\n IntlBase.compareBlazorDateFormats = compareBlazorDateFormats;\n /**\n * Returns proper numeric skeleton\n *\n * @private\n * @param {string} skeleton ?\n * @returns {any} ?\n */\n function getProperNumericSkeleton(skeleton) {\n var matches = skeleton.match(IntlBase.formatRegex);\n var ret = {};\n var pattern = matches[1].toUpperCase();\n ret.isAccount = (pattern === 'A');\n // eslint-disable-next-line\n ret.type = IntlBase.patternMatcher[pattern];\n if (skeleton.length > 1) {\n ret.fractionDigits = parseInt(matches[2], 10);\n }\n return ret;\n }\n IntlBase.getProperNumericSkeleton = getProperNumericSkeleton;\n /**\n * Returns format data for number formatting like minimum fraction, maximum fraction, etc..,\n *\n * @private\n * @param {string} pattern ?\n * @param {boolean} needFraction ?\n * @param {string} cSymbol ?\n * @param {boolean} fractionOnly ?\n * @returns {any} ?\n */\n function getFormatData(pattern, needFraction, cSymbol, fractionOnly) {\n var nData = fractionOnly ? {} : { nlead: '', nend: '' };\n var match = pattern.match(IntlBase.customRegex);\n if (match) {\n if (!fractionOnly) {\n nData.nlead = changeCurrencySymbol(match[1], cSymbol);\n nData.nend = changeCurrencySymbol(match[10], cSymbol);\n nData.groupPattern = match[4];\n }\n var fraction = match[7];\n if (fraction && needFraction) {\n var fmatch = fraction.match(fractionRegex);\n if (!isNullOrUndefined(fmatch)) {\n nData.minimumFraction = fmatch.length;\n }\n else {\n nData.minimumFraction = 0;\n }\n nData.maximumFraction = fraction.length - 1;\n }\n }\n return nData;\n }\n IntlBase.getFormatData = getFormatData;\n /**\n * Changes currency symbol\n *\n * @private\n * @param {string} val ?\n * @param {string} sym ?\n * @returns {string} ?\n */\n function changeCurrencySymbol(val, sym) {\n if (val) {\n return val.replace(IntlBase.defaultCurrency, sym);\n }\n return '';\n }\n IntlBase.changeCurrencySymbol = changeCurrencySymbol;\n /**\n * Returns currency symbol based on currency code ?\n *\n * @private\n * @param {Object} numericObject ?\n * @param {string} currencyCode ?\n * @param {string} altSymbol ?\n * @returns {string} ?\n */\n function getCurrencySymbol(numericObject, currencyCode, altSymbol) {\n var symbol = altSymbol ? ('.' + altSymbol) : '.symbol';\n var getCurrency = getValue('currencies.' + currencyCode + symbol, numericObject) ||\n getValue('currencies.' + currencyCode + '.symbol-alt-narrow', numericObject) || '$';\n return getCurrency;\n }\n IntlBase.getCurrencySymbol = getCurrencySymbol;\n /**\n * Returns formatting options for custom number format\n *\n * @private\n * @param {string} format ?\n * @param {CommonOptions} dOptions ?\n * @param {any} obj ?\n * @returns {any} ?\n */\n function customFormat(format, dOptions, obj) {\n var options = {};\n var formatSplit = format.split(';');\n var data = ['pData', 'nData', 'zeroData'];\n for (var i = 0; i < formatSplit.length; i++) {\n // eslint-disable-next-line\n options[data[i]] = customNumberFormat(formatSplit[i], dOptions, obj);\n }\n if (isNullOrUndefined(options.nData)) {\n options.nData = extend({}, options.pData);\n options.nData.nlead = isNullOrUndefined(dOptions) ? '-' + options.nData.nlead : dOptions.minusSymbol + options.nData.nlead;\n }\n return options;\n }\n IntlBase.customFormat = customFormat;\n /**\n * Returns custom formatting options\n *\n * @private\n * @param {string} format ?\n * @param {CommonOptions} dOptions ?\n * @param {Object} numObject ?\n * @returns {any} ?\n */\n function customNumberFormat(format, dOptions, numObject) {\n var cOptions = { type: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: 0 };\n var pattern = format.match(IntlBase.customRegex);\n if (isNullOrUndefined(pattern) || (pattern[5] === '' && format !== 'N/A')) {\n cOptions.type = undefined;\n return cOptions;\n }\n cOptions.nlead = pattern[1];\n cOptions.nend = pattern[10];\n var integerPart = pattern[6];\n cOptions.useGrouping = integerPart.indexOf(',') !== -1;\n integerPart = integerPart.replace(/,/g, '');\n var fractionPart = pattern[7];\n if (integerPart.indexOf('0') !== -1) {\n cOptions.minimumIntegerDigits = integerPart.length - integerPart.indexOf('0');\n }\n if (!isNullOrUndefined(fractionPart)) {\n cOptions.minimumFractionDigits = fractionPart.lastIndexOf('0');\n cOptions.maximumFractionDigits = fractionPart.lastIndexOf('#');\n if (cOptions.minimumFractionDigits === -1) {\n cOptions.minimumFractionDigits = 0;\n }\n if (cOptions.maximumFractionDigits === -1 || cOptions.maximumFractionDigits < cOptions.minimumFractionDigits) {\n cOptions.maximumFractionDigits = cOptions.minimumFractionDigits;\n }\n }\n if (!isNullOrUndefined(dOptions)) {\n extend(cOptions, isCurrencyPercent([cOptions.nlead, cOptions.nend], '$', dOptions.currencySymbol));\n if (!cOptions.isCurrency) {\n extend(cOptions, isCurrencyPercent([cOptions.nlead, cOptions.nend], '%', dOptions.percentSymbol));\n }\n }\n else {\n extend(cOptions, isCurrencyPercent([cOptions.nlead, cOptions.nend], '%', '%'));\n }\n if (!isNullOrUndefined(numObject)) {\n var symbolPattern = getSymbolPattern(cOptions.type, dOptions.numberMapper.numberSystem, numObject, false);\n if (cOptions.useGrouping) {\n // eslint-disable-next-line\n cOptions.groupSeparator = dOptions.numberMapper.numberSymbols[mapper[2]];\n cOptions.groupData = NumberFormat.getGroupingDetails(symbolPattern.split(';')[0]);\n }\n cOptions.nlead = cOptions.nlead.replace(/'/g, '');\n cOptions.nend = cOptions.nend.replace(/'/g, '');\n }\n return cOptions;\n }\n IntlBase.customNumberFormat = customNumberFormat;\n /**\n * Returns formatting options for currency or percent type\n *\n * @private\n * @param {string[]} parts ?\n * @param {string} actual ?\n * @param {string} symbol ?\n * @returns {any} ?\n */\n function isCurrencyPercent(parts, actual, symbol) {\n var options = { nlead: parts[0], nend: parts[1] };\n for (var i = 0; i < 2; i++) {\n var part = parts[i];\n var loc = part.indexOf(actual);\n if ((loc !== -1) && ((loc < part.indexOf('\\'')) || (loc > part.lastIndexOf('\\'')))) {\n // eslint-disable-next-line\n options[typeMapper[i]] = part.substr(0, loc) + symbol + part.substr(loc + 1);\n // eslint-disable-next-line\n options[typeMapper[actual]] = true;\n options.type = options.isCurrency ? 'currency' : 'percent';\n break;\n }\n }\n return options;\n }\n IntlBase.isCurrencyPercent = isCurrencyPercent;\n /**\n * Returns culture based date separator\n *\n * @private\n * @param {Object} dateObj ?\n * @returns {string} ?\n */\n function getDateSeparator(dateObj) {\n var value = (getValue('dateFormats.short', dateObj) || '').match(/[dM]([^dM])[dM]/i);\n return value ? value[1] : '/';\n }\n IntlBase.getDateSeparator = getDateSeparator;\n /**\n * Returns Native Date Time pattern\n *\n * @private\n * @param {string} culture ?\n * @param {DateFormatOptions} options ?\n * @param {Object} cldr ?\n * @param {boolean} isExcelFormat ?\n * @returns {string} ?\n */\n function getActualDateTimeFormat(culture, options, cldr, isExcelFormat) {\n var dependable = getDependables(cldr, culture, options.calendar);\n if (isBlazor()) {\n options = compareBlazorDateFormats(options, culture);\n }\n var actualPattern = options.format || getResultantPattern(options.skeleton, dependable.dateObject, options.type);\n if (isExcelFormat) {\n actualPattern = actualPattern.replace(patternRegex, function (pattern) {\n // eslint-disable-next-line\n return patternMatch[pattern];\n });\n if (actualPattern.indexOf('z') !== -1) {\n var tLength = actualPattern.match(/z/g).length;\n var timeZonePattern = void 0;\n var options_1 = { 'timeZone': {} };\n options_1.numMapper = parser.getNumberMapper(dependable.parserObject, parser.getNumberingSystem(cldr));\n options_1.timeZone = getValue('dates.timeZoneNames', dependable.parserObject);\n var value = new Date();\n var timezone = value.getTimezoneOffset();\n var pattern = (tLength < 4) ? '+H;-H' : options_1.timeZone.hourFormat;\n pattern = pattern.replace(/:/g, options_1.numMapper.timeSeparator);\n if (timezone === 0) {\n timeZonePattern = options_1.timeZone.gmtZeroFormat;\n }\n else {\n timeZonePattern = DateFormat.getTimeZoneValue(timezone, pattern);\n timeZonePattern = options_1.timeZone.gmtFormat.replace(/\\{0\\}/, timeZonePattern);\n }\n actualPattern = actualPattern.replace(/[z]+/, '\"' + timeZonePattern + '\"');\n }\n actualPattern = actualPattern.replace(/ $/, '');\n }\n return actualPattern;\n }\n IntlBase.getActualDateTimeFormat = getActualDateTimeFormat;\n /**\n *\n * @param {string} actual ?\n * @param {any} option ?\n * @returns {any} ?\n */\n // eslint-disable-next-line\n function processSymbol(actual, option) {\n if (actual.indexOf(',') !== -1) {\n // eslint-disable-next-line\n var split = actual.split(',');\n actual = (split[0] + getValue('numberMapper.numberSymbols.group', option) +\n split[1].replace('.', getValue('numberMapper.numberSymbols.decimal', option)));\n }\n else {\n actual = actual.replace('.', getValue('numberMapper.numberSymbols.decimal', option));\n }\n return actual;\n }\n /**\n * Returns Native Number pattern\n *\n * @private\n * @param {string} culture ?\n * @param {NumberFormatOptions} options ?\n * @param {Object} cldr ?\n * @param {boolean} isExcel ?\n * @returns {string} ?\n */\n function getActualNumberFormat(culture, options, cldr, isExcel) {\n var dependable = getDependables(cldr, culture, '', true);\n var parseOptions = { custom: true };\n var numrericObject = dependable.numericObject;\n var minFrac;\n var curObj = {};\n var curMatch = (options.format || '').match(IntlBase.currencyFormatRegex);\n var type = IntlBase.formatRegex.test(options.format) ? getProperNumericSkeleton(options.format || 'N') : {};\n var dOptions = {};\n if (curMatch) {\n dOptions.numberMapper = isBlazor() ?\n extend({}, dependable.numericObject) :\n parser.getNumberMapper(dependable.parserObject, parser.getNumberingSystem(cldr), true);\n var curCode = isBlazor() ? getValue('currencySymbol', dependable.numericObject) :\n getCurrencySymbol(dependable.numericObject, options.currency || defaultCurrencyCode, options.altSymbol);\n var symbolPattern = getSymbolPattern('currency', dOptions.numberMapper.numberSystem, dependable.numericObject, (/a/i).test(options.format));\n symbolPattern = symbolPattern.replace(/\\u00A4/g, curCode);\n var split = symbolPattern.split(';');\n curObj.hasNegativePattern = isBlazor() ? true : (split.length > 1);\n curObj.nData = isBlazor() ? getValue(type.type + 'nData', numrericObject) :\n getFormatData(split[1] || '-' + split[0], true, curCode);\n curObj.pData = isBlazor() ? getValue(type.type + 'pData', numrericObject) :\n getFormatData(split[0], false, curCode);\n if (!curMatch[2] && !options.minimumFractionDigits && !options.maximumFractionDigits) {\n minFrac = getFormatData(symbolPattern.split(';')[0], true, '', true).minimumFraction;\n }\n }\n var actualPattern;\n if ((IntlBase.formatRegex.test(options.format)) || !(options.format)) {\n extend(parseOptions, getProperNumericSkeleton(options.format || 'N'));\n parseOptions.custom = false;\n actualPattern = '###0';\n if (parseOptions.fractionDigits || options.minimumFractionDigits || options.maximumFractionDigits || minFrac) {\n var defaultMinimum = 0;\n if (parseOptions.fractionDigits) {\n options.minimumFractionDigits = options.maximumFractionDigits = parseOptions.fractionDigits;\n }\n actualPattern = fractionDigitsPattern(actualPattern, minFrac || parseOptions.fractionDigits ||\n options.minimumFractionDigits || defaultMinimum, options.maximumFractionDigits || defaultMinimum);\n }\n if (options.minimumIntegerDigits) {\n actualPattern = minimumIntegerPattern(actualPattern, options.minimumIntegerDigits);\n }\n if (options.useGrouping) {\n actualPattern = groupingPattern(actualPattern);\n }\n if (parseOptions.type === 'currency' || (parseOptions.type && isBlazor())) {\n if (isBlazor() && parseOptions.type !== 'currency') {\n curObj.pData = getValue(parseOptions.type + 'pData', numrericObject);\n curObj.nData = getValue(parseOptions.type + 'nData', numrericObject);\n }\n var cPattern = actualPattern;\n actualPattern = curObj.pData.nlead + cPattern + curObj.pData.nend;\n if (curObj.hasNegativePattern || isBlazor()) {\n actualPattern += ';' + curObj.nData.nlead + cPattern + curObj.nData.nend;\n }\n }\n if (parseOptions.type === 'percent' && !isBlazor()) {\n actualPattern += ' %';\n }\n }\n else {\n actualPattern = options.format.replace(/'/g, '\"');\n }\n if (Object.keys(dOptions).length > 0) {\n actualPattern = !isExcel ? processSymbol(actualPattern, dOptions) : actualPattern;\n }\n return actualPattern;\n }\n IntlBase.getActualNumberFormat = getActualNumberFormat;\n /**\n *\n * @param {string} pattern ?\n * @param {number} minDigits ?\n * @param {number} maxDigits ?\n * @returns {string} ?\n */\n function fractionDigitsPattern(pattern, minDigits, maxDigits) {\n pattern += '.';\n for (var a = 0; a < minDigits; a++) {\n pattern += '0';\n }\n if (minDigits < maxDigits) {\n var diff = maxDigits - minDigits;\n for (var b = 0; b < diff; b++) {\n pattern += '#';\n }\n }\n return pattern;\n }\n IntlBase.fractionDigitsPattern = fractionDigitsPattern;\n /**\n *\n * @param {string} pattern ?\n * @param {number} digits ?\n * @returns {string} ?\n */\n function minimumIntegerPattern(pattern, digits) {\n var temp = pattern.split('.');\n var integer = '';\n for (var x = 0; x < digits; x++) {\n integer += '0';\n }\n return temp[1] ? (integer + '.' + temp[1]) : integer;\n }\n IntlBase.minimumIntegerPattern = minimumIntegerPattern;\n /**\n *\n * @param {string} pattern ?\n * @returns {string} ?\n */\n function groupingPattern(pattern) {\n var temp = pattern.split('.');\n var integer = temp[0];\n var no = 3 - integer.length % 3;\n var hash = (no && no === 1) ? '#' : (no === 2 ? '##' : '');\n integer = hash + integer;\n pattern = '';\n for (var x = integer.length - 1; x > 0; x = x - 3) {\n pattern = ',' + integer[x - 2] + integer[x - 1] + integer[x] + pattern;\n }\n pattern = pattern.slice(1);\n return temp[1] ? (pattern + '.' + temp[1]) : pattern;\n }\n IntlBase.groupingPattern = groupingPattern;\n /**\n *\n * @param {string} culture ?\n * @param {Object} cldr ?\n * @returns {number} ?\n */\n function getWeekData(culture, cldr) {\n var firstDay = defaultFirstDay;\n var mapper = getValue('supplemental.weekData.firstDay', cldr);\n var iCulture = culture;\n if ((/en-/).test(iCulture)) {\n iCulture = iCulture.slice(3);\n }\n iCulture = iCulture.slice(0, 2).toUpperCase() + iCulture.substr(2);\n if (mapper) {\n firstDay = mapper[iCulture] || defaultFirstDay;\n }\n return firstDayMapper[firstDay];\n }\n IntlBase.getWeekData = getWeekData;\n /**\n * @private\n * @param {any} pData ?\n * @param {string} aCurrency ?\n * @param {string} rCurrency ?\n * @returns {void} ?\n */\n function replaceBlazorCurrency(pData, aCurrency, rCurrency) {\n var iCurrency = getBlazorCurrencySymbol(rCurrency);\n if (aCurrency !== iCurrency) {\n for (var _i = 0, pData_1 = pData; _i < pData_1.length; _i++) {\n var data = pData_1[_i];\n data.nend = data.nend.replace(aCurrency, iCurrency);\n data.nlead = data.nlead.replace(aCurrency, iCurrency);\n }\n }\n }\n IntlBase.replaceBlazorCurrency = replaceBlazorCurrency;\n /**\n * @private\n * @param {Date} date ?\n * @returns {number} ?\n */\n function getWeekOfYear(date) {\n var newYear = new Date(date.getFullYear(), 0, 1);\n var day = newYear.getDay();\n var weeknum;\n day = (day >= 0 ? day : day + 7);\n var daynum = Math.floor((date.getTime() - newYear.getTime() -\n (date.getTimezoneOffset() - newYear.getTimezoneOffset()) * 60000) / 86400000) + 1;\n if (day < 4) {\n weeknum = Math.floor((daynum + day - 1) / 7) + 1;\n if (weeknum > 52) {\n var nYear = new Date(this.getFullYear() + 1, 0, 1);\n var nday = nYear.getDay();\n nday = nday >= 0 ? nday : nday + 7;\n weeknum = nday < 4 ? 1 : 53;\n }\n }\n else {\n weeknum = Math.floor((daynum + day - 1) / 7);\n }\n return weeknum;\n }\n IntlBase.getWeekOfYear = getWeekOfYear;\n})(IntlBase || (IntlBase = {}));\n","import { isNullOrUndefined, merge } from './util';\nvar headerRegex = /^(.*?):[ \\t]*([^\\r\\n]*)$/gm;\nvar defaultType = 'GET';\n/**\n * Ajax class provides ability to make asynchronous HTTP request to the server\n * ```typescript\n * var ajax = new Ajax(\"index.html\", \"GET\", true);\n * ajax.send().then(\n * function (value) {\n * console.log(value);\n * },\n * function (reason) {\n * console.log(reason);\n * });\n * ```\n */\nvar Ajax = /** @class */ (function () {\n /**\n * Constructor for Ajax class\n *\n * @param {string|Object} options ?\n * @param {string} type ?\n * @param {boolean} async ?\n * @returns defaultType any\n */\n function Ajax(options, type, async, contentType) {\n /**\n * A boolean value indicating whether the request should be sent asynchronous or not.\n *\n * @default true\n */\n this.mode = true;\n /**\n * A boolean value indicating whether to ignore the promise reject.\n *\n * @private\n * @default true\n */\n this.emitError = true;\n this.options = {};\n if (typeof options === 'string') {\n this.url = options;\n this.type = type ? type.toUpperCase() : defaultType;\n this.mode = !isNullOrUndefined(async) ? async : true;\n }\n else if (typeof options === 'object') {\n this.options = options;\n merge(this, this.options);\n }\n this.type = this.type ? this.type.toUpperCase() : defaultType;\n this.contentType = (this.contentType !== undefined) ? this.contentType : contentType;\n }\n /**\n *\n * Send the request to server.\n *\n * @param {any} data - To send the user data\n * @return {Promise} ?\n */\n Ajax.prototype.send = function (data) {\n var _this = this;\n this.data = isNullOrUndefined(data) ? this.data : data;\n var eventArgs = {\n cancel: false,\n httpRequest: null\n };\n var promise = new Promise(function (resolve, reject) {\n _this.httpRequest = new XMLHttpRequest();\n _this.httpRequest.onreadystatechange = function () { _this.stateChange(resolve, reject); };\n if (!isNullOrUndefined(_this.onLoad)) {\n _this.httpRequest.onload = _this.onLoad;\n }\n if (!isNullOrUndefined(_this.onProgress)) {\n _this.httpRequest.onprogress = _this.onProgress;\n }\n /* istanbul ignore next */\n if (!isNullOrUndefined(_this.onAbort)) {\n _this.httpRequest.onabort = _this.onAbort;\n }\n /* istanbul ignore next */\n if (!isNullOrUndefined(_this.onError)) {\n _this.httpRequest.onerror = _this.onError;\n }\n //** Upload Events **/\n /* istanbul ignore next */\n if (!isNullOrUndefined(_this.onUploadProgress)) {\n _this.httpRequest.upload.onprogress = _this.onUploadProgress;\n }\n _this.httpRequest.open(_this.type, _this.url, _this.mode);\n // Set default headers\n if (!isNullOrUndefined(_this.data) && _this.contentType !== null) {\n _this.httpRequest.setRequestHeader('Content-Type', _this.contentType || 'application/json; charset=utf-8');\n }\n if (_this.beforeSend) {\n eventArgs.httpRequest = _this.httpRequest;\n _this.beforeSend(eventArgs);\n }\n if (!eventArgs.cancel) {\n _this.httpRequest.send(!isNullOrUndefined(_this.data) ? _this.data : null);\n }\n });\n return promise;\n };\n Ajax.prototype.successHandler = function (data) {\n if (this.onSuccess) {\n this.onSuccess(data, this);\n }\n return data;\n };\n Ajax.prototype.failureHandler = function (reason) {\n if (this.onFailure) {\n this.onFailure(this.httpRequest);\n }\n return reason;\n };\n Ajax.prototype.stateChange = function (resolve, reject) {\n var data = this.httpRequest.responseText;\n if (this.dataType && this.dataType.toLowerCase() === 'json') {\n if (data === '') {\n data = undefined;\n }\n else {\n try {\n data = JSON.parse(data);\n }\n catch (error) {\n // no exception handle\n }\n }\n }\n if (this.httpRequest.readyState === 4) {\n //success range should be 200 to 299\n if ((this.httpRequest.status >= 200 && this.httpRequest.status <= 299) || this.httpRequest.status === 304) {\n resolve(this.successHandler(data));\n }\n else {\n if (this.emitError) {\n reject(new Error(this.failureHandler(this.httpRequest.statusText)));\n }\n else {\n resolve();\n }\n }\n }\n };\n /**\n * To get the response header from XMLHttpRequest\n *\n * @param {string} key Key to search in the response header\n * @returns {string} ?\n */\n Ajax.prototype.getResponseHeader = function (key) {\n var responseHeaders;\n var header;\n // eslint-disable-next-line\n responseHeaders = {};\n var headers = headerRegex.exec(this.httpRequest.getAllResponseHeaders());\n while (headers) {\n responseHeaders[headers[1].toLowerCase()] = headers[2];\n headers = headerRegex.exec(this.httpRequest.getAllResponseHeaders());\n }\n // eslint-disable-next-line\n header = responseHeaders[key.toLowerCase()];\n return isNullOrUndefined(header) ? null : header;\n };\n return Ajax;\n}());\nexport { Ajax };\n","import { isUndefined } from './util';\nvar REGX_MOBILE = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i;\nvar REGX_IE = /msie|trident/i;\nvar REGX_IE11 = /Trident\\/7\\./;\nvar REGX_IOS = /(ipad|iphone|ipod touch)/i;\nvar REGX_IOS7 = /(ipad|iphone|ipod touch);.*os 7_\\d|(ipad|iphone|ipod touch);.*os 8_\\d/i;\nvar REGX_ANDROID = /android/i;\nvar REGX_WINDOWS = /trident|windows phone|edge/i;\nvar REGX_VERSION = /(version)[ /]([\\w.]+)/i;\nvar REGX_BROWSER = {\n OPERA: /(opera|opr)(?:.*version|)[ /]([\\w.]+)/i,\n EDGE: /(edge)(?:.*version|)[ /]([\\w.]+)/i,\n CHROME: /(chrome|crios)[ /]([\\w.]+)/i,\n PANTHOMEJS: /(phantomjs)[ /]([\\w.]+)/i,\n SAFARI: /(safari)[ /]([\\w.]+)/i,\n WEBKIT: /(webkit)[ /]([\\w.]+)/i,\n MSIE: /(msie|trident) ([\\w.]+)/i,\n MOZILLA: /(mozilla)(?:.*? rv:([\\w.]+)|)/i\n};\n/* istanbul ignore else */\nif (typeof window !== 'undefined') {\n window.browserDetails = window.browserDetails || {};\n}\n/**\n * Get configuration details for Browser\n *\n * @private\n */\nvar Browser = /** @class */ (function () {\n function Browser() {\n }\n Browser.extractBrowserDetail = function () {\n var browserInfo = { culture: {} };\n var keys = Object.keys(REGX_BROWSER);\n var clientInfo = [];\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n clientInfo = Browser.userAgent.match(REGX_BROWSER[key]);\n if (clientInfo) {\n browserInfo.name = (clientInfo[1].toLowerCase() === 'opr' ? 'opera' : clientInfo[1].toLowerCase());\n browserInfo.name = (clientInfo[1].toLowerCase() === 'crios' ? 'chrome' : browserInfo.name);\n browserInfo.version = clientInfo[2];\n browserInfo.culture.name = browserInfo.culture.language = navigator.language;\n // eslint-disable-next-line\n if (!!Browser.userAgent.match(REGX_IE11)) {\n browserInfo.name = 'msie';\n break;\n }\n var version = Browser.userAgent.match(REGX_VERSION);\n if (browserInfo.name === 'safari' && version) {\n browserInfo.version = version[2];\n }\n break;\n }\n }\n return browserInfo;\n };\n /**\n * To get events from the browser\n *\n * @param {string} event - type of event triggered.\n * @returns {boolean}\n */\n Browser.getEvent = function (event) {\n // eslint-disable-next-line\n var events = {\n start: {\n isPointer: 'pointerdown', isTouch: 'touchstart', isDevice: 'mousedown'\n },\n move: {\n isPointer: 'pointermove', isTouch: 'touchmove', isDevice: 'mousemove'\n },\n end: {\n isPointer: 'pointerup', isTouch: 'touchend', isDevice: 'mouseup'\n },\n cancel: {\n isPointer: 'pointercancel', isTouch: 'touchcancel', isDevice: 'mouseleave'\n }\n };\n return (Browser.isPointer ? events[event].isPointer :\n (Browser.isTouch ? events[event].isTouch + (!Browser.isDevice ? ' ' + events[event].isDevice : '')\n : events[event].isDevice));\n };\n /**\n * To get the Touch start event from browser\n *\n * @returns {string}\n */\n Browser.getTouchStartEvent = function () {\n return Browser.getEvent('start');\n };\n /**\n * To get the Touch end event from browser\n *\n * @returns {string}\n */\n Browser.getTouchEndEvent = function () {\n return Browser.getEvent('end');\n };\n /**\n * To get the Touch move event from browser\n *\n * @returns {string}\n */\n Browser.getTouchMoveEvent = function () {\n return Browser.getEvent('move');\n };\n /**\n * To cancel the touch event from browser\n *\n * @returns {string}\n */\n Browser.getTouchCancelEvent = function () {\n return Browser.getEvent('cancel');\n };\n /**\n * To get the value based on provided key and regX\n *\n * @param {string} key ?\n * @param {RegExp} regX ?\n * @returns {Object} ?\n */\n Browser.getValue = function (key, regX) {\n var browserDetails = window.browserDetails;\n if ('undefined' === typeof browserDetails[key]) {\n return browserDetails[key] = regX.test(Browser.userAgent);\n }\n if (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 && Browser.isTouch === true) {\n browserDetails['isIos'] = true;\n browserDetails['isDevice'] = true;\n browserDetails['isTouch'] = true;\n browserDetails['isPointer'] = true;\n }\n return browserDetails[key];\n };\n Object.defineProperty(Browser, \"userAgent\", {\n get: function () {\n return Browser.uA;\n },\n //Properties\n /**\n * Property specifies the userAgent of the browser. Default userAgent value is based on the browser.\n * Also we can set our own userAgent.\n *\n * @param {string} uA ?\n */\n set: function (uA) {\n Browser.uA = uA;\n window.browserDetails = {};\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"info\", {\n //Read Only Properties\n /**\n * Property is to get the browser information like Name, Version and Language\n *\n * @returns {BrowserInfo} ?\n */\n get: function () {\n if (isUndefined(window.browserDetails.info)) {\n return window.browserDetails.info = Browser.extractBrowserDetail();\n }\n return window.browserDetails.info;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"isIE\", {\n /**\n * Property is to get whether the userAgent is based IE.\n *\n * @returns {boolean} ?\n */\n get: function () {\n return Browser.getValue('isIE', REGX_IE);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"isTouch\", {\n /**\n * Property is to get whether the browser has touch support.\n *\n * @returns {boolean} ?\n */\n get: function () {\n if (isUndefined(window.browserDetails.isTouch)) {\n return (window.browserDetails.isTouch =\n ('ontouchstart' in window.navigator) ||\n (window &&\n window.navigator &&\n (window.navigator.maxTouchPoints > 0)) || ('ontouchstart' in window));\n }\n return window.browserDetails.isTouch;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"isPointer\", {\n /**\n * Property is to get whether the browser has Pointer support.\n *\n * @returns {boolean} ?\n */\n get: function () {\n if (isUndefined(window.browserDetails.isPointer)) {\n return window.browserDetails.isPointer = ('pointerEnabled' in window.navigator);\n }\n return window.browserDetails.isPointer;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"isMSPointer\", {\n /**\n * Property is to get whether the browser has MSPointer support.\n *\n * @returns {boolean} ?\n */\n get: function () {\n if (isUndefined(window.browserDetails.isMSPointer)) {\n return window.browserDetails.isMSPointer = ('msPointerEnabled' in window.navigator);\n }\n return window.browserDetails.isMSPointer;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"isDevice\", {\n /**\n * Property is to get whether the userAgent is device based.\n *\n * @returns {boolean} ?\n */\n get: function () {\n return Browser.getValue('isDevice', REGX_MOBILE);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"isIos\", {\n /**\n * Property is to get whether the userAgent is IOS.\n *\n * @returns {boolean} ?\n */\n get: function () {\n return Browser.getValue('isIos', REGX_IOS);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"isIos7\", {\n /**\n * Property is to get whether the userAgent is Ios7.\n *\n * @returns {boolean} ?\n */\n get: function () {\n return Browser.getValue('isIos7', REGX_IOS7);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"isAndroid\", {\n /**\n * Property is to get whether the userAgent is Android.\n *\n * @returns {boolean} ?\n */\n get: function () {\n return Browser.getValue('isAndroid', REGX_ANDROID);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"isWebView\", {\n /**\n * Property is to identify whether application ran in web view.\n *\n * @returns {boolean} ?\n */\n get: function () {\n if (isUndefined(window.browserDetails.isWebView)) {\n window.browserDetails.isWebView = !(isUndefined(window.cordova) && isUndefined(window.PhoneGap)\n && isUndefined(window.phonegap) && window.forge !== 'object');\n return window.browserDetails.isWebView;\n }\n return window.browserDetails.isWebView;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"isWindows\", {\n /**\n * Property is to get whether the userAgent is Windows.\n *\n * @returns {boolean} ?\n */\n get: function () {\n return Browser.getValue('isWindows', REGX_WINDOWS);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"touchStartEvent\", {\n /**\n * Property is to get the touch start event. It returns event name based on browser.\n *\n * @returns {string} ?\n */\n get: function () {\n if (isUndefined(window.browserDetails.touchStartEvent)) {\n return window.browserDetails.touchStartEvent = Browser.getTouchStartEvent();\n }\n return window.browserDetails.touchStartEvent;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"touchMoveEvent\", {\n /**\n * Property is to get the touch move event. It returns event name based on browser.\n *\n * @returns {string} ?\n */\n get: function () {\n if (isUndefined(window.browserDetails.touchMoveEvent)) {\n return window.browserDetails.touchMoveEvent = Browser.getTouchMoveEvent();\n }\n return window.browserDetails.touchMoveEvent;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"touchEndEvent\", {\n /**\n * Property is to get the touch end event. It returns event name based on browser.\n *\n * @returns {string} ?\n */\n get: function () {\n if (isUndefined(window.browserDetails.touchEndEvent)) {\n return window.browserDetails.touchEndEvent = Browser.getTouchEndEvent();\n }\n return window.browserDetails.touchEndEvent;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Browser, \"touchCancelEvent\", {\n /**\n * Property is to cancel the touch end event.\n *\n * @returns {string} ?\n */\n get: function () {\n if (isUndefined(window.browserDetails.touchCancelEvent)) {\n return window.browserDetails.touchCancelEvent = Browser.getTouchCancelEvent();\n }\n return window.browserDetails.touchCancelEvent;\n },\n enumerable: true,\n configurable: true\n });\n /* istanbul ignore next */\n Browser.uA = typeof navigator !== 'undefined' ? navigator.userAgent : '';\n return Browser;\n}());\nexport { Browser };\n","import { debounce, extend } from './util';\nimport { Browser } from './browser';\n/**\n * EventHandler class provides option to add, remove, clear and trigger events to a HTML DOM element\n * ```html\n *
\n * \n * ```\n */\nvar EventHandler = /** @class */ (function () {\n function EventHandler() {\n }\n // to get the event data based on element\n EventHandler.addOrGetEventData = function (element) {\n if ('__eventList' in element) {\n return element.__eventList.events;\n }\n else {\n element.__eventList = {};\n return element.__eventList.events = [];\n }\n };\n /**\n * Add an event to the specified DOM element.\n *\n * @param {any} element - Target HTML DOM element\n * @param {string} eventName - A string that specifies the name of the event\n * @param {Function} listener - Specifies the function to run when the event occurs\n * @param {Object} bindTo - A object that binds 'this' variable in the event handler\n * @param {number} intDebounce - Specifies at what interval given event listener should be triggered.\n * @returns {Function} ?\n */\n EventHandler.add = function (element, eventName, listener, bindTo, intDebounce) {\n var eventData = EventHandler.addOrGetEventData(element);\n var debounceListener;\n if (intDebounce) {\n debounceListener = debounce(listener, intDebounce);\n }\n else {\n debounceListener = listener;\n }\n if (bindTo) {\n debounceListener = debounceListener.bind(bindTo);\n }\n var event = eventName.split(' ');\n for (var i = 0; i < event.length; i++) {\n eventData.push({\n name: event[i],\n listener: listener,\n debounce: debounceListener\n });\n if (Browser.isIE) {\n element.addEventListener(event[i], debounceListener);\n }\n else {\n element.addEventListener(event[i], debounceListener, { passive: false });\n }\n }\n return debounceListener;\n };\n /**\n * Remove an event listener that has been attached before.\n *\n * @param {any} element - Specifies the target html element to remove the event\n * @param {string} eventName - A string that specifies the name of the event to remove\n * @param {Function} listener - Specifies the function to remove\n * @returns {void} ?\n */\n EventHandler.remove = function (element, eventName, listener) {\n var eventData = EventHandler.addOrGetEventData(element);\n var event = eventName.split(' ');\n var _loop_1 = function (j) {\n var index = -1;\n var debounceListener;\n if (eventData && eventData.length !== 0) {\n eventData.some(function (x, i) {\n return x.name === event[j] && x.listener === listener ?\n (index = i, debounceListener = x.debounce, true) : false;\n });\n }\n if (index !== -1) {\n eventData.splice(index, 1);\n }\n if (debounceListener) {\n element.removeEventListener(event[j], debounceListener);\n }\n };\n for (var j = 0; j < event.length; j++) {\n _loop_1(j);\n }\n };\n /**\n * Clear all the event listeners that has been previously attached to the element.\n *\n * @param {any} element - Specifies the target html element to clear the events\n * @returns {void} ?\n */\n EventHandler.clearEvents = function (element) {\n var eventData;\n var copyData;\n // eslint-disable-next-line\n eventData = EventHandler.addOrGetEventData(element);\n // eslint-disable-next-line\n copyData = extend([], copyData, eventData);\n for (var i = 0; i < copyData.length; i++) {\n element.removeEventListener(copyData[i].name, copyData[i].debounce);\n eventData.shift();\n }\n };\n /**\n * Trigger particular event of the element.\n *\n * @param {any} element - Specifies the target html element to trigger the events\n * @param {string} eventName - Specifies the event to trigger for the specified element.\n * Can be a custom event, or any of the standard events.\n * @param {any} eventProp - Additional parameters to pass on to the event properties\n * @returns {void} ?\n */\n EventHandler.trigger = function (element, eventName, eventProp) {\n var eventData = EventHandler.addOrGetEventData(element);\n for (var _i = 0, eventData_1 = eventData; _i < eventData_1.length; _i++) {\n var event_1 = eventData_1[_i];\n if (event_1.name === eventName) {\n event_1.debounce.call(this, eventProp);\n }\n }\n };\n return EventHandler;\n}());\nexport { EventHandler };\n","/**\n * Functions related to dom operations.\n */\nimport { EventHandler } from './event-handler';\nimport { isNullOrUndefined, getValue, setValue, isObject, extend } from './util';\nvar SVG_REG = /^svg|^path|^g/;\n/**\n * Function to create Html element.\n *\n * @param {string} tagName - Name of the tag, id and class names.\n * @param {ElementProperties} properties - Object to set properties in the element.\n * @param {ElementProperties} properties.id - To set the id to the created element.\n * @param {ElementProperties} properties.className - To add classes to the element.\n * @param {ElementProperties} properties.innerHTML - To set the innerHTML to element.\n * @param {ElementProperties} properties.styles - To set the some custom styles to element.\n * @param {ElementProperties} properties.attrs - To set the attributes to element.\n * @returns {any} ?\n * @private\n */\nexport function createElement(tagName, properties) {\n var element = (SVG_REG.test(tagName) ? document.createElementNS('http://www.w3.org/2000/svg', tagName) : document.createElement(tagName));\n if (typeof (properties) === 'undefined') {\n return element;\n }\n element.innerHTML = (properties.innerHTML ? properties.innerHTML : '');\n if (properties.className !== undefined) {\n element.className = properties.className;\n }\n if (properties.id !== undefined) {\n element.id = properties.id;\n }\n if (properties.styles !== undefined) {\n element.setAttribute('style', properties.styles);\n }\n if (properties.attrs !== undefined) {\n attributes(element, properties.attrs);\n }\n return element;\n}\n/**\n * The function used to add the classes to array of elements\n *\n * @param {Element[]|NodeList} elements - An array of elements that need to add a list of classes\n * @param {string|string[]} classes - String or array of string that need to add an individual element as a class\n * @returns {any} .\n * @private\n */\nexport function addClass(elements, classes) {\n var classList = getClassList(classes);\n for (var _i = 0, _a = elements; _i < _a.length; _i++) {\n var ele = _a[_i];\n for (var _b = 0, classList_1 = classList; _b < classList_1.length; _b++) {\n var className = classList_1[_b];\n if (isObject(ele)) {\n var curClass = getValue('attributes.className', ele);\n if (isNullOrUndefined(curClass)) {\n setValue('attributes.className', className, ele);\n }\n else if (!new RegExp('\\\\b' + className + '\\\\b', 'i').test(curClass)) {\n setValue('attributes.className', curClass + ' ' + className, ele);\n }\n }\n else {\n if (!ele.classList.contains(className)) {\n ele.classList.add(className);\n }\n }\n }\n }\n return elements;\n}\n/**\n * The function used to add the classes to array of elements\n *\n * @param {Element[]|NodeList} elements - An array of elements that need to remove a list of classes\n * @param {string|string[]} classes - String or array of string that need to add an individual element as a class\n * @returns {any} .\n * @private\n */\nexport function removeClass(elements, classes) {\n var classList = getClassList(classes);\n for (var _i = 0, _a = elements; _i < _a.length; _i++) {\n var ele = _a[_i];\n var flag = isObject(ele);\n var canRemove = flag ? getValue('attributes.className', ele) : ele.className !== '';\n if (canRemove) {\n for (var _b = 0, classList_2 = classList; _b < classList_2.length; _b++) {\n var className = classList_2[_b];\n if (flag) {\n var classes_1 = getValue('attributes.className', ele);\n var classArr = classes_1.split(' ');\n var index = classArr.indexOf(className);\n if (index !== -1) {\n classArr.splice(index, 1);\n }\n setValue('attributes.className', classArr.join(' '), ele);\n }\n else {\n ele.classList.remove(className);\n }\n }\n }\n }\n return elements;\n}\n/**\n * The function used to get classlist.\n *\n * @param {string | string[]} classes - An element the need to check visibility\n * @returns {string[]} ?\n * @private\n */\nfunction getClassList(classes) {\n var classList = [];\n if (typeof classes === 'string') {\n classList.push(classes);\n }\n else {\n classList = classes;\n }\n return classList;\n}\n/**\n * The function used to check element is visible or not.\n *\n * @param {Element|Node} element - An element the need to check visibility\n * @returns {boolean} ?\n * @private\n */\nexport function isVisible(element) {\n var ele = element;\n return (ele.style.visibility === '' && ele.offsetWidth > 0);\n}\n/**\n * The function used to insert an array of elements into a first of the element.\n *\n * @param {Element[]|NodeList} fromElements - An array of elements that need to prepend.\n * @param {Element} toElement - An element that is going to prepend.\n * @param {boolean} isEval - ?\n * @returns {Element[] | NodeList} ?\n * @private\n */\nexport function prepend(fromElements, toElement, isEval) {\n var docFrag = document.createDocumentFragment();\n for (var _i = 0, _a = fromElements; _i < _a.length; _i++) {\n var ele = _a[_i];\n docFrag.appendChild(ele);\n }\n toElement.insertBefore(docFrag, toElement.firstElementChild);\n if (isEval) {\n executeScript(toElement);\n }\n return fromElements;\n}\n/**\n * The function used to insert an array of elements into last of the element.\n *\n * @param {Element[]|NodeList} fromElements - An array of elements that need to append.\n * @param {Element} toElement - An element that is going to prepend.\n * @param {boolean} isEval - ?\n * @returns {Element[] | NodeList} ?\n * @private\n */\nexport function append(fromElements, toElement, isEval) {\n var docFrag = document.createDocumentFragment();\n for (var _i = 0, _a = fromElements; _i < _a.length; _i++) {\n var ele = _a[_i];\n docFrag.appendChild(ele);\n }\n toElement.appendChild(docFrag);\n if (isEval) {\n executeScript(toElement);\n }\n return fromElements;\n}\n/**\n * The function is used to evaluate script from Ajax request\n *\n * @param {Element} ele - An element is going to evaluate the script\n * @returns {void} ?\n */\nfunction executeScript(ele) {\n var eleArray = ele.querySelectorAll('script');\n eleArray.forEach(function (element) {\n var script = document.createElement('script');\n script.text = element.innerHTML;\n document.head.appendChild(script);\n detach(script);\n });\n}\n/**\n * The function used to remove the element from parentnode\n *\n * @param {Element|Node|HTMLElement} element - An element that is going to detach from the Dom\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function detach(element) {\n var parentNode = element.parentNode;\n if (parentNode) {\n return parentNode.removeChild(element);\n }\n}\n/**\n * The function used to remove the element from Dom also clear the bounded events\n *\n * @param {Element|Node|HTMLElement} element - An element remove from the Dom\n * @returns {void} ?\n * @private\n */\nexport function remove(element) {\n var parentNode = element.parentNode;\n EventHandler.clearEvents(element);\n parentNode.removeChild(element);\n}\n/**\n * The function helps to set multiple attributes to an element\n *\n * @param {Element|Node} element - An element that need to set attributes.\n * @param {string} attributes - JSON Object that is going to as attributes.\n * @returns {Element} ?\n * @private\n */\n// eslint-disable-next-line\nexport function attributes(element, attributes) {\n var keys = Object.keys(attributes);\n var ele = element;\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (isObject(ele)) {\n var iKey = key;\n if (key === 'tabindex') {\n iKey = 'tabIndex';\n }\n ele.attributes[iKey] = attributes[key];\n }\n else {\n ele.setAttribute(key, attributes[key]);\n }\n }\n return ele;\n}\n/**\n * The function selects the element from giving context.\n *\n * @param {string} selector - Selector string need fetch element\n * @param {Document|Element} context - It is an optional type, That specifies a Dom context.\n * @param {boolean} needsVDOM ?\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function select(selector, context, needsVDOM) {\n if (context === void 0) { context = document; }\n selector = querySelectId(selector);\n return context.querySelector(selector);\n}\n/**\n * The function selects an array of element from the given context.\n *\n * @param {string} selector - Selector string need fetch element\n * @param {Document|Element} context - It is an optional type, That specifies a Dom context.\n * @param {boolean} needsVDOM ?\n * @returns {HTMLElement[]} ?\n * @private\n */\n// eslint-disable-next-line\nexport function selectAll(selector, context, needsVDOM) {\n if (context === void 0) { context = document; }\n selector = querySelectId(selector);\n var nodeList = context.querySelectorAll(selector);\n return nodeList;\n}\n/**\n * The function selects an id of element from the given context.\n *\n * @param {string} selector - Selector string need fetch element\n * @returns {string} ?\n * @private\n */\nfunction querySelectId(selector) {\n var charRegex = /(!|\"|\\$|%|&|'|\\(|\\)|\\*|\\/|:|;|<|=|\\?|@|\\]|\\^|`|{|}|\\||\\+|~)/g;\n if (selector.match(/#[0-9]/g) || selector.match(charRegex)) {\n var idList = selector.split(',');\n for (var i = 0; i < idList.length; i++) {\n var list = idList[i].split(' ');\n for (var j = 0; j < list.length; j++) {\n if (list[j].indexOf('#') > -1) {\n if (!list[j].match(/\\[.*\\]/)) {\n var splitId = list[j].split('#');\n if (splitId[1].match(/^\\d/) || splitId[1].match(charRegex)) {\n var setId = list[j].split('.');\n setId[0] = setId[0].replace(/#/, '[id=\\'') + '\\']';\n list[j] = setId.join('.');\n }\n }\n }\n }\n idList[i] = list.join(' ');\n }\n return idList.join(',');\n }\n return selector;\n}\n/**\n * Returns single closest parent element based on class selector.\n *\n * @param {Element} element - An element that need to find the closest element.\n * @param {string} selector - A classSelector of closest element.\n * @returns {Element} ?\n * @private\n */\nexport function closest(element, selector) {\n var el = element;\n if (typeof el.closest === 'function') {\n return el.closest(selector);\n }\n while (el && el.nodeType === 1) {\n if (matches(el, selector)) {\n return el;\n }\n el = el.parentNode;\n }\n return null;\n}\n/**\n * Returns all sibling elements of the given element.\n *\n * @param {Element|Node} element - An element that need to get siblings.\n * @returns {Element[]} ?\n * @private\n */\nexport function siblings(element) {\n var siblings = [];\n var childNodes = Array.prototype.slice.call(element.parentNode.childNodes);\n for (var _i = 0, childNodes_1 = childNodes; _i < childNodes_1.length; _i++) {\n var curNode = childNodes_1[_i];\n if (curNode.nodeType === Node.ELEMENT_NODE && element !== curNode) {\n siblings.push(curNode);\n }\n }\n return siblings;\n}\n/**\n * set the value if not exist. Otherwise set the existing value\n *\n * @param {HTMLElement} element - An element to which we need to set value.\n * @param {string} property - Property need to get or set.\n * @param {string} value - value need to set.\n * @returns {string} ?\n * @private\n */\nexport function getAttributeOrDefault(element, property, value) {\n var attrVal;\n var isObj = isObject(element);\n if (isObj) {\n attrVal = getValue('attributes.' + property, element);\n }\n else {\n attrVal = element.getAttribute(property);\n }\n if (isNullOrUndefined(attrVal) && value) {\n if (!isObj) {\n element.setAttribute(property, value.toString());\n }\n else {\n element.attributes[property] = value;\n }\n attrVal = value;\n }\n return attrVal;\n}\n/**\n * Set the style attributes to Html element.\n *\n * @param {HTMLElement} element - Element which we want to set attributes\n * @param {any} attrs - Set the given attributes to element\n * @returns {void} ?\n * @private\n */\nexport function setStyleAttribute(element, attrs) {\n if (attrs !== undefined) {\n Object.keys(attrs).forEach(function (key) {\n // eslint-disable-next-line\n element.style[key] = attrs[key];\n });\n }\n}\n/**\n * Method for add and remove classes to a dom element.\n *\n * @param {Element} element - Element for add and remove classes\n * @param {string[]} addClasses - List of classes need to be add to the element\n * @param {string[]} removeClasses - List of classes need to be remove from the element\n * @returns {void} ?\n * @private\n */\nexport function classList(element, addClasses, removeClasses) {\n addClass([element], addClasses);\n removeClass([element], removeClasses);\n}\n/**\n * Method to check whether the element matches the given selector.\n *\n * @param {Element} element - Element to compare with the selector.\n * @param {string} selector - String selector which element will satisfy.\n * @returns {void} ?\n * @private\n */\nexport function matches(element, selector) {\n // eslint-disable-next-line\n var matches = element.matches || element.msMatchesSelector || element.webkitMatchesSelector;\n if (matches) {\n return matches.call(element, selector);\n }\n else {\n return [].indexOf.call(document.querySelectorAll(selector), element) !== -1;\n }\n}\n/**\n * Method to get the html text from DOM.\n *\n * @param {HTMLElement} ele - Element to compare with the selector.\n * @param {string} innerHTML - String selector which element will satisfy.\n * @returns {void} ?\n * @private\n */\nexport function includeInnerHTML(ele, innerHTML) {\n ele.innerHTML = innerHTML;\n}\n/**\n * Method to get the containsclass.\n *\n * @param {HTMLElement} ele - Element to compare with the selector.\n * @param {string} className - String selector which element will satisfy.\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function containsClass(ele, className) {\n if (isObject(ele)) {\n // eslint-disable-next-line\n return new RegExp('\\\\b' + className + '\\\\b', 'i').test(ele.attributes.className);\n }\n else {\n return ele.classList.contains(className);\n }\n}\n/**\n * Method to check whether the element matches the given selector.\n *\n * @param {Object} element - Element to compare with the selector.\n * @param {boolean} deep ?\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function cloneNode(element, deep) {\n if (isObject(element)) {\n if (deep) {\n return extend({}, {}, element, true);\n }\n }\n else {\n return element.cloneNode(deep);\n }\n}\n","import { isUndefined, isNullOrUndefined, merge, setImmediate, setValue, isBlazor, getValue, extend } from './util';\nimport { addClass, removeClass } from './dom';\nimport { Observer } from './observer';\nvar isColEName = new RegExp(']');\n/* tslint:enable:no-any */\n/**\n * Base library module is common module for Framework modules like touch,keyboard and etc.,\n *\n * @private\n */\nvar Base = /** @class */ (function () {\n /**\n * Base constructor accept options and element\n *\n * @param {Object} options ?\n * @param {string} element ?\n */\n function Base(options, element) {\n this.isRendered = false;\n this.isComplexArraySetter = false;\n this.isServerRendered = false;\n this.allowServerDataBinding = true;\n this.isProtectedOnChange = true;\n this.properties = {};\n this.changedProperties = {};\n this.oldProperties = {};\n this.bulkChanges = {};\n this.refreshing = false;\n this.ignoreCollectionWatch = false;\n // eslint-disable-next-line\n this.finalUpdate = function () { };\n this.childChangedProperties = {};\n this.modelObserver = new Observer(this);\n if (!isUndefined(element)) {\n if ('string' === typeof (element)) {\n this.element = document.querySelector(element);\n }\n else {\n this.element = element;\n }\n if (!isNullOrUndefined(this.element)) {\n this.isProtectedOnChange = false;\n this.addInstance();\n }\n }\n if (!isUndefined(options)) {\n this.setProperties(options, true);\n }\n this.isDestroyed = false;\n }\n /** Property base section */\n /**\n * Function used to set bunch of property at a time.\n *\n * @private\n * @param {Object} prop - JSON object which holds components properties.\n * @param {boolean} muteOnChange ? - Specifies to true when we set properties.\n * @returns {void} ?\n */\n Base.prototype.setProperties = function (prop, muteOnChange) {\n var prevDetection = this.isProtectedOnChange;\n this.isProtectedOnChange = !!muteOnChange;\n merge(this, prop);\n if (muteOnChange !== true) {\n merge(this.changedProperties, prop);\n this.dataBind();\n }\n else if (isBlazor() && this.isRendered) {\n this.serverDataBind(prop);\n }\n this.finalUpdate();\n this.changedProperties = {};\n this.oldProperties = {};\n this.isProtectedOnChange = prevDetection;\n };\n /**\n * Calls for child element data bind\n *\n * @param {Object} obj ?\n * @param {Object} parent ?\n * @returns {void} ?\n */\n // tslint:disable-next-line:no-any\n Base.callChildDataBind = function (obj, parent) {\n var keys = Object.keys(obj);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (parent[key] instanceof Array) {\n for (var _a = 0, _b = parent[key]; _a < _b.length; _a++) {\n var obj_1 = _b[_a];\n if (obj_1.dataBind !== undefined) {\n obj_1.dataBind();\n }\n }\n }\n else {\n parent[key].dataBind();\n }\n }\n };\n Base.prototype.clearChanges = function () {\n this.finalUpdate();\n this.changedProperties = {};\n this.oldProperties = {};\n this.childChangedProperties = {};\n };\n /**\n * Bind property changes immediately to components\n *\n * @returns {void} ?\n */\n Base.prototype.dataBind = function () {\n Base.callChildDataBind(this.childChangedProperties, this);\n if (Object.getOwnPropertyNames(this.changedProperties).length) {\n var prevDetection = this.isProtectedOnChange;\n var newChanges = this.changedProperties;\n var oldChanges = this.oldProperties;\n this.clearChanges();\n this.isProtectedOnChange = true;\n this.onPropertyChanged(newChanges, oldChanges);\n this.isProtectedOnChange = prevDetection;\n }\n };\n /* tslint:disable:no-any */\n Base.prototype.serverDataBind = function (newChanges) {\n if (!isBlazor()) {\n return;\n }\n newChanges = newChanges ? newChanges : {};\n extend(this.bulkChanges, {}, newChanges, true);\n var sfBlazor = 'sfBlazor';\n if (this.allowServerDataBinding && window[sfBlazor].updateModel) {\n window[sfBlazor].updateModel(this);\n this.bulkChanges = {};\n }\n };\n /* tslint:enable:no-any */\n Base.prototype.saveChanges = function (key, newValue, oldValue) {\n if (isBlazor()) {\n // tslint:disable-next-line:no-any\n var newChanges = {};\n newChanges[key] = newValue;\n this.serverDataBind(newChanges);\n }\n if (this.isProtectedOnChange) {\n return;\n }\n this.oldProperties[key] = oldValue;\n this.changedProperties[key] = newValue;\n this.finalUpdate();\n this.finalUpdate = setImmediate(this.dataBind.bind(this));\n };\n /** Event Base Section */\n /**\n * Adds the handler to the given event listener.\n *\n * @param {string} eventName - A String that specifies the name of the event\n * @param {Function} handler - Specifies the call to run when the event occurs.\n * @returns {void} ?\n */\n Base.prototype.addEventListener = function (eventName, handler) {\n this.modelObserver.on(eventName, handler);\n };\n /**\n * Removes the handler from the given event listener.\n *\n * @param {string} eventName - A String that specifies the name of the event to remove\n * @param {Function} handler - Specifies the function to remove\n * @returns {void} ?\n */\n Base.prototype.removeEventListener = function (eventName, handler) {\n this.modelObserver.off(eventName, handler);\n };\n /**\n * Triggers the handlers in the specified event.\n *\n * @private\n * @param {string} eventName - Specifies the event to trigger for the specified component properties.\n * Can be a custom event, or any of the standard events.\n * @param {Event} eventProp - Additional parameters to pass on to the event properties\n * @param {Function} successHandler - this function will invoke after event successfully triggered\n * @param {Function} errorHandler - this function will invoke after event if it failured to call.\n * @returns {void} ?\n */\n Base.prototype.trigger = function (eventName, eventProp, successHandler, errorHandler) {\n var _this = this;\n if (this.isDestroyed !== true) {\n var prevDetection = this.isProtectedOnChange;\n this.isProtectedOnChange = false;\n var data = this.modelObserver.notify(eventName, eventProp, successHandler, errorHandler);\n if (isColEName.test(eventName)) {\n var handler = getValue(eventName, this);\n if (handler) {\n var blazor = 'Blazor';\n if (window[blazor]) {\n var promise = handler.call(this, eventProp);\n if (promise && typeof promise.then === 'function') {\n if (!successHandler) {\n data = promise;\n }\n else {\n promise.then(function (data) {\n if (successHandler) {\n data = typeof data === 'string' && _this.modelObserver.isJson(data) ?\n JSON.parse(data) : data;\n successHandler.call(_this, data);\n }\n }).catch(function (data) {\n if (errorHandler) {\n data = typeof data === 'string' && _this.modelObserver.isJson(data) ? JSON.parse(data) : data;\n errorHandler.call(_this, data);\n }\n });\n }\n }\n else if (successHandler) {\n successHandler.call(this, eventProp);\n }\n }\n else {\n handler.call(this, eventProp);\n if (successHandler) {\n successHandler.call(this, eventProp);\n }\n }\n }\n else if (successHandler) {\n successHandler.call(this, eventProp);\n }\n }\n this.isProtectedOnChange = prevDetection;\n return data;\n }\n };\n /**\n * To maintain instance in base class\n *\n * @returns {void} ?\n */\n Base.prototype.addInstance = function () {\n // Add module class to the root element\n var moduleClass = 'e-' + this.getModuleName().toLowerCase();\n addClass([this.element], ['e-lib', moduleClass]);\n if (!isNullOrUndefined(this.element.ej2_instances)) {\n this.element.ej2_instances.push(this);\n }\n else {\n setValue('ej2_instances', [this], this.element);\n }\n };\n /**\n * To remove the instance from the element\n *\n * @returns {void} ?\n */\n Base.prototype.destroy = function () {\n var _this = this;\n // eslint-disable-next-line\n this.element.ej2_instances =\n this.element.ej2_instances.filter(function (i) { return i !== _this; });\n removeClass([this.element], ['e-' + this.getModuleName()]);\n if (this.element.ej2_instances.length === 0) {\n // Remove module class from the root element\n removeClass([this.element], ['e-lib']);\n }\n this.clearChanges();\n this.modelObserver.destroy();\n this.isDestroyed = true;\n };\n return Base;\n}());\nexport { Base };\n/**\n * Global function to get the component instance from the rendered element.\n *\n * @param {HTMLElement} elem Specifies the HTMLElement or element id string.\n * @param {string} comp Specifies the component module name or Component.\n * @returns {any} ?\n */\n// tslint:disable-next-line:no-any\nexport function getComponent(elem, comp) {\n var instance;\n var i;\n var ele = typeof elem === 'string' ? document.getElementById(elem) : elem;\n for (i = 0; i < ele.ej2_instances.length; i++) {\n instance = ele.ej2_instances[i];\n if (typeof comp === 'string') {\n var compName = instance.getModuleName();\n if (comp === compName) {\n return instance;\n }\n }\n else {\n // tslint:disable-next-line:no-any\n if (instance instanceof comp) {\n return instance;\n }\n }\n }\n return undefined;\n}\n/**\n * Function to remove the child instances.\n *\n * @param {HTMLElement} element ?\n * @return {void}\n * @private\n */\n// tslint:disable-next-line:no-any\nexport function removeChildInstance(element) {\n // tslint:disable-next-line:no-any\n var childEle = [].slice.call(element.getElementsByClassName('e-control'));\n for (var i = 0; i < childEle.length; i++) {\n var compName = childEle[i].classList[1].split('e-')[1];\n // tslint:disable-next-line:no-any\n var compInstance = getComponent(childEle[i], compName);\n if (!isUndefined(compInstance)) {\n compInstance.destroy();\n }\n }\n}\n","import { createInstance, isUndefined, merge, extend, getValue } from './util';\n/**\n * Returns the Class Object\n *\n * @param {ClassObject} instance - instance of ClassObject\n * @param {string} curKey - key of the current instance\n * @param {Object} defaultValue - default Value\n * @param {Object[]} type ?\n * @returns {ClassObject} ?\n */\n// eslint-disable-next-line\nfunction getObject(instance, curKey, defaultValue, type) {\n // eslint-disable-next-line\n if (!instance.properties.hasOwnProperty(curKey) || !(instance.properties[curKey] instanceof type)) {\n instance.properties[curKey] = createInstance(type, [instance, curKey, defaultValue]);\n }\n return instance.properties[curKey];\n}\n/**\n * Returns object array\n *\n * @param {ClassObject} instance ?\n * @param {string} curKey ?\n * @param {Object[]} defaultValue ?\n * @param {Object} type ?\n * @param {boolean} isSetter ?\n * @param {boolean} isFactory ?\n * @returns {Object[]} ?\n */\n// eslint-disable-next-line\nfunction getObjectArray(instance, curKey, defaultValue, type, isSetter, isFactory) {\n var result = [];\n var len = defaultValue ? defaultValue.length : 0;\n for (var i = 0; i < len; i++) {\n var curType = type;\n if (isFactory) {\n curType = type(defaultValue[i], instance);\n }\n if (isSetter) {\n var inst = createInstance(curType, [instance, curKey, {}, true]);\n inst.setProperties(defaultValue[i], true);\n result.push(inst);\n }\n else {\n result.push(createInstance(curType, [instance, curKey, defaultValue[i], false]));\n }\n }\n return result;\n}\n/**\n * Returns the properties of the object\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @returns {void} ?\n */\nfunction propertyGetter(defaultValue, curKey) {\n return function () {\n // eslint-disable-next-line\n if (!this.properties.hasOwnProperty(curKey)) {\n this.properties[curKey] = defaultValue;\n }\n return this.properties[curKey];\n };\n}\n/**\n * Set the properties for the object\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @returns {void} ?\n */\nfunction propertySetter(defaultValue, curKey) {\n return function (newValue) {\n if (this.properties[curKey] !== newValue) {\n // eslint-disable-next-line\n var oldVal = this.properties.hasOwnProperty(curKey) ? this.properties[curKey] : defaultValue;\n this.saveChanges(curKey, newValue, oldVal);\n this.properties[curKey] = newValue;\n }\n };\n}\n/**\n * Returns complex objects\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\n// eslint-disable-next-line\nfunction complexGetter(defaultValue, curKey, type) {\n return function () {\n return getObject(this, curKey, defaultValue, type);\n };\n}\n/**\n * Sets complex objects\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\nfunction complexSetter(defaultValue, curKey, type) {\n return function (newValue) {\n getObject(this, curKey, defaultValue, type).setProperties(newValue);\n };\n}\n/**\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @param {FunctionConstructor} type ?\n * @returns {void} ?\n */\n// eslint-disable-next-line\nfunction complexFactoryGetter(defaultValue, curKey, type) {\n return function () {\n var curType = type({});\n // eslint-disable-next-line\n if (this.properties.hasOwnProperty(curKey)) {\n return this.properties[curKey];\n }\n else {\n return getObject(this, curKey, defaultValue, curType);\n }\n };\n}\n/**\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\nfunction complexFactorySetter(defaultValue, curKey, type) {\n return function (newValue) {\n var curType = type(newValue, this);\n getObject(this, curKey, defaultValue, curType).setProperties(newValue);\n };\n}\n/**\n *\n * @param {Object[]} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\nfunction complexArrayGetter(defaultValue, curKey, type) {\n return function () {\n var _this = this;\n // eslint-disable-next-line\n if (!this.properties.hasOwnProperty(curKey)) {\n var defCollection = getObjectArray(this, curKey, defaultValue, type, false);\n this.properties[curKey] = defCollection;\n }\n var ignore = ((this.controlParent !== undefined && this.controlParent.ignoreCollectionWatch)\n || this.ignoreCollectionWatch);\n // eslint-disable-next-line\n if (!this.properties[curKey].hasOwnProperty('push') && !ignore) {\n ['push', 'pop'].forEach(function (extendFunc) {\n var descriptor = {\n value: complexArrayDefinedCallback(extendFunc, curKey, type, _this.properties[curKey]).bind(_this),\n configurable: true\n };\n Object.defineProperty(_this.properties[curKey], extendFunc, descriptor);\n });\n }\n // eslint-disable-next-line\n if (!this.properties[curKey].hasOwnProperty('isComplexArray')) {\n Object.defineProperty(this.properties[curKey], 'isComplexArray', { value: true });\n }\n return this.properties[curKey];\n };\n}\n/**\n *\n * @param {Object[]} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\nfunction complexArraySetter(defaultValue, curKey, type) {\n return function (newValue) {\n this.isComplexArraySetter = true;\n var oldValueCollection = getObjectArray(this, curKey, defaultValue, type, false);\n var newValCollection = getObjectArray(this, curKey, newValue, type, true);\n this.isComplexArraySetter = false;\n this.saveChanges(curKey, newValCollection, oldValueCollection);\n this.properties[curKey] = newValCollection;\n };\n}\n/**\n *\n * @param {Object[]} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\nfunction complexArrayFactorySetter(defaultValue, curKey, type) {\n return function (newValue) {\n // eslint-disable-next-line\n var oldValueCollection = this.properties.hasOwnProperty(curKey) ? this.properties[curKey] : defaultValue;\n var newValCollection = getObjectArray(this, curKey, newValue, type, true, true);\n this.saveChanges(curKey, newValCollection, oldValueCollection);\n this.properties[curKey] = newValCollection;\n };\n}\n/**\n *\n * @param {Object[]} defaultValue ?\n * @param {string} curKey ?\n * @param {FunctionConstructor} type ?\n * @returns {void} ?\n */\nfunction complexArrayFactoryGetter(defaultValue, curKey, type) {\n return function () {\n var curType = type({});\n // eslint-disable-next-line\n if (!this.properties.hasOwnProperty(curKey)) {\n var defCollection = getObjectArray(this, curKey, defaultValue, curType, false);\n this.properties[curKey] = defCollection;\n }\n return this.properties[curKey];\n };\n}\n/**\n *\n * @param {string} dFunc ?\n * @param {string} curKey ?\n * @param {Object} type ?\n * @param {Object} prop ?\n * @returns {Object} ?\n */\nfunction complexArrayDefinedCallback(dFunc, curKey, type, prop) {\n /* tslint:disable no-function-expression */\n return function () {\n var newValue = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newValue[_i] = arguments[_i];\n }\n var keyString = this.propName ? this.getParentKey() + '.' + curKey + '-' : curKey + '-';\n switch (dFunc) {\n case 'push':\n for (var i = 0; i < newValue.length; i++) {\n Array.prototype[dFunc].apply(prop, [newValue[i]]);\n var model_1 = getArrayModel(keyString + (prop.length - 1), newValue[i], !this.controlParent, dFunc);\n this.serverDataBind(model_1, newValue[i], false, dFunc);\n }\n break;\n case 'pop':\n Array.prototype[dFunc].apply(prop);\n // eslint-disable-next-line\n var model = getArrayModel(keyString + prop.length, null, !this.controlParent, dFunc);\n this.serverDataBind(model, { ejsAction: 'pop' }, false, dFunc);\n break;\n }\n return prop;\n };\n}\n/**\n *\n * @param {string} keyString ?\n * @param {Object} value ?\n * @param {boolean} isControlParent ?\n * @param {string} arrayFunction ?\n * @returns {Object} ?\n */\nfunction getArrayModel(keyString, value, isControlParent, arrayFunction) {\n var modelObject = keyString;\n if (isControlParent) {\n modelObject = {};\n modelObject[keyString] = value;\n if (value && typeof value === 'object') {\n var action = 'ejsAction';\n modelObject[keyString][action] = arrayFunction;\n }\n }\n return modelObject;\n}\n// eslint-disable-next-line\n/**\n * Method used to create property. General syntax below.\n *\n * @param {Object} defaultValue - Specifies the default value of property.\n * @returns {PropertyDecorator} ?\n * ```\n * @Property('TypeScript')\n * propertyName: Type;\n * ```\n * @private\n */\nexport function Property(defaultValue) {\n return function (target, key) {\n var propertyDescriptor = {\n set: propertySetter(defaultValue, key),\n get: propertyGetter(defaultValue, key),\n enumerable: true,\n configurable: true\n };\n //new property creation\n Object.defineProperty(target, key, propertyDescriptor);\n addPropertyCollection(target, key, 'prop', defaultValue);\n };\n}\n/**\n * Method used to create complex property. General syntax below.\n *\n * @param {any} defaultValue - Specifies the default value of property.\n * @param {Function} type - Specifies the class type of complex object.\n * @returns {PropertyDecorator} ?\n * ```\n * @Complex({},Type)\n * propertyName: Type;\n * ```\n * @private\n */\nexport function Complex(defaultValue, type) {\n return function (target, key) {\n var propertyDescriptor = {\n set: complexSetter(defaultValue, key, type),\n get: complexGetter(defaultValue, key, type),\n enumerable: true,\n configurable: true\n };\n //new property creation\n Object.defineProperty(target, key, propertyDescriptor);\n addPropertyCollection(target, key, 'complexProp', defaultValue, type);\n };\n}\n/**\n * Method used to create complex Factory property. General syntax below.\n *\n * @param {Function} type - Specifies the class factory type of complex object.\n * @returns {PropertyDecorator} ?\n * ```\n * @ComplexFactory(defaultType, factoryFunction)\n * propertyName: Type1 | Type2;\n * ```\n * @private\n */\nexport function ComplexFactory(type) {\n return function (target, key) {\n var propertyDescriptor = {\n set: complexFactorySetter({}, key, type),\n get: complexFactoryGetter({}, key, type),\n enumerable: true,\n configurable: true\n };\n //new property creation\n Object.defineProperty(target, key, propertyDescriptor);\n addPropertyCollection(target, key, 'complexProp', {}, type);\n };\n}\n/**\n * Method used to create complex array property. General syntax below.\n *\n * @param {any} defaultValue - Specifies the default value of property.\n * @param {Function} type - Specifies the class type of complex object.\n * @returns {PropertyDecorator} ?\n * ```\n * @Collection([], Type);\n * propertyName: Type;\n * ```\n * @private\n */\nexport function Collection(defaultValue, type) {\n return function (target, key) {\n var propertyDescriptor = {\n set: complexArraySetter(defaultValue, key, type),\n get: complexArrayGetter(defaultValue, key, type),\n enumerable: true,\n configurable: true\n };\n //new property creation\n Object.defineProperty(target, key, propertyDescriptor);\n addPropertyCollection(target, key, 'colProp', defaultValue, type);\n };\n}\n/**\n * Method used to create complex factory array property. General syntax below.\n *\n * @param {Function} type - Specifies the class type of complex object.\n * @returns {PropertyCollectionInfo} ?\n * ```\n * @Collection([], Type);\n * propertyName: Type;\n * ```\n * @private\n */\nexport function CollectionFactory(type) {\n return function (target, key) {\n var propertyDescriptor = {\n set: complexArrayFactorySetter([], key, type),\n get: complexArrayFactoryGetter([], key, type),\n enumerable: true,\n configurable: true\n };\n //new property creation\n Object.defineProperty(target, key, propertyDescriptor);\n addPropertyCollection(target, key, 'colProp', {}, type);\n };\n}\n/**\n * Method used to create event property. General syntax below.\n *\n * @returns {PropertyDecorator} ?\n * ```\n * @Event(()=>{return true;})\n * ```\n * @private\n */\nexport function Event() {\n return function (target, key) {\n var eventDescriptor = {\n set: function (newValue) {\n var oldValue = this.properties[key];\n if (oldValue !== newValue) {\n var finalContext = getParentContext(this, key);\n if (isUndefined(oldValue) === false) {\n finalContext.context.removeEventListener(finalContext.prefix, oldValue);\n }\n finalContext.context.addEventListener(finalContext.prefix, newValue);\n this.properties[key] = newValue;\n }\n },\n get: propertyGetter(undefined, key),\n enumerable: true,\n configurable: true\n };\n Object.defineProperty(target, key, eventDescriptor);\n addPropertyCollection(target, key, 'event');\n };\n}\n/**\n * NotifyPropertyChanges is triggers the call back when the property has been changed.\n *\n * @param {Function} classConstructor ?\n * @returns {void} ?\n * ```\n * @NotifyPropertyChanges\n * class DemoClass implements INotifyPropertyChanged {\n *\n * @Property()\n * property1: string;\n *\n * dataBind: () => void;\n *\n * constructor() { }\n *\n * onPropertyChanged(newProp: any, oldProp: any) {\n * // Called when property changed\n * }\n * }\n * ```\n * @private\n */\n// eslint-disable-next-line\nexport function NotifyPropertyChanges(classConstructor) {\n /** Need to code */\n}\n/**\n * Method used to create the builderObject for the target component.\n *\n * @param {BuildInfo} target ?\n * @param {string} key ?\n * @param {string} propertyType ?\n * @param {Object} defaultValue ?\n * @param {Function} type ?\n * @returns {void} ?\n * @private\n */\nfunction addPropertyCollection(target, key, propertyType, defaultValue, type) {\n if (isUndefined(target.propList)) {\n target.propList = {\n props: [],\n complexProps: [],\n colProps: [],\n events: [],\n propNames: [],\n complexPropNames: [],\n colPropNames: [],\n eventNames: []\n };\n }\n // eslint-disable-next-line\n target.propList[propertyType + 's'].push({\n propertyName: key,\n defaultValue: defaultValue,\n type: type\n });\n // eslint-disable-next-line\n target.propList[propertyType + 'Names'].push(key);\n}\n/**\n * Returns an object containing the builder properties\n *\n * @param {Function} component ?\n * @returns {Object} ?\n * @private\n */\nfunction getBuilderProperties(component) {\n if (isUndefined(component.prototype.builderObject)) {\n component.prototype.builderObject = {\n properties: {}, propCollections: [], add: function () {\n this.isPropertyArray = true;\n this.propCollections.push(extend({}, this.properties, {}));\n }\n };\n var rex = /complex/;\n for (var _i = 0, _a = Object.keys(component.prototype.propList); _i < _a.length; _i++) {\n var key = _a[_i];\n var _loop_1 = function (prop) {\n if (rex.test(key)) {\n component.prototype.builderObject[prop.propertyName] = function (value) {\n var childType = {};\n merge(childType, getBuilderProperties(prop.type));\n value(childType);\n var tempValue;\n if (!childType.isPropertyArray) {\n tempValue = extend({}, childType.properties, {});\n }\n else {\n tempValue = childType.propCollections;\n }\n this.properties[prop.propertyName] = tempValue;\n childType.properties = {};\n childType.propCollections = [];\n childType.isPropertyArray = false;\n return this;\n };\n }\n else {\n component.prototype.builderObject[prop.propertyName] = function (value) {\n this.properties[prop.propertyName] = value;\n return this;\n };\n }\n };\n for (var _b = 0, _c = component.prototype.propList[key]; _b < _c.length; _b++) {\n var prop = _c[_b];\n _loop_1(prop);\n }\n }\n }\n return component.prototype.builderObject;\n}\n/**\n * Method used to create builder for the components\n *\n * @param {any} component -specifies the target component for which builder to be created.\n * @returns {Object} ?\n * @private\n */\nexport function CreateBuilder(component) {\n var builderFunction = function (element) {\n this.element = element;\n return this;\n };\n var instanceFunction = function (element) {\n // eslint-disable-next-line\n if (!builderFunction.prototype.hasOwnProperty('create')) {\n builderFunction.prototype = getBuilderProperties(component);\n builderFunction.prototype.create = function () {\n var temp = extend({}, {}, this.properties);\n this.properties = {};\n return new component(temp, this.element);\n };\n }\n return new builderFunction(element);\n };\n return instanceFunction;\n}\n/**\n * Returns parent options for the object\n *\n * @param {Object} context ?\n * @param {string} prefix ?\n * @returns {ParentOption} ?\n * @private\n */\nfunction getParentContext(context, prefix) {\n // eslint-disable-next-line\n if (context.hasOwnProperty('parentObj') === false) {\n return { context: context, prefix: prefix };\n }\n else {\n var curText = getValue('propName', context);\n if (curText) {\n prefix = curText + '-' + prefix;\n }\n return getParentContext(getValue('parentObj', context), prefix);\n }\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { createElement, selectAll, closest } from './dom';\nimport { Base } from './base';\nimport { Browser } from './browser';\nimport { EventHandler } from './event-handler';\nimport { Property, NotifyPropertyChanges, Event } from './notify-property-change';\n/**\n * The Animation framework provide options to animate the html DOM elements\n * ```typescript\n * let animeObject = new Animation({\n * name: 'SlideLeftIn',\n * duration: 1000\n * });\n * animeObject.animate('#anime1');\n * animeObject.animate('#anime2', { duration: 500 });\n * ```\n */\nvar Animation = /** @class */ (function (_super) {\n __extends(Animation, _super);\n function Animation(options) {\n var _this = _super.call(this, options, undefined) || this;\n /**\n * @private\n */\n _this.easing = {\n ease: 'cubic-bezier(0.250, 0.100, 0.250, 1.000)',\n linear: 'cubic-bezier(0.250, 0.250, 0.750, 0.750)',\n easeIn: 'cubic-bezier(0.420, 0.000, 1.000, 1.000)',\n easeOut: 'cubic-bezier(0.000, 0.000, 0.580, 1.000)',\n easeInOut: 'cubic-bezier(0.420, 0.000, 0.580, 1.000)',\n elasticInOut: 'cubic-bezier(0.5,-0.58,0.38,1.81)',\n elasticIn: 'cubic-bezier(0.17,0.67,0.59,1.81)',\n elasticOut: 'cubic-bezier(0.7,-0.75,0.99,1.01)'\n };\n return _this;\n }\n Animation_1 = Animation;\n /**\n * Applies animation to the current element.\n *\n * @param {string | HTMLElement} element - Element which needs to be animated.\n * @param {AnimationModel} options - Overriding default animation settings.\n * @returns {void} ?\n */\n Animation.prototype.animate = function (element, options) {\n options = !options ? {} : options;\n var model = this.getModel(options);\n if (typeof element === 'string') {\n var elements = Array.prototype.slice.call(selectAll(element, document));\n for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {\n var element_1 = elements_1[_i];\n model.element = element_1;\n Animation_1.delayAnimation(model);\n }\n }\n else {\n model.element = element;\n Animation_1.delayAnimation(model);\n }\n };\n /**\n * Stop the animation effect on animated element.\n *\n * @param {HTMLElement} element - Element which needs to be stop the animation.\n * @param {AnimationOptions} model - Handling the animation model at stop function.\n * @return {void}\n */\n Animation.stop = function (element, model) {\n element.style.animation = '';\n element.removeAttribute('e-animate');\n var animationId = element.getAttribute('e-animation-id');\n if (animationId) {\n var frameId = parseInt(animationId, 10);\n cancelAnimationFrame(frameId);\n element.removeAttribute('e-animation-id');\n }\n if (model && model.end) {\n model.end.call(this, model);\n }\n };\n /**\n * Set delay to animation element\n *\n * @param {AnimationModel} model ?\n * @returns {void}\n */\n Animation.delayAnimation = function (model) {\n if (model.delay) {\n setTimeout(function () { Animation_1.applyAnimation(model); }, model.delay);\n }\n else {\n Animation_1.applyAnimation(model);\n }\n };\n /**\n * Triggers animation\n *\n * @param {AnimationModel} model ?\n * @returns {void}\n */\n Animation.applyAnimation = function (model) {\n var _this = this;\n model.timeStamp = 0;\n var step = 0;\n var timerId = 0;\n var prevTimeStamp = 0;\n var duration = model.duration;\n model.element.setAttribute('e-animate', 'true');\n var startAnimation = function (timeStamp) {\n try {\n if (timeStamp) {\n // let step: number = model.timeStamp = timeStamp - startTime;\n /** phantomjs workaround for timestamp fix */\n prevTimeStamp = prevTimeStamp === 0 ? timeStamp : prevTimeStamp;\n model.timeStamp = (timeStamp + model.timeStamp) - prevTimeStamp;\n prevTimeStamp = timeStamp;\n /** phantomjs workaround end */\n // trigger animation begin event\n if (!step && model.begin) {\n model.begin.call(_this, model);\n }\n step = step + 1;\n var avg = model.timeStamp / step;\n if (model.timeStamp < duration && model.timeStamp + avg < duration && model.element.getAttribute('e-animate')) {\n // apply animation effect to the current element\n model.element.style.animation = model.name + ' ' + model.duration + 'ms ' + model.timingFunction;\n if (model.progress) {\n model.progress.call(_this, model);\n }\n // repeat requestAnimationFrame\n requestAnimationFrame(startAnimation);\n }\n else {\n // clear requestAnimationFrame\n cancelAnimationFrame(timerId);\n model.element.removeAttribute('e-animation-id');\n model.element.removeAttribute('e-animate');\n model.element.style.animation = '';\n if (model.end) {\n model.end.call(_this, model);\n }\n }\n }\n else {\n //startTime = performance.now();\n // set initial requestAnimationFrame\n timerId = requestAnimationFrame(startAnimation);\n model.element.setAttribute('e-animation-id', timerId.toString());\n }\n }\n catch (e) {\n cancelAnimationFrame(timerId);\n model.element.removeAttribute('e-animation-id');\n if (model.fail) {\n model.fail.call(_this, e);\n }\n }\n };\n startAnimation();\n };\n /**\n * Returns Animation Model\n *\n * @param {AnimationModel} options ?\n * @returns {AnimationModel} ?\n */\n Animation.prototype.getModel = function (options) {\n return {\n name: options.name || this.name,\n delay: options.delay || this.delay,\n duration: (options.duration !== undefined ? options.duration : this.duration),\n begin: options.begin || this.begin,\n end: options.end || this.end,\n fail: options.fail || this.fail,\n progress: options.progress || this.progress,\n timingFunction: this.easing[options.timingFunction] ? this.easing[options.timingFunction] :\n (options.timingFunction || this.easing[this.timingFunction])\n };\n };\n /**\n * @private\n * @param {AnimationModel} newProp ?\n * @param {AnimationModel} oldProp ?\n * @returns {void} ?\n */\n // eslint-disable-next-line\n Animation.prototype.onPropertyChanged = function (newProp, oldProp) {\n // no code needed\n };\n /**\n * Returns module name as animation\n *\n * @private\n * @returns {void} ?\n */\n Animation.prototype.getModuleName = function () {\n return 'animation';\n };\n /**\n *\n * @private\n * @returns {void} ?\n */\n Animation.prototype.destroy = function () {\n //Override base destroy;\n };\n var Animation_1;\n __decorate([\n Property('FadeIn')\n ], Animation.prototype, \"name\", void 0);\n __decorate([\n Property(400)\n ], Animation.prototype, \"duration\", void 0);\n __decorate([\n Property('ease')\n ], Animation.prototype, \"timingFunction\", void 0);\n __decorate([\n Property(0)\n ], Animation.prototype, \"delay\", void 0);\n __decorate([\n Event()\n ], Animation.prototype, \"progress\", void 0);\n __decorate([\n Event()\n ], Animation.prototype, \"begin\", void 0);\n __decorate([\n Event()\n ], Animation.prototype, \"end\", void 0);\n __decorate([\n Event()\n ], Animation.prototype, \"fail\", void 0);\n Animation = Animation_1 = __decorate([\n NotifyPropertyChanges\n ], Animation);\n return Animation;\n}(Base));\nexport { Animation };\n/**\n * Ripple provides material theme's wave effect when an element is clicked\n * ```html\n * \n * \n * ```\n *\n * @private\n * @param {HTMLElement} element - Target element\n * @param {RippleOptions} rippleOptions - Ripple options .\n * @param {Function} done .\n * @returns {void} .\n */\nexport function rippleEffect(element, rippleOptions, done) {\n var rippleModel = getRippleModel(rippleOptions);\n if (rippleModel.rippleFlag === false || (rippleModel.rippleFlag === undefined && !isRippleEnabled)) {\n return Function;\n }\n element.setAttribute('data-ripple', 'true');\n EventHandler.add(element, 'mousedown', rippleHandler, { parent: element, rippleOptions: rippleModel });\n EventHandler.add(element, 'mouseup', rippleUpHandler, { parent: element, rippleOptions: rippleModel, done: done });\n EventHandler.add(element, 'mouseleave', rippleLeaveHandler, { parent: element, rippleOptions: rippleModel });\n if (Browser.isPointer) {\n EventHandler.add(element, 'transitionend', rippleLeaveHandler, { parent: element, rippleOptions: rippleModel });\n }\n return (function () {\n element.removeAttribute('data-ripple');\n EventHandler.remove(element, 'mousedown', rippleHandler);\n EventHandler.remove(element, 'mouseup', rippleUpHandler);\n EventHandler.remove(element, 'mouseleave', rippleLeaveHandler);\n EventHandler.remove(element, 'transitionend', rippleLeaveHandler);\n });\n}\n/**\n * Handler for ripple model\n *\n * @param {RippleOptions} rippleOptions ?\n * @returns {RippleOptions} ?\n */\nfunction getRippleModel(rippleOptions) {\n var rippleModel = {\n selector: rippleOptions && rippleOptions.selector ? rippleOptions.selector : null,\n ignore: rippleOptions && rippleOptions.ignore ? rippleOptions.ignore : null,\n rippleFlag: rippleOptions && rippleOptions.rippleFlag,\n isCenterRipple: rippleOptions && rippleOptions.isCenterRipple,\n duration: rippleOptions && rippleOptions.duration ? rippleOptions.duration : 350\n };\n return rippleModel;\n}\n/**\n * Handler for ripple event\n *\n * @param {MouseEvent} e ?\n * @returns {void} ?\n * @private\n */\nfunction rippleHandler(e) {\n var target = (e.target);\n var selector = this.rippleOptions.selector;\n var element = selector ? closest(target, selector) : target;\n if (!element || (this.rippleOptions && closest(target, this.rippleOptions.ignore))) {\n return;\n }\n var offset = element.getBoundingClientRect();\n var offsetX = e.pageX - document.body.scrollLeft;\n var offsetY = e.pageY - ((!document.body.scrollTop && document.documentElement) ?\n document.documentElement.scrollTop : document.body.scrollTop);\n var pageX = Math.max(Math.abs(offsetX - offset.left), Math.abs(offsetX - offset.right));\n var pageY = Math.max(Math.abs(offsetY - offset.top), Math.abs(offsetY - offset.bottom));\n var radius = Math.sqrt(pageX * pageX + pageY * pageY);\n var diameter = radius * 2 + 'px';\n var x = offsetX - offset.left - radius;\n var y = offsetY - offset.top - radius;\n if (this.rippleOptions && this.rippleOptions.isCenterRipple) {\n x = 0;\n y = 0;\n diameter = '100%';\n }\n element.classList.add('e-ripple');\n var duration = this.rippleOptions.duration.toString();\n var styles = 'width: ' + diameter + ';height: ' + diameter + ';left: ' + x + 'px;top: ' + y + 'px;' +\n 'transition-duration: ' + duration + 'ms;';\n var rippleElement = createElement('div', { className: 'e-ripple-element', styles: styles });\n element.appendChild(rippleElement);\n window.getComputedStyle(rippleElement).getPropertyValue('opacity');\n rippleElement.style.transform = 'scale(1)';\n if (element !== this.parent) {\n EventHandler.add(element, 'mouseleave', rippleLeaveHandler, { parent: this.parent, rippleOptions: this.rippleOptions });\n }\n}\n/**\n * Handler for ripple element mouse up event\n *\n * @param {MouseEvent} e ?\n * @returns {void} ?\n * @private\n */\nfunction rippleUpHandler(e) {\n removeRipple(e, this);\n}\n/**\n * Handler for ripple element mouse move event\n *\n * @param {MouseEvent} e ?\n * @returns {void} ?\n * @private\n */\nfunction rippleLeaveHandler(e) {\n removeRipple(e, this);\n}\n/**\n * Handler for removing ripple element\n *\n * @param {MouseEvent} e ?\n * @param {RippleArgs} eventArgs ?\n * @returns {void} ?\n * @private\n */\nfunction removeRipple(e, eventArgs) {\n var duration = eventArgs.rippleOptions.duration;\n var target = (e.target);\n var selector = eventArgs.rippleOptions.selector;\n var element = selector ? closest(target, selector) : target;\n if (!element || (element && element.className.indexOf('e-ripple') === -1)) {\n return;\n }\n var rippleElements = selectAll('.e-ripple-element', element);\n var rippleElement = rippleElements[rippleElements.length - 1];\n if (rippleElement) {\n rippleElement.style.opacity = '0.5';\n }\n if (eventArgs.parent !== element) {\n EventHandler.remove(element, 'mouseleave', rippleLeaveHandler);\n }\n /* tslint:disable:align */\n setTimeout(function () {\n if (rippleElement && rippleElement.parentNode) {\n rippleElement.parentNode.removeChild(rippleElement);\n }\n if (!element.getElementsByClassName('e-ripple-element').length) {\n element.classList.remove('e-ripple');\n }\n if (eventArgs.done) {\n eventArgs.done(e);\n }\n }, duration);\n}\nexport var isRippleEnabled = false;\n/**\n * Animation Module provides support to enable ripple effect functionality to Essential JS 2 components.\n *\n * @param {boolean} isRipple Specifies the boolean value to enable or disable ripple effect.\n * @returns {boolean} ?\n */\nexport function enableRipple(isRipple) {\n isRippleEnabled = isRipple;\n return isRippleEnabled;\n}\n","/**\n * Module loading operations\n */\nimport { createInstance, setValue, getValue, deleteObject } from './util';\nvar MODULE_SUFFIX = 'Module';\nvar ModuleLoader = /** @class */ (function () {\n function ModuleLoader(parent) {\n this.loadedModules = [];\n this.parent = parent;\n }\n /**\n * Inject required modules in component library\n *\n * @returns {void} ?\n * @param {ModuleDeclaration[]} requiredModules - Array of modules to be required\n * @param {Function[]} moduleList - Array of modules to be injected from sample side\n */\n ModuleLoader.prototype.inject = function (requiredModules, moduleList) {\n var reqLength = requiredModules.length;\n if (reqLength === 0) {\n this.clean();\n return;\n }\n if (this.loadedModules.length) {\n this.clearUnusedModule(requiredModules);\n }\n for (var i = 0; i < reqLength; i++) {\n var modl = requiredModules[i];\n for (var _i = 0, moduleList_1 = moduleList; _i < moduleList_1.length; _i++) {\n var module = moduleList_1[_i];\n var modName = modl.member;\n if (module.prototype.getModuleName() === modl.member && !this.isModuleLoaded(modName)) {\n var moduleObject = createInstance(module, modl.args);\n var memberName = this.getMemberName(modName);\n if (modl.isProperty) {\n setValue(memberName, module, this.parent);\n }\n else {\n setValue(memberName, moduleObject, this.parent);\n }\n var loadedModule = modl;\n loadedModule.member = memberName;\n this.loadedModules.push(loadedModule);\n }\n }\n }\n };\n /**\n * To remove the created object while destroying the control\n *\n * @returns {void}\n */\n ModuleLoader.prototype.clean = function () {\n for (var _i = 0, _a = this.loadedModules; _i < _a.length; _i++) {\n var modules = _a[_i];\n if (!modules.isProperty) {\n getValue(modules.member, this.parent).destroy();\n }\n }\n this.loadedModules = [];\n };\n /**\n * Removes all unused modules\n *\n * @param {ModuleDeclaration[]} moduleList ?\n * @returns {void} ?\n */\n ModuleLoader.prototype.clearUnusedModule = function (moduleList) {\n var _this = this;\n var usedModules = moduleList.map(function (arg) { return _this.getMemberName(arg.member); });\n var removableModule = this.loadedModules.filter(function (module) {\n return usedModules.indexOf(module.member) === -1;\n });\n for (var _i = 0, removableModule_1 = removableModule; _i < removableModule_1.length; _i++) {\n var mod = removableModule_1[_i];\n if (!mod.isProperty) {\n getValue(mod.member, this.parent).destroy();\n }\n this.loadedModules.splice(this.loadedModules.indexOf(mod), 1);\n deleteObject(this.parent, mod.member);\n }\n };\n /**\n * To get the name of the member.\n *\n * @param {string} name ?\n * @returns {string} ?\n */\n ModuleLoader.prototype.getMemberName = function (name) {\n return name[0].toLowerCase() + name.substring(1) + MODULE_SUFFIX;\n };\n /**\n * Returns boolean based on whether the module specified is loaded or not\n *\n * @param {string} modName ?\n * @returns {boolean} ?\n */\n ModuleLoader.prototype.isModuleLoaded = function (modName) {\n for (var _i = 0, _a = this.loadedModules; _i < _a.length; _i++) {\n var mod = _a[_i];\n if (mod.member === this.getMemberName(modName)) {\n return true;\n }\n }\n return false;\n };\n return ModuleLoader;\n}());\nexport { ModuleLoader };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { isUndefined, getValue, isNullOrUndefined, setValue, uniqueID, isBlazor } from './util';\nimport { ModuleLoader } from './module-loader';\nimport { Base } from './base';\nimport { Observer } from './observer';\nimport { ChildProperty } from './child-property';\nimport { Property, NotifyPropertyChanges } from './notify-property-change';\nimport { onIntlChange, rightToLeft, defaultCulture } from './internationalization';\nimport { createElement, addClass, removeClass, select } from './dom';\nvar componentCount = 0;\nvar lastPageID;\nvar lastHistoryLen = 0;\nexport var versionBasedStatePersistence = false;\n/**\n * To enable or disable version based statePersistence functionality for all components globally.\n *\n * @param {boolean} status - Optional argument Specifies the status value to enable or disable versionBasedStatePersistence option.\n * @returns {void}\n */\nexport function enableVersionBasedPersistence(status) {\n versionBasedStatePersistence = status;\n}\n/**\n * Base class for all Essential JavaScript components\n */\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n /**\n * Initialize the constructor for component base\n *\n * @param {Object} options ?\n * @param {string} selector ?\n */\n function Component(options, selector) {\n var _this = _super.call(this, options, selector) || this;\n _this.randomId = uniqueID();\n /**\n * string template option for Blazor template rendering\n *\n * @private\n */\n _this.isStringTemplate = false;\n _this.needsID = false;\n _this.isReactHybrid = false;\n if (isNullOrUndefined(_this.enableRtl)) {\n _this.setProperties({ 'enableRtl': rightToLeft }, true);\n }\n if (isNullOrUndefined(_this.locale)) {\n _this.setProperties({ 'locale': defaultCulture }, true);\n }\n _this.moduleLoader = new ModuleLoader(_this);\n _this.localObserver = new Observer(_this);\n // tslint:disable-next-line:no-function-constructor-with-string-args\n onIntlChange.on('notifyExternalChange', _this.detectFunction, _this, _this.randomId);\n if (!isUndefined(selector)) {\n _this.appendTo();\n }\n return _this;\n }\n Component.prototype.requiredModules = function () {\n return [];\n };\n /**\n * Destroys the sub modules while destroying the widget\n *\n * @returns {void} ?\n */\n Component.prototype.destroy = function () {\n if (this.isDestroyed) {\n return;\n }\n if (this.enablePersistence) {\n this.setPersistData();\n }\n this.localObserver.destroy();\n if (this.refreshing) {\n return;\n }\n removeClass([this.element], ['e-control']);\n this.trigger('destroyed', { cancel: false });\n _super.prototype.destroy.call(this);\n this.moduleLoader.clean();\n onIntlChange.off('notifyExternalChange', this.detectFunction, this.randomId);\n };\n /**\n * Applies all the pending property changes and render the component again.\n *\n * @returns {void} ?\n */\n Component.prototype.refresh = function () {\n this.refreshing = true;\n this.moduleLoader.clean();\n this.destroy();\n this.clearChanges();\n this.localObserver = new Observer(this);\n this.preRender();\n this.injectModules();\n this.render();\n this.refreshing = false;\n };\n Component.prototype.accessMount = function () {\n if (this.mount && !this.isReactHybrid) {\n this.mount();\n }\n };\n /**\n * Returns the route element of the component\n *\n * @returns {HTMLElement} ?\n */\n Component.prototype.getRootElement = function () {\n if (this.isReactHybrid) {\n // eslint-disable-next-line\n return this.actualElement;\n }\n else {\n return this.element;\n }\n };\n /**\n * Returns the persistence data for component\n *\n * @returns {any} ?\n */\n // eslint-disable-next-line\n Component.prototype.getLocalData = function () {\n var eleId = this.getModuleName() + this.element.id;\n if (versionBasedStatePersistence) {\n return window.localStorage.getItem(eleId + this.ej2StatePersistenceVersion);\n }\n else {\n return window.localStorage.getItem(eleId);\n }\n };\n /**\n * Appends the control within the given HTML element\n *\n * @param {string | HTMLElement} selector - Target element where control needs to be appended\n * @returns {void} ?\n */\n Component.prototype.appendTo = function (selector) {\n if (!isNullOrUndefined(selector) && typeof (selector) === 'string') {\n this.element = select(selector, document);\n }\n else if (!isNullOrUndefined(selector)) {\n this.element = selector;\n }\n if (!isNullOrUndefined(this.element)) {\n var moduleClass = 'e-' + this.getModuleName().toLowerCase();\n addClass([this.element], ['e-control', moduleClass]);\n this.isProtectedOnChange = false;\n if (this.needsID && !this.element.id) {\n this.element.id = this.getUniqueID(this.getModuleName());\n }\n if (this.enablePersistence) {\n this.mergePersistData();\n window.addEventListener('unload', this.setPersistData.bind(this));\n }\n var inst = getValue('ej2_instances', this.element);\n if (!inst || inst.indexOf(this) === -1) {\n _super.prototype.addInstance.call(this);\n }\n this.preRender();\n this.injectModules();\n this.render();\n if (!this.mount) {\n this.trigger('created');\n }\n else {\n this.accessMount();\n }\n }\n };\n /**\n * It is used to process the post rendering functionalities to a component.\n *\n * @param {Node} wrapperElement ?\n * @returns {void} ?\n */\n Component.prototype.renderComplete = function (wrapperElement) {\n if (isBlazor()) {\n var sfBlazor = 'sfBlazor';\n // eslint-disable-next-line\n window[sfBlazor].renderComplete(this.element, wrapperElement);\n }\n this.isRendered = true;\n };\n /**\n * When invoked, applies the pending property changes immediately to the component.\n *\n * @returns {void} ?\n */\n Component.prototype.dataBind = function () {\n this.injectModules();\n _super.prototype.dataBind.call(this);\n };\n /**\n * Attach one or more event handler to the current component context.\n * It is used for internal handling event internally within the component only.\n *\n * @param {BoundOptions[]| string} event - It is optional type either to Set the collection of event list or the eventName.\n * @param {Function} handler - optional parameter Specifies the handler to run when the event occurs\n * @param {Object} context - optional parameter Specifies the context to be bind in the handler.\n * @returns {void} ?\n * @private\n */\n Component.prototype.on = function (event, handler, context) {\n if (typeof event === 'string') {\n this.localObserver.on(event, handler, context);\n }\n else {\n for (var _i = 0, event_1 = event; _i < event_1.length; _i++) {\n var arg = event_1[_i];\n this.localObserver.on(arg.event, arg.handler, arg.context);\n }\n }\n };\n /**\n * To remove one or more event handler that has been attached with the on() method.\n *\n * @param {BoundOptions[]| string} event - It is optional type either to Set the collection of event list or the eventName.\n * @param {Function} handler - optional parameter Specifies the function to run when the event occurs\n * @returns {void} ?\n * @private\n */\n Component.prototype.off = function (event, handler) {\n if (typeof event === 'string') {\n this.localObserver.off(event, handler);\n }\n else {\n for (var _i = 0, event_2 = event; _i < event_2.length; _i++) {\n var arg = event_2[_i];\n this.localObserver.off(arg.event, arg.handler);\n }\n }\n };\n /**\n * To notify the handlers in the specified event.\n *\n * @param {string} property - Specifies the event to be notify.\n * @param {Object} argument - Additional parameters to pass while calling the handler.\n * @returns {void} ?\n * @private\n */\n Component.prototype.notify = function (property, argument) {\n if (this.isDestroyed !== true) {\n this.localObserver.notify(property, argument);\n }\n };\n /**\n * Get injected modules\n *\n * @returns {Function} ?\n * @private\n */\n Component.prototype.getInjectedModules = function () {\n return this.injectedModules;\n };\n /**\n * Dynamically injects the required modules to the component.\n *\n * @param {Function} moduleList ?\n * @returns {void} ?\n */\n Component.Inject = function () {\n var moduleList = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n moduleList[_i] = arguments[_i];\n }\n if (!this.prototype.injectedModules) {\n this.prototype.injectedModules = [];\n }\n for (var i = 0; i < moduleList.length; i++) {\n if (this.prototype.injectedModules.indexOf(moduleList[i]) === -1) {\n this.prototype.injectedModules.push(moduleList[i]);\n }\n }\n };\n /**\n * This is a instance method to create an element.\n *\n * @param {string} tagName ?\n * @param {ElementProperties} prop ?\n * @param {boolean} isVDOM ?\n * @returns {any} ?\n * @private\n */\n // eslint-disable-next-line\n Component.prototype.createElement = function (tagName, prop, isVDOM) {\n return createElement(tagName, prop);\n };\n /**\n *\n * @param {Function} handler - handler to be triggered after state Updated.\n * @param {any} argument - Arguments to be passed to caller.\n * @returns {void} .\n * @private\n */\n // eslint-disable-next-line\n Component.prototype.triggerStateChange = function (handler, argument) {\n if (this.isReactHybrid) {\n // eslint-disable-next-line\n this.setState();\n this.currentContext = { calls: handler, args: argument };\n }\n };\n // tslint: enable: no-any\n Component.prototype.injectModules = function () {\n if (this.injectedModules && this.injectedModules.length) {\n this.moduleLoader.inject(this.requiredModules(), this.injectedModules);\n }\n };\n Component.prototype.detectFunction = function (args) {\n var prop = Object.keys(args);\n if (prop.length) {\n this[prop[0]] = args[prop[0]];\n }\n };\n Component.prototype.mergePersistData = function () {\n var data;\n if (versionBasedStatePersistence) {\n data = window.localStorage.getItem(this.getModuleName() + this.element.id + this.ej2StatePersistenceVersion);\n }\n else {\n data = window.localStorage.getItem(this.getModuleName() + this.element.id);\n }\n if (!(isNullOrUndefined(data) || (data === ''))) {\n this.setProperties(JSON.parse(data), true);\n }\n };\n Component.prototype.setPersistData = function () {\n if (!this.isDestroyed) {\n if (versionBasedStatePersistence) {\n window.localStorage.setItem(this.getModuleName() +\n this.element.id + this.ej2StatePersistenceVersion, this.getPersistData());\n }\n else {\n window.localStorage.setItem(this.getModuleName() + this.element.id, this.getPersistData());\n }\n }\n };\n //tslint:disable-next-line\n Component.prototype.renderReactTemplates = function () {\n //No Code\n };\n // eslint-disable-next-line\n Component.prototype.clearTemplate = function (templateName, index) {\n //No Code\n };\n Component.prototype.getUniqueID = function (definedName) {\n if (this.isHistoryChanged()) {\n componentCount = 0;\n }\n lastPageID = this.pageID(location.href);\n lastHistoryLen = history.length;\n return definedName + '_' + lastPageID + '_' + componentCount++;\n };\n Component.prototype.pageID = function (url) {\n var hash = 0;\n if (url.length === 0) {\n return hash;\n }\n for (var i = 0; i < url.length; i++) {\n var char = url.charCodeAt(i);\n hash = ((hash << 5) - hash) + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return Math.abs(hash);\n };\n Component.prototype.isHistoryChanged = function () {\n return lastPageID !== this.pageID(location.href) || lastHistoryLen !== history.length;\n };\n Component.prototype.addOnPersist = function (options) {\n var _this = this;\n var persistObj = {};\n for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {\n var key = options_1[_i];\n var objValue = void 0;\n // eslint-disable-next-line\n objValue = getValue(key, this);\n if (!isUndefined(objValue)) {\n setValue(key, this.getActualProperties(objValue), persistObj);\n }\n }\n return JSON.stringify(persistObj, function (key, value) {\n return _this.getActualProperties(value);\n });\n };\n Component.prototype.getActualProperties = function (obj) {\n if (obj instanceof ChildProperty) {\n return getValue('properties', obj);\n }\n else {\n return obj;\n }\n };\n Component.prototype.ignoreOnPersist = function (options) {\n return JSON.stringify(this.iterateJsonProperties(this.properties, options));\n };\n Component.prototype.iterateJsonProperties = function (obj, ignoreList) {\n var newObj = {};\n var _loop_1 = function (key) {\n if (ignoreList.indexOf(key) === -1) {\n // eslint-disable-next-line\n var value = obj[key];\n if (typeof value === 'object' && !(value instanceof Array)) {\n var newList = ignoreList.filter(function (str) {\n return new RegExp(key + '.').test(str);\n }).map(function (str) {\n return str.replace(key + '.', '');\n });\n newObj[key] = this_1.iterateJsonProperties(this_1.getActualProperties(value), newList);\n }\n else {\n newObj[key] = value;\n }\n }\n };\n var this_1 = this;\n for (var _i = 0, _a = Object.keys(obj); _i < _a.length; _i++) {\n var key = _a[_i];\n _loop_1(key);\n }\n return newObj;\n };\n __decorate([\n Property(false)\n ], Component.prototype, \"enablePersistence\", void 0);\n __decorate([\n Property()\n ], Component.prototype, \"enableRtl\", void 0);\n __decorate([\n Property()\n ], Component.prototype, \"locale\", void 0);\n Component = __decorate([\n NotifyPropertyChanges\n ], Component);\n return Component;\n}(Base));\nexport { Component };\n//Function handling for page navigation detection\n/* istanbul ignore next */\n(function () {\n if (typeof window !== 'undefined') {\n window.addEventListener('popstate', \n /* istanbul ignore next */\n function () {\n componentCount = 0;\n });\n }\n})();\n","import { getValue, setValue, merge, isBlazor } from './util';\nimport { Base } from './base';\n/**\n * To detect the changes for inner properties.\n *\n * @private\n */\nvar ChildProperty = /** @class */ (function () {\n function ChildProperty(parent, propName, defaultValue, isArray) {\n this.isComplexArraySetter = false;\n this.properties = {};\n this.changedProperties = {};\n this.childChangedProperties = {};\n this.oldProperties = {};\n // eslint-disable-next-line\n this.finalUpdate = function () { };\n this.callChildDataBind = getValue('callChildDataBind', Base);\n this.parentObj = parent;\n this.controlParent = this.parentObj.controlParent || this.parentObj;\n this.propName = propName;\n this.isParentArray = isArray;\n this.setProperties(defaultValue, true);\n }\n /**\n * Updates the property changes\n *\n * @param {boolean} val ?\n * @param {string} propName ?\n * @returns {void} ?\n */\n ChildProperty.prototype.updateChange = function (val, propName) {\n if (val === true) {\n this.parentObj.childChangedProperties[propName] = val;\n }\n else {\n delete this.parentObj.childChangedProperties[propName];\n }\n if (this.parentObj.updateChange) {\n this.parentObj.updateChange(val, this.parentObj.propName);\n }\n };\n /**\n * Updates time out duration\n *\n * @returns {void} ?\n */\n ChildProperty.prototype.updateTimeOut = function () {\n if (this.parentObj.updateTimeOut) {\n this.parentObj.finalUpdate();\n this.parentObj.updateTimeOut();\n }\n else {\n var changeTime_1 = setTimeout(this.parentObj.dataBind.bind(this.parentObj));\n var clearUpdate = function () {\n clearTimeout(changeTime_1);\n };\n this.finalUpdate = clearUpdate;\n }\n };\n /**\n * Clears changed properties\n *\n * @returns {void} ?\n */\n ChildProperty.prototype.clearChanges = function () {\n this.finalUpdate();\n this.updateChange(false, this.propName);\n this.oldProperties = {};\n this.changedProperties = {};\n };\n /**\n * Set property changes\n *\n * @param {Object} prop ?\n * @param {boolean} muteOnChange ?\n * @returns {void} ?\n */\n ChildProperty.prototype.setProperties = function (prop, muteOnChange) {\n if (muteOnChange === true) {\n merge(this, prop);\n this.updateChange(false, this.propName);\n this.clearChanges();\n }\n else {\n merge(this, prop);\n }\n };\n /**\n * Binds data\n *\n * @returns {void} ?\n */\n ChildProperty.prototype.dataBind = function () {\n this.callChildDataBind(this.childChangedProperties, this);\n if (this.isParentArray) {\n var curIndex = this.parentObj[this.propName].indexOf(this);\n if (Object.keys(this.changedProperties).length) {\n setValue(this.propName + '.' + curIndex, this.changedProperties, this.parentObj.changedProperties);\n setValue(this.propName + '.' + curIndex, this.oldProperties, this.parentObj.oldProperties);\n }\n }\n else {\n this.parentObj.changedProperties[this.propName] = this.changedProperties;\n this.parentObj.oldProperties[this.propName] = this.oldProperties;\n }\n this.clearChanges();\n };\n /**\n * Saves changes to newer values\n *\n * @param {string} key ?\n * @param {Object} newValue ?\n * @param {Object} oldValue ?\n * @param {boolean} restrictServerDataBind ?\n * @returns {void} ?\n */\n ChildProperty.prototype.saveChanges = function (key, newValue, oldValue, restrictServerDataBind) {\n if (this.controlParent.isProtectedOnChange) {\n return;\n }\n if (!restrictServerDataBind) {\n this.serverDataBind(key, newValue, true);\n }\n this.oldProperties[key] = oldValue;\n this.changedProperties[key] = newValue;\n this.updateChange(true, this.propName);\n this.finalUpdate();\n this.updateTimeOut();\n };\n ChildProperty.prototype.serverDataBind = function (key, value, isSaveChanges, action) {\n if (isBlazor() && !this.parentObj.isComplexArraySetter) {\n var parent_1;\n var newChanges = {};\n var parentKey = isSaveChanges ? this.getParentKey(true) + '.' + key : key;\n /* istanbul ignore else */\n if (parentKey.indexOf('.') !== -1) {\n var complexKeys = parentKey.split('.');\n parent_1 = newChanges;\n for (var i = 0; i < complexKeys.length; i++) {\n var isFinal = i === complexKeys.length - 1;\n parent_1[complexKeys[i]] = isFinal ? value : {};\n parent_1 = isFinal ? parent_1 : parent_1[complexKeys[i]];\n }\n }\n else {\n newChanges[parentKey] = {};\n parent_1 = newChanges[parentKey];\n newChanges[parentKey][key] = value;\n }\n /* istanbul ignore next */\n if (this.isParentArray) {\n var actionProperty = 'ejsAction';\n parent_1[actionProperty] = action ? action : 'none';\n }\n this.controlParent.serverDataBind(newChanges);\n }\n };\n ChildProperty.prototype.getParentKey = function (isSaveChanges) {\n // eslint-disable-next-line\n var index = '';\n var propName = this.propName;\n /* istanbul ignore next */\n if (this.isParentArray) {\n index = this.parentObj[this.propName].indexOf(this);\n var valueLength = this.parentObj[this.propName].length;\n valueLength = isSaveChanges ? valueLength : (valueLength > 0 ? valueLength - 1 : 0);\n index = index !== -1 ? '-' + index : '-' + valueLength;\n propName = propName + index;\n }\n if (this.controlParent !== this.parentObj) {\n propName = this.parentObj.getParentKey() + '.' + this.propName + index;\n }\n return propName;\n };\n return ChildProperty;\n}());\nexport { ChildProperty };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Base } from './base';\nimport { Browser } from './browser';\nimport { isVisible } from './dom';\nimport { Property, Complex, NotifyPropertyChanges, Event } from './notify-property-change';\nimport { EventHandler } from './event-handler';\nimport { ChildProperty } from './child-property';\nimport { select, closest, setStyleAttribute, addClass, createElement } from './dom';\nimport { extend, isUndefined, isNullOrUndefined, compareElementParent, isBlazor } from './util';\nvar defaultPosition = { left: 0, top: 0, bottom: 0, right: 0 };\nvar positionProp = ['offsetLeft', 'offsetTop'];\nvar axisMapper = ['x', 'y'];\nvar axisValueMapper = ['left', 'top'];\nvar isDraggedObject = { isDragged: false };\n/**\n * Specifies the position coordinates\n */\nvar Position = /** @class */ (function (_super) {\n __extends(Position, _super);\n function Position() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(0)\n ], Position.prototype, \"left\", void 0);\n __decorate([\n Property(0)\n ], Position.prototype, \"top\", void 0);\n return Position;\n}(ChildProperty));\nexport { Position };\n/**\n * Draggable Module provides support to enable draggable functionality in Dom Elements.\n * ```html\n * Draggable
\n * \n * ```\n */\nvar Draggable = /** @class */ (function (_super) {\n __extends(Draggable, _super);\n function Draggable(element, options) {\n var _this = _super.call(this, options, element) || this;\n _this.dragLimit = Draggable_1.getDefaultPosition();\n _this.borderWidth = Draggable_1.getDefaultPosition();\n _this.padding = Draggable_1.getDefaultPosition();\n _this.diffX = 0;\n _this.prevLeft = 0;\n _this.prevTop = 0;\n _this.dragProcessStarted = false;\n /* tslint:disable no-any */\n _this.tapHoldTimer = 0;\n _this.externalInitialize = false;\n _this.diffY = 0;\n _this.parentScrollX = 0;\n _this.parentScrollY = 0;\n _this.droppables = {};\n _this.bind();\n return _this;\n }\n Draggable_1 = Draggable;\n Draggable.prototype.bind = function () {\n this.toggleEvents();\n if (Browser.isIE) {\n addClass([this.element], 'e-block-touch');\n }\n this.droppables[this.scope] = {};\n };\n Draggable.getDefaultPosition = function () {\n return extend({}, defaultPosition);\n };\n Draggable.prototype.toggleEvents = function (isUnWire) {\n var ele;\n if (!isUndefined(this.handle)) {\n ele = select(this.handle, this.element);\n }\n var handler = (this.enableTapHold && Browser.isDevice && Browser.isTouch) ? this.mobileInitialize : this.initialize;\n if (isUnWire) {\n EventHandler.remove(ele || this.element, Browser.touchStartEvent, handler);\n }\n else {\n EventHandler.add(ele || this.element, Browser.touchStartEvent, handler, this);\n }\n };\n /* istanbul ignore next */\n Draggable.prototype.mobileInitialize = function (evt) {\n var _this = this;\n var target = evt.currentTarget;\n this.tapHoldTimer = setTimeout(function () {\n _this.externalInitialize = true;\n _this.removeTapholdTimer();\n _this.initialize(evt, target);\n }, this.tapHoldThreshold);\n EventHandler.add(document, Browser.touchMoveEvent, this.removeTapholdTimer, this);\n EventHandler.add(document, Browser.touchEndEvent, this.removeTapholdTimer, this);\n };\n /* istanbul ignore next */\n Draggable.prototype.removeTapholdTimer = function () {\n clearTimeout(this.tapHoldTimer);\n EventHandler.remove(document, Browser.touchMoveEvent, this.removeTapholdTimer);\n EventHandler.remove(document, Browser.touchEndEvent, this.removeTapholdTimer);\n };\n /* istanbul ignore next */\n Draggable.prototype.getScrollableParent = function (element, axis) {\n var scroll = { 'vertical': 'scrollHeight', 'horizontal': 'scrollWidth' };\n var client = { 'vertical': 'clientHeight', 'horizontal': 'clientWidth' };\n if (isNullOrUndefined(element)) {\n return null;\n }\n if (element[scroll[axis]] > element[client[axis]]) {\n if (axis === 'vertical' ? element.scrollTop > 0 : element.scrollLeft > 0) {\n if (axis === 'vertical') {\n this.parentScrollY = this.parentScrollY +\n (this.parentScrollY === 0 ? element.scrollTop : element.scrollTop - this.parentScrollY);\n this.tempScrollHeight = element.scrollHeight;\n }\n else {\n this.parentScrollX = this.parentScrollX +\n (this.parentScrollX === 0 ? element.scrollLeft : element.scrollLeft - this.parentScrollX);\n this.tempScrollWidth = element.scrollWidth;\n }\n if (!isNullOrUndefined(element)) {\n return this.getScrollableParent(element.parentNode, axis);\n }\n else {\n return element;\n }\n }\n else {\n return this.getScrollableParent(element.parentNode, axis);\n }\n }\n else {\n return this.getScrollableParent(element.parentNode, axis);\n }\n };\n Draggable.prototype.getScrollableValues = function () {\n this.parentScrollX = 0;\n this.parentScrollY = 0;\n var isModalDialog = this.element.classList.contains('e-dialog') && this.element.classList.contains('e-dlg-modal');\n var verticalScrollParent = this.getScrollableParent(this.element.parentNode, 'vertical');\n var horizontalScrollParent = this.getScrollableParent(this.element.parentNode, 'horizontal');\n };\n Draggable.prototype.initialize = function (evt, curTarget) {\n this.currentStateTarget = evt.target;\n if (this.isDragStarted()) {\n return;\n }\n else {\n this.isDragStarted(true);\n this.externalInitialize = false;\n }\n this.target = (evt.currentTarget || curTarget);\n this.dragProcessStarted = false;\n if (this.abort) {\n /* tslint:disable no-any */\n var abortSelectors = this.abort;\n if (typeof abortSelectors === 'string') {\n abortSelectors = [abortSelectors];\n }\n for (var i = 0; i < abortSelectors.length; i++) {\n if (!isNullOrUndefined(closest(evt.target, abortSelectors[i]))) {\n /* istanbul ignore next */\n if (this.isDragStarted()) {\n this.isDragStarted(true);\n }\n return;\n }\n }\n }\n if (this.preventDefault && !isUndefined(evt.changedTouches) && evt.type !== 'touchstart') {\n evt.preventDefault();\n }\n this.element.setAttribute('aria-grabbed', 'true');\n var intCoord = this.getCoordinates(evt);\n this.initialPosition = { x: intCoord.pageX, y: intCoord.pageY };\n if (!this.clone) {\n var pos = this.element.getBoundingClientRect();\n this.getScrollableValues();\n if (evt.clientX === evt.pageX) {\n this.parentScrollX = 0;\n }\n if (evt.clientY === evt.pageY) {\n this.parentScrollY = 0;\n }\n this.relativeXPosition = intCoord.pageX - (pos.left + this.parentScrollX);\n this.relativeYPosition = intCoord.pageY - (pos.top + this.parentScrollY);\n }\n if (this.externalInitialize) {\n this.intDragStart(evt);\n }\n else {\n EventHandler.add(document, Browser.touchMoveEvent, this.intDragStart, this);\n EventHandler.add(document, Browser.touchEndEvent, this.intDestroy, this);\n }\n this.toggleEvents(true);\n if (evt.type !== 'touchstart' && this.isPreventSelect) {\n document.body.classList.add('e-prevent-select');\n }\n this.externalInitialize = false;\n EventHandler.trigger(document.documentElement, Browser.touchStartEvent, evt);\n };\n Draggable.prototype.intDragStart = function (evt) {\n this.removeTapholdTimer();\n var isChangeTouch = !isUndefined(evt.changedTouches);\n if (isChangeTouch && (evt.changedTouches.length !== 1)) {\n return;\n }\n if (isChangeTouch) {\n evt.preventDefault();\n }\n var intCordinate = this.getCoordinates(evt);\n var pos;\n var styleProp = getComputedStyle(this.element);\n this.margin = {\n left: parseInt(styleProp.marginLeft, 10),\n top: parseInt(styleProp.marginTop, 10),\n right: parseInt(styleProp.marginRight, 10),\n bottom: parseInt(styleProp.marginBottom, 10),\n };\n var element = this.element;\n if (this.clone && this.dragTarget) {\n var intClosest = closest(evt.target, this.dragTarget);\n if (!isNullOrUndefined(intClosest)) {\n element = intClosest;\n }\n }\n /* istanbul ignore next */\n if (this.isReplaceDragEle) {\n element = this.currentStateCheck(evt.target, element);\n }\n this.offset = this.calculateParentPosition(element);\n this.position = this.getMousePosition(evt, this.isDragScroll);\n var x = this.initialPosition.x - intCordinate.pageX;\n var y = this.initialPosition.y - intCordinate.pageY;\n var distance = Math.sqrt((x * x) + (y * y));\n if ((distance >= this.distance || this.externalInitialize)) {\n var ele = this.getHelperElement(evt);\n if (!ele || isNullOrUndefined(ele)) {\n return;\n }\n var dragTargetElement = this.helperElement = ele;\n this.parentClientRect = this.calculateParentPosition(dragTargetElement.offsetParent);\n if (this.dragStart) {\n var curTarget = this.getProperTargetElement(evt);\n var args = {\n event: evt,\n element: element,\n target: curTarget,\n bindEvents: isBlazor() ? this.bindDragEvents.bind(this) : null,\n dragElement: dragTargetElement\n };\n this.trigger('dragStart', args);\n }\n if (this.dragArea) {\n this.setDragArea();\n }\n else {\n this.dragLimit = { left: 0, right: 0, bottom: 0, top: 0 };\n this.borderWidth = { top: 0, left: 0 };\n }\n pos = { left: this.position.left - this.parentClientRect.left, top: this.position.top - this.parentClientRect.top };\n if (this.clone && !this.enableTailMode) {\n this.diffX = this.position.left - this.offset.left;\n this.diffY = this.position.top - this.offset.top;\n }\n this.getScrollableValues();\n // when drag element has margin-top\n var styles = getComputedStyle(element);\n var marginTop = parseFloat(styles.marginTop);\n /* istanbul ignore next */\n if (this.clone && marginTop !== 0) {\n pos.top += marginTop;\n }\n if (this.enableScrollHandler && !this.clone) {\n pos.top -= this.parentScrollY;\n pos.left -= this.parentScrollX;\n }\n var posValue = this.getProcessedPositionValue({\n top: (pos.top - this.diffY) + 'px',\n left: (pos.left - this.diffX) + 'px'\n });\n this.dragElePosition = { top: pos.top, left: pos.left };\n setStyleAttribute(dragTargetElement, this.getDragPosition({ position: 'absolute', left: posValue.left, top: posValue.top }));\n EventHandler.remove(document, Browser.touchMoveEvent, this.intDragStart);\n EventHandler.remove(document, Browser.touchEndEvent, this.intDestroy);\n if (!isBlazor()) {\n this.bindDragEvents(dragTargetElement);\n }\n }\n };\n Draggable.prototype.bindDragEvents = function (dragTargetElement) {\n if (isVisible(dragTargetElement)) {\n EventHandler.add(document, Browser.touchMoveEvent, this.intDrag, this);\n EventHandler.add(document, Browser.touchEndEvent, this.intDragStop, this);\n this.setGlobalDroppables(false, this.element, dragTargetElement);\n }\n else {\n this.toggleEvents();\n document.body.classList.remove('e-prevent-select');\n }\n };\n Draggable.prototype.elementInViewport = function (el) {\n this.top = el.offsetTop;\n this.left = el.offsetLeft;\n this.width = el.offsetWidth;\n this.height = el.offsetHeight;\n while (el.offsetParent) {\n el = el.offsetParent;\n this.top += el.offsetTop;\n this.left += el.offsetLeft;\n }\n return (this.top >= window.pageYOffset &&\n this.left >= window.pageXOffset &&\n (this.top + this.height) <= (window.pageYOffset + window.innerHeight) &&\n (this.left + this.width) <= (window.pageXOffset + window.innerWidth));\n };\n Draggable.prototype.getProcessedPositionValue = function (value) {\n if (this.queryPositionInfo) {\n return this.queryPositionInfo(value);\n }\n return value;\n };\n Draggable.prototype.calculateParentPosition = function (ele) {\n if (isNullOrUndefined(ele)) {\n return { left: 0, top: 0 };\n }\n var rect = ele.getBoundingClientRect();\n var style = getComputedStyle(ele);\n return {\n left: (rect.left + window.pageXOffset) - parseInt(style.marginLeft, 10),\n top: (rect.top + window.pageYOffset) - parseInt(style.marginTop, 10)\n };\n };\n // tslint:disable-next-line:max-func-body-length\n Draggable.prototype.intDrag = function (evt) {\n if (!isUndefined(evt.changedTouches) && (evt.changedTouches.length !== 1)) {\n return;\n }\n var left;\n var top;\n this.position = this.getMousePosition(evt, this.isDragScroll);\n var docHeight = this.getDocumentWidthHeight('Height');\n if (docHeight < this.position.top) {\n this.position.top = docHeight;\n }\n var docWidth = this.getDocumentWidthHeight('Width');\n if (docWidth < this.position.left) {\n this.position.left = docWidth;\n }\n if (this.drag) {\n var curTarget = this.getProperTargetElement(evt);\n this.trigger('drag', { event: evt, element: this.element, target: curTarget });\n }\n var eleObj = this.checkTargetElement(evt);\n if (eleObj.target && eleObj.instance) {\n /* tslint:disable no-any */\n var flag = true;\n if (this.hoverObject) {\n if (this.hoverObject.instance !== eleObj.instance) {\n this.triggerOutFunction(evt, eleObj);\n }\n else {\n flag = false;\n }\n }\n if (flag) {\n eleObj.instance.dragData[this.scope] = this.droppables[this.scope];\n eleObj.instance.intOver(evt, eleObj.target);\n this.hoverObject = eleObj;\n }\n }\n else if (this.hoverObject) {\n this.triggerOutFunction(evt, eleObj);\n }\n var helperElement = this.droppables[this.scope].helper;\n this.parentClientRect = this.calculateParentPosition(this.helperElement.offsetParent);\n var tLeft = this.parentClientRect.left;\n var tTop = this.parentClientRect.top;\n var intCoord = this.getCoordinates(evt);\n var pagex = intCoord.pageX;\n var pagey = intCoord.pageY;\n var dLeft = this.position.left - this.diffX;\n var dTop = this.position.top - this.diffY;\n var styles = getComputedStyle(helperElement);\n var marginTop = parseFloat(styles.marginTop);\n if (this.dragArea) {\n if (this.pageX !== pagex || this.skipDistanceCheck) {\n var helperWidth = helperElement.offsetWidth + (parseFloat(styles.marginLeft)\n + parseFloat(styles.marginRight));\n if (this.dragLimit.left > dLeft && dLeft > 0) {\n left = this.dragLimit.left;\n }\n else if (this.dragLimit.right + window.pageXOffset < dLeft + helperWidth && dLeft > 0) {\n left = dLeft - (dLeft - this.dragLimit.right) + window.pageXOffset - helperWidth;\n }\n else {\n left = dLeft < 0 ? this.dragLimit.left : dLeft;\n }\n }\n if (this.pageY !== pagey || this.skipDistanceCheck) {\n var helperHeight = helperElement.offsetHeight + (parseFloat(styles.marginTop)\n + parseFloat(styles.marginBottom));\n if (this.dragLimit.top > dTop && dTop > 0) {\n top = this.dragLimit.top;\n }\n else if (this.dragLimit.bottom + window.pageYOffset < dTop + helperHeight && dTop > 0) {\n top = dTop - (dTop - this.dragLimit.bottom) + window.pageYOffset - helperHeight;\n }\n else {\n top = dTop < 0 ? this.dragLimit.top : dTop;\n }\n }\n }\n else {\n left = dLeft;\n top = dTop;\n }\n var iTop = tTop + this.borderWidth.top;\n var iLeft = tLeft + this.borderWidth.left;\n if (this.dragProcessStarted) {\n if (isNullOrUndefined(top)) {\n top = this.prevTop;\n }\n if (isNullOrUndefined(left)) {\n left = this.prevLeft;\n }\n }\n var draEleTop;\n var draEleLeft;\n if (this.dragArea) {\n this.dragLimit.top = this.clone ? this.dragLimit.top : 0;\n draEleTop = (top - iTop) < 0 ? this.dragLimit.top : (top - iTop);\n draEleLeft = (left - iLeft) < 0 ? this.dragElePosition.left : (left - iLeft);\n // when drag-element has margin-top\n /* istanbul ignore next */\n if (marginTop > 0) {\n if (this.clone) {\n draEleTop += this.element.offsetTop;\n if (dTop < 0) {\n if ((this.element.offsetTop + dTop) >= 0) {\n draEleTop = this.element.offsetTop + dTop;\n }\n else {\n draEleTop -= this.element.offsetTop;\n }\n }\n draEleTop = (this.dragLimit.bottom < draEleTop) ? this.dragLimit.bottom : draEleTop;\n }\n if ((top - iTop) < 0) {\n if (dTop + marginTop + (helperElement.offsetHeight - iTop) >= 0) {\n var tempDraEleTop = this.dragLimit.top + dTop - iTop;\n if ((tempDraEleTop + marginTop + iTop) < 0) {\n draEleTop -= marginTop + iTop;\n }\n else {\n draEleTop = tempDraEleTop;\n }\n }\n else {\n draEleTop -= marginTop + iTop;\n }\n }\n }\n }\n else {\n draEleTop = top - iTop;\n draEleLeft = left - iLeft;\n }\n if (this.enableScrollHandler && !this.clone) {\n draEleTop -= this.parentScrollY;\n draEleLeft -= this.parentScrollX;\n }\n var dragValue = this.getProcessedPositionValue({ top: draEleTop + 'px', left: draEleLeft + 'px' });\n setStyleAttribute(helperElement, this.getDragPosition(dragValue));\n if (!this.elementInViewport(helperElement) && this.enableAutoScroll) {\n this.helperElement.scrollIntoView();\n }\n this.dragProcessStarted = true;\n this.prevLeft = left;\n this.prevTop = top;\n this.position.left = left;\n this.position.top = top;\n this.pageX = pagex;\n this.pageY = pagey;\n };\n Draggable.prototype.triggerOutFunction = function (evt, eleObj) {\n this.hoverObject.instance.intOut(evt, eleObj.target);\n this.hoverObject.instance.dragData[this.scope] = null;\n this.hoverObject = null;\n };\n Draggable.prototype.getDragPosition = function (dragValue) {\n var temp = extend({}, dragValue);\n if (this.axis) {\n if (this.axis === 'x') {\n delete temp.top;\n }\n else if (this.axis === 'y') {\n delete temp.left;\n }\n }\n return temp;\n };\n Draggable.prototype.getDocumentWidthHeight = function (str) {\n var docBody = document.body;\n var docEle = document.documentElement;\n var returnValue = Math.max(docBody['scroll' + str], docEle['scroll' + str], docBody['offset' + str], docEle['offset' + str], docEle['client' + str]);\n return returnValue;\n };\n Draggable.prototype.intDragStop = function (evt) {\n this.dragProcessStarted = false;\n if (!isUndefined(evt.changedTouches) && (evt.changedTouches.length !== 1)) {\n return;\n }\n var type = ['touchend', 'pointerup', 'mouseup'];\n if (type.indexOf(evt.type) !== -1) {\n if (this.dragStop) {\n var curTarget = this.getProperTargetElement(evt);\n this.trigger('dragStop', { event: evt, element: this.element, target: curTarget, helper: this.helperElement });\n }\n this.intDestroy(evt);\n }\n else {\n this.element.setAttribute('aria-grabbed', 'false');\n }\n var eleObj = this.checkTargetElement(evt);\n if (eleObj.target && eleObj.instance) {\n eleObj.instance.dragStopCalled = true;\n eleObj.instance.dragData[this.scope] = this.droppables[this.scope];\n eleObj.instance.intDrop(evt, eleObj.target);\n }\n this.setGlobalDroppables(true);\n document.body.classList.remove('e-prevent-select');\n };\n /**\n * @private\n */\n Draggable.prototype.intDestroy = function (evt) {\n this.dragProcessStarted = false;\n this.toggleEvents();\n document.body.classList.remove('e-prevent-select');\n this.element.setAttribute('aria-grabbed', 'false');\n EventHandler.remove(document, Browser.touchMoveEvent, this.intDragStart);\n EventHandler.remove(document, Browser.touchEndEvent, this.intDragStop);\n EventHandler.remove(document, Browser.touchEndEvent, this.intDestroy);\n EventHandler.remove(document, Browser.touchMoveEvent, this.intDrag);\n if (this.isDragStarted()) {\n this.isDragStarted(true);\n }\n };\n // triggers when property changed\n Draggable.prototype.onPropertyChanged = function (newProp, oldProp) {\n //No Code to handle\n };\n Draggable.prototype.getModuleName = function () {\n return 'draggable';\n };\n Draggable.prototype.isDragStarted = function (change) {\n if (change) {\n isDraggedObject.isDragged = !isDraggedObject.isDragged;\n }\n return isDraggedObject.isDragged;\n };\n Draggable.prototype.setDragArea = function () {\n var eleWidthBound;\n var eleHeightBound;\n var top = 0;\n var left = 0;\n var ele;\n var type = typeof this.dragArea;\n if (type === 'string') {\n ele = select(this.dragArea);\n }\n else {\n ele = this.dragArea;\n }\n if (ele) {\n var elementArea = ele.getBoundingClientRect();\n eleWidthBound = ele.scrollWidth ? ele.scrollWidth : elementArea.right - elementArea.left;\n eleHeightBound = ele.scrollHeight ? ele.scrollHeight : elementArea.bottom - elementArea.top;\n var keys = ['Top', 'Left', 'Bottom', 'Right'];\n var styles = getComputedStyle(ele);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var tborder = styles['border' + key + 'Width'];\n var tpadding = styles['padding' + key];\n var lowerKey = key.toLowerCase();\n this.borderWidth[lowerKey] = isNaN(parseFloat(tborder)) ? 0 : parseFloat(tborder);\n this.padding[lowerKey] = isNaN(parseFloat(tpadding)) ? 0 : parseFloat(tpadding);\n }\n top = elementArea.top;\n left = elementArea.left;\n this.dragLimit.left = left + this.borderWidth.left + this.padding.left;\n this.dragLimit.top = ele.offsetTop + this.borderWidth.top + this.padding.top;\n this.dragLimit.right = left + eleWidthBound - (this.borderWidth.right + this.padding.right);\n this.dragLimit.bottom = top + eleHeightBound - (this.borderWidth.bottom + this.padding.bottom);\n }\n };\n Draggable.prototype.getProperTargetElement = function (evt) {\n var intCoord = this.getCoordinates(evt);\n var ele;\n var prevStyle = this.helperElement.style.pointerEvents || '';\n if (compareElementParent(evt.target, this.helperElement) || evt.type.indexOf('touch') !== -1) {\n this.helperElement.style.pointerEvents = 'none';\n ele = document.elementFromPoint(intCoord.clientX, intCoord.clientY);\n this.helperElement.style.pointerEvents = prevStyle;\n }\n else {\n ele = evt.target;\n }\n return ele;\n };\n /* istanbul ignore next */\n Draggable.prototype.currentStateCheck = function (ele, oldEle) {\n var elem;\n if (!isNullOrUndefined(this.currentStateTarget) && this.currentStateTarget !== ele) {\n elem = this.currentStateTarget;\n }\n else {\n elem = !isNullOrUndefined(oldEle) ? oldEle : ele;\n }\n return elem;\n };\n Draggable.prototype.getMousePosition = function (evt, isdragscroll) {\n /* tslint:disable no-any */\n var dragEle = evt.srcElement !== undefined ? evt.srcElement : evt.target;\n var intCoord = this.getCoordinates(evt);\n var pageX;\n var pageY;\n var isOffsetParent = isNullOrUndefined(dragEle.offsetParent);\n /* istanbul ignore next */\n if (isdragscroll) {\n pageX = this.clone ? intCoord.pageX :\n (intCoord.pageX + (isOffsetParent ? 0 : dragEle.offsetParent.scrollLeft)) - this.relativeXPosition;\n pageY = this.clone ? intCoord.pageY :\n (intCoord.pageY + (isOffsetParent ? 0 : dragEle.offsetParent.scrollTop)) - this.relativeYPosition;\n }\n else {\n pageX = this.clone ? intCoord.pageX : (intCoord.pageX + window.pageXOffset) - this.relativeXPosition;\n pageY = this.clone ? intCoord.pageY : (intCoord.pageY + window.pageYOffset) - this.relativeYPosition;\n }\n if (!this.clone && this.dragArea && !isdragscroll) {\n this.getScrollableValues();\n pageY -= this.tempScrollHeight ? this.parentScrollY : 0;\n pageX -= this.tempScrollWidth ? this.parentScrollX : 0;\n }\n return {\n left: pageX - (this.margin.left + this.cursorAt.left),\n top: pageY - (this.margin.top + this.cursorAt.top)\n };\n };\n Draggable.prototype.getCoordinates = function (evt) {\n if (evt.type.indexOf('touch') > -1) {\n return evt.changedTouches[0];\n }\n return evt;\n };\n Draggable.prototype.getHelperElement = function (evt) {\n var element;\n if (this.clone) {\n if (this.helper) {\n element = this.helper({ sender: evt, element: this.target });\n }\n else {\n element = createElement('div', { className: 'e-drag-helper e-block-touch', innerHTML: 'Draggable' });\n document.body.appendChild(element);\n }\n }\n else {\n element = this.element;\n }\n return element;\n };\n Draggable.prototype.setGlobalDroppables = function (reset, drag, helper) {\n this.droppables[this.scope] = reset ? null : {\n draggable: drag,\n helper: helper,\n draggedElement: this.element\n };\n };\n Draggable.prototype.checkTargetElement = function (evt) {\n var target = this.getProperTargetElement(evt);\n var dropIns = this.getDropInstance(target);\n if (!dropIns && target && !isNullOrUndefined(target.parentNode)) {\n var parent_1 = closest(target.parentNode, '.e-droppable') || target.parentElement;\n if (parent_1) {\n dropIns = this.getDropInstance(parent_1);\n }\n }\n return { target: target, instance: dropIns };\n };\n Draggable.prototype.getDropInstance = function (ele) {\n var name = 'getModuleName';\n var drop;\n var eleInst = ele && ele.ej2_instances;\n if (eleInst) {\n for (var _i = 0, eleInst_1 = eleInst; _i < eleInst_1.length; _i++) {\n var inst = eleInst_1[_i];\n if (inst[name]() === 'droppable') {\n drop = inst;\n break;\n }\n }\n }\n return drop;\n };\n Draggable.prototype.destroy = function () {\n this.toggleEvents(true);\n _super.prototype.destroy.call(this);\n };\n var Draggable_1;\n __decorate([\n Complex({}, Position)\n ], Draggable.prototype, \"cursorAt\", void 0);\n __decorate([\n Property(true)\n ], Draggable.prototype, \"clone\", void 0);\n __decorate([\n Property()\n ], Draggable.prototype, \"dragArea\", void 0);\n __decorate([\n Property()\n ], Draggable.prototype, \"isDragScroll\", void 0);\n __decorate([\n Property()\n ], Draggable.prototype, \"isReplaceDragEle\", void 0);\n __decorate([\n Property(true)\n ], Draggable.prototype, \"isPreventSelect\", void 0);\n __decorate([\n Event()\n ], Draggable.prototype, \"drag\", void 0);\n __decorate([\n Event()\n ], Draggable.prototype, \"dragStart\", void 0);\n __decorate([\n Event()\n ], Draggable.prototype, \"dragStop\", void 0);\n __decorate([\n Property(1)\n ], Draggable.prototype, \"distance\", void 0);\n __decorate([\n Property()\n ], Draggable.prototype, \"handle\", void 0);\n __decorate([\n Property()\n ], Draggable.prototype, \"abort\", void 0);\n __decorate([\n Property()\n ], Draggable.prototype, \"helper\", void 0);\n __decorate([\n Property('default')\n ], Draggable.prototype, \"scope\", void 0);\n __decorate([\n Property('')\n ], Draggable.prototype, \"dragTarget\", void 0);\n __decorate([\n Property()\n ], Draggable.prototype, \"axis\", void 0);\n __decorate([\n Property()\n ], Draggable.prototype, \"queryPositionInfo\", void 0);\n __decorate([\n Property(false)\n ], Draggable.prototype, \"enableTailMode\", void 0);\n __decorate([\n Property(false)\n ], Draggable.prototype, \"skipDistanceCheck\", void 0);\n __decorate([\n Property(true)\n ], Draggable.prototype, \"preventDefault\", void 0);\n __decorate([\n Property(false)\n ], Draggable.prototype, \"enableAutoScroll\", void 0);\n __decorate([\n Property(false)\n ], Draggable.prototype, \"enableTapHold\", void 0);\n __decorate([\n Property(750)\n ], Draggable.prototype, \"tapHoldThreshold\", void 0);\n __decorate([\n Property(false)\n ], Draggable.prototype, \"enableScrollHandler\", void 0);\n Draggable = Draggable_1 = __decorate([\n NotifyPropertyChanges\n ], Draggable);\n return Draggable;\n}(Base));\nexport { Draggable };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Base } from './base';\nimport { Browser } from './browser';\nimport { isVisible, matches } from './dom';\nimport { Property, NotifyPropertyChanges, Event } from './notify-property-change';\nimport { EventHandler } from './event-handler';\nimport { compareElementParent } from './util';\n/**\n * Droppable Module provides support to enable droppable functionality in Dom Elements.\n * ```html\n * Droppable
\n * \n * ```\n */\nvar Droppable = /** @class */ (function (_super) {\n __extends(Droppable, _super);\n function Droppable(element, options) {\n var _this = _super.call(this, options, element) || this;\n _this.mouseOver = false;\n _this.dragData = {};\n _this.dragStopCalled = false;\n _this.bind();\n return _this;\n }\n Droppable.prototype.bind = function () {\n this.wireEvents();\n };\n Droppable.prototype.wireEvents = function () {\n EventHandler.add(this.element, Browser.touchEndEvent, this.intDrop, this);\n };\n // triggers when property changed\n // eslint-disable-next-line\n Droppable.prototype.onPropertyChanged = function (newProp, oldProp) {\n //No Code to handle\n };\n Droppable.prototype.getModuleName = function () {\n return 'droppable';\n };\n Droppable.prototype.intOver = function (event, element) {\n if (!this.mouseOver) {\n var drag = this.dragData[this.scope];\n this.trigger('over', { event: event, target: element, dragData: drag });\n this.mouseOver = true;\n }\n };\n Droppable.prototype.intOut = function (event, element) {\n if (this.mouseOver) {\n this.trigger('out', { evt: event, target: element });\n this.mouseOver = false;\n }\n };\n Droppable.prototype.intDrop = function (evt, element) {\n if (!this.dragStopCalled) {\n return;\n }\n else {\n this.dragStopCalled = false;\n }\n var accept = true;\n var drag = this.dragData[this.scope];\n var isDrag = drag ? (drag.helper && isVisible(drag.helper)) : false;\n var area;\n if (isDrag) {\n area = this.isDropArea(evt, drag.helper, element);\n if (this.accept) {\n accept = matches(drag.helper, this.accept);\n }\n }\n if (isDrag && this.drop && area.canDrop && accept) {\n this.trigger('drop', { event: evt, target: area.target, droppedElement: drag.helper, dragData: drag });\n }\n this.mouseOver = false;\n };\n Droppable.prototype.isDropArea = function (evt, helper, element) {\n var area = { canDrop: true, target: element || evt.target };\n var isTouch = evt.type === 'touchend';\n if (isTouch || area.target === helper) {\n helper.style.display = 'none';\n var coord = isTouch ? (evt.changedTouches[0]) : evt;\n var ele = document.elementFromPoint(coord.clientX, coord.clientY);\n area.canDrop = false;\n area.canDrop = compareElementParent(ele, this.element);\n if (area.canDrop) {\n area.target = ele;\n }\n helper.style.display = '';\n }\n return area;\n };\n Droppable.prototype.destroy = function () {\n EventHandler.remove(this.element, Browser.touchEndEvent, this.intDrop);\n _super.prototype.destroy.call(this);\n };\n __decorate([\n Property()\n ], Droppable.prototype, \"accept\", void 0);\n __decorate([\n Property('default')\n ], Droppable.prototype, \"scope\", void 0);\n __decorate([\n Event()\n ], Droppable.prototype, \"drop\", void 0);\n __decorate([\n Event()\n ], Droppable.prototype, \"over\", void 0);\n __decorate([\n Event()\n ], Droppable.prototype, \"out\", void 0);\n Droppable = __decorate([\n NotifyPropertyChanges\n ], Droppable);\n return Droppable;\n}(Base));\nexport { Droppable };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, NotifyPropertyChanges, Event } from './notify-property-change';\nimport { Base } from './base';\nvar keyCode = {\n 'backspace': 8,\n 'tab': 9,\n 'enter': 13,\n 'shift': 16,\n 'control': 17,\n 'alt': 18,\n 'pause': 19,\n 'capslock': 20,\n 'space': 32,\n 'escape': 27,\n 'pageup': 33,\n 'pagedown': 34,\n 'end': 35,\n 'home': 36,\n 'leftarrow': 37,\n 'uparrow': 38,\n 'rightarrow': 39,\n 'downarrow': 40,\n 'insert': 45,\n 'delete': 46,\n 'f1': 112,\n 'f2': 113,\n 'f3': 114,\n 'f4': 115,\n 'f5': 116,\n 'f6': 117,\n 'f7': 118,\n 'f8': 119,\n 'f9': 120,\n 'f10': 121,\n 'f11': 122,\n 'f12': 123,\n 'semicolon': 186,\n 'plus': 187,\n 'comma': 188,\n 'minus': 189,\n 'dot': 190,\n 'forwardslash': 191,\n 'graveaccent': 192,\n 'openbracket': 219,\n 'backslash': 220,\n 'closebracket': 221,\n 'singlequote': 222\n};\n/**\n * KeyboardEvents class enables you to bind key action desired key combinations for ex., Ctrl+A, Delete, Alt+Space etc.\n * ```html\n *
;\n * \n * ```\n */\nvar KeyboardEvents = /** @class */ (function (_super) {\n __extends(KeyboardEvents, _super);\n /**\n * Initializes the KeyboardEvents\n *\n * @param {HTMLElement} element ?\n * @param {KeyboardEventsModel} options ?\n */\n function KeyboardEvents(element, options) {\n var _this = _super.call(this, options, element) || this;\n /**\n * To handle a key press event returns null\n *\n * @param {KeyboardEventArgs} e ?\n * @returns {void} ?\n */\n _this.keyPressHandler = function (e) {\n var isAltKey = e.altKey;\n var isCtrlKey = e.ctrlKey;\n var isShiftKey = e.shiftKey;\n var curkeyCode = e.which;\n var keys = Object.keys(_this.keyConfigs);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n var configCollection = _this.keyConfigs[key].split(',');\n for (var _a = 0, configCollection_1 = configCollection; _a < configCollection_1.length; _a++) {\n var rconfig = configCollection_1[_a];\n var rKeyObj = KeyboardEvents_1.getKeyConfigData(rconfig.trim());\n if (isAltKey === rKeyObj.altKey && isCtrlKey === rKeyObj.ctrlKey &&\n isShiftKey === rKeyObj.shiftKey && curkeyCode === rKeyObj.keyCode) {\n e.action = key;\n if (_this.keyAction) {\n _this.keyAction(e);\n }\n }\n }\n }\n };\n _this.bind();\n return _this;\n }\n KeyboardEvents_1 = KeyboardEvents;\n /**\n * Unwire bound events and destroy the instance.\n *\n * @returns {void} ?\n */\n KeyboardEvents.prototype.destroy = function () {\n this.unwireEvents();\n _super.prototype.destroy.call(this);\n };\n /**\n * Function can be used to specify certain action if a property is changed\n *\n * @param {KeyboardEventsModel} newProp ?\n * @param {KeyboardEventsModel} oldProp ?\n * @returns {void} ?\n * @private\n */\n // eslint-disable-next-line\n KeyboardEvents.prototype.onPropertyChanged = function (newProp, oldProp) {\n // No code are needed\n };\n KeyboardEvents.prototype.bind = function () {\n this.wireEvents();\n };\n /**\n * To get the module name, returns 'keyboard'.\n *\n * @returns {string} ?\n * @private\n */\n KeyboardEvents.prototype.getModuleName = function () {\n return 'keyboard';\n };\n /**\n * Wiring event handlers to events\n *\n * @returns {void} ?\n * @private\n */\n KeyboardEvents.prototype.wireEvents = function () {\n this.element.addEventListener(this.eventName, this.keyPressHandler);\n };\n /**\n * Unwiring event handlers to events\n *\n * @returns {void} ?\n * @private\n */\n KeyboardEvents.prototype.unwireEvents = function () {\n this.element.removeEventListener(this.eventName, this.keyPressHandler);\n };\n /**\n * To get the key configuration data\n *\n * @param {string} config - configuration data\n * @returns {KeyData} ?\n */\n KeyboardEvents.getKeyConfigData = function (config) {\n if (config in this.configCache) {\n return this.configCache[config];\n }\n var keys = config.toLowerCase().split('+');\n var keyData = {\n altKey: (keys.indexOf('alt') !== -1 ? true : false),\n ctrlKey: (keys.indexOf('ctrl') !== -1 ? true : false),\n shiftKey: (keys.indexOf('shift') !== -1 ? true : false),\n keyCode: null\n };\n if (keys[keys.length - 1].length > 1 && !!Number(keys[keys.length - 1])) {\n keyData.keyCode = Number(keys[keys.length - 1]);\n }\n else {\n keyData.keyCode = KeyboardEvents_1.getKeyCode(keys[keys.length - 1]);\n }\n KeyboardEvents_1.configCache[config] = keyData;\n return keyData;\n };\n // Return the keycode value as string\n KeyboardEvents.getKeyCode = function (keyVal) {\n return keyCode[keyVal] || keyVal.toUpperCase().charCodeAt(0);\n };\n var KeyboardEvents_1;\n KeyboardEvents.configCache = {};\n __decorate([\n Property({})\n ], KeyboardEvents.prototype, \"keyConfigs\", void 0);\n __decorate([\n Property('keyup')\n ], KeyboardEvents.prototype, \"eventName\", void 0);\n __decorate([\n Event()\n ], KeyboardEvents.prototype, \"keyAction\", void 0);\n KeyboardEvents = KeyboardEvents_1 = __decorate([\n NotifyPropertyChanges\n ], KeyboardEvents);\n return KeyboardEvents;\n}(Base));\nexport { KeyboardEvents };\n","import { extend, isNullOrUndefined } from './util';\nimport { defaultCulture } from './internationalization';\n/**\n * L10n modules provides localized text for different culture.\n * ```typescript\n * import {setCulture} from '@syncfusion/ts-base-library';\n * //load global locale object common for all components.\n * L10n.load({\n * 'fr-BE': {\n * 'button': {\n * 'check': 'vérifié'\n * }\n * }\n * });\n * //set globale default locale culture.\n * setCulture('fr-BE');\n * let instance: L10n = new L10n('button', {\n * check: 'checked'\n * });\n * //Get locale text for current property.\n * instance.getConstant('check');\n * //Change locale culture in a component.\n * instance.setLocale('en-US');\n * ```\n */\nvar L10n = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param {string} controlName ?\n * @param {Object} localeStrings ?\n * @param {string} locale ?\n */\n function L10n(controlName, localeStrings, locale) {\n this.controlName = controlName;\n this.localeStrings = localeStrings;\n this.setLocale(locale || defaultCulture);\n }\n /**\n * Sets the locale text\n *\n * @param {string} locale ?\n * @returns {void} ?\n */\n L10n.prototype.setLocale = function (locale) {\n var intLocale = this.intGetControlConstant(L10n.locale, locale);\n this.currentLocale = intLocale || this.localeStrings;\n };\n /**\n * Sets the global locale for all components.\n *\n * @param {Object} localeObject - specifies the localeObject to be set as global locale.\n * @returns {void} ?\n */\n L10n.load = function (localeObject) {\n this.locale = extend(this.locale, localeObject, {}, true);\n };\n /**\n * Returns current locale text for the property based on the culture name and control name.\n *\n * @param {string} prop - specifies the property for which localize text to be returned.\n * @returns {string} ?\n */\n L10n.prototype.getConstant = function (prop) {\n // Removed conditional operator because this method does not return correct value when passing 0 as value in localization\n if (!isNullOrUndefined(this.currentLocale[prop])) {\n return this.currentLocale[prop];\n }\n else {\n return this.localeStrings[prop] || '';\n }\n };\n /**\n * Returns the control constant object for current object and the locale specified.\n *\n * @param {Object} curObject ?\n * @param {string} locale ?\n * @returns {Object} ?\n */\n L10n.prototype.intGetControlConstant = function (curObject, locale) {\n if ((curObject)[locale]) {\n return (curObject)[locale][this.controlName];\n }\n return null;\n };\n L10n.locale = {};\n return L10n;\n}());\nexport { L10n };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { extend } from './util';\nimport { Property, Complex, NotifyPropertyChanges, Event } from './notify-property-change';\nimport { Browser } from './browser';\nimport { Base } from './base';\nimport { ChildProperty } from './child-property';\nimport { EventHandler } from './event-handler';\n/**\n * SwipeSettings is a framework module that provides support to handle swipe event like swipe up, swipe right, etc..,\n */\nvar SwipeSettings = /** @class */ (function (_super) {\n __extends(SwipeSettings, _super);\n function SwipeSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(50)\n ], SwipeSettings.prototype, \"swipeThresholdDistance\", void 0);\n return SwipeSettings;\n}(ChildProperty));\nexport { SwipeSettings };\nvar swipeRegex = /(Up|Down)/;\n/**\n * Touch class provides support to handle the touch event like tap, double tap, tap hold, etc..,\n * ```typescript\n * let node: HTMLElement;\n * let touchObj: Touch = new Touch({\n * element: node,\n * tap: function (e) {\n * // tap handler function code\n * }\n * tapHold: function (e) {\n * // tap hold handler function code\n * }\n * scroll: function (e) {\n * // scroll handler function code\n * }\n * swipe: function (e) {\n * // swipe handler function code\n * }\n * });\n * ```\n */\nvar Touch = /** @class */ (function (_super) {\n __extends(Touch, _super);\n /* End-Properties */\n function Touch(element, options) {\n var _this = _super.call(this, options, element) || this;\n _this.touchAction = true;\n _this.tapCount = 0;\n /**\n *\n * @param {MouseEventArgs | TouchEventArgs} evt ?\n * @returns {void} ?\n */\n _this.startEvent = function (evt) {\n if (_this.touchAction === true) {\n var point = _this.updateChangeTouches(evt);\n if (evt.changedTouches !== undefined) {\n _this.touchAction = false;\n }\n _this.isTouchMoved = false;\n _this.movedDirection = '';\n _this.startPoint = _this.lastMovedPoint = { clientX: point.clientX, clientY: point.clientY };\n _this.startEventData = point;\n _this.hScrollLocked = _this.vScrollLocked = false;\n _this.tStampStart = Date.now();\n _this.timeOutTapHold = setTimeout(function () { _this.tapHoldEvent(evt); }, _this.tapHoldThreshold);\n EventHandler.add(_this.element, Browser.touchMoveEvent, _this.moveEvent, _this);\n EventHandler.add(_this.element, Browser.touchEndEvent, _this.endEvent, _this);\n EventHandler.add(_this.element, Browser.touchCancelEvent, _this.cancelEvent, _this);\n }\n };\n /**\n *\n * @param {MouseEventArgs | TouchEventArgs} evt ?\n * @returns {void} ?\n */\n _this.moveEvent = function (evt) {\n var point = _this.updateChangeTouches(evt);\n _this.movedPoint = point;\n _this.isTouchMoved = !(point.clientX === _this.startPoint.clientX && point.clientY === _this.startPoint.clientY);\n var eScrollArgs = {};\n if (_this.isTouchMoved) {\n clearTimeout(_this.timeOutTapHold);\n _this.calcScrollPoints(evt);\n var scrollArg = {\n startEvents: _this.startEventData,\n originalEvent: evt, startX: _this.startPoint.clientX,\n startY: _this.startPoint.clientY, distanceX: _this.distanceX,\n distanceY: _this.distanceY, scrollDirection: _this.scrollDirection,\n velocity: _this.getVelocity(point)\n };\n eScrollArgs = extend(eScrollArgs, {}, scrollArg);\n _this.trigger('scroll', eScrollArgs);\n _this.lastMovedPoint = { clientX: point.clientX, clientY: point.clientY };\n }\n };\n /**\n *\n * @param {MouseEventArgs | TouchEventArgs} evt ?\n * @returns {void} ?\n */\n _this.cancelEvent = function (evt) {\n clearTimeout(_this.timeOutTapHold);\n clearTimeout(_this.timeOutTap);\n _this.tapCount = 0;\n _this.swipeFn(evt);\n EventHandler.remove(_this.element, Browser.touchCancelEvent, _this.cancelEvent);\n };\n /**\n *\n * @param {MouseEventArgs | TouchEventArgs} evt ?\n * @returns {void} ?\n */\n _this.endEvent = function (evt) {\n _this.swipeFn(evt);\n if (!_this.isTouchMoved) {\n if (typeof _this.tap === 'function') {\n _this.trigger('tap', { originalEvent: evt, tapCount: ++_this.tapCount });\n _this.timeOutTap = setTimeout(function () {\n _this.tapCount = 0;\n }, _this.tapThreshold);\n }\n }\n _this.modeclear();\n };\n /**\n *\n * @param {MouseEventArgs | TouchEventArgs} evt ?\n * @returns {void} ?\n */\n _this.swipeFn = function (evt) {\n clearTimeout(_this.timeOutTapHold);\n clearTimeout(_this.timeOutTap);\n var point = _this.updateChangeTouches(evt);\n var diffX = point.clientX - _this.startPoint.clientX;\n var diffY = point.clientY - _this.startPoint.clientY;\n diffX = Math.floor(diffX < 0 ? -1 * diffX : diffX);\n diffY = Math.floor(diffY < 0 ? -1 * diffY : diffX);\n _this.isTouchMoved = diffX > 1 || diffY > 1;\n _this.endPoint = point;\n _this.calcPoints(evt);\n var swipeArgs = {\n originalEvent: evt,\n startEvents: _this.startEventData,\n startX: _this.startPoint.clientX,\n startY: _this.startPoint.clientY,\n distanceX: _this.distanceX, distanceY: _this.distanceY, swipeDirection: _this.movedDirection,\n velocity: _this.getVelocity(point)\n };\n if (_this.isTouchMoved) {\n var eSwipeArgs = void 0;\n var tDistance = _this.swipeSettings.swipeThresholdDistance;\n // eslint-disable-next-line\n eSwipeArgs = extend(eSwipeArgs, _this.defaultArgs, swipeArgs);\n var canTrigger = false;\n var ele = _this.element;\n var scrollBool = _this.isScrollable(ele);\n var moved = swipeRegex.test(_this.movedDirection);\n if ((tDistance < _this.distanceX && !moved) || (tDistance < _this.distanceY && moved)) {\n if (!scrollBool) {\n canTrigger = true;\n }\n else {\n canTrigger = _this.checkSwipe(ele, moved);\n }\n }\n if (canTrigger) {\n _this.trigger('swipe', eSwipeArgs);\n }\n }\n _this.modeclear();\n };\n _this.modeclear = function () {\n _this.modeClear = setTimeout(function () {\n _this.touchAction = true;\n }, (typeof _this.tap !== 'function' ? 0 : 20));\n _this.lastTapTime = new Date().getTime();\n EventHandler.remove(_this.element, Browser.touchMoveEvent, _this.moveEvent);\n EventHandler.remove(_this.element, Browser.touchEndEvent, _this.endEvent);\n EventHandler.remove(_this.element, Browser.touchCancelEvent, _this.cancelEvent);\n };\n _this.bind();\n return _this;\n }\n // triggers when property changed\n /**\n *\n * @private\n * @param {TouchModel} newProp ?\n * @param {TouchModel} oldProp ?\n * @returns {void} ?\n */\n // eslint-disable-next-line\n Touch.prototype.onPropertyChanged = function (newProp, oldProp) {\n //No Code to handle\n };\n Touch.prototype.bind = function () {\n this.wireEvents();\n if (Browser.isIE) {\n this.element.classList.add('e-block-touch');\n }\n };\n /**\n * To destroy the touch instance.\n *\n * @returns {void}\n */\n Touch.prototype.destroy = function () {\n this.unwireEvents();\n _super.prototype.destroy.call(this);\n };\n // Need to changes the event binding once we updated the event handler.\n Touch.prototype.wireEvents = function () {\n EventHandler.add(this.element, Browser.touchStartEvent, this.startEvent, this);\n };\n Touch.prototype.unwireEvents = function () {\n EventHandler.remove(this.element, Browser.touchStartEvent, this.startEvent);\n };\n /**\n * Returns module name as touch\n *\n * @returns {string} ?\n * @private\n */\n Touch.prototype.getModuleName = function () {\n return 'touch';\n };\n /**\n * Returns if the HTML element is Scrollable.\n *\n * @param {HTMLElement} element - HTML Element to check if Scrollable.\n * @returns {boolean} ?\n */\n Touch.prototype.isScrollable = function (element) {\n var eleStyle = getComputedStyle(element);\n var style = eleStyle.overflow + eleStyle.overflowX + eleStyle.overflowY;\n if ((/(auto|scroll)/).test(style)) {\n return true;\n }\n return false;\n };\n /**\n *\n * @param {MouseEventArgs | TouchEventArgs} evt ?\n * @returns {void} ?\n */\n Touch.prototype.tapHoldEvent = function (evt) {\n this.tapCount = 0;\n this.touchAction = true;\n var eTapArgs;\n EventHandler.remove(this.element, Browser.touchMoveEvent, this.moveEvent);\n EventHandler.remove(this.element, Browser.touchEndEvent, this.endEvent);\n // eslint-disable-next-line\n eTapArgs = { originalEvent: evt };\n this.trigger('tapHold', eTapArgs);\n EventHandler.remove(this.element, Browser.touchCancelEvent, this.cancelEvent);\n };\n Touch.prototype.calcPoints = function (evt) {\n var point = this.updateChangeTouches(evt);\n this.defaultArgs = { originalEvent: evt };\n this.distanceX = Math.abs((Math.abs(point.clientX) - Math.abs(this.startPoint.clientX)));\n this.distanceY = Math.abs((Math.abs(point.clientY) - Math.abs(this.startPoint.clientY)));\n if (this.distanceX > this.distanceY) {\n this.movedDirection = (point.clientX > this.startPoint.clientX) ? 'Right' : 'Left';\n }\n else {\n this.movedDirection = (point.clientY < this.startPoint.clientY) ? 'Up' : 'Down';\n }\n };\n Touch.prototype.calcScrollPoints = function (evt) {\n var point = this.updateChangeTouches(evt);\n this.defaultArgs = { originalEvent: evt };\n this.distanceX = Math.abs((Math.abs(point.clientX) - Math.abs(this.lastMovedPoint.clientX)));\n this.distanceY = Math.abs((Math.abs(point.clientY) - Math.abs(this.lastMovedPoint.clientY)));\n if ((this.distanceX > this.distanceY || this.hScrollLocked === true) && this.vScrollLocked === false) {\n this.scrollDirection = (point.clientX > this.lastMovedPoint.clientX) ? 'Right' : 'Left';\n this.hScrollLocked = true;\n }\n else {\n this.scrollDirection = (point.clientY < this.lastMovedPoint.clientY) ? 'Up' : 'Down';\n this.vScrollLocked = true;\n }\n };\n Touch.prototype.getVelocity = function (pnt) {\n var newX = pnt.clientX;\n var newY = pnt.clientY;\n var newT = Date.now();\n var xDist = newX - this.startPoint.clientX;\n var yDist = newY - this.startPoint.clientX;\n var interval = newT - this.tStampStart;\n return Math.sqrt(xDist * xDist + yDist * yDist) / interval;\n };\n // eslint-disable-next-line\n Touch.prototype.checkSwipe = function (ele, flag) {\n var keys = ['scroll', 'offset'];\n var temp = flag ? ['Height', 'Top'] : ['Width', 'Left'];\n if ((ele[keys[0] + temp[0]] <= ele[keys[1] + temp[0]])) {\n return true;\n }\n return (ele[keys[0] + temp[1]] === 0) ||\n (ele[keys[1] + temp[0]] + ele[keys[0] + temp[1]] >= ele[keys[0] + temp[0]]);\n };\n Touch.prototype.updateChangeTouches = function (evt) {\n var point = evt.changedTouches && evt.changedTouches.length !== 0 ? evt.changedTouches[0] : evt;\n return point;\n };\n __decorate([\n Event()\n ], Touch.prototype, \"tap\", void 0);\n __decorate([\n Event()\n ], Touch.prototype, \"tapHold\", void 0);\n __decorate([\n Event()\n ], Touch.prototype, \"swipe\", void 0);\n __decorate([\n Event()\n ], Touch.prototype, \"scroll\", void 0);\n __decorate([\n Property(350)\n ], Touch.prototype, \"tapThreshold\", void 0);\n __decorate([\n Property(750)\n ], Touch.prototype, \"tapHoldThreshold\", void 0);\n __decorate([\n Complex({}, SwipeSettings)\n ], Touch.prototype, \"swipeSettings\", void 0);\n Touch = __decorate([\n NotifyPropertyChanges\n ], Touch);\n return Touch;\n}(Base));\nexport { Touch };\n","/**\n * Template Engine\n */\nvar LINES = new RegExp('\\\\n|\\\\r|\\\\s\\\\s+', 'g');\nvar QUOTES = new RegExp(/'|\"/g);\nvar IF_STMT = new RegExp('if ?\\\\(');\nvar ELSEIF_STMT = new RegExp('else if ?\\\\(');\nvar ELSE_STMT = new RegExp('else');\nvar FOR_STMT = new RegExp('for ?\\\\(');\nvar IF_OR_FOR = new RegExp('(/if|/for)');\nvar CALL_FUNCTION = new RegExp('\\\\((.*)\\\\)', '');\nvar NOT_NUMBER = new RegExp('^[0-9]+$', 'g');\nvar WORD = new RegExp('[\\\\w\"\\'.\\\\s+]+', 'g');\nvar DBL_QUOTED_STR = new RegExp('\"(.*?)\"', 'g');\nvar WORDIF = new RegExp('[\\\\w\"\\'@#$.\\\\s-+]+', 'g');\nvar exp = new RegExp('\\\\${([^}]*)}', 'g');\n// let cachedTemplate: Object = {};\nvar ARR_OBJ = /^\\..*/gm;\nvar SINGLE_SLASH = /\\\\/gi;\nvar DOUBLE_SLASH = /\\\\\\\\/gi;\nvar WORDFUNC = new RegExp('[\\\\w\"\\'@#$.\\\\s+]+', 'g');\nvar WINDOWFUNC = /\\window\\./gm;\n/**\n * The function to set regular expression for template expression string.\n *\n * @param {RegExp} value - Value expression.\n * @returns {RegExp} ?\n * @private\n */\nexport function expression(value) {\n if (value) {\n exp = value;\n }\n return exp;\n}\n// /**\n// * To render the template string from the given data.\n// * @param {string} template - String Template.\n// * @param {Object[]|JSON} data - DataSource for the template.\n// * @param {Object} helper? - custom helper object.\n// */\n// export function template(template: string, data: JSON, helper?: Object): string {\n// let hash: string = hashCode(template);\n// let tmpl: Function;\n// if (!cachedTemplate[hash]) {\n// tmpl = cachedTemplate[hash] = compile(template, helper);\n// } else {\n// tmpl = cachedTemplate[hash];\n// }\n// return tmpl(data);\n// }\n/**\n * Compile the template string into template function.\n *\n * @param {string} template - The template string which is going to convert.\n * @param {Object} helper - Helper functions as an object.\n * @param {boolean} ignorePrefix ?\n * @returns {string} ?\n * @private\n */\nexport function compile(template, helper, ignorePrefix) {\n var argName = 'data';\n var evalExpResult = evalExp(template, argName, helper, ignorePrefix);\n var condtion = \"var valueRegEx = (/value=\\\\'([A-Za-z0-9 _]*)((.)([\\\\w)(!-;?-\\u25A0\\\\s]+)['])/g);\\n var hrefRegex = (/(?:href)([\\\\s='\\\"./]+)([\\\\w-./?=&\\\\\\\\#\\\"]+)((.)([\\\\w)(!-;/?-\\u25A0\\\\s]+)['])/g);\\n if(str.match(valueRegEx)){\\n var check = str.match(valueRegEx);\\n var str1 = str;\\n for (var i=0; i < check.length; i++) {\\n var check1 = str.match(valueRegEx)[i].split('value=')[1];\\n var change = check1.match(/^'/) !== null ? check1.replace(/^'/, '\\\"') : check1;\\n change =change.match(/.$/)[0] === '\\\\'' ? change.replace(/.$/,'\\\"') : change;\\n str1 = str1.replace(check1, change);\\n }\\n str = str.replace(str, str1);\\n }\\n else if (str.match(/(?:href='')/) === null) {\\n if(str.match(hrefRegex)) {\\n var check = str.match(hrefRegex);\\n var str1 = str;\\n for (var i=0; i < check.length; i++) {\\n var check1 = str.match(hrefRegex)[i].split('href=')[1];\\n var change = check1.match(/^'/) !== null ? check1.replace(/^'/, '\\\"') : check1;\\n change =change.match(/.$/)[0] === '\\\\'' ? change.replace(/.$/,'\\\"') : change;\\n str1 = str1.replace(check1, change);\\n }\\n str = str.replace(str, str1);\\n }\\n }\\n \";\n var fnCode = \"var str=\\\"\" + evalExpResult + \"\\\";\" + condtion + \" return str;\";\n var fn = new Function(argName, fnCode);\n return fn.bind(helper);\n}\n/** function used to evaluate the function expression\n *\n * @param {string} str ?\n * @param {string} nameSpace ?\n * @param {Object} helper ?\n * @param {boolean} ignorePrefix ?\n * @returns {string} ?\n */\nfunction evalExp(str, nameSpace, helper, ignorePrefix) {\n var varCOunt = 0;\n /**\n * Variable containing Local Keys\n */\n var localKeys = [];\n var isClass = str.match(/class=\"([^\"]+|)\\s{2}/g);\n var singleSpace = '';\n if (isClass) {\n isClass.forEach(function (value) {\n singleSpace = value.replace(/\\s\\s+/g, ' ');\n str = str.replace(value, singleSpace);\n });\n }\n return str.replace(LINES, '').replace(DBL_QUOTED_STR, '\\'$1\\'').replace(exp, \n // eslint-disable-next-line\n function (match, cnt, offset, matchStr) {\n var SPECIAL_CHAR = /@|#|\\$/gm;\n var matches = cnt.match(CALL_FUNCTION);\n // matches to detect any function calls\n if (matches) {\n var rlStr = matches[1];\n if (ELSEIF_STMT.test(cnt)) {\n //handling else-if condition\n cnt = '\";} ' + cnt.replace(matches[1], rlStr.replace(WORD, function (str) {\n str = str.trim();\n return addNameSpace(str, !(QUOTES.test(str)) && (localKeys.indexOf(str) === -1), nameSpace, localKeys, ignorePrefix);\n })) + '{ \\n str = str + \"';\n }\n else if (IF_STMT.test(cnt)) {\n //handling if condition\n cnt = '\"; ' + cnt.replace(matches[1], rlStr.replace(WORDIF, function (strs) {\n return HandleSpecialCharArrObj(strs, nameSpace, localKeys, ignorePrefix);\n })) + '{ \\n str = str + \"';\n }\n else if (FOR_STMT.test(cnt)) {\n //handling for condition\n var rlStr_1 = matches[1].split(' of ');\n // replace for each into actual JavaScript\n // eslint-disable-next-line\n cnt = '\"; ' + cnt.replace(matches[1], function (mtc) {\n localKeys.push(rlStr_1[0]);\n localKeys.push(rlStr_1[0] + 'Index');\n varCOunt = varCOunt + 1;\n // tslint:disable-next-line\n return 'var i' + varCOunt + '=0; i' + varCOunt + ' < ' + addNameSpace(rlStr_1[1], true, nameSpace, localKeys, ignorePrefix) + '.length; i' + varCOunt + '++';\n }) + '{ \\n ' + rlStr_1[0] + '= ' + addNameSpace(rlStr_1[1], true, nameSpace, localKeys, ignorePrefix)\n + '[i' + varCOunt + ']; \\n var ' + rlStr_1[0] + 'Index=i' + varCOunt + '; \\n str = str + \"';\n }\n else {\n //helper function handling\n var fnStr = cnt.split('(');\n // eslint-disable-next-line\n var fNameSpace = (helper && helper.hasOwnProperty(fnStr[0]) ? 'this.' : 'global');\n fNameSpace = (/\\./.test(fnStr[0]) ? '' : fNameSpace);\n var ftArray = matches[1].split(',');\n if (matches[1].length !== 0 && !(/data/).test(ftArray[0]) && !(/window./).test(ftArray[0])) {\n matches[1] = (fNameSpace === 'global' ? nameSpace + '.' + matches[1] : matches[1]);\n }\n var splRegexp = /@|\\$|#/gm;\n var arrObj = /\\]\\./gm;\n if (WINDOWFUNC.test(cnt) && arrObj.test(cnt) || splRegexp.test(cnt)) {\n var splArrRegexp = /@|\\$|#|\\]\\./gm;\n if (splArrRegexp.test(cnt)) {\n // tslint:disable-next-line\n cnt = '\"+ ' + (fNameSpace === 'global' ? '' : fNameSpace) + cnt.replace(matches[1], rlStr.replace(WORDFUNC, function (strs) {\n return HandleSpecialCharArrObj(strs, nameSpace, localKeys, ignorePrefix);\n })) + '+ \"';\n }\n }\n else {\n cnt = '\" + ' + (fNameSpace === 'global' ? '' : fNameSpace) +\n cnt.replace(rlStr, addNameSpace(matches[1].replace(/,( |)data.|,/gi, ',' + nameSpace + '.').replace(/,( |)data.window/gi, ',window'), (fNameSpace === 'global' ? false : true), nameSpace, localKeys, ignorePrefix)) +\n '+\"';\n }\n }\n }\n else if (ELSE_STMT.test(cnt)) {\n // handling else condition\n cnt = '\"; ' + cnt.replace(ELSE_STMT, '} else { \\n str = str + \"');\n // eslint-disable-next-line\n }\n else if (!!cnt.match(IF_OR_FOR)) {\n // close condition\n cnt = cnt.replace(IF_OR_FOR, '\"; \\n } \\n str = str + \"');\n }\n else if (SPECIAL_CHAR.test(cnt)) {\n // template string with double slash with special character\n if (cnt.match(SINGLE_SLASH)) {\n cnt = SlashReplace(cnt);\n }\n cnt = '\"+' + NameSpaceForspecialChar(cnt, (localKeys.indexOf(cnt) === -1), nameSpace, localKeys) + '\"]+\"';\n }\n else {\n // template string with double slash\n if (cnt.match(SINGLE_SLASH)) {\n cnt = SlashReplace(cnt);\n cnt = '\"+' + NameSpaceForspecialChar(cnt, (localKeys.indexOf(cnt) === -1), nameSpace, localKeys) + '\"]+\"';\n }\n else {\n // evaluate normal expression\n cnt = '\"+' + addNameSpace(cnt.replace(/,/gi, '+' + nameSpace + '.'), (localKeys.indexOf(cnt) === -1), nameSpace, localKeys, ignorePrefix) + '+\"';\n }\n }\n return cnt;\n });\n}\n/**\n *\n * @param {string} str ?\n * @param {boolean} addNS ?\n * @param {string} nameSpace ?\n * @param {string[]} ignoreList ?\n * @param {boolean} ignorePrefix ?\n * @returns {string} ?\n */\nfunction addNameSpace(str, addNS, nameSpace, ignoreList, ignorePrefix) {\n return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1 && !ignorePrefix) ? nameSpace + '.' + str : str);\n}\n/**\n *\n * @param {string} str ?\n * @param {boolean} addNS ?\n * @param {string} nameSpace ?\n * @param {string[]} ignoreList ?\n * @returns {string} ?\n */\nfunction NameSpaceArrObj(str, addNS, nameSpace, ignoreList) {\n var arrObjReg = /^\\..*/gm;\n return ((addNS && !(NOT_NUMBER.test(str)) &&\n ignoreList.indexOf(str.split('.')[0]) === -1 && !(arrObjReg.test(str))) ? nameSpace + '.' + str : str);\n}\n// // Create hashCode for template string to storeCached function\n// function hashCode(str: string): string {\n// return str.split('').reduce((a: number, b: string) => { a = ((a << 5) - a) + b.charCodeAt(0); return a & a; }, 0).toString();\n// }\n/**\n *\n * @param {string} str ?\n * @param {boolean} addNS ?\n * @param {string} nameSpace ?\n * @param {string[]} ignoreList ?\n * @returns {string} ?\n */\nfunction NameSpaceForspecialChar(str, addNS, nameSpace, ignoreList) {\n return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1) ? nameSpace + '[\"' + str : str);\n}\n// eslint-disable-next-line\nfunction SlashReplace(tempStr) {\n var double = '\\\\\\\\';\n if (tempStr.match(DOUBLE_SLASH)) {\n // eslint-disable-next-line\n tempStr = tempStr;\n }\n else {\n tempStr = tempStr.replace(SINGLE_SLASH, double);\n }\n return tempStr;\n}\n/**\n *\n * @param {string} str ?\n * @param {string} nameSpaceNew ?\n * @param {string[]} keys ?\n * @param {boolean} ignorePrefix ?\n * @returns {string} ?\n */\nfunction HandleSpecialCharArrObj(str, nameSpaceNew, keys, ignorePrefix) {\n str = str.trim();\n var windowFunc = /\\window\\./gm;\n if (!windowFunc.test(str)) {\n var quotes = /'|\"/gm;\n var splRegexp = /@|\\$|#/gm;\n if (splRegexp.test(str)) {\n str = NameSpaceForspecialChar(str, (keys.indexOf(str) === -1), nameSpaceNew, keys) + '\"]';\n }\n if (ARR_OBJ.test(str)) {\n return NameSpaceArrObj(str, !(quotes.test(str)) && (keys.indexOf(str) === -1), nameSpaceNew, keys);\n }\n else {\n return addNameSpace(str, !(quotes.test(str)) && (keys.indexOf(str) === -1), nameSpaceNew, keys, ignorePrefix);\n }\n }\n else {\n return str;\n }\n}\n","/**\n * Template Engine Bridge\n */\nimport { compile as render } from './template';\nimport { createElement } from './dom';\nimport { isNullOrUndefined, isBlazor } from './util';\nvar HAS_ROW = /^[\\n\\r.]+ 0) {\n elements.forEach(function (element) {\n detach(element);\n });\n }\n else {\n return;\n }\n };\n SanitizeHtmlHelper.removeJsEvents = function () {\n var elements = this.wrapElement.querySelectorAll('[' + jsEvents.join('],[') + ']');\n if (elements.length > 0) {\n elements.forEach(function (element) {\n jsEvents.forEach(function (attr) {\n if (element.hasAttribute(attr)) {\n element.removeAttribute(attr);\n }\n });\n });\n }\n else {\n return;\n }\n };\n SanitizeHtmlHelper.removeXssAttrs = function () {\n var _this = this;\n // eslint-disable-next-line\n this.removeAttrs.forEach(function (item, index) {\n var elements = _this.wrapElement.querySelectorAll(item.selector);\n if (elements.length > 0) {\n elements.forEach(function (element) {\n element.removeAttribute(item.attribute);\n });\n }\n });\n };\n return SanitizeHtmlHelper;\n}());\nexport { SanitizeHtmlHelper };\n","/**\n * public Enum for `PdfPageOrientation`.\n * @private\n */\nexport var PdfPageOrientation;\n(function (PdfPageOrientation) {\n /**\n * Specifies the type of `Portrait`.\n * @private\n */\n PdfPageOrientation[PdfPageOrientation[\"Portrait\"] = 0] = \"Portrait\";\n /**\n * Specifies the type of `Landscape`.\n * @private\n */\n PdfPageOrientation[PdfPageOrientation[\"Landscape\"] = 1] = \"Landscape\";\n})(PdfPageOrientation || (PdfPageOrientation = {}));\n/**\n * public Enum for `PdfPageRotateAngle`.\n * @private\n */\nexport var PdfPageRotateAngle;\n(function (PdfPageRotateAngle) {\n /**\n * Specifies the type of `RotateAngle0`.\n * @private\n */\n PdfPageRotateAngle[PdfPageRotateAngle[\"RotateAngle0\"] = 0] = \"RotateAngle0\";\n /**\n * Specifies the type of `RotateAngle90`.\n * @private\n */\n PdfPageRotateAngle[PdfPageRotateAngle[\"RotateAngle90\"] = 1] = \"RotateAngle90\";\n /**\n * Specifies the type of `RotateAngle180`.\n * @private\n */\n PdfPageRotateAngle[PdfPageRotateAngle[\"RotateAngle180\"] = 2] = \"RotateAngle180\";\n /**\n * Specifies the type of `RotateAngle270`.\n * @private\n */\n PdfPageRotateAngle[PdfPageRotateAngle[\"RotateAngle270\"] = 3] = \"RotateAngle270\";\n})(PdfPageRotateAngle || (PdfPageRotateAngle = {}));\n/**\n * public Enum for `PdfNumberStyle`.\n * @private\n */\nexport var PdfNumberStyle;\n(function (PdfNumberStyle) {\n /**\n * Specifies the type of `None`.\n * @private\n */\n PdfNumberStyle[PdfNumberStyle[\"None\"] = 0] = \"None\";\n /**\n * Specifies the type of `Numeric`.\n * @private\n */\n PdfNumberStyle[PdfNumberStyle[\"Numeric\"] = 1] = \"Numeric\";\n /**\n * Specifies the type of `LowerLatin`.\n * @private\n */\n PdfNumberStyle[PdfNumberStyle[\"LowerLatin\"] = 2] = \"LowerLatin\";\n /**\n * Specifies the type of `LowerRoman`.\n * @private\n */\n PdfNumberStyle[PdfNumberStyle[\"LowerRoman\"] = 3] = \"LowerRoman\";\n /**\n * Specifies the type of `UpperLatin`.\n * @private\n */\n PdfNumberStyle[PdfNumberStyle[\"UpperLatin\"] = 4] = \"UpperLatin\";\n /**\n * Specifies the type of `UpperRoman`.\n * @private\n */\n PdfNumberStyle[PdfNumberStyle[\"UpperRoman\"] = 5] = \"UpperRoman\";\n})(PdfNumberStyle || (PdfNumberStyle = {}));\n/**\n * public Enum for `PdfDockStyle`.\n * @private\n */\nexport var PdfDockStyle;\n(function (PdfDockStyle) {\n /**\n * Specifies the type of `None`.\n * @private\n */\n PdfDockStyle[PdfDockStyle[\"None\"] = 0] = \"None\";\n /**\n * Specifies the type of `Bottom`.\n * @private\n */\n PdfDockStyle[PdfDockStyle[\"Bottom\"] = 1] = \"Bottom\";\n /**\n * Specifies the type of `Top`.\n * @private\n */\n PdfDockStyle[PdfDockStyle[\"Top\"] = 2] = \"Top\";\n /**\n * Specifies the type of `Left`.\n * @private\n */\n PdfDockStyle[PdfDockStyle[\"Left\"] = 3] = \"Left\";\n /**\n * Specifies the type of `Right`.\n * @private\n */\n PdfDockStyle[PdfDockStyle[\"Right\"] = 4] = \"Right\";\n /**\n * Specifies the type of `Fill`.\n * @private\n */\n PdfDockStyle[PdfDockStyle[\"Fill\"] = 5] = \"Fill\";\n})(PdfDockStyle || (PdfDockStyle = {}));\n/**\n * public Enum for `PdfAlignmentStyle`.\n * @private\n */\nexport var PdfAlignmentStyle;\n(function (PdfAlignmentStyle) {\n /**\n * Specifies the type of `None`.\n * @private\n */\n PdfAlignmentStyle[PdfAlignmentStyle[\"None\"] = 0] = \"None\";\n /**\n * Specifies the type of `TopLeft`.\n * @private\n */\n PdfAlignmentStyle[PdfAlignmentStyle[\"TopLeft\"] = 1] = \"TopLeft\";\n /**\n * Specifies the type of `TopCenter`.\n * @private\n */\n PdfAlignmentStyle[PdfAlignmentStyle[\"TopCenter\"] = 2] = \"TopCenter\";\n /**\n * Specifies the type of `TopRight`.\n * @private\n */\n PdfAlignmentStyle[PdfAlignmentStyle[\"TopRight\"] = 3] = \"TopRight\";\n /**\n * Specifies the type of `MiddleLeft`.\n * @private\n */\n PdfAlignmentStyle[PdfAlignmentStyle[\"MiddleLeft\"] = 4] = \"MiddleLeft\";\n /**\n * Specifies the type of `MiddleCenter`.\n * @private\n */\n PdfAlignmentStyle[PdfAlignmentStyle[\"MiddleCenter\"] = 5] = \"MiddleCenter\";\n /**\n * Specifies the type of `MiddleRight`.\n * @private\n */\n PdfAlignmentStyle[PdfAlignmentStyle[\"MiddleRight\"] = 6] = \"MiddleRight\";\n /**\n * Specifies the type of `BottomLeft`.\n * @private\n */\n PdfAlignmentStyle[PdfAlignmentStyle[\"BottomLeft\"] = 7] = \"BottomLeft\";\n /**\n * Specifies the type of `BottomCenter`.\n * @private\n */\n PdfAlignmentStyle[PdfAlignmentStyle[\"BottomCenter\"] = 8] = \"BottomCenter\";\n /**\n * Specifies the type of `BottomRight`.\n * @private\n */\n PdfAlignmentStyle[PdfAlignmentStyle[\"BottomRight\"] = 9] = \"BottomRight\";\n})(PdfAlignmentStyle || (PdfAlignmentStyle = {}));\n/**\n * public Enum for `TemplateType`.\n * @private\n */\nexport var TemplateType;\n(function (TemplateType) {\n /**\n * Specifies the type of `None`.\n * @private\n */\n TemplateType[TemplateType[\"None\"] = 0] = \"None\";\n /**\n * Specifies the type of `Top`.\n * @private\n */\n TemplateType[TemplateType[\"Top\"] = 1] = \"Top\";\n /**\n * Specifies the type of `Bottom`.\n * @private\n */\n TemplateType[TemplateType[\"Bottom\"] = 2] = \"Bottom\";\n /**\n * Specifies the type of `Left`.\n * @private\n */\n TemplateType[TemplateType[\"Left\"] = 3] = \"Left\";\n /**\n * Specifies the type of `Right`.\n * @private\n */\n TemplateType[TemplateType[\"Right\"] = 4] = \"Right\";\n})(TemplateType || (TemplateType = {}));\n","import { createElement, isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { DataUtil } from '@syncfusion/ej2-data';\nimport { subtractThickness, valueToCoefficient, sum, redrawElement, isBreakLabel, ChartLocation } from '../../common/utils/helper';\nimport { subArray, inside, appendChildElement } from '../../common/utils/helper';\nimport { Thickness, logBase, createZoomingLabels, getElement } from '../../common/utils/helper';\nimport { Size, Rect, measureText, TextOption, PathOption } from '@syncfusion/ej2-svg-base';\nimport { textElement, textTrim, getRotatedRectangleCoordinates, isRotatedRectIntersect, isZoomSet } from '../../common/utils/helper';\n/**\n * Specifies the Cartesian Axis Layout.\n */\nvar axisPadding = 10;\nvar CartesianAxisLayoutPanel = /** @class */ (function () {\n /** @private */\n function CartesianAxisLayoutPanel(chartModule) {\n this.chart = chartModule;\n this.padding = 5;\n }\n /**\n * Measure the axis size.\n *\n * @returns {void}\n * @private\n */\n CartesianAxisLayoutPanel.prototype.measureAxis = function (rect) {\n var chart = this.chart;\n this.crossAt(chart);\n this.seriesClipRect = new Rect(rect.x, rect.y, rect.width, rect.height);\n this.initialClipRect = rect;\n this.leftSize = 0;\n this.rightSize = 0;\n this.topSize = 0;\n this.bottomSize = 0;\n //Measure Axis size with initial Rect\n this.measureRowAxis(chart, this.initialClipRect);\n this.initialClipRect = subtractThickness(this.initialClipRect, new Thickness(this.leftSize, this.rightSize, 0, 0));\n this.measureColumnAxis(chart, this.initialClipRect);\n this.initialClipRect = subtractThickness(this.initialClipRect, new Thickness(0, 0, this.topSize, this.bottomSize));\n if (!this.chart.delayRedraw) {\n this.calculateAxisSize(this.initialClipRect);\n }\n this.leftSize = 0;\n this.rightSize = 0;\n this.topSize = 0;\n this.bottomSize = 0;\n //Measure Axis size with series Rect\n this.measureRowAxis(chart, this.initialClipRect);\n this.seriesClipRect = subtractThickness(this.seriesClipRect, new Thickness(this.leftSize, this.rightSize, 0, 0));\n this.measureColumnAxis(chart, this.initialClipRect);\n this.seriesClipRect = subtractThickness(this.seriesClipRect, new Thickness(0, 0, this.topSize, this.bottomSize));\n if (!this.chart.delayRedraw) {\n chart.refreshAxis();\n this.calculateAxisSize(this.seriesClipRect);\n }\n };\n CartesianAxisLayoutPanel.prototype.measureRowAxis = function (chart, rect) {\n var row;\n this.calculateRowSize(rect);\n for (var _i = 0, _a = chart.rows; _i < _a.length; _i++) {\n var item = _a[_i];\n row = item;\n row.nearSizes = [];\n row.farSizes = [];\n this.arrangeAxis(row);\n this.measureDefinition(row, chart, new Size(chart.availableSize.width, row.computedHeight));\n if (this.leftSize < sum(row.nearSizes)) {\n this.leftSize = sum(row.nearSizes);\n }\n if (this.rightSize < sum(row.farSizes)) {\n this.rightSize = sum(row.farSizes);\n }\n }\n };\n CartesianAxisLayoutPanel.prototype.measureColumnAxis = function (chart, rect) {\n var column;\n this.calculateColumnSize(rect);\n for (var _i = 0, _a = chart.columns; _i < _a.length; _i++) {\n var item = _a[_i];\n column = item;\n column.farSizes = [];\n column.nearSizes = [];\n this.arrangeAxis(column);\n this.measureDefinition(column, chart, new Size(column.computedWidth, chart.availableSize.height));\n if (this.bottomSize < sum(column.nearSizes)) {\n this.bottomSize = sum(column.nearSizes);\n }\n if (this.topSize < sum(column.farSizes)) {\n this.topSize = sum(column.farSizes);\n }\n }\n };\n /**\n * Measure the column and row in chart.\n *\n * @returns {void}\n * @private\n */\n CartesianAxisLayoutPanel.prototype.measureDefinition = function (definition, chart, size) {\n var ele = 16; // scrollbar element height is 16.\n for (var _i = 0, _a = definition.axes; _i < _a.length; _i++) {\n var axis = _a[_i];\n axis.scrollBarHeight = chart.scrollBarModule && chart.zoomModule && chart.zoomSettings.enableScrollbar &&\n axis.enableScrollbarOnZooming && chart.zoomModule.isZoomed && (axis.zoomFactor < 1 || axis.zoomPosition > 0) ? ele : 0;\n axis.scrollBarHeight = chart.scrollBarModule && (chart.zoomModule && chart.zoomSettings.enableScrollbar &&\n axis.enableScrollbarOnZooming && chart.zoomModule.isZoomed && (axis.zoomFactor < 1 || axis.zoomPosition > 0)\n || axis.scrollbarSettings.enable) ? ele : 0;\n axis.getModule(chart);\n axis.baseModule.calculateRangeAndInterval(size, axis);\n definition.computeSize(axis, axis.scrollBarHeight);\n }\n if (definition.farSizes.length > 0) {\n definition.farSizes[definition.farSizes.length - 1] -= axisPadding;\n }\n if (definition.nearSizes.length > 0) {\n definition.nearSizes[definition.nearSizes.length - 1] -= axisPadding;\n }\n };\n /**\n * Measure the axis.\n *\n * @returns {void}\n * @private\n */\n CartesianAxisLayoutPanel.prototype.calculateAxisSize = function (rect) {\n var chart = this.chart;\n var row;\n var column;\n var definition;\n var axis;\n var nearCount = 0;\n var farCount = 0;\n var size = 0;\n var x;\n var y;\n var axisOffset;\n this.calculateRowSize(rect);\n for (var i = 0, len = chart.rows.length; i < len; i++) {\n row = chart.rows[i];\n nearCount = 0;\n farCount = 0;\n for (var j = 0, len_1 = row.axes.length; j < len_1; j++) {\n axis = row.axes[j];\n axisOffset = axis.plotOffset;\n if (axis.rect.height === 0) {\n axis.rect.height = row.computedHeight;\n size = 0;\n for (var k = i + 1, len_2 = i + axis.span; k < len_2; k++) {\n definition = chart.rows[k];\n size += definition.computedHeight;\n }\n axis.rect.y = (row.computedTop - size) + (axis.plotOffsetTop ? axis.plotOffsetTop : axisOffset);\n axis.rect.height = (axis.rect.height + size) -\n (this.getAxisOffsetValue(axis.plotOffsetTop, axis.plotOffsetBottom, axis.plotOffset));\n axis.rect.width = 0;\n }\n if (axis.opposedPosition) {\n x = rect.x + rect.width + sum(subArray(row.farSizes, farCount));\n axis.rect.x = axis.rect.x >= x ? axis.rect.x : x;\n farCount++;\n }\n else {\n x = rect.x - sum(subArray(row.nearSizes, nearCount));\n axis.rect.x = axis.rect.x <= x ? axis.rect.x : x;\n nearCount++;\n }\n }\n }\n this.calculateColumnSize(rect);\n for (var i = 0, len = chart.columns.length; i < len; i++) {\n column = chart.columns[i];\n nearCount = 0;\n farCount = 0;\n for (var j = 0, len_3 = column.axes.length; j < len_3; j++) {\n axis = column.axes[j];\n axisOffset = axis.plotOffset;\n if (axis.rect.width === 0) {\n for (var k = i, len_4 = (i + axis.span); k < len_4; k++) {\n definition = chart.columns[k];\n axis.rect.width += definition.computedWidth;\n }\n axis.rect.x = column.computedLeft + (axis.plotOffsetLeft ? axis.plotOffsetLeft : axisOffset);\n axis.rect.width -= (this.getAxisOffsetValue(axis.plotOffsetLeft, axis.plotOffsetRight, axis.plotOffset));\n axis.rect.height = 0;\n }\n if (axis.opposedPosition) {\n y = rect.y - sum(subArray(column.farSizes, farCount));\n axis.rect.y = axis.rect.y <= y ? axis.rect.y : y;\n farCount++;\n }\n else {\n y = rect.y + rect.height + sum(subArray(column.nearSizes, nearCount));\n axis.rect.y = axis.rect.y >= y ? axis.rect.y : y;\n nearCount++;\n }\n }\n }\n };\n /**\n * Measure the axis.\n *\n * @returns {void}\n * @private\n */\n CartesianAxisLayoutPanel.prototype.measure = function () {\n var chart = this.chart;\n var row;\n var column;\n var definition;\n var actualIndex;\n var span;\n for (var _i = 0, _a = chart.axisCollections; _i < _a.length; _i++) {\n var axis = _a[_i];\n //definition.Axes = axis;\n if (axis.orientation === 'Vertical') {\n chart.verticalAxes.push(axis);\n actualIndex = this.getActualRow(axis);\n row = chart.rows[actualIndex];\n this.pushAxis(row, axis);\n span = ((actualIndex + axis.span) > chart.rows.length ? chart.rows.length : (actualIndex + axis.span));\n for (var j = actualIndex + 1; j < span; j++) {\n definition = chart.rows[j];\n definition.axes[row.axes.length - 1] = axis;\n chart.rows[j] = definition;\n }\n chart.rows[actualIndex] = row;\n }\n else {\n chart.horizontalAxes.push(axis);\n actualIndex = this.getActualColumn(axis);\n column = chart.columns[actualIndex];\n this.pushAxis(column, axis);\n span = ((actualIndex + axis.span) > chart.columns.length ? chart.columns.length : (actualIndex + axis.span));\n for (var j = actualIndex + 1; j < span; j++) {\n definition = chart.columns[j];\n definition.axes[column.axes.length - 1] = axis;\n chart.columns[j] = definition;\n }\n chart.columns[actualIndex] = column;\n }\n }\n };\n CartesianAxisLayoutPanel.prototype.getAxisOffsetValue = function (position1, position2, plotOffset) {\n var rangeOffset = position1 ? (position1 + (position2 ? position2 :\n plotOffset)) : (position2 ? position2 + plotOffset : 2 * plotOffset);\n return rangeOffset;\n };\n CartesianAxisLayoutPanel.prototype.crossAt = function (chart) {\n for (var _i = 0, _a = chart.axisCollections; _i < _a.length; _i++) {\n var axis = _a[_i];\n if (axis.crossesAt === null) {\n continue;\n }\n if (!axis.crossesInAxis) {\n if (chart.requireInvertedAxis) {\n axis.crossInAxis = ((axis.orientation === 'Horizontal')) ? chart.primaryXAxis : chart.primaryYAxis;\n }\n else {\n axis.crossInAxis = ((axis.orientation === 'Horizontal')) ? chart.primaryYAxis : chart.primaryXAxis;\n }\n axis.crossAt = this.updateCrossAt(axis.crossInAxis, axis.crossesAt);\n continue;\n }\n else {\n for (var i = 2, len = chart.axisCollections.length; i < len; i++) {\n if (axis.crossesInAxis === chart.axisCollections[i].name) {\n axis.crossInAxis = chart.axisCollections[i];\n axis.crossAt = this.updateCrossAt(axis.crossInAxis, axis.crossesAt);\n continue;\n }\n }\n }\n }\n };\n CartesianAxisLayoutPanel.prototype.updateCrossAt = function (axis, crossAt) {\n switch (axis.valueType) {\n case 'DateTime':\n var option = {\n skeleton: 'full',\n type: 'dateTime'\n };\n var dateParser = this.chart.intl.getDateParser(option);\n var dateFormatter = this.chart.intl.getDateFormat(option);\n return Date.parse(dateParser(dateFormatter(new Date(DataUtil.parse.parseJson({ val: crossAt }).val))));\n case 'Category':\n return parseFloat(crossAt) ? parseFloat(crossAt) : axis.labels.indexOf(crossAt);\n case 'Logarithmic':\n return logBase(crossAt, axis.logBase);\n default:\n return crossAt;\n }\n };\n CartesianAxisLayoutPanel.prototype.pushAxis = function (definition, axis) {\n for (var i = 0, len = definition.axes.length; i <= len; i++) {\n if (!definition.axes[i]) {\n definition.axes[i] = axis;\n break;\n }\n }\n };\n CartesianAxisLayoutPanel.prototype.arrangeAxis = function (definition) {\n var axisCollection = [];\n for (var i = 0, len = definition.axes.length; i <= len; i++) {\n if (definition.axes[i]) {\n axisCollection.push(definition.axes[i]);\n }\n }\n definition.axes = axisCollection;\n };\n CartesianAxisLayoutPanel.prototype.getActualColumn = function (axis) {\n var actualLength = this.chart.columns.length;\n var pos = axis.columnIndex;\n var result = pos >= actualLength ? actualLength - 1 : (pos < 0 ? 0 : pos);\n return result;\n };\n CartesianAxisLayoutPanel.prototype.getActualRow = function (axis) {\n var actualLength = this.chart.rows.length;\n var pos = axis.rowIndex;\n var result = pos >= actualLength ? actualLength - 1 : (pos < 0 ? 0 : pos);\n return result;\n };\n /**\n * Measure the row size.\n *\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.calculateRowSize = function (rect) {\n /*! Calculate row size */\n var chart = this.chart;\n var row;\n var rowTop = rect.y + rect.height;\n var height = 0;\n var remainingHeight = Math.max(0, rect.height);\n for (var i = 0, len = chart.rows.length; i < len; i++) {\n row = chart.rows[i];\n if (row.height.indexOf('%') !== -1) {\n height = Math.min(remainingHeight, (rect.height * parseInt(row.height, 10) / 100));\n }\n else {\n height = Math.min(remainingHeight, parseInt(row.height, 10));\n }\n height = (i !== (len - 1)) ? height : remainingHeight;\n row.computedHeight = height;\n rowTop -= height;\n row.computedTop = rowTop;\n remainingHeight -= height;\n }\n };\n /**\n * Measure the row size.\n *\n * @param {Rect} rect rect\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.calculateColumnSize = function (rect) {\n /*! Calculate column size */\n var chart = this.chart;\n var column;\n var columnLeft = rect.x;\n var width = 0;\n var remainingWidth = Math.max(0, rect.width);\n for (var i = 0, len = chart.columns.length; i < len; i++) {\n column = chart.columns[i];\n if (column.width.indexOf('%') !== -1) {\n width = Math.min(remainingWidth, (rect.width * parseInt(column.width, 10) / 100));\n }\n else {\n width = Math.min(remainingWidth, parseInt(column.width, 10));\n }\n width = (i !== (len - 1)) ? width : remainingWidth;\n column.computedWidth = width;\n column.computedLeft = columnLeft;\n columnLeft += width;\n remainingWidth -= width;\n }\n };\n /**\n * To render the axis element.\n *\n * @returns {void}\n * @private\n */\n CartesianAxisLayoutPanel.prototype.renderAxes = function () {\n var chart = this.chart;\n var axis;\n var axisElement = chart.renderer.createGroup({ id: chart.element.id + 'AxisInsideCollection' });\n var axisLineElement = chart.renderer.createGroup({ id: chart.element.id + 'AxisOutsideCollection' });\n var outsideElement;\n var isInside;\n for (var i = 0, len = chart.axisCollections.length; i < len; i++) {\n axis = chart.axisCollections[i];\n this.element = chart.renderer.createGroup({ id: chart.element.id + 'AxisGroup' + i + 'Inside' });\n outsideElement = chart.renderer.createGroup({ id: chart.element.id + 'AxisGroup' + i + 'Outside' });\n isInside = this.findAxisPosition(axis);\n if (axis.orientation === 'Horizontal') {\n axis.updateCrossValue();\n if (axis.visible && axis.internalVisibility && axis.lineStyle.width > 0) {\n this.drawAxisLine(axis, i, axis.plotOffset, 0, isInside ? outsideElement : this.element, axis.updatedRect);\n }\n if (axis.majorGridLines.width > 0 || axis.majorTickLines.width > 0) {\n this.drawXAxisGridLine(axis, i, (isInside || axis.tickPosition === 'Inside') ? outsideElement : this.element, axis.updatedRect);\n }\n if (axis.visible && axis.internalVisibility) {\n this.drawXAxisLabels(axis, i, (isInside || axis.labelPosition === 'Inside') ? outsideElement : this.element, (axis.placeNextToAxisLine ? axis.updatedRect : axis.rect));\n this.drawXAxisBorder(axis, i, (isInside || axis.labelPosition === 'Inside') ? outsideElement : this.element, (axis.placeNextToAxisLine ? axis.updatedRect : axis.rect));\n this.drawXAxisTitle(axis, i, isInside ? outsideElement : this.element, (axis.placeNextToAxisLine ? axis.updatedRect : axis.rect));\n }\n }\n else {\n axis.updateCrossValue();\n if (axis.visible && axis.internalVisibility && axis.lineStyle.width > 0) {\n this.drawAxisLine(axis, i, 0, axis.plotOffset, isInside ? outsideElement : this.element, axis.updatedRect);\n }\n if (axis.majorGridLines.width > 0 || axis.majorTickLines.width > 0) {\n this.drawYAxisGridLine(axis, i, (isInside || axis.tickPosition === 'Inside') ? outsideElement : this.element, axis.updatedRect);\n }\n if (axis.visible && axis.internalVisibility) {\n this.drawYAxisLabels(axis, i, (isInside || axis.labelPosition === 'Inside') ? outsideElement : this.element, (axis.placeNextToAxisLine ? axis.updatedRect : axis.rect));\n this.drawYAxisBorder(axis, i, (isInside || axis.labelPosition === 'Inside') ? outsideElement : this.element, (axis.placeNextToAxisLine ? axis.updatedRect : axis.rect));\n this.drawYAxisTitle(axis, i, isInside ? outsideElement : this.element, (axis.placeNextToAxisLine ? axis.updatedRect : axis.rect));\n }\n }\n if (!this.chart.enableCanvas) {\n axisElement.appendChild(this.element);\n if (outsideElement && outsideElement.childNodes.length > 0) {\n axisLineElement.appendChild(outsideElement);\n }\n }\n if (chart.scrollBarModule && ((chart.zoomSettings.enableScrollbar && axis.enableScrollbarOnZooming) ||\n axis.scrollbarSettings.enable)) {\n this.renderScrollbar(chart, axis);\n }\n }\n this.element = chart.renderer.createGroup({ id: chart.element.id + 'DefinitionLine' });\n for (var j = 0, len = chart.rows.length; j < len; j++) {\n var row = chart.rows[j];\n if (row.border.color) {\n this.drawBottomLine(row, j, true);\n }\n }\n for (var j = 0, len = chart.columns.length; j < len; j++) {\n var column = chart.columns[j];\n if (column.border.color) {\n this.drawBottomLine(column, j, false);\n }\n }\n if (!this.chart.enableCanvas) {\n axisElement.appendChild(this.element);\n }\n appendChildElement(chart.enableCanvas, chart.svgObject, axisElement, chart.redraw);\n return axisLineElement;\n };\n /**\n * To render the axis scrollbar\n *\n * @param {Chart} chart chart\n * @param {Axis} axis axis\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.renderScrollbar = function (chart, axis) {\n var isZoomed = isNullOrUndefined(chart.zoomModule) ? false : chart.zoomModule.isZoomed;\n if (((isZoomed && (axis.zoomFactor < 1 || axis.zoomPosition > 0)) || (axis.scrollbarSettings.enable &&\n (axis.zoomFactor <= 1 || axis.zoomPosition >= 0))) &&\n (!axis.zoomingScrollBar.isScrollUI || chart.visibleSeries[0].type.indexOf('Bar') >= 0)) {\n if (!chart.scrollElement) {\n chart.scrollElement = redrawElement(chart.redraw, chart.element.id + '_scrollElement') || createElement('div', { id: chart.element.id + '_scrollElement' });\n }\n appendChildElement(false, chart.scrollElement, axis.zoomingScrollBar.render(true), true);\n }\n else if (axis.zoomFactor === 1 && axis.zoomPosition === 0 && axis.zoomingScrollBar.svgObject && !axis.scrollbarSettings.enable) {\n axis.zoomingScrollBar.destroy();\n }\n if (axis.zoomingScrollBar.isScrollUI) {\n axis.zoomingScrollBar.isScrollUI = false;\n }\n };\n /**\n * To find the axis position\n *\n * @param {Axis} axis axis\n * @returns {boolean} axis position\n */\n CartesianAxisLayoutPanel.prototype.findAxisPosition = function (axis) {\n return axis.crossAt !== null && axis.isInside(axis.crossInAxis.visibleRange);\n };\n /**\n * To render the bootom line of the columns and rows\n *\n * @param {Row | Column} definition definition\n * @param {number} index index\n * @param {boolean} isRow isRow\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.drawBottomLine = function (definition, index, isRow) {\n var chart = this.chart;\n var optionsLine = {};\n var x1;\n var x2;\n var y1;\n var y2;\n var definitionName;\n if (isRow) {\n definition = definition;\n y1 = y2 = definition.computedTop + definition.computedHeight;\n x1 = this.seriesClipRect.x;\n x2 = x1 + this.seriesClipRect.width;\n definitionName = 'Row';\n }\n else {\n definition = definition;\n x1 = x2 = definition.computedLeft;\n y1 = this.seriesClipRect.y;\n y2 = y1 + this.seriesClipRect.height;\n definitionName = 'Column';\n }\n optionsLine = {\n 'id': chart.element.id + '_AxisBottom_' + definitionName + index,\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n 'stroke-width': definition.border.width,\n 'stroke': definition.border.color\n };\n this.htmlObject = chart.renderer.drawLine(optionsLine);\n this.element.appendChild(this.htmlObject);\n };\n /**\n * To render the axis line\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {number} plotX plotX\n * @param {number} plotY plotY\n * @param {Element} parent parent\n * @param {Rect} rect rect\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.drawAxisLine = function (axis, index, plotX, plotY, parent, rect) {\n var chart = this.chart;\n var optionsLine = {};\n var element = getElement(chart.element.id + 'AxisLine_' + index);\n var direction = element ? element.getAttribute('d') : '';\n element = null;\n optionsLine = {\n 'id': chart.element.id + 'AxisLine_' + index,\n 'd': 'M ' + (rect.x - plotX) + ' ' + (rect.y - plotY) +\n ' L ' + (rect.x + rect.width + plotX) + ' ' + (rect.y + rect.height + plotY),\n 'stroke-dasharray': axis.lineStyle.dashArray,\n 'stroke-width': axis.lineStyle.width,\n 'stroke': axis.lineStyle.color || chart.themeStyle.axisLine\n };\n this.htmlObject = chart.renderer.drawPath(optionsLine);\n appendChildElement(chart.enableCanvas, parent, this.htmlObject, chart.redraw, true, 'x', 'y', null, direction);\n };\n /**\n * To render the yAxis grid line\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {Element} parent parent\n * @param {Rect} rect rect\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.drawYAxisGridLine = function (axis, index, parent, rect) {\n var isLogAxis = axis.valueType === 'Logarithmic';\n var isCategoryAxis = axis.valueType.indexOf('Category') > -1;\n var tempInterval;\n var pointY = 0;\n var majorGrid = '';\n var majorTick = '';\n var minorGridDirection;\n var tickSize = axis.opposedPosition ? axis.majorTickLines.height : -axis.majorTickLines.height;\n var axisLineSize = (axis.opposedPosition) ? axis.lineStyle.width * 0.5 : -axis.lineStyle.width * 0.5;\n var ticksbwtLabel = (axis.valueType === 'Category' && axis.labelPlacement === 'BetweenTicks') ?\n 0.5 : 0;\n var scrollBarHeight = isNullOrUndefined(axis.crossesAt) ? axis.opposedPosition ? axis.scrollBarHeight :\n -axis.scrollBarHeight : 0;\n var isTickInside = axis.tickPosition === 'Inside';\n var ticks = isTickInside ? (rect.x - tickSize - axisLineSize) : (rect.x + tickSize + axisLineSize + scrollBarHeight);\n var length = axis.visibleLabels.length;\n var chartThemeStyle = this.chart.themeStyle;\n if (axis.valueType.indexOf('Category') > -1 && axis.labelPlacement === 'BetweenTicks' && length > 0) {\n length += 1;\n }\n var minorGridLines = axis.minorGridLines;\n var minorTickLines = axis.minorTickLines;\n //Gridlines\n for (var i = 0; i < length; i++) {\n tempInterval = !axis.visibleLabels[i] ? (axis.visibleLabels[i - 1].value + axis.visibleRange.interval) - ticksbwtLabel\n : axis.visibleLabels[i].value - ticksbwtLabel;\n pointY = valueToCoefficient(tempInterval, axis) * rect.height;\n pointY = (pointY * -1) + (rect.y + rect.height);\n if (pointY >= rect.y && (rect.y + rect.height) >= pointY) {\n if ((inside(tempInterval, axis.visibleRange)) || this.isBorder(axis, i, pointY)) {\n majorGrid = 'M ' + this.seriesClipRect.x + ' ' + (pointY) +\n ' L ' + (this.seriesClipRect.x + this.seriesClipRect.width) + ' ' + pointY;\n this.renderGridLine(axis, index, majorGrid, axis.majorGridLines, '_MajorGridLine_', i, this.element, chartThemeStyle.majorGridLine, axis.majorGridLines.dashArray);\n }\n majorTick = 'M ' + (rect.x + axisLineSize + (isTickInside ? scrollBarHeight : 0)) + ' ' + pointY +\n ' L ' + (ticks) + ' ' + pointY;\n this.renderGridLine(axis, index, majorTick, axis.majorTickLines, '_MajorTickLine_', i, parent, chartThemeStyle.majorTickLine);\n if ((minorGridLines.width > 0 || minorTickLines.width > 0) && axis.minorTicksPerInterval > 0) {\n if (i === 0 && isZoomSet(axis) && !isLogAxis && !isCategoryAxis) {\n this.renderMinorGridOnZooming(axis, tempInterval, rect, i, index, chartThemeStyle, parent);\n }\n minorGridDirection = this.drawAxisMinorLine(axis, tempInterval, rect, i);\n this.renderGridLine(axis, index, minorGridDirection[0], minorGridLines, '_MinorGridLine_', i, this.element, chartThemeStyle.minorGridLine, minorGridLines.dashArray);\n this.renderGridLine(axis, index, minorGridDirection[1], minorTickLines, '_MinorTickLine_', i, parent, chartThemeStyle.minorTickLine);\n if (i === length - 1 && isZoomSet(axis) && isLogAxis && !isCategoryAxis) {\n this.renderMinorGridOnZooming(axis, (tempInterval + axis.visibleRange.interval), rect, i, index, chartThemeStyle, parent);\n }\n }\n }\n }\n };\n /**\n * To check the border of the axis\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {number} value value\n * @returns {boolean} check the border of the axis\n */\n CartesianAxisLayoutPanel.prototype.isBorder = function (axis, index, value) {\n var border = this.chart.chartArea.border;\n var rect = this.seriesClipRect;\n var orientation = axis.orientation;\n var start = (orientation === 'Horizontal') ? rect.x : rect.y;\n var size = (orientation === 'Horizontal') ? rect.width : rect.height;\n var startIndex = (orientation === 'Horizontal') ? 0 : axis.visibleLabels.length - 1;\n var endIndex = (orientation === 'Horizontal') ? axis.visibleLabels.length - 1 : 0;\n if (axis.plotOffset > 0) {\n return true;\n }\n else if ((value === start || value === (start + size)) && (border.width <= 0 || border.color === 'transparent')) {\n return true;\n }\n else if ((value !== start && index === startIndex) || (value !== (start + size) && index === endIndex)) {\n return true;\n }\n return false;\n };\n /**\n * To render the yAxis label\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {Element} parent parent\n * @param {Rect} rect rect\n * @returns {void}\n * @private\n */\n CartesianAxisLayoutPanel.prototype.drawYAxisLabels = function (axis, index, parent, rect) {\n var chart = this.chart;\n var pointX = 0;\n var pointY = 0;\n var elementSize;\n var labelSpace = axis.labelPadding;\n var options;\n var isAxisBreakLabel;\n var isLabelInside = axis.labelPosition === 'Inside';\n var isOpposed = axis.opposedPosition;\n var tickSpace = axis.labelPosition === axis.tickPosition ? axis.majorTickLines.height : 0;\n var padding = tickSpace + labelSpace + axis.lineStyle.width * 0.5;\n padding = (axis.opposedPosition) ? padding : -padding;\n var defaultAnchor = ((isOpposed && isLabelInside) || (!isOpposed && !isLabelInside)) ? 'end' : 'start';\n defaultAnchor = chart.isRtlEnabled ? ((axis.opposedPosition) ? 'end' : 'start') : defaultAnchor;\n var labelElement = chart.renderer.createGroup({ id: chart.element.id + 'AxisLabels' + index });\n var scrollBarHeight = isNullOrUndefined(axis.crossesAt) ? axis.scrollBarHeight * (isOpposed ? 1 : -1) : 0;\n var textHeight;\n var textPadding;\n var maxLineWidth;\n var pixel = 10;\n for (var i = 0, len = axis.visibleLabels.length; i < len; i++) {\n isAxisBreakLabel = isBreakLabel(axis.visibleLabels[i].originalText);\n pointX = isLabelInside ? (rect.x - padding) : (rect.x + padding + scrollBarHeight);\n elementSize = isAxisBreakLabel ? axis.visibleLabels[i].breakLabelSize : axis.visibleLabels[i].size;\n pointY = (valueToCoefficient(axis.visibleLabels[i].value, axis) * rect.height) + (chart.stockChart ? 7 : 0);\n pointY = Math.floor((pointY * -1) + (rect.y + rect.height));\n textHeight = ((elementSize.height / 8) * axis.visibleLabels[i].text.length / 2);\n textPadding = ((elementSize.height / 4) * 3) + 3;\n pointY = (isAxisBreakLabel ? (axis.labelPosition === 'Inside' ? (pointY - (elementSize.height / 2) - textHeight + textPadding)\n : (pointY - textHeight)) : (axis.labelPosition === 'Inside' ? (pointY + textPadding) : pointY + (elementSize.height / 4)));\n if (axis.majorGridLines.width > axis.majorTickLines.width) {\n maxLineWidth = axis.majorGridLines.width;\n }\n else {\n maxLineWidth = axis.majorTickLines.width;\n }\n if (axis.labelStyle.textAlignment === 'Far') {\n pointY = pointY - maxLineWidth - pixel;\n }\n else if (axis.labelStyle.textAlignment === 'Near') {\n pointY = pointY + maxLineWidth + pixel;\n }\n else if (axis.labelStyle.textAlignment === 'Center') {\n // eslint-disable-next-line no-self-assign\n pointY = pointY;\n }\n pointX = isAxisBreakLabel ? this.getAxisLabelXvalue(pointX, axis, elementSize.width) : pointX;\n var anchor = isAxisBreakLabel ? this.getAnchor(axis) : defaultAnchor;\n options = new TextOption(chart.element.id + index + '_AxisLabel_' + i, pointX, pointY, anchor, axis.visibleLabels[i].text);\n if (axis.edgeLabelPlacement) {\n switch (axis.edgeLabelPlacement) {\n case 'None':\n break;\n case 'Hide':\n if (((i === 0 || (axis.isInversed && i === len - 1)) && options.y > rect.y + rect.height) ||\n (((i === len - 1) || (axis.isInversed && i === 0)) && options.y - elementSize.height * 0.5 < rect.y)) {\n options.text = '';\n }\n break;\n case 'Shift':\n if ((i === 0 || (axis.isInversed && i === len - 1)) && options.y > rect.y + rect.height) {\n options.y = pointY = rect.y + rect.height;\n }\n else if (((i === len - 1) || (axis.isInversed && i === 0)) && (options.y - elementSize.height * 0.5 < rect.y)) {\n options.y = pointY = rect.y + elementSize.height * 0.5;\n }\n break;\n }\n }\n textElement(chart.renderer, options, axis.labelStyle, axis.labelStyle.color || chart.themeStyle.axisLabel, labelElement, false, chart.redraw, true, true, null, null, null, null, chart.enableCanvas);\n }\n if (!this.chart.enableCanvas) {\n if (!chart.delayRedraw) {\n appendChildElement(chart.enableCanvas, parent, labelElement, chart.redraw);\n }\n else if (axis.visible && axis.internalVisibility) {\n this.createZoomingLabel(this.chart, labelElement, axis, index, rect);\n }\n }\n };\n /**\n * To get X value based on lineBreakAlignment for Y axis line break labels only.\n *\n * @param {number} x text x position\n * @param {Axis} axis y axis values\n * @param {number} textWidth axis label width\n * @returns {number} returns suitable axis label x position\n */\n CartesianAxisLayoutPanel.prototype.getAxisLabelXvalue = function (x, axis, textWidth) {\n var anchor = axis.lineBreakAlignment;\n var isLabelInside = axis.labelPosition === 'Inside';\n var isOpposed = axis.opposedPosition;\n if ((isOpposed && isLabelInside) || (!isOpposed && !isLabelInside)) {\n return (anchor === 'Right' ? x : (anchor === 'Center' ? (x - textWidth / 2) : (x - textWidth)));\n }\n else {\n return (anchor === 'Left' ? x : (anchor === 'Center' ? (x + textWidth / 2) : (x + textWidth)));\n }\n };\n /**\n * To render the yAxis label border.\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {Element} parent parent\n * @param {Rect} rect rect\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.drawYAxisBorder = function (axis, index, parent, rect) {\n if (axis.border.width > 0) {\n var startY = void 0;\n var pointY = void 0;\n var scrollBarHeight = axis.labelPosition === 'Outside' ? axis.scrollBarHeight : 0;\n scrollBarHeight = (axis.opposedPosition ? 1 : -1) * scrollBarHeight;\n var gap = (rect.height / axis.visibleRange.delta) * (axis.valueType === 'DateTime' ? axis.dateTimeInterval\n : axis.visibleRange.interval);\n var endY = void 0;\n var length_1 = axis.maxLabelSize.width + 10 + ((axis.tickPosition === axis.labelPosition) ?\n axis.majorTickLines.height : 0);\n var labelBorder = '';\n var ticksbwtLabel = (axis.valueType === 'Category' && axis.labelPlacement === 'BetweenTicks') ? -0.5 : 0;\n var endX = ((axis.opposedPosition && axis.labelPosition === 'Inside') || (!axis.opposedPosition\n && axis.labelPosition === 'Outside')) ? rect.x - length_1 + scrollBarHeight : rect.x + length_1 + scrollBarHeight;\n for (var i = 0, len = axis.visibleLabels.length; i < len; i++) {\n pointY = valueToCoefficient(axis.visibleLabels[i].value + ticksbwtLabel, axis);\n pointY = (axis.isInversed ? (1 - pointY) : pointY) * rect.height;\n if (axis.valueType === 'Category' && axis.labelPlacement === 'BetweenTicks') {\n startY = (pointY * -1) + (rect.y + rect.height);\n endY = (pointY * -1) - (gap) + (rect.y + rect.height);\n }\n else {\n startY = (pointY * -1) + gap / 2 + (rect.y + rect.height);\n endY = (pointY * -1) - gap / 2 + (rect.y + rect.height);\n }\n switch (axis.border.type) {\n case 'Rectangle':\n case 'WithoutTopBorder':\n if (startY > (rect.y + rect.height)) {\n labelBorder += ('M' + ' ' + endX + ' ' + (rect.y + rect.height) + ' ' + 'L' + ' ' + endX + ' ' + endY + ' ');\n }\n else if (Math.floor(rect.y) > (endY)) {\n labelBorder += ('M' + ' ' + (rect.x + scrollBarHeight) + ' ' + startY + ' ' + 'L' + ' ' + endX\n + ' ' + startY + ' ' + 'L' + ' ' + endX + ' ' + (rect.y) + ' ');\n }\n else {\n labelBorder += ('M' + ' ' + (rect.x + scrollBarHeight) + ' ' + startY + ' ' + 'L' + ' ' + endX +\n ' ' + startY + ' ' + 'L' + ' ' + endX + ' ' + endY + ' ');\n if (i === axis.visibleLabels.length - 1) {\n labelBorder += ('M' + ' ' + (rect.x + scrollBarHeight) + ' ' + endY + ' ' + 'L' + ' ' +\n endX + ' ' + endY + ' ');\n }\n }\n break;\n case 'WithoutTopandBottomBorder':\n if (!(startY > rect.y + rect.height) && !((endY) < Math.floor(rect.y))) {\n labelBorder += ('M' + ' ' + (rect.x + scrollBarHeight) + ' ' + startY + ' ' + 'L' + ' ' + endX +\n ' ' + startY + ' ' + 'M' + ' ' + endX + ' ' + endY + ' ' +\n 'L' + ' ' + (rect.x + scrollBarHeight) + ' ' + endY);\n }\n break;\n }\n }\n labelBorder += (axis.border.type === 'Rectangle') ? ('M' + ' ' + (rect.x + scrollBarHeight) + ' ' + rect.y + ' ' + 'L' + ' ' +\n (rect.x + scrollBarHeight) + ' ' + (rect.y + rect.height) + ' ') : '';\n if (labelBorder !== '') {\n this.createAxisBorderElement(axis, index, labelBorder, parent);\n }\n }\n if (axis.multiLevelLabels.length > 0 && this.chart.multiLevelLabelModule) {\n this.chart.multiLevelLabelModule.renderYAxisMultiLevelLabels(axis, index, parent, rect);\n }\n };\n /**\n * To render the yAxis title\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {Element} parent parent\n * @param {Rect} rect rect\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.drawYAxisTitle = function (axis, index, parent, rect) {\n if (axis.title) {\n var chart = this.chart;\n var labelRotation = (axis.opposedPosition) ? 90 : -90;\n var padding = (axis.tickPosition === 'Inside' ? 0 : axis.majorTickLines.height + axis.titlePadding) +\n (axis.labelPosition === 'Inside' ? 0 :\n (axis.maxLabelSize.width + axis.multiLevelLabelHeight + this.padding));\n padding = axis.opposedPosition ? padding + axis.scrollBarHeight : -padding - axis.scrollBarHeight;\n var x = rect.x + padding;\n var y = rect.y + rect.height * 0.5;\n var titleSize = (axis.titleSize.height * (axis.titleCollection.length - 1));\n var options = new TextOption(chart.element.id + '_AxisTitle_' + index, x, y - axis.labelPadding - titleSize, 'middle', axis.titleCollection, 'rotate(' + labelRotation + ',' + (x) + ',' + (y) + ')', null, labelRotation);\n var element = textElement(chart.renderer, options, axis.titleStyle, axis.titleStyle.color || chart.themeStyle.axisTitle, parent, null, null, null, null, null, null, null, null, chart.enableCanvas);\n element.setAttribute('tabindex', axis.tabIndex.toString());\n element.setAttribute('aria-label', axis.description || axis.title);\n }\n };\n /**\n * xAxis grid line calculation performed here\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {Element} parent parent\n * @param {Rect} rect rect\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.drawXAxisGridLine = function (axis, index, parent, rect) {\n var isLogAxis = axis.valueType === 'Logarithmic';\n var isCategoryAxis = axis.valueType.indexOf('Category') > -1;\n var tempInterval;\n var pointX = 0;\n var majorGrid = '';\n var majorTick = '';\n var minorDirection;\n var tickSize = (axis.opposedPosition) ? -axis.majorTickLines.height : axis.majorTickLines.height;\n var axisLineSize = (axis.opposedPosition) ? -axis.lineStyle.width * 0.5 : axis.lineStyle.width * 0.5;\n var scrollBarHeight = isNullOrUndefined(axis.crossesAt) ? axis.opposedPosition ? -axis.scrollBarHeight :\n axis.scrollBarHeight : 0;\n var ticksbwtLabel = (axis.valueType.indexOf('Category') > -1 && axis.labelPlacement === 'BetweenTicks') ?\n 0.5 : 0;\n var length = axis.visibleLabels.length;\n var isTickInside = axis.tickPosition === 'Inside';\n var ticks = isTickInside ? (rect.y - tickSize - axisLineSize) : (rect.y + tickSize + axisLineSize + scrollBarHeight);\n var chartThemeStyle = this.chart.themeStyle;\n if (axis.valueType.indexOf('Category') > -1 && length > 0 && axis.labelPlacement === 'BetweenTicks') {\n length += 1;\n }\n //Gridlines\n for (var i = 0; i < length; i++) {\n if (axis.valueType !== 'DateTimeCategory') {\n tempInterval = axis.visibleLabels[i] ? axis.visibleLabels[i].value - ticksbwtLabel\n : (axis.visibleLabels[i - 1].value + axis.visibleRange.interval) - ticksbwtLabel;\n }\n else {\n tempInterval = axis.visibleLabels[i] ?\n axis.visibleLabels[i].value - ticksbwtLabel : axis.visibleRange.max;\n }\n pointX = (valueToCoefficient(tempInterval, axis) * rect.width) + rect.x;\n if (pointX >= rect.x && (rect.x + rect.width) >= pointX) {\n if (inside(tempInterval, axis.visibleRange) || this.isBorder(axis, i, pointX)) {\n majorGrid = 'M ' + pointX + ' ' + (this.seriesClipRect.y + this.seriesClipRect.height) +\n ' L ' + pointX + ' ' + this.seriesClipRect.y;\n this.renderGridLine(axis, index, majorGrid, axis.majorGridLines, '_MajorGridLine_', i, this.element, chartThemeStyle.majorGridLine, axis.majorGridLines.dashArray);\n }\n majorTick = 'M ' + (pointX) + ' ' + (rect.y + axisLineSize + (isTickInside ? scrollBarHeight : 0))\n + ' L ' + (pointX) + ' ' + ticks;\n this.renderGridLine(axis, index, majorTick, axis.majorTickLines, '_MajorTickLine_', i, parent, chartThemeStyle.majorTickLine);\n if (axis.minorTicksPerInterval > 0 && (axis.minorGridLines.width > 0 || axis.minorTickLines.width > 0)) {\n if (i === 0 && isZoomSet(axis) && !isLogAxis && !isCategoryAxis) {\n this.renderMinorGridOnZooming(axis, tempInterval, rect, i, index, chartThemeStyle, parent);\n }\n minorDirection = this.drawAxisMinorLine(axis, tempInterval, rect, i);\n this.renderGridLine(axis, index, minorDirection[0], axis.minorGridLines, '_MinorGridLine_', i, this.element, chartThemeStyle.minorGridLine, axis.minorGridLines.dashArray);\n this.renderGridLine(axis, index, minorDirection[1], axis.minorTickLines, '_MinorTickLine_', i, parent, chartThemeStyle.minorTickLine);\n if (i === length - 1 && isZoomSet(axis) && isLogAxis && !isCategoryAxis) {\n this.renderMinorGridOnZooming(axis, (tempInterval + axis.visibleRange.interval), rect, i, index, chartThemeStyle, parent);\n }\n }\n }\n }\n };\n /**\n * To render missing minor grid lines while zooming\n *\n * @param {Axis} axis axis\n * @param {number} tempInterval tempInterval\n * @param {Rect} rect rect\n * @param {number} i i\n * @param {number} index index\n * @param {IThemeStyle} chartThemeStyle chartThemeStyle\n * @param {Element} parent parent\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.renderMinorGridOnZooming = function (axis, tempInterval, rect, i, index, chartThemeStyle, parent) {\n var minorDirection = this.drawAxisMinorLine(axis, tempInterval, rect, i, true);\n this.renderGridLine(axis, index, minorDirection[0], axis.minorGridLines, '_MinorGridLine_', -1, this.element, chartThemeStyle.minorGridLine, axis.minorGridLines.dashArray);\n this.renderGridLine(axis, index, minorDirection[1], axis.minorTickLines, '_MinorTickLine_', -1, parent, chartThemeStyle.minorTickLine);\n };\n /**\n * To calcualte the axis minor line\n *\n * @param {Axis} axis axis\n * @param {number} tempInterval tempInterval\n * @param {Rect} rect rect\n * @param {number} labelIndex labelIndex\n * @param {boolean} isFirstLabel isFirstLabel\n * @returns {string[]} axis minor line path\n */\n CartesianAxisLayoutPanel.prototype.drawAxisMinorLine = function (axis, tempInterval, rect, labelIndex, isFirstLabel) {\n var value = tempInterval;\n var coor = 0;\n var position = 0;\n var range = axis.visibleRange;\n var isTickInside = axis.tickPosition === 'Inside';\n var direction = [];\n var tickSize = axis.opposedPosition ? -axis.minorTickLines.height : axis.minorTickLines.height;\n var logStart;\n var logEnd;\n var logInterval = 1;\n var logPosition = 1;\n var ticksX = isTickInside ? (rect.y - tickSize) : (rect.y + tickSize);\n var ticksY = isTickInside ? (rect.x + tickSize) : (rect.x - tickSize);\n var minorGird = '';\n var minorTick = '';\n if (axis.valueType === 'Logarithmic') {\n logStart = Math.pow(axis.logBase, value - range.interval);\n logEnd = Math.pow(axis.logBase, value);\n logInterval = (logEnd - logStart) / (axis.minorTicksPerInterval + 1);\n logPosition = logStart + logInterval;\n }\n if (axis.orientation === 'Horizontal') {\n for (var j = 0; j < axis.minorTicksPerInterval; j++) {\n value = this.findLogNumeric(axis, logPosition, value, labelIndex, isFirstLabel);\n logPosition += logInterval;\n if (inside(value, range)) {\n position = ((value - range.min) / (range.max - range.min));\n position = Math.ceil((axis.isInversed ? (1 - position) : position) * rect.width);\n coor = (Math.floor(position + rect.x));\n minorGird = minorGird.concat('M' + ' ' + coor + ' ' + (this.seriesClipRect.y)\n + 'L ' + coor + ' ' + (this.seriesClipRect.y + this.seriesClipRect.height));\n coor = (Math.floor(position + rect.x));\n minorTick = minorTick.concat('M' + ' ' + coor + ' ' + (rect.y)\n + 'L ' + coor + ' ' + (ticksX + axis.scrollBarHeight));\n }\n }\n }\n else {\n for (var j = 0; j < axis.minorTicksPerInterval; j++) {\n value = this.findLogNumeric(axis, logPosition, value, labelIndex, isFirstLabel);\n if (inside(value, range)) {\n position = ((value - range.min) / (range.max - range.min));\n position = Math.ceil(((axis.isInversed ? (1 - position) : position)) * rect.height) * -1; // For inversed axis\n coor = (Math.floor(position + rect.y + rect.height));\n minorGird = minorGird.concat('M' + ' ' + (this.seriesClipRect.x) + ' ' + coor\n + 'L ' + (this.seriesClipRect.x + this.seriesClipRect.width) + ' ' + coor + ' ');\n coor = (Math.floor(position + rect.y + rect.height));\n minorTick = minorTick.concat('M' + ' ' + rect.x + ' ' + coor + 'L ' + (ticksY - axis.scrollBarHeight) +\n ' ' + coor + ' ');\n }\n logPosition += logInterval;\n }\n }\n direction.push(minorGird);\n direction.push(minorTick);\n return direction;\n };\n /**\n * To find the numeric value of the log\n *\n * @param {Axis} axis axis\n * @param {number} logPosition logPosition\n * @param {number} value value\n * @param {number} labelIndex labelIndex\n * @param {boolean} isFirstLabel isFirstLabel\n * @returns {number} value\n */\n CartesianAxisLayoutPanel.prototype.findLogNumeric = function (axis, logPosition, value, labelIndex, isFirstLabel) {\n var range = axis.visibleRange;\n var tempValue;\n if (axis.valueType === 'Logarithmic') {\n value = logBase(logPosition, axis.logBase);\n }\n else if (axis.valueType === 'DateTime') {\n tempValue = axis.dateTimeInterval / (axis.minorTicksPerInterval + 1);\n value = isFirstLabel ? (value - tempValue) : (value + tempValue);\n }\n else if (axis.valueType === 'DateTimeCategory') {\n var padding = axis.labelPlacement === 'BetweenTicks' ? 0.5 : 0;\n value += ((axis.visibleLabels[labelIndex + 1] ?\n axis.visibleLabels[labelIndex + 1].value - padding : axis.visibleRange.max) -\n (axis.visibleLabels[labelIndex] ?\n axis.visibleLabels[labelIndex].value - padding : axis.visibleRange.min)) /\n (axis.minorTicksPerInterval + 1);\n }\n else {\n tempValue = range.interval / (axis.minorTicksPerInterval + 1);\n value = isFirstLabel ? (value - tempValue) : (value + tempValue);\n }\n return value;\n };\n /**\n * To render the xAxis Labels\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {Element} parent parent\n * @param {Rect} rect rect\n * @returns {void}\n * @private\n */\n CartesianAxisLayoutPanel.prototype.drawXAxisLabels = function (axis, index, parent, rect) {\n var chart = this.chart;\n var pointX = 0;\n var pointY = 0;\n var labelSpace = axis.labelPadding;\n var labelHeight;\n var elementSize;\n var labelPadding;\n var anchor;\n var pixel = 10;\n var labelElement = chart.renderer.createGroup({ id: chart.element.id + 'AxisLabels' + index });\n var islabelInside = axis.labelPosition === 'Inside';\n var isOpposed = axis.opposedPosition;\n var tickSpace = axis.labelPosition === axis.tickPosition ? axis.majorTickLines.height : 0;\n var padding = tickSpace + labelSpace + axis.lineStyle.width * 0.5;\n var angle = axis.angle % 360;\n var isHorizontalAngle = (angle === 0 || angle === -180 || angle === 180);\n var options;\n var labelWidth;\n var previousEnd = axis.isInversed ? (rect.x + rect.width) : rect.x;\n var width = 0;\n var length = axis.visibleLabels.length;\n var intervalLength;\n var label;\n var isAxisBreakLabel;\n var scrollBarHeight = axis.scrollbarSettings.enable || (!islabelInside && isNullOrUndefined(axis.crossesAt)\n && (axis.zoomFactor < 1 || axis.zoomPosition > 0)) ? axis.scrollBarHeight : 0;\n var newPoints = [];\n var isRotatedLabelIntersect = false;\n padding += (angle === 90 || angle === 270 || angle === -90 || angle === -270) ? (islabelInside ? 5 : -5) : 0;\n var isLabelUnderAxisLine = ((!isOpposed && !islabelInside) || (isOpposed && islabelInside));\n var isEndAnchor = isLabelUnderAxisLine ?\n ((360 >= angle && angle >= 180) || (-1 >= angle && angle >= -180)) :\n ((1 <= angle && angle <= 180) || (-181 >= angle && angle >= -360));\n for (var i = 0, len = length; i < len; i++) {\n label = axis.visibleLabels[i];\n isAxisBreakLabel = isBreakLabel(label.originalText);\n pointX = (valueToCoefficient(label.value, axis) * rect.width) + rect.x;\n elementSize = label.size;\n intervalLength = rect.width / length;\n labelWidth = isAxisBreakLabel ? label.breakLabelSize.width : elementSize.width;\n width = ((axis.labelIntersectAction === 'Trim' || axis.labelIntersectAction === 'Wrap') && angle === 0 &&\n labelWidth > intervalLength) ? intervalLength : labelWidth;\n labelHeight = elementSize.height / 4;\n pointX -= (isAxisBreakLabel || angle !== 0) ? 0 : (width / 2);\n // label X value adjustment for label rotation (Start)\n if (angle !== 0) {\n if (isAxisBreakLabel) {\n pointX -= axis.lineBreakAlignment === 'Left' ? (label.breakLabelSize.width / 2) : axis.lineBreakAlignment === 'Right' ?\n -(label.breakLabelSize.width / 2) : 0;\n }\n else {\n pointX -= (angle === -90 || angle === 270 ? -labelHeight : (angle === 90 || angle === -270) ? labelHeight : 0);\n }\n }\n // label X value adjustment for label rotation (End)\n if (axis.labelStyle.textAlignment === 'Far') {\n pointX = pointX + width - pixel;\n }\n else if (axis.labelStyle.textAlignment === 'Near') {\n pointX = pointX - width + pixel;\n }\n else if (axis.labelStyle.textAlignment === 'Center') {\n // eslint-disable-next-line no-self-assign\n pointX = pointX;\n }\n // For line break label alignment like left, right & center in angle 0\n if (isAxisBreakLabel && axis.lineBreakAlignment !== 'Center' && angle === 0) {\n pointX += axis.lineBreakAlignment === 'Left' ? -(width / 2) : (width / 2);\n }\n var paddingForBreakLabel = isAxisBreakLabel ?\n (isHorizontalAngle ? (elementSize.height) : (label.breakLabelSize.width / 2)) : 0;\n padding = isAxisBreakLabel ? (tickSpace + labelSpace + axis.lineStyle.width * 0.5) : padding;\n // label Y value adjustment (Start)\n if (islabelInside && angle) {\n if (isAxisBreakLabel) {\n pointY = isOpposed ? (rect.y + padding + (paddingForBreakLabel)) : (rect.y - padding - (paddingForBreakLabel));\n }\n else {\n pointY = isOpposed ? (rect.y + padding + labelHeight) : (rect.y - padding - labelHeight);\n }\n }\n else {\n if (isAxisBreakLabel) {\n labelPadding = !isLabelUnderAxisLine ? -(padding + scrollBarHeight + (paddingForBreakLabel)) :\n padding + scrollBarHeight + (angle ? paddingForBreakLabel : (3 * labelHeight));\n }\n else {\n labelPadding = !isLabelUnderAxisLine ?\n -(padding + scrollBarHeight + (angle ? labelHeight : (label.index > 1 ? (2 * labelHeight) : 0))) :\n padding + scrollBarHeight + ((angle ? 1 : 3) * labelHeight);\n }\n pointY = (rect.y + (labelPadding * label.index));\n }\n // label Y value adjustment (End)\n if (isAxisBreakLabel) {\n anchor = this.getAnchor(axis); // for break label self alignment\n }\n else {\n anchor = (chart.isRtlEnabled || isEndAnchor) ? 'end' : '';\n }\n options = new TextOption(chart.element.id + index + '_AxisLabel_' + i, pointX, pointY, anchor);\n if (axis.edgeLabelPlacement && (angle === 0)) {\n switch (axis.edgeLabelPlacement) {\n case 'None':\n break;\n case 'Hide':\n if (((i === 0 || (axis.isInversed && i === len - 1)) && options.x < rect.x) ||\n ((i === len - 1 || (axis.isInversed && i === 0)) && (options.x + width > rect.x + rect.width))) {\n continue;\n }\n break;\n case 'Shift':\n if ((i === 0 || (axis.isInversed && i === len - 1)) && options.x < rect.x) {\n intervalLength -= (rect.x - options.x);\n options.x = pointX = rect.x;\n }\n else if ((i === len - 1 || (axis.isInversed && i === 0)) && ((options.x + width) > rect.x + rect.width)) {\n if (elementSize.width > intervalLength && axis.labelIntersectAction === 'Trim') {\n intervalLength -= (options.x + width - (rect.x + rect.width));\n }\n else {\n intervalLength = width;\n }\n options.x = pointX = rect.x + rect.width - intervalLength;\n }\n break;\n }\n }\n options.text = this.getLabelText(label, axis, intervalLength);\n // ------- Hide Calculation (Start) -------------\n // Currect label actual start value (Start)\n var xValue = void 0;\n var xValue2 = void 0;\n if (isAxisBreakLabel && angle === 0) {\n if (axis.lineBreakAlignment === 'Right') {\n xValue = (options.x - width);\n xValue2 = options.x;\n }\n else if (axis.lineBreakAlignment === 'Center') {\n xValue = (options.x - (width / 2));\n xValue2 = options.x + (width / 2);\n }\n else {\n xValue = options.x;\n xValue2 = options.x + width;\n }\n }\n else {\n xValue = options.x;\n xValue2 = options.x + width;\n }\n // Currect label actual start value (End)\n if (angle === 0 && axis.labelIntersectAction === 'Hide' && i !== 0 &&\n (!axis.isInversed ? xValue <= previousEnd : xValue2 >= previousEnd)) {\n continue;\n }\n // Previous label actual end value (Start)\n if (isAxisBreakLabel) {\n if (axis.lineBreakAlignment === 'Right') {\n previousEnd = axis.isInversed ? (options.x - width) : options.x;\n }\n else if (axis.lineBreakAlignment === 'Center') {\n previousEnd = axis.isInversed ? (options.x - (width / 2)) : options.x + (width / 2);\n }\n else {\n previousEnd = axis.isInversed ? options.x : options.x + width;\n }\n }\n else {\n previousEnd = axis.isInversed ? options.x : options.x + width;\n }\n // Previous label actual end value (End)\n // ------- Hide Calculation (End) -------------\n // label Rotataion calculation (Start)\n if (angle !== 0) {\n var height = void 0;\n var rect_1 = void 0;\n if (isAxisBreakLabel) {\n var xAdjustment = 0;\n var yAdjustment = 0;\n height = (label.breakLabelSize.height);\n yAdjustment = (label.breakLabelSize.height) - 4; // 4 for label bound correction\n // xAdjustment (Start)\n if (axis.lineBreakAlignment === 'Center') {\n xAdjustment = -(label.breakLabelSize.width / 2);\n }\n else if (axis.lineBreakAlignment === 'Right') {\n xAdjustment = -label.breakLabelSize.width;\n }\n // xAdjustment (End)\n if (isLabelUnderAxisLine) {\n yAdjustment = (label.breakLabelSize.height) / (options.text.length + 1);\n }\n rect_1 = new Rect(options.x + xAdjustment, options.y - (yAdjustment), label.breakLabelSize.width, height);\n }\n else {\n height = (pointY) - (options.y - ((label.size.height / 2) + 10));\n rect_1 = new Rect(options.x, options.y - ((label.size.height / 2) - 5), label.size.width, height);\n }\n var rectCoordinates = this.getRectanglePoints(rect_1);\n var rectCenterX = isAxisBreakLabel ? rect_1.x + (rect_1.width / 2) : pointX;\n var rectCenterY = isAxisBreakLabel ? rect_1.y + (rect_1.height / 2) : (pointY - (height / 2));\n if (isAxisBreakLabel) {\n options.transform = 'rotate(' + angle + ',' + rectCenterX + ',' + rectCenterY + ')';\n }\n else {\n options.transform = 'rotate(' + angle + ',' + pointX + ',' + pointY + ')';\n }\n newPoints.push(getRotatedRectangleCoordinates(rectCoordinates, rectCenterX, rectCenterY, angle));\n isRotatedLabelIntersect = false;\n for (var index_1 = i; index_1 > 0; index_1--) {\n if (newPoints[i] && newPoints[index_1 - 1] && isRotatedRectIntersect(newPoints[i], newPoints[index_1 - 1])) {\n isRotatedLabelIntersect = true;\n newPoints[i] = null;\n break;\n }\n }\n }\n // label Rotataion calculation (End)\n textElement(chart.renderer, options, label.labelStyle, label.labelStyle.color || chart.themeStyle.axisLabel, labelElement, (axis.opposedPosition !== (axis.labelPosition === 'Inside')), chart.redraw, true, null, null, null, label.size, isRotatedLabelIntersect, chart.enableCanvas);\n }\n if (!this.chart.enableCanvas) {\n if (!chart.delayRedraw) {\n parent.appendChild(labelElement);\n }\n else if (axis.visible && axis.internalVisibility) {\n this.createZoomingLabel(this.chart, labelElement, axis, index, rect);\n }\n }\n };\n /**\n * To get text anchor value for line break labels.\n *\n * @param {Axis} axis axis model\n * @returns {string} returns text anchor\n */\n CartesianAxisLayoutPanel.prototype.getAnchor = function (axis) {\n return (axis.lineBreakAlignment === 'Center' ? 'middle' : (axis.lineBreakAlignment === 'Left' ? 'start' : 'end'));\n };\n /**\n * Get rect coordinates\n *\n * @param {Rect} rect rect\n * @returns {ChartLocation[]} rectangle points\n */\n CartesianAxisLayoutPanel.prototype.getRectanglePoints = function (rect) {\n var point1 = new ChartLocation(rect.x, rect.y);\n var point2 = new ChartLocation(rect.x + rect.width, rect.y);\n var point3 = new ChartLocation(rect.x + rect.width, rect.y + rect.height);\n var point4 = new ChartLocation(rect.x, rect.y + rect.height);\n return [point1, point2, point3, point4];\n };\n /**\n * To get axis label text\n *\n * @param {VisibleLabels} label label\n * @param {Axis} axis axis\n * @param {number} intervalLength intervalLength\n * @returns {string | string[]} label or label collection\n */\n CartesianAxisLayoutPanel.prototype.getLabelText = function (label, axis, intervalLength) {\n if (isBreakLabel(label.originalText)) {\n var result = [];\n var str = void 0;\n for (var index = 0; index < label.text.length; index++) {\n str = this.findAxisLabel(axis, label.text[index], intervalLength);\n result.push(str);\n }\n return result;\n }\n else {\n return this.findAxisLabel(axis, label.text, intervalLength);\n }\n };\n /**\n * To render the x-axis label border.\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {Element} parent parent\n * @param {Rect} axisRect axisRect\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.drawXAxisBorder = function (axis, index, parent, axisRect) {\n if (axis.border.width > 0) {\n var scrollBarHeight = axis.labelPosition === 'Outside' ? axis.scrollBarHeight : 0;\n var startX = void 0;\n var startY = axisRect.y + ((axis.opposedPosition ? -1 : 1) * scrollBarHeight);\n var padding = 10;\n var pointX = void 0;\n var gap = (axisRect.width / axis.visibleRange.delta) * (axis.valueType === 'DateTime' ? axis.dateTimeInterval\n : axis.visibleRange.interval);\n var endX = void 0;\n var length_2 = axis.maxLabelSize.height +\n ((axis.tickPosition === axis.labelPosition) ? axis.majorTickLines.height : 0);\n var labelBorder = '';\n var ticksbwtLabel = (axis.valueType === 'Category' && axis.labelPlacement === 'BetweenTicks') ? -0.5 : 0;\n var endY = ((axis.opposedPosition && axis.labelPosition === 'Inside') ||\n (!axis.opposedPosition && axis.labelPosition === 'Outside')) ?\n (axisRect.y + length_2 + padding + scrollBarHeight) : (axisRect.y - length_2 - padding - scrollBarHeight);\n for (var i = 0, len = axis.visibleLabels.length; i < len; i++) {\n pointX = valueToCoefficient(axis.visibleLabels[i].value + ticksbwtLabel, axis);\n pointX = (axis.isInversed ? (1 - pointX) : pointX) * axisRect.width;\n if (axis.valueType === 'Category' && axis.labelPlacement === 'BetweenTicks') {\n startX = pointX + axisRect.x;\n endX = pointX + (gap) + axisRect.x;\n }\n else {\n startX = pointX - gap * 0.5 + axisRect.x;\n endX = pointX + gap * 0.5 + axisRect.x;\n }\n switch (axis.border.type) {\n case 'Rectangle':\n case 'WithoutTopBorder':\n if (startX < axisRect.x) {\n labelBorder += ('M' + ' ' + axisRect.x + ' ' + endY + ' ' + 'L' + ' ' + endX + ' ' + endY + ' ');\n }\n else if (Math.floor(endX) > axisRect.width + axisRect.x && !(axis.visibleLabels.length === 1)) {\n labelBorder += ('M' + ' ' + startX + ' ' + startY + ' ' + 'L' + ' ' + startX + ' ' + endY + ' ' +\n 'L' + ' ' + (axisRect.width + axisRect.x) + ' ' + endY + ' ');\n }\n else {\n labelBorder += ('M' + ' ' + startX + ' ' + startY + ' ' + 'L' + ' ' + startX + ' ' +\n endY + ' ' + 'L' + ' ' + endX + ' ' + endY + ' ');\n if (i === 0) {\n labelBorder += ('M' + ' ' + startX + ' ' + startY + ' ' + 'L' + ' ' + startX + ' ' + endY + ' ' +\n 'M ' + startX + ' ' + endY + ' L ' + (axisRect.x) + ' ' + endY);\n }\n if (i === axis.visibleLabels.length - 1) {\n labelBorder += ('M' + ' ' + endX + ' ' + startY + ' ' + 'L' + ' ' + endX + ' ' + endY + ' ' +\n 'M ' + endX + ' ' + endY + ' L ' + (axisRect.width + axisRect.x) + ' ' + endY);\n }\n }\n break;\n case 'WithoutTopandBottomBorder':\n if (!(startX < axisRect.x) && !(Math.floor(endX) > axisRect.width + axisRect.x)) {\n labelBorder += ('M' + ' ' + startX + ' ' + startY + ' ' + 'L' + ' ' + startX + ' ' + endY + ' ' +\n 'M ' + endX + ' ' + startY + ' L ' + endX + ' ' + endY);\n }\n break;\n }\n }\n labelBorder += (axis.border.type === 'Rectangle' ? ('M ' + ' ' + axisRect.x + ' ' + startY + 'L' + ' ' +\n (axisRect.x + axisRect.width) + ' ' + startY) : '');\n if (labelBorder !== '') {\n this.createAxisBorderElement(axis, index, labelBorder, parent);\n }\n }\n if (this.chart.multiLevelLabelModule && axis.multiLevelLabels.length > 0) {\n this.chart.multiLevelLabelModule.renderXAxisMultiLevelLabels(axis, index, parent, axisRect);\n }\n };\n /**\n * To create border element of the axis\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {string} labelBorder labelBorder\n * @param {Element} parent parent\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.createAxisBorderElement = function (axis, index, labelBorder, parent) {\n var element = getElement(this.chart.element.id + '_BorderLine_' + index);\n var direction = element ? element.getAttribute('d') : '';\n var borderElement = this.chart.renderer.drawPath(new PathOption(this.chart.element.id + '_BorderLine_' + index, 'transparent', axis.border.width, axis.border.color || this.chart.themeStyle.axisLine, 1, '', labelBorder));\n borderElement.setAttribute('style', 'pointer-events: none');\n appendChildElement(this.chart.enableCanvas, parent, borderElement, this.chart.redraw, true, 'x', 'y', null, direction, true);\n };\n /**\n * To find the axis label of the intersect action\n *\n * @param {Axis} axis axis\n * @param {string} label label\n * @param {number} width width\n * @returns {string} label\n */\n CartesianAxisLayoutPanel.prototype.findAxisLabel = function (axis, label, width) {\n return (axis.labelIntersectAction === 'Trim' ?\n ((axis.angle % 360 === 0 && !axis.enableTrim) ? textTrim(width, label, axis.labelStyle) : label) : label);\n };\n /**\n * X-Axis Title function performed\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {Element} parent parent\n * @param {Rect} rect rect\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.drawXAxisTitle = function (axis, index, parent, rect) {\n if (axis.title) {\n var chart = this.chart;\n var elementSize = measureText(axis.title, axis.titleStyle);\n var scrollBarHeight = isNullOrUndefined(axis.crossesAt) ? axis.scrollBarHeight : 0;\n var padding = (axis.tickPosition === 'Inside' ? 0 : axis.majorTickLines.height + axis.titlePadding) +\n (axis.labelPosition === 'Inside' ? 0 :\n axis.maxLabelSize.height + axis.multiLevelLabelHeight + axis.labelPadding);\n var titleSize = (axis.titleSize.height * (axis.titleCollection.length - 1));\n padding = axis.opposedPosition ? -(padding + elementSize.height / 4 + scrollBarHeight + titleSize) : (padding + (3 *\n elementSize.height / 4) + scrollBarHeight);\n var options = new TextOption(chart.element.id + '_AxisTitle_' + index, rect.x + rect.width * 0.5, rect.y + padding, 'middle', axis.titleCollection);\n var element = textElement(chart.renderer, options, axis.titleStyle, axis.titleStyle.color || chart.themeStyle.axisTitle, parent, null, null, null, null, null, null, null, null, chart.enableCanvas);\n element.setAttribute('aria-label', axis.description || axis.title);\n element.setAttribute('tabindex', axis.tabIndex.toString());\n }\n };\n /**\n * To render the axis grid and tick lines(Both Major and Minor)\n *\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {string} gridDirection gridDirection\n * @param {MajorTickLinesModel | MinorTickLinesModel | MajorGridLinesModel | MinorGridLinesModel} gridModel gridModel\n * @param {string} gridId gridId\n * @param {number} gridIndex gridIndex\n * @param {Element} parent parent\n * @param {string} themeColor themeColor\n * @param {string} dashArray dashArray\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.renderGridLine = function (axis, index, gridDirection, gridModel, gridId, gridIndex, parent, themeColor, dashArray) {\n if (dashArray === void 0) { dashArray = null; }\n var chart = this.chart;\n var direction;\n var element;\n if (gridModel.width > 0 && axis.visible && axis.internalVisibility && gridDirection) {\n element = getElement(chart.element.id + gridId + index + '_' + gridIndex);\n direction = element ? element.getAttribute('d') : null;\n element = null;\n this.htmlObject = chart.renderer.drawPath(new PathOption(chart.element.id + gridId + index + '_' + gridIndex, 'transparent', gridModel.width, gridModel.color || themeColor, null, dashArray, gridDirection));\n appendChildElement(chart.enableCanvas, parent, this.htmlObject, chart.redraw, true, 'x', 'y', null, direction, true);\n }\n };\n /**\n * To Find the parent node of the axis\n *\n * @param {string} elementId elementId\n * @param {Element} label label\n * @param {number} index index\n * @returns {Element} parent node of the axis\n */\n CartesianAxisLayoutPanel.prototype.findParentNode = function (elementId, label, index) {\n if (document.getElementById(elementId + 'AxisGroup' + index + 'Inside').contains(document.getElementById(label.id))) {\n return document.getElementById(elementId + 'AxisGroup' + index + 'Inside');\n }\n else {\n return document.getElementById(elementId + 'AxisGroup' + index + 'Outside');\n }\n };\n /**\n * Create Zooming Labels Function Called here\n *\n * @param {Chart} chart chart\n * @param {Element} labelElement labelElement\n * @param {Axis} axis axis\n * @param {number} index index\n * @param {Rect} rect rect\n * @returns {void}\n */\n CartesianAxisLayoutPanel.prototype.createZoomingLabel = function (chart, labelElement, axis, index, rect) {\n var parentNode = this.findParentNode(chart.element.id, labelElement, index);\n labelElement.setAttribute('opacity', '0.3');\n var zoomElement = chart.renderer.createGroup({\n id: chart.element.id + 'AxisLabels_Zoom' + index\n });\n zoomElement = createZoomingLabels(chart, axis, zoomElement, index, axis.orientation === 'Vertical', rect);\n parentNode.replaceChild(labelElement, document.getElementById(labelElement.id));\n if (getElement(chart.element.id + 'AxisLabels_Zoom' + index)) {\n parentNode.replaceChild(zoomElement, document.getElementById(zoomElement.id));\n }\n else {\n parentNode.appendChild(zoomElement);\n }\n };\n return CartesianAxisLayoutPanel;\n}());\nexport { CartesianAxisLayoutPanel };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable jsdoc/require-returns */\n/* eslint-disable jsdoc/require-param */\n/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable valid-jsdoc */\nimport { Property, ChildProperty, Complex, Collection, getValue } from '@syncfusion/ej2-base';\nimport { isNullOrUndefined, extend } from '@syncfusion/ej2-base';\nimport { StackValues, RectOption, appendChildElement, appendClipElement } from '../../common/utils/helper';\nimport { firstToLowerCase, CircleOption, getColorByValue } from '../../common/utils/helper';\nimport { Rect } from '@syncfusion/ej2-svg-base';\nimport { Border, Font, Margin, Animation, EmptyPointSettings, CornerRadius, Connector, DragSettings } from '../../common/model/base';\nimport { DataManager, DataUtil } from '@syncfusion/ej2-data';\nimport { Offset } from '../../common/model/base';\nimport { seriesRender } from '../../common/model/constants';\nimport { sort, getVisiblePoints, setRange } from '../../common/utils/helper';\nimport { Browser } from '@syncfusion/ej2-base';\n/**\n * Configures the data label in the series.\n */\nvar DataLabelSettings = /** @class */ (function (_super) {\n __extends(DataLabelSettings, _super);\n function DataLabelSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(false)\n ], DataLabelSettings.prototype, \"visible\", void 0);\n __decorate([\n Property(true)\n ], DataLabelSettings.prototype, \"showZero\", void 0);\n __decorate([\n Property(null)\n ], DataLabelSettings.prototype, \"name\", void 0);\n __decorate([\n Property('transparent')\n ], DataLabelSettings.prototype, \"fill\", void 0);\n __decorate([\n Property(1)\n ], DataLabelSettings.prototype, \"opacity\", void 0);\n __decorate([\n Property(0)\n ], DataLabelSettings.prototype, \"angle\", void 0);\n __decorate([\n Property(false)\n ], DataLabelSettings.prototype, \"enableRotation\", void 0);\n __decorate([\n Property('Auto')\n ], DataLabelSettings.prototype, \"position\", void 0);\n __decorate([\n Property(5)\n ], DataLabelSettings.prototype, \"rx\", void 0);\n __decorate([\n Property(5)\n ], DataLabelSettings.prototype, \"ry\", void 0);\n __decorate([\n Property('Center')\n ], DataLabelSettings.prototype, \"alignment\", void 0);\n __decorate([\n Complex({ width: null, color: null }, Border)\n ], DataLabelSettings.prototype, \"border\", void 0);\n __decorate([\n Complex({ left: 5, right: 5, top: 5, bottom: 5 }, Margin)\n ], DataLabelSettings.prototype, \"margin\", void 0);\n __decorate([\n Complex({ size: '11px', color: '', fontStyle: 'Normal', fontWeight: 'Normal', fontFamily: 'Segoe UI' }, Font)\n ], DataLabelSettings.prototype, \"font\", void 0);\n __decorate([\n Property(null)\n ], DataLabelSettings.prototype, \"template\", void 0);\n __decorate([\n Property('Hide')\n ], DataLabelSettings.prototype, \"labelIntersectAction\", void 0);\n return DataLabelSettings;\n}(ChildProperty));\nexport { DataLabelSettings };\n/**\n * Configures the marker in the series.\n */\nvar MarkerSettings = /** @class */ (function (_super) {\n __extends(MarkerSettings, _super);\n function MarkerSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(false)\n ], MarkerSettings.prototype, \"visible\", void 0);\n __decorate([\n Property('Circle')\n ], MarkerSettings.prototype, \"shape\", void 0);\n __decorate([\n Property('')\n ], MarkerSettings.prototype, \"imageUrl\", void 0);\n __decorate([\n Property(5)\n ], MarkerSettings.prototype, \"height\", void 0);\n __decorate([\n Property(5)\n ], MarkerSettings.prototype, \"width\", void 0);\n __decorate([\n Complex({ width: 2, color: null }, Border)\n ], MarkerSettings.prototype, \"border\", void 0);\n __decorate([\n Complex({ x: 0, y: 0 }, Offset)\n ], MarkerSettings.prototype, \"offset\", void 0);\n __decorate([\n Property(null)\n ], MarkerSettings.prototype, \"fill\", void 0);\n __decorate([\n Property(1)\n ], MarkerSettings.prototype, \"opacity\", void 0);\n __decorate([\n Complex({}, DataLabelSettings)\n ], MarkerSettings.prototype, \"dataLabel\", void 0);\n return MarkerSettings;\n}(ChildProperty));\nexport { MarkerSettings };\n/**\n * Points model for the series.\n *\n * @public\n */\nvar Points = /** @class */ (function () {\n function Points() {\n /** point symbol location */\n this.symbolLocations = null;\n /** point region */\n this.regions = null;\n /** point percentage value */\n this.percentage = null;\n /** point region data */\n this.regionData = null;\n /** To know the point is selected */\n this.isSelect = false;\n /** point marker */\n this.marker = {\n visible: false\n };\n /**\n * To identify point y value with in the range.\n *\n * @private\n */\n this.isPointInRange = true;\n }\n return Points;\n}());\nexport { Points };\n/**\n * Defines the behavior of the Trendlines\n */\nvar Trendline = /** @class */ (function (_super) {\n __extends(Trendline, _super);\n function Trendline() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /** @private */\n _this.clipRect = new Rect(0, 0, 0, 0);\n return _this;\n }\n /** @private */\n Trendline.prototype.setDataSource = function (series, chart) {\n if (series) {\n this.points = series.points;\n }\n chart.trendLineModule.initDataSource(this);\n chart.visibleSeriesCount++;\n };\n __decorate([\n Property('')\n ], Trendline.prototype, \"name\", void 0);\n __decorate([\n Property('0')\n ], Trendline.prototype, \"dashArray\", void 0);\n __decorate([\n Property(true)\n ], Trendline.prototype, \"visible\", void 0);\n __decorate([\n Property('Linear')\n ], Trendline.prototype, \"type\", void 0);\n __decorate([\n Property(2)\n ], Trendline.prototype, \"period\", void 0);\n __decorate([\n Property(2)\n ], Trendline.prototype, \"polynomialOrder\", void 0);\n __decorate([\n Property(0)\n ], Trendline.prototype, \"backwardForecast\", void 0);\n __decorate([\n Property(0)\n ], Trendline.prototype, \"forwardForecast\", void 0);\n __decorate([\n Complex({}, Animation)\n ], Trendline.prototype, \"animation\", void 0);\n __decorate([\n Complex({}, MarkerSettings)\n ], Trendline.prototype, \"marker\", void 0);\n __decorate([\n Property(true)\n ], Trendline.prototype, \"enableTooltip\", void 0);\n __decorate([\n Property(null)\n ], Trendline.prototype, \"intercept\", void 0);\n __decorate([\n Property('')\n ], Trendline.prototype, \"fill\", void 0);\n __decorate([\n Property(1)\n ], Trendline.prototype, \"width\", void 0);\n __decorate([\n Property('SeriesType')\n ], Trendline.prototype, \"legendShape\", void 0);\n return Trendline;\n}(ChildProperty));\nexport { Trendline };\n/**\n * Configures Error bar in series.\n */\nvar ErrorBarCapSettings = /** @class */ (function (_super) {\n __extends(ErrorBarCapSettings, _super);\n function ErrorBarCapSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(1)\n ], ErrorBarCapSettings.prototype, \"width\", void 0);\n __decorate([\n Property(10)\n ], ErrorBarCapSettings.prototype, \"length\", void 0);\n __decorate([\n Property(null)\n ], ErrorBarCapSettings.prototype, \"color\", void 0);\n __decorate([\n Property(1)\n ], ErrorBarCapSettings.prototype, \"opacity\", void 0);\n return ErrorBarCapSettings;\n}(ChildProperty));\nexport { ErrorBarCapSettings };\nvar ChartSegment = /** @class */ (function (_super) {\n __extends(ChartSegment, _super);\n function ChartSegment() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(null)\n ], ChartSegment.prototype, \"value\", void 0);\n __decorate([\n Property(null)\n ], ChartSegment.prototype, \"color\", void 0);\n __decorate([\n Property('0')\n ], ChartSegment.prototype, \"dashArray\", void 0);\n return ChartSegment;\n}(ChildProperty));\nexport { ChartSegment };\n/**\n * Error bar settings\n *\n * @public\n */\nvar ErrorBarSettings = /** @class */ (function (_super) {\n __extends(ErrorBarSettings, _super);\n function ErrorBarSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(false)\n ], ErrorBarSettings.prototype, \"visible\", void 0);\n __decorate([\n Property('Fixed')\n ], ErrorBarSettings.prototype, \"type\", void 0);\n __decorate([\n Property('Both')\n ], ErrorBarSettings.prototype, \"direction\", void 0);\n __decorate([\n Property('Vertical')\n ], ErrorBarSettings.prototype, \"mode\", void 0);\n __decorate([\n Property(null)\n ], ErrorBarSettings.prototype, \"color\", void 0);\n __decorate([\n Property(1)\n ], ErrorBarSettings.prototype, \"verticalError\", void 0);\n __decorate([\n Property(1)\n ], ErrorBarSettings.prototype, \"width\", void 0);\n __decorate([\n Property(1)\n ], ErrorBarSettings.prototype, \"horizontalError\", void 0);\n __decorate([\n Property(3)\n ], ErrorBarSettings.prototype, \"verticalPositiveError\", void 0);\n __decorate([\n Property(3)\n ], ErrorBarSettings.prototype, \"verticalNegativeError\", void 0);\n __decorate([\n Property(1)\n ], ErrorBarSettings.prototype, \"horizontalPositiveError\", void 0);\n __decorate([\n Property(1)\n ], ErrorBarSettings.prototype, \"horizontalNegativeError\", void 0);\n __decorate([\n Complex(null, ErrorBarCapSettings)\n ], ErrorBarSettings.prototype, \"errorBarCap\", void 0);\n return ErrorBarSettings;\n}(ChildProperty));\nexport { ErrorBarSettings };\n/**\n * Defines the common behavior of Series and Technical Indicators\n */\nvar SeriesBase = /** @class */ (function (_super) {\n __extends(SeriesBase, _super);\n function SeriesBase() {\n /**\n * The DataSource field that contains the x value.\n * It is applicable for series and technical indicators\n *\n * @default ''\n */\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /** @private */\n _this.currentViewData = [];\n /** @private */\n _this.clipRect = new Rect(0, 0, 0, 0);\n /** @private */\n _this.seriesType = 'XY';\n _this.isRectTypeSeries = false;\n return _this;\n }\n /**\n * Process data for the series.\n *\n * @hidden\n */\n SeriesBase.prototype.processJsonData = function () {\n var i = 0;\n var point = new Points();\n var xName = (this instanceof Series && this.type === 'Histogram') ? 'x' : this.xName;\n var textMappingName = this instanceof Series && this.marker.dataLabel.name ?\n this.marker.dataLabel.name : '';\n if (this instanceof Series) {\n if ((this.type === 'Waterfall' || this.type === 'Histogram')) {\n this.currentViewData = this.chart[firstToLowerCase(this.type) + 'SeriesModule'].\n processInternalData(extend([], this.currentViewData, null, true), this);\n }\n if (this.category === 'Pareto') {\n this.currentViewData = sort(extend([], this.currentViewData, null, true), [this.yName], true);\n if (this.type === 'Line') {\n this.currentViewData = this.chart.paretoSeriesModule.performCumulativeCalculation(this.currentViewData, this);\n }\n }\n this.isRectTypeSeries = this.type.indexOf('Column') > -1 || this.type.indexOf('Bar') > -1\n || this.type.indexOf('Histogram') > -1;\n }\n var len = Object.keys(this.currentViewData).length;\n this.points = [];\n this.xMin = Infinity;\n this.xMax = -Infinity;\n this.yMin = Infinity;\n this.yMax = -Infinity;\n this.sizeMax = -Infinity;\n this.getSeriesType();\n if (this.xAxis.valueType === 'Category') {\n while (i < len) {\n point = this.dataPoint(i, textMappingName, xName);\n this.pushCategoryData(point, i, point.x);\n this.pushData(point, i);\n this.setEmptyPoint(point, i);\n i++;\n }\n }\n else if (this.xAxis.valueType.indexOf('DateTime') > -1) {\n var option = {\n skeleton: 'full',\n type: 'dateTime'\n };\n var dateParser = this.chart.intl.getDateParser(option);\n var dateFormatter = this.chart.intl.getDateFormat(option);\n while (i < len) {\n point = this.dataPoint(i, textMappingName, xName);\n if (!isNullOrUndefined(point.x) && point.x !== '') {\n point.x = new Date(DataUtil.parse.parseJson({ val: point.x }).val);\n if (this.xAxis.valueType === 'DateTime') {\n point.xValue = Date.parse(point.x.toString());\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n this.chart.isBlazor ? this.pushCategoryData(point, i, Date.parse(point.x.toString()).toString()) :\n this.pushCategoryData(point, i, Date.parse(dateParser(dateFormatter(point.x))).toString());\n }\n this.pushData(point, i);\n this.setEmptyPoint(point, i);\n }\n else {\n point.visible = false;\n }\n i++;\n }\n }\n else {\n while (i < len) {\n point = this.dataPoint(i, textMappingName, xName);\n point.xValue = point.x;\n this.pushData(point, i);\n this.setEmptyPoint(point, i);\n i++;\n }\n }\n if (this instanceof Series) {\n if (this.type.indexOf('Spline') > -1 || (this.drawType.indexOf('Spline') > -1 && this.chart.chartAreaType === 'PolarRadar')) {\n var isArea = (this.type.indexOf('Area') > -1 || this.drawType.indexOf('Area') > -1);\n var isRange = this.type.indexOf('Range') > -1;\n this.chart['spline' + (isArea ? isRange ? 'RangeArea' : 'Area' : '') + 'SeriesModule'].findSplinePoint(this);\n }\n else if (this.type.indexOf('Histogram') > -1 && (this.xAxis.maximum || this.xAxis.minimum)) {\n this.chart['histogramSeriesModule'].calculateBinValues(this);\n }\n }\n };\n SeriesBase.prototype.pushData = function (point, i) {\n point.index = i;\n point.yValue = point.y;\n // To find the min, max for the axis range.\n this.xMin = Math.min(this.xMin, point.xValue);\n this.xMax = Math.max(this.xMax, point.xValue);\n this.xData.push(point.xValue);\n };\n /** @private */\n SeriesBase.prototype.dataPoint = function (i, textMappingName, xName) {\n this.points[i] = new Points();\n var point = this.points[i];\n var currentViewData = this.currentViewData;\n var getObjectValueByMappingString = this.enableComplexProperty ? getValue : this.getObjectValue;\n point.x = getObjectValueByMappingString(xName, currentViewData[i]);\n point.high = getObjectValueByMappingString(this.high, currentViewData[i]);\n point.low = getObjectValueByMappingString(this.low, currentViewData[i]);\n point.open = getObjectValueByMappingString(this.open, currentViewData[i]);\n point.close = getObjectValueByMappingString(this.close, currentViewData[i]);\n point.volume = getObjectValueByMappingString(this.volume, currentViewData[i]);\n point.interior = getObjectValueByMappingString(this.pointColorMapping, currentViewData[i]);\n if (this instanceof Series) {\n point.y = getObjectValueByMappingString(this.yName, currentViewData[i]);\n point.size = getObjectValueByMappingString(this.size, currentViewData[i]);\n point.text = getObjectValueByMappingString(textMappingName, currentViewData[i]);\n point.tooltip = getObjectValueByMappingString(this.tooltipMappingName, currentViewData[i]);\n if (this.chart.rangeColorSettings && this.chart.rangeColorSettings.length > 0 && this.isAdvancedColorSupported()) {\n if (this.colorName && this.colorName.length > 0) {\n point.colorValue = getObjectValueByMappingString(this.colorName, currentViewData[i]);\n }\n else {\n point.colorValue = getObjectValueByMappingString(this.yName, currentViewData[i]);\n }\n point.interior = this.getPointFillColor(point.interior, point.colorValue);\n }\n }\n return point;\n };\n SeriesBase.prototype.isAdvancedColorSupported = function () {\n if (this.chart.visibleSeries.length === 1 &&\n (this.chart.series[0].type === 'Column' || this.chart.series[0].type === 'Bar' ||\n this.chart.series[0].type === 'Scatter' || this.chart.series[0].type === 'Bubble')) {\n return true;\n }\n return false;\n };\n SeriesBase.prototype.getPointFillColor = function (pointFill, value) {\n var color = pointFill;\n if (value && this.chart.rangeColorSettings && this.chart.rangeColorSettings.length > 0) {\n for (var _i = 0, _a = this.chart.rangeColorSettings; _i < _a.length; _i++) {\n var rangeMap = _a[_i];\n if (value >= rangeMap.start && value <= rangeMap.end) {\n if (rangeMap.colors.length > 1) {\n color = getColorByValue(rangeMap, value);\n }\n else {\n color = rangeMap.colors[0];\n }\n }\n }\n }\n return color;\n };\n SeriesBase.prototype.getObjectValue = function (mappingName, data) {\n return data[mappingName];\n };\n /**\n * To set empty point value based on empty point mode\n *\n * @private\n */\n SeriesBase.prototype.setEmptyPoint = function (point, i) {\n if (!this.findVisibility(point)) {\n point.visible = true;\n return null;\n }\n point.isEmpty = true;\n var mode = this instanceof Series && point.isPointInRange ? this.emptyPointSettings.mode : 'Drop';\n switch (mode) {\n case 'Zero':\n point.visible = true;\n if (this instanceof Series && this.seriesType.indexOf('HighLow') > -1) {\n point.high = point.low = 0;\n if (this.seriesType.indexOf('HighLowOpenClose') > -1) {\n point.open = point.close = 0;\n }\n }\n else {\n point.y = point.yValue = this.yData[i] = 0;\n }\n break;\n case 'Average':\n if (this instanceof Series) {\n if (this.seriesType.indexOf('HighLow') > -1) {\n point.high = (isNullOrUndefined(point.high) || isNaN(+point.high)) ? this.getAverage(this.high, i) : point.high;\n point.low = (isNullOrUndefined(point.low) || isNaN(+point.low)) ? this.getAverage(this.low, i) : point.low;\n if (this.seriesType.indexOf('HighLowOpenClose') > -1) {\n point.open = (isNullOrUndefined(point.open) || isNaN(+point.open)) ? this.getAverage(this.open, i) : point.open;\n point.close = (isNullOrUndefined(point.close) || isNaN(+point.close)) ? this.getAverage(this.close, i) :\n point.close;\n }\n }\n else {\n point.y = point.yValue = this.yData[i] = this.getAverage(this.yName, i);\n }\n }\n point.visible = true;\n break;\n case 'Drop':\n case 'Gap':\n this.yData[i] = null;\n point.visible = false;\n break;\n }\n };\n SeriesBase.prototype.findVisibility = function (point) {\n var type = this instanceof Series ? this.seriesType : 'HighLowOpenClose';\n var yValues;\n var yAxisMin = this.yAxis.minimum;\n var yAxisMax = this.yAxis.maximum;\n switch (type) {\n case 'XY':\n if (this.chart.chartAreaType === 'PolarRadar' && ((!isNullOrUndefined(yAxisMin) && point.yValue < yAxisMin) ||\n (!isNullOrUndefined(yAxisMax) && point.yValue > yAxisMax))) {\n point.isPointInRange = false;\n return true;\n }\n this.setXYMinMax(point.yValue);\n this.yData.push(point.yValue);\n if (this instanceof Series && this.type === 'Bubble') {\n this.sizeMax = Math.max(this.sizeMax, (isNullOrUndefined(point.size) || isNaN(+point.size)) ? this.sizeMax\n : point.size);\n }\n return isNullOrUndefined(point.x) || (isNullOrUndefined(point.y) || isNaN(+point.y));\n case 'HighLow':\n this.setHiloMinMax(point.high, point.low);\n return isNullOrUndefined(point.x) || (isNullOrUndefined(point.low) || isNaN(+point.low)) ||\n (isNullOrUndefined(point.high) || isNaN(+point.high));\n case 'HighLowOpenClose':\n this.setHiloMinMax(point.high, point.low);\n return isNullOrUndefined(point.x) || (isNullOrUndefined(point.low) || isNaN(+point.low)) ||\n (isNullOrUndefined(point.open) || isNaN(+point.open)) || (isNullOrUndefined(point.close) || isNaN(+point.close))\n || (isNullOrUndefined(point.high) || isNaN(+point.high));\n case 'BoxPlot':\n yValues = (point.y || [null]).filter(function (value) {\n return !isNullOrUndefined(value) && !isNaN(value);\n }).sort(function (a, b) {\n return a - b;\n });\n point.y = yValues;\n this.yMin = Math.min(this.yMin, Math.min.apply(Math, yValues));\n this.yMax = Math.max(this.yMax, Math.max.apply(Math, yValues));\n return !yValues.length;\n }\n };\n /**\n * To get Y min max for the provided point seriesType XY\n */\n SeriesBase.prototype.setXYMinMax = function (yValue) {\n var isLogAxis = (this.yAxis.valueType === 'Logarithmic' || this.xAxis.valueType === 'Logarithmic');\n var isNegativeValue = yValue < 0;\n var seriesMinY;\n if (this.isRectTypeSeries && !setRange(this.yAxis)) {\n seriesMinY = ((isLogAxis ? (yValue) : isNegativeValue ? yValue : 0));\n }\n else {\n seriesMinY = yValue;\n }\n this.yMin = isLogAxis ?\n Math.min(this.yMin, (isNullOrUndefined(seriesMinY) || isNaN(seriesMinY) || (seriesMinY === 0) ||\n (seriesMinY.toString() === \"0\") || (seriesMinY.toString() === '')) ? this.yMin : seriesMinY) :\n Math.min(this.yMin, (isNullOrUndefined(seriesMinY) || isNaN(seriesMinY)) ? this.yMin : seriesMinY);\n this.yMax = Math.max(this.yMax, (isNullOrUndefined(yValue) || isNaN(yValue)) ? this.yMax : yValue);\n };\n /**\n * To get Y min max for the provided point seriesType XY\n */\n SeriesBase.prototype.setHiloMinMax = function (high, low) {\n this.yMin = Math.min(this.yMin, Math.min((isNullOrUndefined(low) || isNaN(low)) ? this.yMin : low, (isNullOrUndefined(high) || isNaN(high)) ? this.yMin : high));\n this.yMax = Math.max(this.yMax, Math.max((isNullOrUndefined(low) || isNaN(low)) ? this.yMax : low, (isNullOrUndefined(high) || isNaN(high)) ? this.yMax : high));\n };\n /**\n * Finds the type of the series\n *\n * @private\n */\n SeriesBase.prototype.getSeriesType = function () {\n var type;\n if (this instanceof Series) {\n var seriesType = this.chart.chartAreaType === 'PolarRadar' ? this.drawType : this.type;\n if (seriesType) {\n switch (seriesType) {\n case 'RangeColumn':\n case 'RangeArea':\n case 'SplineRangeArea':\n case 'Hilo':\n type = 'HighLow';\n break;\n case 'HiloOpenClose':\n case 'Candle':\n type = 'HighLowOpenClose';\n break;\n case 'BoxAndWhisker':\n type = 'BoxPlot';\n break;\n default:\n type = 'XY';\n }\n }\n }\n this.seriesType = type;\n };\n /** @private */\n SeriesBase.prototype.pushCategoryData = function (point, index, pointX) {\n if (!this.chart.tooltip.shared) {\n if (!this.visible) {\n return null;\n }\n }\n if (!this.xAxis.isIndexed) {\n if (this.xAxis.labels.indexOf(pointX) < 0) {\n this.xAxis.labels.push(pointX);\n }\n point.xValue = this.xAxis.labels.indexOf(pointX);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n this.xAxis.labels[index] ? this.xAxis.labels[index] += ', ' + pointX :\n this.xAxis.labels.push(pointX);\n point.xValue = index;\n }\n };\n /**\n * To find average of given property\n */\n SeriesBase.prototype.getAverage = function (member, i, data) {\n if (data === void 0) { data = this.currentViewData; }\n var previous = data[i - 1] ? (data[i - 1][member] || 0) : 0;\n var next = data[i + 1] ? (data[i + 1][member] || 0) : 0;\n return (previous + next) / 2;\n };\n /**\n * To find the control points for spline.\n *\n * @returns {void}\n * @private\n */\n SeriesBase.prototype.refreshDataManager = function (chart) {\n var _this = this;\n this.chart = chart;\n var dataSource;\n var isAngular = 'isAngular';\n if (chart[isAngular]) {\n dataSource = Object.keys(this.dataSource).length ? this.dataSource : chart.dataSource;\n }\n else {\n dataSource = this.dataSource || chart.dataSource;\n }\n if (!(dataSource instanceof DataManager) && isNullOrUndefined(this.query)) {\n this.dataManagerSuccess({ result: dataSource, count: dataSource.length }, false);\n return;\n }\n var dataManager = this.dataModule.getData(this.dataModule.generateQuery().requiresCount());\n dataManager.then(function (e) { return _this.dataManagerSuccess(e); });\n };\n SeriesBase.prototype.dataManagerSuccess = function (e, isRemoteData) {\n if (isRemoteData === void 0) { isRemoteData = true; }\n this.currentViewData = e.count ? e.result : [];\n this.chart.allowServerDataBinding = false;\n if (this instanceof Series) {\n if (this.chart.stockChart) {\n this.chart.stockChart.series[this.index].localData = this.currentViewData;\n }\n var argsData = {\n name: seriesRender, series: this, data: this.currentViewData, fill: this.interior\n };\n this.chart.trigger(seriesRender, argsData);\n this.interior = argsData.fill;\n this.currentViewData = argsData.data;\n }\n if (this.chart.stockChart && !(this instanceof Series)) {\n this.currentViewData = this.chart.stockChart.findCurrentData(this.chart.stockChart.series[0].localData, this.chart.stockChart.series[0].xName);\n }\n this.processJsonData();\n this.recordsCount = e.count;\n this.refreshChart(isRemoteData);\n this.currentViewData = null;\n };\n SeriesBase.prototype.refreshChart = function (isRemoteData) {\n var chart = this.chart;\n if (this instanceof Series) {\n chart.visibleSeriesCount += isRemoteData ? 1 : 0;\n }\n chart.refreshTechnicalIndicator(this);\n if (this instanceof Series && this.category !== 'TrendLine') {\n for (var _i = 0, _a = this.trendlines; _i < _a.length; _i++) {\n var trendline = _a[_i];\n trendline.setDataSource(this, chart);\n }\n }\n //if (chart.visibleSeries.length === (chart.visibleSeriesCount - chart.indicators.length)) {\n if (chart.visibleSeries.length === (chart.visibleSeriesCount)) {\n chart.refreshBound();\n chart.trigger('loaded', { chart: chart.isBlazor ? {} : chart });\n if (this.chart.stockChart && this.chart.stockChart.initialRender) {\n this.chart.stockChart.initialRender = false;\n this.chart.stockChart.stockChartDataManagerSuccess();\n }\n }\n if (this instanceof Series) {\n chart.visibleSeriesCount += isRemoteData ? 0 : 1;\n }\n };\n __decorate([\n Property('')\n ], SeriesBase.prototype, \"xName\", void 0);\n __decorate([\n Property('')\n ], SeriesBase.prototype, \"colorName\", void 0);\n __decorate([\n Property('')\n ], SeriesBase.prototype, \"high\", void 0);\n __decorate([\n Property('')\n ], SeriesBase.prototype, \"low\", void 0);\n __decorate([\n Property('')\n ], SeriesBase.prototype, \"open\", void 0);\n __decorate([\n Property('')\n ], SeriesBase.prototype, \"close\", void 0);\n __decorate([\n Property('')\n ], SeriesBase.prototype, \"volume\", void 0);\n __decorate([\n Property('')\n ], SeriesBase.prototype, \"pointColorMapping\", void 0);\n __decorate([\n Property(true)\n ], SeriesBase.prototype, \"visible\", void 0);\n __decorate([\n Property(null)\n ], SeriesBase.prototype, \"xAxisName\", void 0);\n __decorate([\n Property(null)\n ], SeriesBase.prototype, \"yAxisName\", void 0);\n __decorate([\n Complex(null, Animation)\n ], SeriesBase.prototype, \"animation\", void 0);\n __decorate([\n Property(null)\n ], SeriesBase.prototype, \"fill\", void 0);\n __decorate([\n Property(1)\n ], SeriesBase.prototype, \"width\", void 0);\n __decorate([\n Property('0')\n ], SeriesBase.prototype, \"dashArray\", void 0);\n __decorate([\n Property('')\n ], SeriesBase.prototype, \"dataSource\", void 0);\n __decorate([\n Property()\n ], SeriesBase.prototype, \"query\", void 0);\n __decorate([\n Collection([], ChartSegment)\n ], SeriesBase.prototype, \"segments\", void 0);\n __decorate([\n Property('X')\n ], SeriesBase.prototype, \"segmentAxis\", void 0);\n __decorate([\n Property(false)\n ], SeriesBase.prototype, \"enableComplexProperty\", void 0);\n return SeriesBase;\n}(ChildProperty));\nexport { SeriesBase };\n/**\n * Configures the series in charts.\n *\n * @public\n */\nvar Series = /** @class */ (function (_super) {\n __extends(Series, _super);\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n function Series(parent, propName, defaultValue, isArray) {\n var _this = _super.call(this, parent, propName, defaultValue, isArray) || this;\n _this.visibleSeriesCount = 0;\n /** @private */\n _this.category = 'Series';\n /** @private */\n _this.isRectSeries = false;\n /** @private */\n _this.drawPoints = [];\n /** @private */\n _this.lowDrawPoints = [];\n /** @private */\n _this.delayedAnimation = false;\n return _this;\n }\n /**\n * Refresh the axis label.\n *\n * @returns {void}\n * @private\n */\n Series.prototype.refreshAxisLabel = function () {\n if (this.xAxis.valueType !== 'Category') {\n return null;\n }\n this.xAxis.labels = [];\n for (var _i = 0, _a = this.xAxis.series; _i < _a.length; _i++) {\n var item = _a[_i];\n if (item.visible && item.category !== 'TrendLine') {\n item.xMin = Infinity;\n item.xMax = -Infinity;\n for (var _b = 0, _c = item.points; _b < _c.length; _b++) {\n var point = _c[_b];\n item.pushCategoryData(point, point.index, point.x);\n item.xMin = Math.min(item.xMin, point.xValue);\n item.xMax = Math.max(item.xMax, point.xValue);\n }\n }\n }\n };\n /**\n * To get the series collection.\n *\n * @returns {void}\n * @private\n */\n Series.prototype.findSeriesCollection = function (column, row, isStack) {\n var seriesCollection = [];\n for (var _i = 0, _a = row.axes; _i < _a.length; _i++) {\n var rowAxis = _a[_i];\n for (var _b = 0, _c = rowAxis.series; _b < _c.length; _b++) {\n var rowSeries = _c[_b];\n for (var _d = 0, _e = column.axes; _d < _e.length; _d++) {\n var axis = _e[_d];\n for (var _f = 0, _g = axis.series; _f < _g.length; _f++) {\n var series = _g[_f];\n if (series === rowSeries && series.visible && this.rectSeriesInChart(series, isStack)) {\n seriesCollection.push(series);\n }\n }\n }\n }\n }\n return seriesCollection;\n };\n /**\n * To get the column type series.\n *\n * @returns {void}\n * @private\n */\n Series.prototype.rectSeriesInChart = function (series, isStack) {\n var type = (series.type).toLowerCase();\n return (type.indexOf('column') !== -1 || type.indexOf('bar') !== -1 || type.indexOf('histogram') !== -1 ||\n type.indexOf('hiloopenclose') !== -1 || type.indexOf('candle') !== -1 || type.indexOf('pareto') !== -1 ||\n type.indexOf('hilo') !== -1 || series.drawType.indexOf('Column') !== -1 ||\n type.indexOf('waterfall') !== -1 || type.indexOf('boxandwhisker') !== -1 || isStack);\n };\n /**\n * To calculate the stacked values.\n *\n * @returns {void}\n * @private\n */\n Series.prototype.calculateStackedValue = function (isStacking100, chart) {\n for (var _i = 0, _a = chart.columns; _i < _a.length; _i++) {\n var columnItem = _a[_i];\n for (var _b = 0, _c = chart.rows; _b < _c.length; _b++) {\n var item = _c[_b];\n this.calculateStackingValues(this.findSeriesCollection(columnItem, item, true), isStacking100);\n }\n }\n };\n Series.prototype.calculateStackingValues = function (seriesCollection, isStacking100) {\n var startValues;\n var endValues;\n var yValues = [];\n var lastPositive = [];\n var lastNegative = [];\n var stackingGroup;\n var lastValue;\n var value;\n var frequencies = [];\n if (isStacking100) {\n frequencies = this.findFrequencies(seriesCollection);\n }\n var stackingSeies = [];\n var stackedValues = [];\n var visiblePoints = [];\n for (var _i = 0, seriesCollection_1 = seriesCollection; _i < seriesCollection_1.length; _i++) {\n var series = seriesCollection_1[_i];\n if (series.type.indexOf('Stacking') !== -1 || (series.drawType.indexOf('Stacking') !== -1 &&\n (series.chart.chartAreaType === 'PolarRadar'))) {\n stackingGroup = (series.type.indexOf('StackingArea') !== -1) ? 'StackingArea100' :\n (series.type.indexOf('StackingLine') !== -1) ? 'StackingLine100' : series.stackingGroup;\n if (!lastPositive[stackingGroup]) {\n lastPositive[stackingGroup] = [];\n lastNegative[stackingGroup] = [];\n }\n yValues = series.yData;\n startValues = [];\n endValues = [];\n stackingSeies.push(series);\n visiblePoints = getVisiblePoints(series);\n for (var j = 0, pointsLength = visiblePoints.length; j < pointsLength; j++) {\n lastValue = 0;\n value = +yValues[j]; // Fix for chart not rendering while y value is given as string issue\n if (lastPositive[stackingGroup][visiblePoints[j].xValue] === undefined) {\n lastPositive[stackingGroup][visiblePoints[j].xValue] = 0;\n }\n if (lastNegative[stackingGroup][visiblePoints[j].xValue] === undefined) {\n lastNegative[stackingGroup][visiblePoints[j].xValue] = 0;\n }\n if (isStacking100) {\n value = value / frequencies[stackingGroup][visiblePoints[j].xValue] * 100;\n value = !isNaN(value) ? value : 0;\n visiblePoints[j].percentage = +(value.toFixed(2));\n }\n else {\n stackedValues[j] = stackedValues[j] ? stackedValues[j] + Math.abs(value) : Math.abs(value);\n }\n if (value >= 0) {\n lastValue = lastPositive[stackingGroup][visiblePoints[j].xValue];\n lastPositive[stackingGroup][visiblePoints[j].xValue] += value;\n }\n else {\n lastValue = lastNegative[stackingGroup][visiblePoints[j].xValue];\n lastNegative[stackingGroup][visiblePoints[j].xValue] += value;\n }\n startValues.push(lastValue);\n endValues.push(value + lastValue);\n if (isStacking100 && (endValues[j] > 100)) {\n endValues[j] = 100;\n }\n }\n series.stackedValues = new StackValues(startValues, endValues);\n var isLogAxis = series.yAxis.valueType === 'Logarithmic';\n var isColumnBarType = (series.type.indexOf(\"Column\") !== -1 || series.type.indexOf(\"Bar\") !== -1);\n series.yMin = isLogAxis && isColumnBarType && series.yMin < 1 ? series.yMin : Math.min.apply(0, startValues);\n series.yMax = Math.max.apply(0, endValues);\n if (series.yMin > Math.min.apply(0, endValues)) {\n series.yMin = (isStacking100) ? -100 :\n isLogAxis && isColumnBarType && series.yMin < 1 ? series.yMin : Math.min.apply(0, endValues);\n }\n if (series.yMax < Math.max.apply(0, startValues)) {\n series.yMax = 0;\n }\n }\n }\n this.findPercentageOfStacking(stackingSeies, stackedValues, isStacking100);\n };\n Series.prototype.findPercentageOfStacking = function (stackingSeies, values, isStacking100) {\n for (var _i = 0, stackingSeies_1 = stackingSeies; _i < stackingSeies_1.length; _i++) {\n var item = stackingSeies_1[_i];\n if (isStacking100) {\n return null;\n }\n for (var _a = 0, _b = getVisiblePoints(item); _a < _b.length; _a++) {\n var point = _b[_a];\n point.percentage = Math.abs(+(point.y / values[point.index] * 100).toFixed(2));\n }\n }\n };\n Series.prototype.findFrequencies = function (seriesCollection) {\n var frequencies = [];\n var stackingGroup;\n var visiblePoints = [];\n for (var _i = 0, seriesCollection_2 = seriesCollection; _i < seriesCollection_2.length; _i++) {\n var series = seriesCollection_2[_i];\n series.yAxis.isStack100 = series.type.indexOf('100') !== -1 ? true : false;\n visiblePoints = getVisiblePoints(series);\n if (series.type.indexOf('Stacking') !== -1) {\n stackingGroup = (series.type.indexOf('StackingArea') !== -1) ? 'StackingArea100' :\n (series.type.indexOf('StackingLine') !== -1) ? 'StackingLine100' : series.stackingGroup;\n if (!frequencies[stackingGroup]) {\n frequencies[stackingGroup] = [];\n }\n for (var j = 0, pointsLength = visiblePoints.length; j < pointsLength; j++) {\n if (frequencies[stackingGroup][visiblePoints[j].xValue] === undefined) {\n frequencies[stackingGroup][visiblePoints[j].xValue] = 0;\n }\n if (series.yData[j] > 0) {\n frequencies[stackingGroup][visiblePoints[j].xValue] += series.yData[j];\n }\n else {\n frequencies[stackingGroup][visiblePoints[j].xValue] -= series.yData[j];\n }\n }\n }\n }\n return frequencies;\n };\n /* private dataManagerFailure(e: { result: Object[] }): void {\n this.currentViewData = [];\n this.refreshChart();\n }*/\n /** @private */\n Series.prototype.renderSeries = function (chart) {\n var seriesType = firstToLowerCase(this.type);\n seriesType = seriesType.replace('100', '');\n if (chart[seriesType + 'SeriesModule']) {\n if (this.category !== 'Indicator' && this.category !== 'TrendLine') {\n this.createSeriesElements(chart);\n }\n this.visiblePoints = getVisiblePoints(this);\n chart[seriesType + 'SeriesModule'].render(this, this.xAxis, this.yAxis, chart.requireInvertedAxis);\n if (this.category !== 'Indicator') {\n if (this.errorBar.visible) {\n this.chart.errorBarModule.render(this);\n }\n if (this.marker.dataLabel.visible) {\n chart.dataLabelModule.render(this, this.chart, this.marker.dataLabel);\n }\n this.appendSeriesElement(chart.seriesElements, chart);\n }\n if (!this.chart.enableCanvas) {\n this.performAnimation(chart, seriesType, this.errorBar, this.marker, this.marker.dataLabel);\n }\n }\n };\n /**\n * To create seris element.\n *\n * @returns {void}\n * @private\n */\n Series.prototype.createSeriesElements = function (chart) {\n if (this.category !== 'Indicator') {\n var elementId = chart.element.id;\n // 8 for extend border value 5 for extend size value\n var explodeValue = this.marker.border.width + 8 + 5;\n var render = (this.type === 'Scatter' || this.type === 'Bubble') ?\n chart.svgRenderer : chart.renderer;\n var index = this.index === undefined ? this.category : this.index;\n var markerHeight = void 0;\n var markerWidth = void 0;\n var options = void 0;\n if (this.type === 'Scatter') {\n markerHeight = (chart.primaryYAxis.maximum || chart.primaryXAxis.maximum) ? 0 : (this.marker.height + explodeValue) / 2;\n markerWidth = (chart.primaryYAxis.maximum || chart.primaryXAxis.maximum) ? 0 : (this.marker.width + explodeValue) / 2;\n }\n else {\n markerHeight = 0;\n markerWidth = 0;\n }\n if (chart.chartAreaType === 'PolarRadar') {\n var markerMaxValue = (this.drawType === 'Scatter') ? Math.max(this.marker.width, this.marker.height) : 0;\n options = new CircleOption(elementId + '_ChartSeriesClipRect_' + index, 'transparent', { width: 1, color: 'Gray' }, 1, this.clipRect.width / 2 + this.clipRect.x, this.clipRect.height / 2 + this.clipRect.y, chart.radius + markerMaxValue);\n this.clipRectElement = appendClipElement(chart.redraw, options, render, 'drawCircularClipPath');\n }\n else {\n options = new RectOption(elementId + '_ChartSeriesClipRect_' + index, 'transparent', { width: 1, color: 'Gray' }, 1, {\n x: -markerWidth, y: -markerHeight,\n width: this.clipRect.width + markerWidth * 2,\n height: this.clipRect.height + markerHeight * 2\n });\n this.clipRectElement = appendClipElement(chart.redraw, options, render);\n }\n var transform = chart.chartAreaType === 'Cartesian' ? 'translate(' + this.clipRect.x + ',' + (this.clipRect.y) + ')' : '';\n this.symbolElement = null;\n this.seriesElement = render.createGroup({\n 'id': elementId + 'SeriesGroup' + index,\n 'transform': transform,\n 'clip-path': 'url(#' + elementId + '_ChartSeriesClipRect_' + index + ')'\n });\n if (!this.chart.enableCanvas || this.type === 'Scatter' || this.type === 'Bubble') {\n this.seriesElement.appendChild(this.clipRectElement);\n }\n }\n };\n /**\n * To append the series.\n *\n * @returns {void}\n * @private\n */\n Series.prototype.appendSeriesElement = function (element, chart) {\n var marker = this.marker;\n var dataLabel = marker.dataLabel;\n var redraw = chart.redraw;\n if (this.category !== 'TrendLine') {\n appendChildElement(chart.enableCanvas, chart.seriesElements, this.seriesElement, redraw);\n var errorBar = this.errorBar;\n if (errorBar.visible) {\n if (chart.chartAreaType === 'PolarRadar') {\n appendChildElement(chart.enableCanvas, chart.seriesElements, this.seriesElement, redraw);\n }\n else {\n appendChildElement(chart.enableCanvas, chart.seriesElements, this.errorBarElement, redraw);\n }\n }\n if (this.type === 'Scatter' || this.type === 'Bubble') {\n appendChildElement(false, chart.seriesElements, this.seriesElement, redraw);\n }\n }\n if (marker.visible && (chart.chartAreaType === 'Cartesian' ||\n ((this.drawType !== 'Scatter') && chart.chartAreaType === 'PolarRadar')) && this.type !== 'Scatter' &&\n this.type !== 'Bubble' && this.type !== 'Candle' && this.type !== 'Hilo' && this.type !== 'HiloOpenClose' && this.symbolElement) {\n appendChildElement(chart.enableCanvas, chart.seriesElements, this.symbolElement, redraw);\n }\n if (dataLabel.visible && this.textElement) {\n appendChildElement(chart.enableCanvas, chart.dataLabelElements, this.shapeElement, redraw);\n appendChildElement(chart.enableCanvas, chart.dataLabelElements, this.textElement, redraw);\n }\n if (!chart.enableCanvas && chart.dataLabelElements.hasChildNodes()) {\n chart.seriesElements.appendChild(chart.dataLabelElements);\n }\n };\n /**\n * To perform animation for chart series.\n *\n * @returns {void}\n * @private\n */\n Series.prototype.performAnimation = function (chart, type, errorBar, marker, dataLabel) {\n if (this.animation.enable && chart.animateSeries) {\n chart[type + 'SeriesModule'].doAnimation(this);\n if (errorBar.visible) {\n chart.errorBarModule.doErrorBarAnimation(this);\n }\n if (marker.visible) {\n chart.markerRender.doMarkerAnimation(this);\n }\n //to datalabel animation disabled for edge and IE\n if (dataLabel.visible && Browser.info.name !== 'edge' && !Browser.isIE) {\n chart.dataLabelModule.doDataLabelAnimation(this);\n }\n }\n };\n /**\n * To set border color for empty point\n *\n * @private\n */\n Series.prototype.setPointColor = function (point, color) {\n color = point.interior || color;\n return point.isEmpty ? (this.emptyPointSettings.fill || color) : color;\n };\n /**\n * To set border color for empty point\n *\n * @private\n */\n Series.prototype.setBorderColor = function (point, border) {\n border.width = point.isEmpty ? (this.emptyPointSettings.border.width || border.width) : border.width;\n border.color = point.isEmpty ? (this.emptyPointSettings.border.color || border.color) : border.color;\n return border;\n };\n __decorate([\n Property('')\n ], Series.prototype, \"name\", void 0);\n __decorate([\n Property('')\n ], Series.prototype, \"yName\", void 0);\n __decorate([\n Property('Line')\n ], Series.prototype, \"drawType\", void 0);\n __decorate([\n Property(true)\n ], Series.prototype, \"isClosed\", void 0);\n __decorate([\n Property('#2ecd71')\n ], Series.prototype, \"bearFillColor\", void 0);\n __decorate([\n Property('#e74c3d')\n ], Series.prototype, \"bullFillColor\", void 0);\n __decorate([\n Property(false)\n ], Series.prototype, \"enableSolidCandles\", void 0);\n __decorate([\n Property('')\n ], Series.prototype, \"size\", void 0);\n __decorate([\n Property(null)\n ], Series.prototype, \"binInterval\", void 0);\n __decorate([\n Property(false)\n ], Series.prototype, \"showNormalDistribution\", void 0);\n __decorate([\n Property('')\n ], Series.prototype, \"stackingGroup\", void 0);\n __decorate([\n Complex({ color: 'transparent', width: 0 }, Border)\n ], Series.prototype, \"border\", void 0);\n __decorate([\n Property(1)\n ], Series.prototype, \"opacity\", void 0);\n __decorate([\n Property(0)\n ], Series.prototype, \"zOrder\", void 0);\n __decorate([\n Property('Line')\n ], Series.prototype, \"type\", void 0);\n __decorate([\n Complex(null, ErrorBarSettings)\n ], Series.prototype, \"errorBar\", void 0);\n __decorate([\n Complex(null, MarkerSettings)\n ], Series.prototype, \"marker\", void 0);\n __decorate([\n Complex({}, DragSettings)\n ], Series.prototype, \"dragSettings\", void 0);\n __decorate([\n Collection([], Trendline)\n ], Series.prototype, \"trendlines\", void 0);\n __decorate([\n Property(true)\n ], Series.prototype, \"enableTooltip\", void 0);\n __decorate([\n Property('')\n ], Series.prototype, \"tooltipFormat\", void 0);\n __decorate([\n Property('')\n ], Series.prototype, \"tooltipMappingName\", void 0);\n __decorate([\n Property('SeriesType')\n ], Series.prototype, \"legendShape\", void 0);\n __decorate([\n Property('')\n ], Series.prototype, \"legendImageUrl\", void 0);\n __decorate([\n Property(null)\n ], Series.prototype, \"selectionStyle\", void 0);\n __decorate([\n Property(null)\n ], Series.prototype, \"unSelectedStyle\", void 0);\n __decorate([\n Property(null)\n ], Series.prototype, \"nonHighlightStyle\", void 0);\n __decorate([\n Property(1)\n ], Series.prototype, \"minRadius\", void 0);\n __decorate([\n Property(3)\n ], Series.prototype, \"maxRadius\", void 0);\n __decorate([\n Property('Natural')\n ], Series.prototype, \"splineType\", void 0);\n __decorate([\n Property(0.5)\n ], Series.prototype, \"cardinalSplineTension\", void 0);\n __decorate([\n Complex(null, EmptyPointSettings)\n ], Series.prototype, \"emptyPointSettings\", void 0);\n __decorate([\n Property(true)\n ], Series.prototype, \"showMean\", void 0);\n __decorate([\n Property('Normal')\n ], Series.prototype, \"boxPlotMode\", void 0);\n __decorate([\n Property(null)\n ], Series.prototype, \"columnWidth\", void 0);\n __decorate([\n Property(null)\n ], Series.prototype, \"columnWidthInPixel\", void 0);\n __decorate([\n Property(0)\n ], Series.prototype, \"columnSpacing\", void 0);\n __decorate([\n Property('#C64E4A')\n ], Series.prototype, \"negativeFillColor\", void 0);\n __decorate([\n Property('#4E81BC')\n ], Series.prototype, \"summaryFillColor\", void 0);\n __decorate([\n Property()\n ], Series.prototype, \"intermediateSumIndexes\", void 0);\n __decorate([\n Property()\n ], Series.prototype, \"sumIndexes\", void 0);\n __decorate([\n Complex({ color: 'black', width: 2 }, Connector)\n ], Series.prototype, \"connector\", void 0);\n __decorate([\n Complex(null, CornerRadius)\n ], Series.prototype, \"cornerRadius\", void 0);\n return Series;\n}(SeriesBase));\nexport { Series };\n","/* eslint-disable @typescript-eslint/ban-types */\nimport { Query, DataManager, Deferred } from '@syncfusion/ej2-data';\n/**\n * data module is used to generate query and dataSource\n */\nvar Data = /** @class */ (function () {\n /**\n * Constructor for data module\n *\n * @param dataSource\n * @param query\n * @param dataSource\n * @param query\n * @private\n */\n function Data(dataSource, query) {\n this.initDataManager(dataSource, query);\n }\n /**\n * The function used to initialize dataManager and query\n *\n * @param dataSource\n * @param query\n * @param dataSource\n * @param query\n * @returns {void}\n * @private\n */\n Data.prototype.initDataManager = function (dataSource, query) {\n this.dataManager = dataSource instanceof DataManager ? dataSource : new DataManager(dataSource);\n this.query = query instanceof Query ? query : new Query();\n };\n /**\n * The function used to generate updated Query from chart model\n *\n * @returns {void}\n * @private\n */\n Data.prototype.generateQuery = function () {\n var query = this.query.clone();\n return query;\n };\n /**\n * The function used to get dataSource by executing given Query\n *\n * @param {Query} query - A Query that specifies to generate dataSource\n * @returns {void}\n * @private\n */\n Data.prototype.getData = function (dataQuery) {\n var _this = this;\n if (this.dataManager.ready) {\n var dataManagerDeferred_1 = new Deferred();\n var ready = this.dataManager.ready;\n ready.then(function () {\n _this.dataManager.executeQuery(dataQuery).then(function (result) {\n dataManagerDeferred_1.resolve(result);\n });\n }).catch(function (e) { dataManagerDeferred_1.reject(e); });\n return dataManagerDeferred_1.promise;\n }\n else {\n return this.dataManager.executeQuery(dataQuery);\n }\n };\n return Data;\n}());\nexport { Data };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/* eslint-disable @typescript-eslint/no-inferrable-types */\n/* eslint-disable valid-jsdoc */\nimport { drawSymbol } from '../../common/utils/helper';\nimport { PathOption, Size } from '@syncfusion/ej2-svg-base';\nimport { Browser, extend, remove, isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { ChartData } from '../../chart/utils/get-data';\nimport { withInBounds, PointData, stopTimer } from '../../common/utils/helper';\nimport { colorNameToHex, convertHexToColor } from '../../common/utils/helper';\n/**\n * Marker Module used to render the marker for line type series.\n */\nvar MarkerExplode = /** @class */ (function (_super) {\n __extends(MarkerExplode, _super);\n /**\n * Constructor for the marker module.\n *\n * @private\n */\n function MarkerExplode(chart) {\n var _this = _super.call(this, chart) || this;\n _this.elementId = chart.element.id;\n return _this;\n }\n /**\n * @hidden\n */\n MarkerExplode.prototype.addEventListener = function () {\n if (this.chart.isDestroyed) {\n return;\n }\n this.chart.on(Browser.touchMoveEvent, this.mouseMoveHandler, this);\n this.chart.on(Browser.touchEndEvent, this.mouseUpHandler, this);\n };\n /**\n * @hidden\n */\n MarkerExplode.prototype.removeEventListener = function () {\n if (this.chart.isDestroyed) {\n return;\n }\n this.chart.off(Browser.touchMoveEvent, this.mouseMoveHandler);\n this.chart.off(Browser.touchEndEvent, this.mouseUpHandler);\n };\n /**\n * @hidden\n */\n MarkerExplode.prototype.mouseUpHandler = function () {\n var chart = this.chart;\n if (chart.isTouch && !chart.crosshair.enable && !this.isSelected(chart)) {\n this.markerMove(true);\n }\n };\n /**\n * @hidden\n */\n MarkerExplode.prototype.mouseMoveHandler = function () {\n var chart = this.chart;\n if ((!chart.crosshair.enable || (chart.tooltip.enable)) && (!chart.isTouch || chart.startMove) && !this.isSelected(chart)) {\n this.markerMove(false);\n }\n };\n MarkerExplode.prototype.markerMove = function (remove) {\n var _this = this;\n var chart = this.chart;\n this.currentPoints = [];\n var data;\n var previous;\n var explodeSeries;\n var series;\n if (!chart.tooltip.shared || !chart.tooltip.enable) {\n data = this.getData();\n series = data.series;\n previous = this.previousPoints[0];\n explodeSeries = series && ((series.type === 'Bubble' || series.drawType === 'Scatter' || series.type === 'Scatter') ||\n (((series.type !== 'Candle') && (series.type !== 'Hilo') && (series.type !== 'HiloOpenClose')) &&\n (series.marker.visible && series.marker.width !== 0 && series.marker.height !== 0)));\n data.lierIndex = this.lierIndex;\n if (data.point && explodeSeries && ((!previous || (previous.point !== data.point)) ||\n (previous && previous.lierIndex > 3 && previous.lierIndex !== this.lierIndex))) {\n this.currentPoints.push(data);\n }\n if (data.point && explodeSeries && chart.isPointMouseDown) {\n this.currentPoints.push(data);\n }\n }\n else {\n if (!withInBounds(chart.mouseX, chart.mouseY, chart.chartAxisLayoutPanel.seriesClipRect)) {\n return null;\n }\n if (chart.tooltip.enable) {\n var pointData = chart.chartAreaType === 'PolarRadar' ? this.getData() : null;\n var commonXvalues = this.mergeXvalues(this.chart.visibleSeries);\n for (var _i = 0, _a = chart.visibleSeries; _i < _a.length; _i++) {\n var chartSeries = _a[_i];\n if (!chartSeries.enableTooltip || chartSeries.category === 'Indicator') {\n continue;\n }\n if (chart.chartAreaType === 'Cartesian' && chartSeries.visible) {\n data = this.getClosestX(chart, chartSeries, commonXvalues);\n }\n else if (chart.chartAreaType === 'PolarRadar' && chartSeries.visible && pointData.point !== null) {\n data = new PointData(chartSeries.points[pointData.point.index], chartSeries);\n }\n if (data) {\n this.currentPoints.push(data);\n data = null;\n }\n }\n }\n }\n var length = this.previousPoints.length;\n if (this.currentPoints.length > 0) {\n if (length === 0 || chart.isPointMouseDown || (length > 0 && this.previousPoints[0].point !== this.currentPoints[0].point)) {\n if (this.previousPoints.length > 0) {\n this.removeHighlightedMarker();\n }\n var _loop_1 = function (data_1) {\n if ((data_1 && data_1.point) || ((series.type !== 'Candle') &&\n (series.type !== 'Hilo') && (series.type !== 'HiloOpenClose'))) {\n stopTimer(this_1.markerExplode);\n this_1.isRemove = true;\n data_1.point.symbolLocations.map(function (location, index) {\n if (!data_1.series.isRectSeries || data_1.point.marker.visible) {\n _this.drawTrackBall(data_1.series, data_1.point, location, index);\n }\n });\n }\n };\n var this_1 = this;\n for (var _b = 0, _c = this.currentPoints; _b < _c.length; _b++) {\n var data_1 = _c[_b];\n _loop_1(data_1);\n }\n this.previousPoints = extend([], this.currentPoints, null, true);\n }\n }\n if (!chart.tooltip.enable && ((this.currentPoints.length === 0 && this.isRemove) || (remove && this.isRemove) ||\n !withInBounds(chart.mouseX, chart.mouseY, chart.chartAxisLayoutPanel.seriesClipRect))) {\n this.isRemove = false;\n this.markerExplode = +setTimeout(function () {\n _this.removeHighlightedMarker();\n }, 2000);\n }\n this.currentPoints = [];\n };\n MarkerExplode.prototype.drawTrackBall = function (series, point, location, index) {\n var marker = point.marker;\n var seriesMarker = series.marker;\n var shape = marker.shape || seriesMarker.shape;\n if (shape === 'None') {\n return null;\n }\n var element = series.symbolElement || series.seriesElement;\n var className;\n if (this.chart.highlightModule && this.chart.highlightMode !== 'None') {\n className = this.chart.highlightModule.generateStyle(series);\n }\n if (this.chart.selectionModule && this.chart.selectionMode !== 'None') {\n className = this.chart.selectionModule.generateStyle(series);\n }\n var symbolId = this.elementId + '_Series_' + series.index + '_Point_' + point.index + '_Trackball' +\n (index ? index : '');\n var size = new Size((marker.width || seriesMarker.width) + 5, (marker.height || seriesMarker.height) + 5);\n var border = (marker.border || series.border);\n var explodeSeries = (series.type === 'BoxAndWhisker' || series.type === 'Bubble' || series.type === 'Scatter');\n var borderColor = (border.color && border.color !== 'transparent') ? border.color :\n marker.fill || point.interior || (explodeSeries ? point.color : series.interior);\n var colorValue = convertHexToColor(colorNameToHex(borderColor));\n var borderWidth = marker.border ? marker.border.width : seriesMarker.border.width;\n var markerShadow = series.chart.themeStyle.markerShadow ||\n 'rgba(' + colorValue.r + ',' + colorValue.g + ',' + colorValue.b + ',0.2)';\n for (var i = 0; i < 2; i++) {\n var options = new PathOption(symbolId + '_' + i, i ? (marker.fill || point.color || (explodeSeries ? series.interior : '#ffffff')) : 'transparent', borderWidth + (i ? 0 : 8), i ? borderColor : markerShadow, (marker.opacity || seriesMarker.opacity), null, null);\n var symbol = drawSymbol(location, shape, size, marker.imageUrl, options, '', this.chart.svgRenderer, series.clipRect);\n // incident: 252450 point click selection not working while maker explode\n //symbol.setAttribute('style', 'pointer-events:none');\n symbol.setAttribute('class', 'EJ2-Trackball');\n var selectionId = element.id.indexOf('Symbol') !== -1 ? '_Symbol' : '';\n var seletionElem = document.getElementById(this.elementId + '_Series_' + series.index + '_Point_' +\n point.index + selectionId);\n if (className !== '' && !isNullOrUndefined(className) && !isNullOrUndefined(seletionElem) &&\n seletionElem.hasAttribute('class') && (className === seletionElem.getAttribute('class'))) {\n symbol.classList.add(className);\n }\n symbol.setAttribute('clip-path', element.getAttribute('clip-path'));\n symbol.setAttribute('transform', element.getAttribute('transform'));\n this.chart.svgObject.appendChild(symbol);\n }\n };\n /**\n * @hidden\n */\n MarkerExplode.prototype.removeHighlightedMarker = function () {\n var elements = document.getElementsByClassName('EJ2-Trackball');\n for (var i = 0, len = elements.length; i < len; i++) {\n remove(elements[0]);\n }\n this.previousPoints = [];\n };\n return MarkerExplode;\n}(ChartData));\nexport { MarkerExplode };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/* eslint-disable @typescript-eslint/no-inferrable-types */\n/* eslint-disable valid-jsdoc */\n/* eslint-disable jsdoc/require-param */\n/* eslint-disable @typescript-eslint/ban-types */\nimport { RectOption, appendChildElement, getElement, appendClipElement } from '../../common/utils/helper';\nimport { findlElement, drawSymbol, markerAnimate, CircleOption } from '../../common/utils/helper';\nimport { PathOption, Size } from '@syncfusion/ej2-svg-base';\nimport { isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { pointRender } from '../../common/model/constants';\nimport { MarkerExplode } from './marker-explode';\nimport { getSaturationColor } from '../../common/utils/helper';\n/**\n * Marker module used to render the marker for line type series.\n */\nvar Marker = /** @class */ (function (_super) {\n __extends(Marker, _super);\n /**\n * Constructor for the marker module.\n *\n * @private\n */\n function Marker(chart) {\n var _this = _super.call(this, chart) || this;\n _this.addEventListener();\n return _this;\n }\n /**\n * Render the marker for series.\n *\n * @returns {void}\n * @private\n */\n Marker.prototype.render = function (series) {\n var _this = this;\n var redraw = series.chart.redraw;\n this.createElement(series, redraw);\n var _loop_1 = function (point) {\n if (point.visible && point.symbolLocations && point.symbolLocations.length) {\n point.symbolLocations.map(function (location, index) {\n if (series.marker.shape !== 'None') {\n _this.renderMarker(series, point, location, index, redraw);\n }\n });\n }\n };\n for (var _i = 0, _a = series.points; _i < _a.length; _i++) {\n var point = _a[_i];\n _loop_1(point);\n }\n };\n Marker.prototype.renderMarker = function (series, point, location, index, redraw) {\n var seriesIndex = series.index === undefined ? series.category : series.index;\n var marker = series.marker;\n var border = {\n color: marker.border.color,\n width: marker.border.width\n };\n var borderColor = marker.border.color;\n var previousLocation;\n var previousPath;\n var circlePath;\n var shapeOption;\n location.x = location.x + marker.offset.x;\n location.y = location.y - marker.offset.y;\n var isBoxPlot = series.type === 'BoxAndWhisker';\n var fill = marker.fill || (isBoxPlot ? point.interior || series.interior : '#ffffff');\n var markerElement;\n var parentElement = isBoxPlot ?\n findlElement(series.seriesElement.childNodes, 'Series_' + series.index + '_Point_' + point.index)\n : series.symbolElement;\n border.color = borderColor || series.setPointColor(point, series.interior);\n var symbolId = this.elementId + '_Series_' + seriesIndex + '_Point_' + point.index + '_Symbol' +\n (index ? index : '');\n var argsData = {\n cancel: false, name: pointRender, series: series, point: point,\n fill: point.isEmpty ? (series.emptyPointSettings.fill || fill) : fill,\n border: {\n color: series.type === 'BoxAndWhisker' ?\n (!isNullOrUndefined(borderColor) && borderColor !== 'transparent') ? borderColor :\n getSaturationColor(fill, -0.6)\n : border.color,\n width: border.width\n },\n height: marker.height, width: marker.width, shape: marker.shape\n };\n argsData.border = series.setBorderColor(point, { width: argsData.border.width, color: argsData.border.color });\n if (!series.isRectSeries || series.type === 'BoxAndWhisker') {\n this.chart.trigger(pointRender, argsData);\n point.color = argsData.fill;\n }\n point.color = argsData.fill;\n if (!argsData.cancel) {\n var y = void 0;\n if (series.type === 'RangeArea' || series.type === 'RangeColumn' || series.drawType === 'RangeColumn'\n || series.type === 'SplineRangeArea') {\n y = index ? point.low : point.high;\n }\n else if (isBoxPlot) {\n y = point.outliers[index];\n }\n else {\n y = point.y;\n }\n var markerFill = argsData.point.marker.fill || argsData.fill;\n var markerBorder = void 0;\n if (!isNullOrUndefined(argsData.point.marker.border)) {\n markerBorder = {\n color: argsData.point.marker.border.color || argsData.border.color,\n width: argsData.point.marker.border.width || argsData.border.width\n };\n }\n else {\n markerBorder = { color: argsData.border.color, width: argsData.border.width };\n }\n var markerWidth = argsData.point.marker.width || argsData.width;\n var markerHeight = argsData.point.marker.height || argsData.height;\n var markerOpacity = argsData.point.marker.opacity || marker.opacity;\n var markerShape = argsData.point.marker.shape || argsData.shape;\n var imageURL = argsData.point.marker.imageUrl || marker.imageUrl;\n shapeOption = new PathOption(symbolId, markerFill, markerBorder.width, markerBorder.color, markerOpacity, null);\n if ((parentElement !== undefined && parentElement !== null) || this.chart.enableCanvas) {\n if (redraw && getElement(shapeOption.id)) {\n markerElement = getElement(shapeOption.id);\n circlePath = markerShape === 'Circle' ? 'c' : '';\n previousLocation = {\n x: +markerElement.getAttribute(circlePath + 'x'), y: +markerElement.getAttribute(circlePath + 'y')\n };\n previousPath = markerElement.getAttribute('d');\n }\n markerElement = drawSymbol(location, markerShape, new Size(markerWidth, markerHeight), imageURL, shapeOption, point.x.toString() + ':' + y.toString(), this.chart.renderer, series.clipRect);\n appendChildElement(this.chart.enableCanvas, parentElement, markerElement, redraw, true, circlePath + 'x', circlePath + 'y', previousLocation, previousPath, false, false, null, series.chart.duration);\n }\n point.marker = {\n border: markerBorder, fill: markerFill, height: markerHeight,\n visible: true, shape: markerShape, width: markerWidth, imageUrl: imageURL\n };\n }\n else {\n location = null;\n point.marker = {\n visible: false\n };\n }\n };\n Marker.prototype.createElement = function (series, redraw) {\n var markerClipRect;\n var marker = series.marker;\n // 8 for extend border value 5 for extend size value\n var explodeValue = marker.border.width + 8 + 5;\n var render = series.chart.svgRenderer;\n var index = series.index === undefined ? series.category : series.index;\n var options;\n var transform = series.chart.chartAreaType === 'Cartesian' ? 'translate(' + series.clipRect.x + ',' + (series.clipRect.y) + ')' : '';\n if (marker.visible) {\n var markerHeight = (marker.height + explodeValue) / 2;\n var markerWidth = (marker.width + explodeValue) / 2;\n if (series.chart.chartAreaType === 'Cartesian') {\n options = new RectOption(this.elementId + '_ChartMarkerClipRect_' + index, 'transparent', { width: 1, color: 'Gray' }, 1, {\n x: -markerWidth, y: -markerHeight,\n width: series.clipRect.width + markerWidth * 2,\n height: series.clipRect.height + markerHeight * 2\n });\n markerClipRect = appendClipElement(redraw, options, render);\n }\n else {\n options = new CircleOption(this.elementId + '_ChartMarkerClipRect_' + index, 'transparent', { width: 1, color: 'Gray' }, 1, series.clipRect.width / 2 + series.clipRect.x, series.clipRect.height / 2 + series.clipRect.y, series.chart.radius + Math.max(markerHeight, markerWidth));\n markerClipRect = appendClipElement(redraw, options, render, 'drawCircularClipPath');\n }\n options = {\n 'id': this.elementId + 'SymbolGroup' + index,\n 'transform': transform,\n 'clip-path': 'url(#' + this.elementId + '_ChartMarkerClipRect_' + index + ')'\n };\n series.symbolElement = render.createGroup(options);\n series.symbolElement.appendChild(markerClipRect);\n if (this.chart.enableCanvas) {\n var element = document.getElementById(this.chart.element.id + '_tooltip_svg');\n element.appendChild(series.symbolElement);\n }\n }\n };\n Marker.prototype.getRangeLowPoint = function (region, series) {\n var x = region.x;\n var y = region.y;\n if (series.chart.requireInvertedAxis) {\n y += region.height / 2;\n x += series.yAxis.isInversed ? region.width : 0;\n }\n else {\n y += series.yAxis.isInversed ? 0 : region.height;\n x += region.width / 2;\n }\n return { x: x, y: y };\n };\n /**\n * Animates the marker.\n *\n * @returns {void}\n * @private\n */\n Marker.prototype.doMarkerAnimation = function (series) {\n if (!(series.type === 'Scatter' || series.type === 'Bubble' || series.type === 'Candle' || series.type === 'Hilo' ||\n series.type === 'HiloOpenClose' || (series.chart.chartAreaType === 'PolarRadar' && (series.drawType === 'Scatter')))) {\n var markerElements = series.symbolElement.childNodes;\n var delay = series.animation.delay + series.animation.duration;\n var duration = series.chart.animated ? series.chart.duration : 200;\n var j = 1;\n var incFactor = (series.type === 'RangeArea' || series.type === 'RangeColumn' || series.type === 'SplineRangeArea') ? 2 : 1;\n for (var i = 0; i < series.points.length; i++) {\n if (series.points[i].symbolLocations) {\n if (!series.points[i].symbolLocations.length || !markerElements[j]) {\n continue;\n }\n markerAnimate(markerElements[j], delay, duration, series, i, series.points[i].symbolLocations[0], false);\n if (incFactor === 2) {\n var lowPoint = this.getRangeLowPoint(series.points[i].regions[0], series);\n markerAnimate(markerElements[j + 1], delay, duration, series, i, lowPoint, false);\n }\n j += incFactor;\n }\n }\n }\n };\n return Marker;\n}(MarkerExplode));\nexport { Marker };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/* eslint-disable valid-jsdoc */\n/* eslint-disable jsdoc/require-param */\n// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// \nimport { Property, Complex } from '@syncfusion/ej2-base';\nimport { Connector } from '../../common/model/base';\nimport { SeriesBase } from '../series/chart-series';\nimport { firstToLowerCase } from '../../common/utils/helper';\nimport { Rect } from '@syncfusion/ej2-svg-base';\n/**\n * Defines how to represent the market trend using technical indicators\n */\nvar TechnicalIndicator = /** @class */ (function (_super) {\n __extends(TechnicalIndicator, _super);\n function TechnicalIndicator() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /** @private */\n _this.clipRect = new Rect(0, 0, 0, 0);\n return _this;\n }\n /** @private */\n TechnicalIndicator.prototype.setDataSource = function (series, chart) {\n if (series) {\n this.xData = series.xData;\n this.yData = series.yData;\n this.points = series.points;\n }\n var type = firstToLowerCase(this.type);\n chart[type + 'IndicatorModule'].initDataSource(this, chart);\n chart.visibleSeriesCount += this.targetSeries.length;\n };\n __decorate([\n Property('Sma')\n ], TechnicalIndicator.prototype, \"type\", void 0);\n __decorate([\n Property(14)\n ], TechnicalIndicator.prototype, \"period\", void 0);\n __decorate([\n Property(14)\n ], TechnicalIndicator.prototype, \"kPeriod\", void 0);\n __decorate([\n Property(3)\n ], TechnicalIndicator.prototype, \"dPeriod\", void 0);\n __decorate([\n Property(80)\n ], TechnicalIndicator.prototype, \"overBought\", void 0);\n __decorate([\n Property(20)\n ], TechnicalIndicator.prototype, \"overSold\", void 0);\n __decorate([\n Property(2)\n ], TechnicalIndicator.prototype, \"standardDeviation\", void 0);\n __decorate([\n Property('Close')\n ], TechnicalIndicator.prototype, \"field\", void 0);\n __decorate([\n Property(12)\n ], TechnicalIndicator.prototype, \"slowPeriod\", void 0);\n __decorate([\n Property(26)\n ], TechnicalIndicator.prototype, \"fastPeriod\", void 0);\n __decorate([\n Property(true)\n ], TechnicalIndicator.prototype, \"showZones\", void 0);\n __decorate([\n Complex({ color: '#ff9933', width: 2 }, Connector)\n ], TechnicalIndicator.prototype, \"macdLine\", void 0);\n __decorate([\n Property('Both')\n ], TechnicalIndicator.prototype, \"macdType\", void 0);\n __decorate([\n Property('#2ecd71')\n ], TechnicalIndicator.prototype, \"macdPositiveColor\", void 0);\n __decorate([\n Property('#e74c3d')\n ], TechnicalIndicator.prototype, \"macdNegativeColor\", void 0);\n __decorate([\n Property('rgba(211,211,211,0.25)')\n ], TechnicalIndicator.prototype, \"bandColor\", void 0);\n __decorate([\n Complex({ color: '#ffb735', width: 1 }, Connector)\n ], TechnicalIndicator.prototype, \"upperLine\", void 0);\n __decorate([\n Complex({ color: '#f2ec2f', width: 1 }, Connector)\n ], TechnicalIndicator.prototype, \"lowerLine\", void 0);\n __decorate([\n Complex({ color: '#f2ec2f', width: 1 }, Connector)\n ], TechnicalIndicator.prototype, \"periodLine\", void 0);\n __decorate([\n Property('')\n ], TechnicalIndicator.prototype, \"seriesName\", void 0);\n return TechnicalIndicator;\n}(SeriesBase));\nexport { TechnicalIndicator };\n","/**\n * Used to `write a string` into output file.\n * @private\n */\nvar PdfWriter = /** @class */ (function () {\n /**\n * Initialize an instance of `PdfWriter` class.\n * @private\n */\n function PdfWriter(stream) {\n this.streamWriter = stream;\n }\n Object.defineProperty(PdfWriter.prototype, \"document\", {\n //properties\n /**\n * Gets and Sets the `document`.\n * @private\n */\n get: function () {\n return this.pdfDocument;\n },\n set: function (value) {\n this.pdfDocument = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfWriter.prototype, \"position\", {\n /**\n * Gets the `position`.\n * @private\n */\n get: function () {\n return this.streamWriter.buffer.size;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfWriter.prototype, \"length\", {\n /**\n * Gets the `length` of the stream'.\n * @private\n */\n get: function () {\n return this.streamWriter.buffer.size;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfWriter.prototype, \"stream\", {\n /**\n * Gets the `stream`.\n * @private\n */\n get: function () {\n var result = this.streamWriter;\n return result;\n },\n enumerable: true,\n configurable: true\n });\n //public Methods\n /**\n * `Writes the specified data`.\n * @private\n */\n PdfWriter.prototype.write = function (overload) {\n var data = [];\n var tempOverload = overload;\n this.streamWriter.write(tempOverload);\n };\n return PdfWriter;\n}());\nexport { PdfWriter };\n","/**\n * @private\n * @hidden\n */\nexport function defaultToString(item) {\n // if (item === null) {\n // return 'COLLECTION_NULL';\n // } else if (typeof item === 'undefined') {\n // return 'COLLECTION_UNDEFINED';\n // } else if (Object.prototype.toString.call(item) === '[object String]') {\n if (Object.prototype.toString.call(item) === '[object String]') {\n return '$s' + item;\n }\n else {\n return '$o' + item.toString();\n }\n}\n","/**\n * Dictionary.ts class for EJ2-PDF\n * @private\n * @hidden\n */\nimport { defaultToString } from './utils';\n/**\n * @private\n * @hidden\n */\nvar Dictionary = /** @class */ (function () {\n /**\n * @private\n * @hidden\n */\n function Dictionary(toStringFunction) {\n this.table = {};\n this.nElements = 0;\n this.toStr = toStringFunction || defaultToString;\n }\n /**\n * @private\n * @hidden\n */\n Dictionary.prototype.getValue = function (key) {\n var pair = this.table['$' + this.toStr(key)];\n if (typeof pair === 'undefined') {\n return undefined;\n }\n return pair.value;\n };\n /**\n * @private\n * @hidden\n */\n Dictionary.prototype.setValue = function (key, value) {\n // if (typeof key === 'undefined' || typeof value === 'undefined') {\n // return undefined;\n // }\n var ret;\n var k = '$' + this.toStr(key);\n var previousElement = this.table[k];\n // if (typeof previousElement === 'undefined') {\n this.nElements++;\n ret = undefined;\n // }\n this.table[k] = {\n key: key,\n value: value\n };\n return ret;\n };\n /**\n * @private\n * @hidden\n */\n Dictionary.prototype.remove = function (key) {\n var k = '$' + this.toStr(key);\n var previousElement = this.table[k];\n // if (typeof previousElement !== 'undefined') {\n delete this.table[k];\n this.nElements--;\n return previousElement.value;\n // }\n // return undefined;\n };\n /**\n * @private\n * @hidden\n */\n Dictionary.prototype.keys = function () {\n var keysArray = [];\n var namesOfKeys = Object.keys(this.table);\n for (var index1 = 0; index1 < namesOfKeys.length; index1++) {\n // if (Object.prototype.hasOwnProperty.call(this.table, namesOfKeys[index1])) {\n var pair1 = this.table[namesOfKeys[index1]];\n keysArray.push(pair1.key);\n // }\n }\n return keysArray;\n };\n /**\n * @private\n * @hidden\n */\n Dictionary.prototype.values = function () {\n var valuesArray = [];\n var namesOfValues = Object.keys(this.table);\n for (var index2 = 0; index2 < namesOfValues.length; index2++) {\n // if (Object.prototype.hasOwnProperty.call(this.table, namesOfValues[index2])) {\n var pair2 = this.table[namesOfValues[index2]];\n valuesArray.push(pair2.value);\n // }\n }\n return valuesArray;\n };\n /**\n * @private\n * @hidden\n */\n Dictionary.prototype.containsKey = function (key) {\n var retutnValue = true;\n if (typeof this.getValue(key) === 'undefined') {\n retutnValue = true;\n }\n else {\n retutnValue = false;\n }\n return !retutnValue;\n };\n /**\n * @private\n * @hidden\n */\n Dictionary.prototype.clear = function () {\n this.table = {};\n this.nElements = 0;\n };\n /**\n * @private\n * @hidden\n */\n Dictionary.prototype.size = function () {\n return this.nElements;\n };\n return Dictionary;\n}()); // End of dictionary\nexport { Dictionary };\n","/**\n * public Enum for `CompositeFontType`.\n * @private\n */\nexport var ObjectStatus;\n(function (ObjectStatus) {\n /**\n * Specifies the type of `None`.\n * @private\n */\n ObjectStatus[ObjectStatus[\"None\"] = 0] = \"None\";\n /**\n * Specifies the type of `Registered`.\n * @private\n */\n ObjectStatus[ObjectStatus[\"Registered\"] = 1] = \"Registered\";\n})(ObjectStatus || (ObjectStatus = {}));\n","/**\n * PdfMainObjectCollection.ts class for EJ2-PDF\n */\nimport { Dictionary } from './../collections/dictionary';\nimport { ObjectStatus } from './enum';\n/**\n * The collection of all `objects` within a PDF document.\n * @private\n */\nvar PdfMainObjectCollection = /** @class */ (function () {\n function PdfMainObjectCollection() {\n //Fields\n /**\n * The collection of the `indirect objects`.\n * @default []\n * @private\n */\n this.objectCollections = [];\n /**\n * The collection of the `Indirect objects`.\n * @default new Dictionary()\n * @private\n */\n this.mainObjectCollection = new Dictionary();\n /**\n * The collection of `primitive objects`.\n * @private\n */\n this.primitiveObjectCollection = new Dictionary();\n }\n Object.defineProperty(PdfMainObjectCollection.prototype, \"count\", {\n //Properties\n /**\n * Gets the `count`.\n * @private\n */\n get: function () {\n return this.objectCollections.length;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the value of `ObjectInfo` from object collection.\n * @private\n */\n PdfMainObjectCollection.prototype.items = function (index) {\n return this.objectCollections[index];\n };\n Object.defineProperty(PdfMainObjectCollection.prototype, \"outIsNew\", {\n //Methods\n /**\n * Specifies the value of `IsNew`.\n * @private\n */\n get: function () {\n return this.isNew;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * `Adds` the specified element.\n * @private\n */\n PdfMainObjectCollection.prototype.add = function (element) {\n var objInfo = new ObjectInfo(element);\n this.objectCollections.push(objInfo);\n if (!this.primitiveObjectCollection.containsKey(element)) {\n this.primitiveObjectCollection.setValue(element, this.objectCollections.length - 1);\n }\n element.position = this.index = this.objectCollections.length - 1;\n element.status = ObjectStatus.Registered;\n };\n /**\n * `Looks` through the collection for the object specified.\n * @private\n */\n PdfMainObjectCollection.prototype.lookFor = function (obj) {\n var index = -1;\n if (obj.position !== -1) {\n return obj.position;\n }\n if (this.primitiveObjectCollection.containsKey(obj) && this.count === this.primitiveObjectCollection.size()) {\n index = this.primitiveObjectCollection.getValue(obj);\n }\n else {\n for (var i = this.count - 1; i >= 0; i--) {\n var oi = this.objectCollections[i];\n if (oi.object === obj) {\n index = i;\n break;\n }\n }\n }\n return index;\n };\n /**\n * Gets the `reference of the object`.\n * @private\n */\n PdfMainObjectCollection.prototype.getReference = function (index, isNew) {\n this.index = this.lookFor(index);\n var reference;\n this.isNew = false;\n var oi = this.objectCollections[this.index];\n reference = oi.reference;\n var obj = { reference: reference, wasNew: isNew };\n return obj;\n };\n /**\n * Tries to set the `reference to the object`.\n * @private\n */\n PdfMainObjectCollection.prototype.trySetReference = function (obj, reference, found) {\n var result = true;\n found = true;\n this.index = this.lookFor(obj);\n var oi = this.objectCollections[this.index];\n oi.setReference(reference);\n return result;\n };\n PdfMainObjectCollection.prototype.destroy = function () {\n for (var _i = 0, _a = this.objectCollections; _i < _a.length; _i++) {\n var obj = _a[_i];\n if (obj !== undefined) {\n obj.pdfObject.position = -1;\n obj.pdfObject.isSaving = undefined;\n obj.pdfObject.objectCollectionIndex = undefined;\n obj.pdfObject.position = undefined;\n }\n }\n this.objectCollections = [];\n this.mainObjectCollection = new Dictionary();\n this.primitiveObjectCollection = new Dictionary();\n };\n return PdfMainObjectCollection;\n}());\nexport { PdfMainObjectCollection };\nvar ObjectInfo = /** @class */ (function () {\n function ObjectInfo(obj, reference) {\n this.pdfObject = obj;\n this.pdfReference = reference;\n }\n Object.defineProperty(ObjectInfo.prototype, \"object\", {\n //Properties\n /**\n * Gets the `object`.\n * @private\n */\n get: function () {\n return this.pdfObject;\n },\n set: function (value) {\n this.pdfObject = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ObjectInfo.prototype, \"reference\", {\n /**\n * Gets the `reference`.\n * @private\n */\n get: function () {\n return this.pdfReference;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Sets the `reference`.\n * @private\n */\n ObjectInfo.prototype.setReference = function (reference) {\n this.pdfReference = reference;\n };\n return ObjectInfo;\n}());\nexport { ObjectInfo };\n","/**\n * Encoding class: Contains the details about encoding type, whether to write a Unicode byte order mark (BOM).\n * ```typescript\n * let encoding : Encoding = new Encoding();\n * encoding.type = 'Utf8';\n * encoding.getBytes('Encoding', 0, 5);\n * ```\n */\nvar Encoding = /** @class */ (function () {\n /**\n * Initializes a new instance of the Encoding class. A parameter specifies whether to write a Unicode byte order mark\n * @param {boolean} includeBom?-true to specify that a Unicode byte order mark is written; otherwise, false.\n */\n function Encoding(includeBom) {\n this.emitBOM = true;\n this.encodingType = 'Ansi';\n this.initBOM(includeBom);\n }\n Object.defineProperty(Encoding.prototype, \"includeBom\", {\n /**\n * Gets a value indicating whether to write a Unicode byte order mark\n * @returns boolean- true to specify that a Unicode byte order mark is written; otherwise, false\n */\n get: function () {\n return this.emitBOM;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Encoding.prototype, \"type\", {\n /**\n * Gets the encoding type.\n * @returns EncodingType\n */\n get: function () {\n return this.encodingType;\n },\n /**\n * Sets the encoding type.\n * @param {EncodingType} value\n */\n set: function (value) {\n this.encodingType = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Initialize the includeBom to emit BOM or Not\n * @param {boolean} includeBom\n */\n Encoding.prototype.initBOM = function (includeBom) {\n if (includeBom === undefined || includeBom === null) {\n this.emitBOM = true;\n }\n else {\n this.emitBOM = includeBom;\n }\n };\n /**\n * Calculates the number of bytes produced by encoding the characters in the specified string\n * @param {string} chars - The string containing the set of characters to encode\n * @returns {number} - The number of bytes produced by encoding the specified characters\n */\n Encoding.prototype.getByteCount = function (chars) {\n var byteCount = 0;\n validateNullOrUndefined(chars, 'string');\n if (chars === '') {\n var byte = this.utf8Len(chars.charCodeAt(0));\n return byte;\n }\n if (this.type === null || this.type === undefined) {\n this.type = 'Ansi';\n }\n return this.getByteCountInternal(chars, 0, chars.length);\n };\n /**\n * Return the Byte of character\n * @param {number} codePoint\n * @returns {number}\n */\n Encoding.prototype.utf8Len = function (codePoint) {\n var bytes = codePoint <= 0x7F ? 1 :\n codePoint <= 0x7FF ? 2 :\n codePoint <= 0xFFFF ? 3 :\n codePoint <= 0x1FFFFF ? 4 : 0;\n return bytes;\n };\n /**\n * for 4 byte character return surrogate pair true, otherwise false\n * @param {number} codeUnit\n * @returns {boolean}\n */\n Encoding.prototype.isHighSurrogate = function (codeUnit) {\n return codeUnit >= 0xD800 && codeUnit <= 0xDBFF;\n };\n /**\n * for 4byte character generate the surrogate pair\n * @param {number} highCodeUnit\n * @param {number} lowCodeUnit\n */\n Encoding.prototype.toCodepoint = function (highCodeUnit, lowCodeUnit) {\n highCodeUnit = (0x3FF & highCodeUnit) << 10;\n var u = highCodeUnit | (0x3FF & lowCodeUnit);\n return u + 0x10000;\n };\n /**\n * private method to get the byte count for specific charindex and count\n * @param {string} chars\n * @param {number} charIndex\n * @param {number} charCount\n */\n Encoding.prototype.getByteCountInternal = function (chars, charIndex, charCount) {\n var byteCount = 0;\n if (this.encodingType === 'Utf8' || this.encodingType === 'Unicode') {\n var isUtf8 = this.encodingType === 'Utf8';\n for (var i = 0; i < charCount; i++) {\n var charCode = chars.charCodeAt(isUtf8 ? charIndex : charIndex++);\n if (this.isHighSurrogate(charCode)) {\n if (isUtf8) {\n var high = charCode;\n var low = chars.charCodeAt(++charIndex);\n byteCount += this.utf8Len(this.toCodepoint(high, low));\n }\n else {\n byteCount += 4;\n ++i;\n }\n }\n else {\n if (isUtf8) {\n byteCount += this.utf8Len(charCode);\n }\n else {\n byteCount += 2;\n }\n }\n if (isUtf8) {\n charIndex++;\n }\n }\n return byteCount;\n }\n else {\n byteCount = charCount;\n return byteCount;\n }\n };\n /**\n * Encodes a set of characters from the specified string into the ArrayBuffer.\n * @param {string} s- The string containing the set of characters to encode\n * @param {number} charIndex-The index of the first character to encode.\n * @param {number} charCount- The number of characters to encode.\n * @returns {ArrayBuffer} - The ArrayBuffer that contains the resulting sequence of bytes.\n */\n Encoding.prototype.getBytes = function (s, charIndex, charCount) {\n validateNullOrUndefined(s, 'string');\n validateNullOrUndefined(charIndex, 'charIndex');\n validateNullOrUndefined(charCount, 'charCount');\n if (charIndex < 0 || charCount < 0) {\n throw new RangeError('Argument Out Of Range Exception: charIndex or charCount is less than zero');\n }\n if (s.length - charIndex < charCount) {\n throw new RangeError('Argument Out Of Range Exception: charIndex and charCount do not denote a valid range in string');\n }\n var bytes;\n if (s === '') {\n bytes = new ArrayBuffer(0);\n return bytes;\n }\n if (this.type === null || this.type === undefined) {\n this.type = 'Ansi';\n }\n var byteCount = this.getByteCountInternal(s, charIndex, charCount);\n switch (this.type) {\n case 'Utf8':\n bytes = this.getBytesOfUtf8Encoding(byteCount, s, charIndex, charCount);\n return bytes;\n case 'Unicode':\n bytes = this.getBytesOfUnicodeEncoding(byteCount, s, charIndex, charCount);\n return bytes;\n default:\n bytes = this.getBytesOfAnsiEncoding(byteCount, s, charIndex, charCount);\n return bytes;\n }\n };\n /**\n * Decodes a sequence of bytes from the specified ArrayBuffer into the string.\n * @param {ArrayBuffer} bytes- The ArrayBuffer containing the sequence of bytes to decode.\n * @param {number} index- The index of the first byte to decode.\n * @param {number} count- The number of bytes to decode.\n * @returns {string} - The string that contains the resulting set of characters.\n */\n Encoding.prototype.getString = function (bytes, index, count) {\n validateNullOrUndefined(bytes, 'bytes');\n validateNullOrUndefined(index, 'index');\n validateNullOrUndefined(count, 'count');\n if (index < 0 || count < 0) {\n throw new RangeError('Argument Out Of Range Exception: index or count is less than zero');\n }\n if (bytes.byteLength - index < count) {\n throw new RangeError('Argument Out Of Range Exception: index and count do not denote a valid range in bytes');\n }\n if (bytes.byteLength === 0 || count === 0) {\n return '';\n }\n if (this.type === null || this.type === undefined) {\n this.type = 'Ansi';\n }\n var out = '';\n var byteCal = new Uint8Array(bytes);\n switch (this.type) {\n case 'Utf8':\n var s = this.getStringOfUtf8Encoding(byteCal, index, count);\n return s;\n case 'Unicode':\n var byteUnicode = new Uint16Array(bytes);\n out = this.getStringofUnicodeEncoding(byteUnicode, index, count);\n return out;\n default:\n var j = index;\n for (var i = 0; i < count; i++) {\n var c = byteCal[j];\n out += String.fromCharCode(c); // 1 byte(ASCII) character \n j++;\n }\n return out;\n }\n };\n Encoding.prototype.getBytesOfAnsiEncoding = function (byteCount, s, charIndex, charCount) {\n var bytes = new ArrayBuffer(byteCount);\n var bufview = new Uint8Array(bytes);\n var k = 0;\n for (var i = 0; i < charCount; i++) {\n var charcode = s.charCodeAt(charIndex++);\n if (charcode < 0x800) {\n bufview[k] = charcode;\n }\n else {\n bufview[k] = 63; //replacement character '?'\n }\n k++;\n }\n return bytes;\n };\n Encoding.prototype.getBytesOfUtf8Encoding = function (byteCount, s, charIndex, charCount) {\n var bytes = new ArrayBuffer(byteCount);\n var uint = new Uint8Array(bytes);\n var index = charIndex;\n var j = 0;\n for (var i = 0; i < charCount; i++) {\n var charcode = s.charCodeAt(index);\n if (charcode <= 0x7F) { // 1 byte character 2^7\n uint[j] = charcode;\n }\n else if (charcode < 0x800) { // 2 byte character 2^11\n uint[j] = 0xc0 | (charcode >> 6);\n uint[++j] = 0x80 | (charcode & 0x3f);\n }\n else if ((charcode < 0xd800 || charcode >= 0xe000)) { // 3 byte character 2^16 \n uint[j] = 0xe0 | (charcode >> 12);\n uint[++j] = 0x80 | ((charcode >> 6) & 0x3f);\n uint[++j] = 0x80 | (charcode & 0x3f);\n }\n else {\n uint[j] = 0xef;\n uint[++j] = 0xbf;\n uint[++j] = 0xbd; // U+FFFE \"replacement character\"\n }\n ++j;\n ++index;\n }\n return bytes;\n };\n Encoding.prototype.getBytesOfUnicodeEncoding = function (byteCount, s, charIndex, charCount) {\n var bytes = new ArrayBuffer(byteCount);\n var uint16 = new Uint16Array(bytes);\n for (var i = 0; i < charCount; i++) {\n var charcode = s.charCodeAt(i);\n uint16[i] = charcode;\n }\n return bytes;\n };\n Encoding.prototype.getStringOfUtf8Encoding = function (byteCal, index, count) {\n var j = 0;\n var i = index;\n var s = '';\n for (j; j < count; j++) {\n var c = byteCal[i++];\n while (i > byteCal.length) {\n return s;\n }\n if (c > 127) {\n if (c > 191 && c < 224 && i < count) {\n c = (c & 31) << 6 | byteCal[i] & 63;\n }\n else if (c > 223 && c < 240 && i < byteCal.byteLength) {\n c = (c & 15) << 12 | (byteCal[i] & 63) << 6 | byteCal[++i] & 63;\n }\n else if (c > 239 && c < 248 && i < byteCal.byteLength) {\n c = (c & 7) << 18 | (byteCal[i] & 63) << 12 | (byteCal[++i] & 63) << 6 | byteCal[++i] & 63;\n }\n ++i;\n }\n s += String.fromCharCode(c); // 1 byte(ASCII) character \n }\n return s;\n };\n Encoding.prototype.getStringofUnicodeEncoding = function (byteUni, index, count) {\n if (count > byteUni.length) {\n throw new RangeError('ArgumentOutOfRange_Count');\n }\n var byte16 = new Uint16Array(count);\n var out = '';\n for (var i = 0; i < count && i < byteUni.length; i++) {\n byte16[i] = byteUni[index++];\n }\n out = String.fromCharCode.apply(null, byte16);\n return out;\n };\n /**\n * To clear the encoding instance\n * @return {void}\n */\n Encoding.prototype.destroy = function () {\n this.emitBOM = undefined;\n this.encodingType = undefined;\n };\n return Encoding;\n}());\nexport { Encoding };\n/**\n * To check the object is null or undefined and throw error if it is null or undefined\n * @param {Object} value - object to check is null or undefined\n * @return {boolean}\n * @throws {ArgumentException} - if the value is null or undefined\n * @private\n */\nexport function validateNullOrUndefined(value, message) {\n if (value === null || value === undefined) {\n throw new Error('ArgumentException: ' + message + ' cannot be null or undefined');\n }\n}\n","/**\n * Save class provide method to save file\n * ```typescript\n * let blob : Blob = new Blob([''], { type: 'text/plain' });\n * Save.save('fileName.txt',blob);\n */\nvar Save = /** @class */ (function () {\n /**\n * Initialize new instance of {save}\n */\n function Save() {\n // tslint:disable\n }\n /**\n * Saves the file with specified name and sends the file to client browser\n * @param {string} fileName- file name to save.\n * @param {Blob} buffer- the content to write in file\n * @param {boolean} isMicrosoftBrowser- specify whether microsoft browser or not\n * @returns {void}\n */\n Save.save = function (fileName, buffer) {\n if (fileName === null || fileName === undefined || fileName === '') {\n throw new Error('ArgumentException: fileName cannot be undefined, null or empty');\n }\n var extension = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length);\n var mimeType = this.getMimeType(extension);\n if (mimeType !== '') {\n buffer = new Blob([buffer], { type: mimeType });\n }\n if (this.isMicrosoftBrowser) {\n navigator.msSaveBlob(buffer, fileName);\n }\n else {\n var downloadLink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');\n this.saveInternal(fileName, extension, buffer, downloadLink, 'download' in downloadLink);\n }\n };\n Save.saveInternal = function (fileName, extension, buffer, downloadLink, hasDownloadAttribute) {\n if (hasDownloadAttribute) {\n downloadLink.download = fileName;\n var dataUrl_1 = window.URL.createObjectURL(buffer);\n downloadLink.href = dataUrl_1;\n var event_1 = document.createEvent('MouseEvent');\n event_1.initEvent('click', true, true);\n downloadLink.dispatchEvent(event_1);\n setTimeout(function () {\n window.URL.revokeObjectURL(dataUrl_1);\n dataUrl_1 = undefined;\n });\n }\n else {\n if (extension !== 'docx' && extension !== 'xlsx') {\n var url = window.URL.createObjectURL(buffer);\n var isPopupBlocked = window.open(url, '_blank');\n if (!isPopupBlocked) {\n window.location.href = url;\n }\n }\n else {\n var reader_1 = new FileReader();\n reader_1.onloadend = function () {\n var isPopupBlocked = window.open(reader_1.result, '_blank');\n if (!isPopupBlocked) {\n window.location.href = reader_1.result;\n }\n };\n reader_1.readAsDataURL(buffer);\n }\n }\n };\n /**\n *\n * @param {string} extension - get mime type of the specified extension\n * @private\n */\n Save.getMimeType = function (extension) {\n var mimeType = '';\n switch (extension) {\n case 'html':\n mimeType = 'text/html';\n break;\n case 'pdf':\n mimeType = 'application/pdf';\n break;\n case 'docx':\n mimeType = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';\n break;\n case 'xlsx':\n mimeType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';\n break;\n case 'txt':\n mimeType = 'text/plain';\n break;\n }\n return mimeType;\n };\n return Save;\n}());\nexport { Save };\n","/**\n * `PdfString` class is used to perform string related primitive operations.\n * @private\n */\nexport var InternalEnum;\n(function (InternalEnum) {\n //Internals\n /**\n * public Enum for `ForceEncoding`.\n * @private\n */\n var ForceEncoding;\n (function (ForceEncoding) {\n /**\n * Specifies the type of `None`.\n * @private\n */\n ForceEncoding[ForceEncoding[\"None\"] = 0] = \"None\";\n /**\n * Specifies the type of `Ascii`.\n * @private\n */\n ForceEncoding[ForceEncoding[\"Ascii\"] = 1] = \"Ascii\";\n /**\n * Specifies the type of `Unicode`.\n * @private\n */\n ForceEncoding[ForceEncoding[\"Unicode\"] = 2] = \"Unicode\";\n })(ForceEncoding = InternalEnum.ForceEncoding || (InternalEnum.ForceEncoding = {}));\n /**\n * public Enum for `SourceType`.\n * @private\n */\n var SourceType;\n (function (SourceType) {\n /**\n * Specifies the type of `StringValue`.\n * @private\n */\n SourceType[SourceType[\"StringValue\"] = 0] = \"StringValue\";\n /**\n * Specifies the type of `ByteBuffer`.\n * @private\n */\n SourceType[SourceType[\"ByteBuffer\"] = 1] = \"ByteBuffer\";\n })(SourceType || (SourceType = {}));\n})(InternalEnum || (InternalEnum = {}));\nvar PdfString = /** @class */ (function () {\n function PdfString(value) {\n /**\n * Value indicating whether the string was converted to hex.\n * @default false\n * @private\n */\n this.bHex = false;\n /**\n * Internal variable to store the `position`.\n * @default -1\n * @private\n */\n this.position1 = -1;\n /**\n * Internal variable to hold `cloned object`.\n * @default null\n * @private\n */\n this.clonedObject1 = null;\n /**\n * `Shows` if the data of the stream was decrypted.\n * @default false\n * @private\n */\n this.bDecrypted = false;\n /**\n * Shows if the data of the stream `was decrypted`.\n * @default false\n * @private\n */\n this.isParentDecrypted = false;\n /**\n * Gets a value indicating whether the object is `packed or not`.\n * @default false\n * @private\n */\n this.isPacked = false;\n /**\n * @hidden\n * @private\n */\n this.isFormField = false;\n /**\n * @hidden\n * @private\n */\n this.isColorSpace = false;\n /**\n * @hidden\n * @private\n */\n this.isHexString = true;\n if (typeof value === 'undefined') {\n this.bHex = false;\n }\n else {\n if (!(value.length > 0 && value[0] === '0xfeff')) {\n this.stringValue = value;\n this.data = [];\n for (var i = 0; i < value.length; ++i) {\n this.data.push(value.charCodeAt(i));\n }\n }\n }\n }\n Object.defineProperty(PdfString.prototype, \"hex\", {\n //Property\n /**\n * Gets a value indicating whether string is in `hex`.\n * @private\n */\n get: function () {\n return this.bHex;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfString.prototype, \"value\", {\n /**\n * Gets or sets string `value` of the object.\n * @private\n */\n get: function () {\n return this.stringValue;\n },\n set: function (value) {\n this.stringValue = value;\n this.data = null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfString.prototype, \"status\", {\n /**\n * Gets or sets the `Status` of the specified object.\n * @private\n */\n get: function () {\n return this.status1;\n },\n set: function (value) {\n this.status1 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfString.prototype, \"isSaving\", {\n /**\n * Gets or sets a value indicating whether this document `is saving` or not.\n * @private\n */\n get: function () {\n return this.isSaving1;\n },\n set: function (value) {\n this.isSaving1 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfString.prototype, \"objectCollectionIndex\", {\n /**\n * Gets or sets the `index` value of the specified object.\n * @private\n */\n get: function () {\n return this.index1;\n },\n set: function (value) {\n this.index1 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfString.prototype, \"clonedObject\", {\n /**\n * Returns `cloned object`.\n * @private\n */\n get: function () {\n return this.clonedObject1;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfString.prototype, \"position\", {\n /**\n * Gets or sets the `position` of the object.\n * @private\n */\n get: function () {\n return this.position1;\n },\n set: function (value) {\n this.position1 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfString.prototype, \"CrossTable\", {\n /**\n * Returns `PdfCrossTable` associated with the object.\n * @private\n */\n get: function () {\n return this.crossTable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfString.prototype, \"converted\", {\n /**\n * Gets a value indicating whether to check if the value has unicode characters.\n * @private\n */\n get: function () {\n return this.bConverted;\n },\n /**\n * sets a value indicating whether to check if the value has unicode characters.\n * @private\n */\n set: function (value) {\n this.bConverted = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfString.prototype, \"encode\", {\n /**\n * Gets value indicating whether we should convert data to Unicode.\n */\n get: function () {\n return this.bForceEncoding;\n },\n set: function (value) {\n this.bForceEncoding = value;\n },\n enumerable: true,\n configurable: true\n });\n //Methods\n /**\n * Converts `bytes to string using hex format` for representing string.\n * @private\n */\n PdfString.bytesToHex = function (bytes) {\n if (bytes == null) {\n return '';\n }\n var builder = '';\n return builder;\n };\n /**\n * `Saves` the object using the specified writer.\n * @private\n */\n PdfString.prototype.save = function (writer) {\n if (writer === null) {\n throw new Error('ArgumentNullException : writer');\n }\n if (this.encode !== undefined && this.encode === InternalEnum.ForceEncoding.Ascii) {\n writer.write(this.pdfEncode());\n }\n else {\n writer.write(PdfString.stringMark[0] + this.value + PdfString.stringMark[1]);\n }\n };\n PdfString.prototype.pdfEncode = function () {\n var result = '';\n if (this.encode !== undefined && this.encode === InternalEnum.ForceEncoding.Ascii) {\n var data = this.escapeSymbols(this.value);\n for (var i = 0; i < data.length; i++) {\n result += String.fromCharCode(data[i]);\n }\n result = PdfString.stringMark[0] + result + PdfString.stringMark[1];\n }\n else {\n result = this.value;\n }\n return result;\n };\n PdfString.prototype.escapeSymbols = function (value) {\n var data = [];\n for (var i = 0; i < value.length; i++) {\n var currentData = value.charCodeAt(i);\n switch (currentData) {\n case 40:\n case 41:\n data.push(92);\n data.push(currentData);\n break;\n case 13:\n data.push(92);\n data.push(114);\n break;\n case 92:\n data.push(92);\n data.push(currentData);\n break;\n default:\n data.push(currentData);\n break;\n }\n }\n return data;\n };\n /**\n * Creates a `copy of PdfString`.\n * @private\n */\n PdfString.prototype.clone = function (crossTable) {\n if (this.clonedObject1 !== null && this.clonedObject1.CrossTable === crossTable) {\n return this.clonedObject1;\n }\n else {\n this.clonedObject1 = null;\n }\n var newString = new PdfString(this.stringValue);\n newString.bHex = this.bHex;\n newString.crossTable = crossTable;\n newString.isColorSpace = this.isColorSpace;\n this.clonedObject1 = newString;\n return newString;\n };\n /**\n * Converts string to array of unicode symbols.\n */\n PdfString.toUnicodeArray = function (value, bAddPrefix) {\n if (value == null) {\n throw new Error('Argument Null Exception : value');\n }\n var startIndex = 0;\n var output = [];\n for (var i = 0; i < value.length; i++) {\n var code = value.charCodeAt(i);\n output.push(code / 256 >>> 0);\n output.push(code & 0xff);\n }\n return output;\n };\n /**\n * Converts byte data to string.\n */\n PdfString.byteToString = function (data) {\n if (data == null) {\n throw new Error('Argument Null Exception : stream');\n }\n var result = '';\n for (var i = 0; i < data.length; ++i) {\n result += String.fromCharCode(data[i]);\n }\n return result;\n };\n //constants = ;\n /**\n * `General markers` for string.\n * @private\n */\n PdfString.stringMark = '()';\n /**\n * `Hex markers` for string.\n * @private\n */\n PdfString.hexStringMark = '<>';\n /**\n * Format of password data.\n * @private\n */\n PdfString.hexFormatPattern = '{0:X2}';\n return PdfString;\n}());\nexport { PdfString };\n","import { Encoding, validateNullOrUndefined } from './encoding';\nimport { Save } from './save';\n/**\n * StreamWriter class contains the implementation for writing characters to a file in a particular encoding\n * ```typescript\n * let writer = new StreamWriter();\n * writer.write('Hello World');\n * writer.save('Sample.txt');\n * writer.dispose();\n * ```\n */\nvar StreamWriter = /** @class */ (function () {\n /**\n * Initializes a new instance of the StreamWriter class by using the specified encoding.\n * @param {Encoding} encoding?- The character encoding to use.\n */\n function StreamWriter(encoding) {\n this.bufferBlob = new Blob(['']);\n this.bufferText = '';\n this.init(encoding);\n Save.isMicrosoftBrowser = !(!navigator.msSaveBlob);\n }\n Object.defineProperty(StreamWriter.prototype, \"buffer\", {\n /**\n * Gets the content written to the StreamWriter as Blob.\n * @returns Blob\n */\n get: function () {\n this.flush();\n return this.bufferBlob;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StreamWriter.prototype, \"encoding\", {\n /**\n * Gets the encoding.\n * @returns Encoding\n */\n get: function () {\n return this.enc;\n },\n enumerable: true,\n configurable: true\n });\n StreamWriter.prototype.init = function (encoding) {\n if (encoding === null || encoding === undefined) {\n this.enc = new Encoding(false);\n this.enc.type = 'Utf8';\n }\n else {\n this.enc = encoding;\n this.setBomByte();\n }\n };\n /**\n * Private method to set Byte Order Mark(BOM) value based on EncodingType\n */\n StreamWriter.prototype.setBomByte = function () {\n if (this.encoding.includeBom) {\n switch (this.encoding.type) {\n case 'Unicode':\n var arrayUnicode = new ArrayBuffer(2);\n var uint8 = new Uint8Array(arrayUnicode);\n uint8[0] = 255;\n uint8[1] = 254;\n this.bufferBlob = new Blob([arrayUnicode]);\n break;\n case 'Utf8':\n var arrayUtf8 = new ArrayBuffer(3);\n var utf8 = new Uint8Array(arrayUtf8);\n utf8[0] = 239;\n utf8[1] = 187;\n utf8[2] = 191;\n this.bufferBlob = new Blob([arrayUtf8]);\n break;\n default:\n this.bufferBlob = new Blob(['']);\n break;\n }\n }\n };\n /**\n * Saves the file with specified name and sends the file to client browser\n * @param {string} fileName - The file name to save\n * @returns {void}\n */\n StreamWriter.prototype.save = function (fileName) {\n if (this.bufferText !== '') {\n this.flush();\n }\n Save.save(fileName, this.buffer);\n };\n /**\n * Writes the specified string.\n * @param {string} value - The string to write. If value is null or undefined, nothing is written.\n * @returns {void}\n */\n StreamWriter.prototype.write = function (value) {\n if (this.encoding === undefined) {\n throw new Error('Object Disposed Exception: current writer is disposed');\n }\n validateNullOrUndefined(value, 'string');\n this.bufferText += value;\n if (this.bufferText.length >= 10240) {\n this.flush();\n }\n };\n StreamWriter.prototype.flush = function () {\n if (this.bufferText === undefined || this.bufferText === null || this.bufferText.length === 0) {\n return;\n }\n var bufferArray = this.encoding.getBytes(this.bufferText, 0, this.bufferText.length);\n this.bufferText = '';\n this.bufferBlob = new Blob([this.bufferBlob, bufferArray]);\n };\n /**\n * Writes the specified string followed by a line terminator\n * @param {string} value - The string to write. If value is null or undefined, nothing is written\n * @returns {void}\n */\n StreamWriter.prototype.writeLine = function (value) {\n if (this.encoding === undefined) {\n throw new Error('Object Disposed Exception: current writer is disposed');\n }\n validateNullOrUndefined(value, 'string');\n this.bufferText = this.bufferText + value + '\\r\\n';\n if (this.bufferText.length >= 10240) {\n this.flush();\n }\n };\n /**\n * Releases the resources used by the StreamWriter\n * @returns {void}\n */\n StreamWriter.prototype.destroy = function () {\n this.bufferBlob = undefined;\n this.bufferText = undefined;\n if (this.enc instanceof Encoding) {\n this.enc.destroy();\n }\n this.enc = undefined;\n };\n return StreamWriter;\n}());\nexport { StreamWriter };\n","import { StreamWriter } from '@syncfusion/ej2-file-utils';\nimport { Encoding } from '@syncfusion/ej2-file-utils';\nimport { PdfDocument } from './pdf-document';\n/**\n * `PdfDocumentBase` class represent common properties of PdfDocument classes.\n * @private\n */\nvar PdfDocumentBase = /** @class */ (function () {\n function PdfDocumentBase(document) {\n /**\n * If the stream is copied, then it specifies true.\n * @private\n */\n this.isStreamCopied = false;\n if (document instanceof PdfDocument) {\n this.document = document;\n }\n }\n Object.defineProperty(PdfDocumentBase.prototype, \"pdfObjects\", {\n //Prpperties\n /**\n * Gets the `PDF objects` collection, which stores all objects and references to it..\n * @private\n */\n get: function () {\n return this.objects;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentBase.prototype, \"crossTable\", {\n /**\n * Gets the `cross-reference` table.\n * @private\n */\n get: function () {\n return this.pdfCrossTable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentBase.prototype, \"currentSavingObj\", {\n /**\n * Gets or sets the current saving `object number`.\n * @private\n */\n get: function () {\n return this.currentSavingObject;\n },\n set: function (value) {\n this.currentSavingObject = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentBase.prototype, \"catalog\", {\n /**\n * Gets the PDF document `catalog`.\n * @private\n */\n get: function () {\n return this.pdfCatalog;\n },\n set: function (value) {\n this.pdfCatalog = value;\n },\n enumerable: true,\n configurable: true\n });\n //Public methods\n /**\n * Sets the `main object collection`.\n * @private\n */\n PdfDocumentBase.prototype.setMainObjectCollection = function (mainObjectCollection) {\n this.objects = mainObjectCollection;\n };\n /**\n * Sets the `cross table`.\n * @private\n */\n PdfDocumentBase.prototype.setCrossTable = function (cTable) {\n this.pdfCrossTable = cTable;\n };\n /**\n * Sets the `catalog`.\n * @private\n */\n PdfDocumentBase.prototype.setCatalog = function (catalog) {\n this.pdfCatalog = catalog;\n };\n PdfDocumentBase.prototype.save = function (filename) {\n var _this = this;\n var encoding = new Encoding(true);\n var SW = new StreamWriter(encoding);\n if (typeof filename === 'undefined') {\n var encoding_1 = new Encoding(true);\n var SW_1 = new StreamWriter(encoding_1);\n return new Promise(function (resolve, reject) {\n /* tslint:disable-next-line:no-any */\n var obj = {};\n obj.blobData = new Blob([_this.document.docSave(SW_1, true)], { type: 'application/pdf' });\n resolve(obj);\n });\n }\n else {\n this.document.docSave(SW, filename, true);\n }\n };\n /**\n * `Clone` of parent object - PdfDocument.\n * @private\n */\n PdfDocumentBase.prototype.clone = function () {\n return this.document;\n };\n return PdfDocumentBase;\n}());\nexport { PdfDocumentBase };\n","/**\n * `PdfName` class is used to perform name (element names) related primitive operations.\n * @private\n */\nvar PdfName = /** @class */ (function () {\n function PdfName(value) {\n /**\n * `Start symbol` of the name object.\n * @default /\n * @private\n */\n this.stringStartMark = '/';\n /**\n * `Value` of the element.\n * @private\n */\n this.internalValue = '';\n /**\n * Indicates if the object is currently in `saving state or not`.\n * @default false\n * @private\n */\n this.isSaving6 = false;\n /**\n * Internal variable to store the `position`.\n * @default -1\n * @private\n */\n this.position6 = -1;\n this.internalValue = this.normalizeValue(value);\n }\n Object.defineProperty(PdfName.prototype, \"status\", {\n //property\n /**\n * Gets or sets the `Status` of the specified object.\n * @private\n */\n get: function () {\n return this.status6;\n },\n set: function (value) {\n this.status6 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfName.prototype, \"isSaving\", {\n /**\n * Gets or sets a value indicating whether this document `is saving` or not.\n * @private\n */\n get: function () {\n return this.isSaving6;\n },\n set: function (value) {\n this.isSaving6 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfName.prototype, \"objectCollectionIndex\", {\n /**\n * Gets or sets the `index` value of the specified object.\n * @private\n */\n get: function () {\n return this.index6;\n },\n set: function (value) {\n this.index6 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfName.prototype, \"position\", {\n /**\n * Gets or sets the `position` of the object.\n * @private\n */\n get: function () {\n return this.position6;\n },\n set: function (value) {\n this.position6 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfName.prototype, \"clonedObject\", {\n /**\n * Returns `cloned object`.\n * @private\n */\n get: function () {\n return null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfName.prototype, \"value\", {\n /**\n * Gets or sets the `value` of the object.\n * @private\n */\n get: function () {\n return this.internalValue;\n },\n set: function (value) {\n // if (value !== this.value) {\n var val = value;\n if (value !== null && value.length > 0) {\n // val = (value.substring(0, 1) === this.stringStartMark) ? value.substring(1) : value;\n val = value;\n this.internalValue = this.normalizeValue(val);\n }\n else {\n this.internalValue = val;\n }\n // }\n },\n enumerable: true,\n configurable: true\n });\n //public methods\n /**\n * `Saves` the name using the specified writer.\n * @private\n */\n PdfName.prototype.save = function (writer) {\n // if (writer === null) {\n // throw new Error('ArgumentNullException : writer');\n // }\n writer.write(this.toString());\n };\n /**\n * Gets `string` representation of the primitive.\n * @private\n */\n PdfName.prototype.toString = function () {\n return (this.stringStartMark + this.escapeString(this.value));\n };\n /**\n * Creates a `copy of PdfName`.\n * @private\n */\n PdfName.prototype.clone = function (crossTable) {\n var newName = new PdfName();\n newName.value = this.internalValue;\n return newName;\n };\n /**\n * Replace some characters with its `escape sequences`.\n * @private\n */\n PdfName.prototype.escapeString = function (stringValue) {\n // if (str === null) {\n // throw new Error('ArgumentNullException : str');\n // }\n // if (str === '') {\n // return str;\n // }\n var result = '';\n var len = 0;\n for (var i = 0, len_1 = stringValue.length; i < len_1; i++) {\n var ch = stringValue[i];\n var index = PdfName.delimiters.indexOf(ch);\n // switch (ch) {\n // case '\\r' :\n // result = result + '\\\\r';\n // break;\n // case '\\n' :\n // result = result + '\\n';\n // break;\n // case '(' :\n // case ')' :\n // case '\\\\' :\n // //result.Append( '\\\\' ).Append( ch );\n // result = result + ch;\n // break;\n // default :\n // result = result + ch;\n // break;\n // }\n result = result + ch;\n }\n return result;\n };\n //methiods\n /**\n * Replace a symbol with its code with the precedence of the `sharp sign`.\n * @private\n */\n PdfName.prototype.normalizeValue = function (value, c) {\n // if (typeof c === undefined) {\n // let str : string = value;\n // for (let i : number = 0; i < PdfName.replacements.length; i++) {\n // str = this.normalizeValue(str, c);\n // }\n // return str;\n // } else {\n var strFormat = '#{0:X}';\n //return value.replace(c.toString(),String.format(strFormat,c));\n return value;\n // }\n };\n /**\n * PDF `special characters`.\n * @private\n */\n PdfName.delimiters = '()<>[]{}/%}';\n /**\n * The symbols that are not allowed in PDF names and `should be replaced`.\n * @private\n */\n PdfName.replacements = [' ', '\\t', '\\n', '\\r'];\n return PdfName;\n}());\nexport { PdfName };\n","/**\n * PdfOperators.ts class for EJ2-PDF\n * Class of string PDF common operators.\n * @private\n */\nvar Operators = /** @class */ (function () {\n /**\n * Create an instance of `PdfOperator` class.\n * @private\n */\n function Operators() {\n /**\n * Specifies the value of `test`.\n * @private\n */\n this.forTest = 'test';\n this.forTest = Operators.obj;\n }\n /**\n * Specifies the value of `obj`.\n * @private\n */\n Operators.obj = 'obj';\n /**\n * Specifies the value of `endObj`.\n * @private\n */\n Operators.endObj = 'endobj';\n /**\n * Specifies the value of `R`.\n * @private\n */\n Operators.r = 'R';\n /**\n * Specifies the value of ` `.\n * @private\n */\n Operators.whiteSpace = ' ';\n /**\n * Specifies the value of `/`.\n * @private\n */\n Operators.slash = '/';\n /**\n * Specifies the value of `\\r\\n`.\n * @private\n */\n Operators.newLine = '\\r\\n';\n /**\n * Specifies the value of `stream`.\n * @private\n */\n Operators.stream = 'stream';\n /**\n * Specifies the value of `endStream`.\n * @private\n */\n Operators.endStream = 'endstream';\n /**\n * Specifies the value of `xref`.\n * @private\n */\n Operators.xref = 'xref';\n /**\n * Specifies the value of `f`.\n * @private\n */\n Operators.f = 'f';\n /**\n * Specifies the value of `n`.\n * @private\n */\n Operators.n = 'n';\n /**\n * Specifies the value of `trailer`.\n * @private\n */\n Operators.trailer = 'trailer';\n /**\n * Specifies the value of `startxref`.\n * @private\n */\n Operators.startxref = 'startxref';\n /**\n * Specifies the value of `eof`.\n * @private\n */\n Operators.eof = '%%EOF';\n /**\n * Specifies the value of `header`.\n * @private\n */\n Operators.header = '%PDF-1.5';\n /**\n * Specifies the value of `beginText`.\n * @private\n */\n Operators.beginText = 'BT';\n /**\n * Specifies the value of `endText`.\n * @private\n */\n Operators.endText = 'ET';\n /**\n * Specifies the value of `m`.\n * @private\n */\n Operators.beginPath = 'm';\n /**\n * Specifies the value of `l`.\n * @private\n */\n Operators.appendLineSegment = 'l';\n /**\n * Specifies the value of `S`.\n * @private\n */\n Operators.stroke = 'S';\n /**\n * Specifies the value of `f`.\n * @private\n */\n Operators.fill = 'f';\n /**\n * Specifies the value of `f*`.\n * @private\n */\n Operators.fillEvenOdd = 'f*';\n /**\n * Specifies the value of `B`.\n * @private\n */\n Operators.fillStroke = 'B';\n /**\n * Specifies the value of `B*`.\n * @private\n */\n Operators.fillStrokeEvenOdd = 'B*';\n /**\n * Specifies the value of `c`.\n * @private\n */\n Operators.appendbeziercurve = 'c';\n /**\n * Specifies the value of `re`.\n * @private\n */\n Operators.appendRectangle = 're';\n /**\n * Specifies the value of `q`.\n * @private\n */\n Operators.saveState = 'q';\n /**\n * Specifies the value of `Q`.\n * @private\n */\n Operators.restoreState = 'Q';\n /**\n * Specifies the value of `Do`.\n * @private\n */\n Operators.paintXObject = 'Do';\n /**\n * Specifies the value of `cm`.\n * @private\n */\n Operators.modifyCtm = 'cm';\n /**\n * Specifies the value of `Tm`.\n * @private\n */\n Operators.modifyTM = 'Tm';\n /**\n * Specifies the value of `w`.\n * @private\n */\n Operators.setLineWidth = 'w';\n /**\n * Specifies the value of `J`.\n * @private\n */\n Operators.setLineCapStyle = 'J';\n /**\n * Specifies the value of `j`.\n * @private\n */\n Operators.setLineJoinStyle = 'j';\n /**\n * Specifies the value of `d`.\n * @private\n */\n Operators.setDashPattern = 'd';\n /**\n * Specifies the value of `i`.\n * @private\n */\n Operators.setFlatnessTolerance = 'i';\n /**\n * Specifies the value of `h`.\n * @private\n */\n Operators.closePath = 'h';\n /**\n * Specifies the value of `s`.\n * @private\n */\n Operators.closeStrokePath = 's';\n /**\n * Specifies the value of `b`.\n * @private\n */\n Operators.closeFillStrokePath = 'b';\n /**\n * Specifies the value of `setCharacterSpace`.\n * @private\n */\n Operators.setCharacterSpace = 'Tc';\n /**\n * Specifies the value of `setWordSpace`.\n * @private\n */\n Operators.setWordSpace = 'Tw';\n /**\n * Specifies the value of `setHorizontalScaling`.\n * @private\n */\n Operators.setHorizontalScaling = 'Tz';\n /**\n * Specifies the value of `setTextLeading`.\n * @private\n */\n Operators.setTextLeading = 'TL';\n /**\n * Specifies the value of `setFont`.\n * @private\n */\n Operators.setFont = 'Tf';\n /**\n * Specifies the value of `setRenderingMode`.\n * @private\n */\n Operators.setRenderingMode = 'Tr';\n /**\n * Specifies the value of `setTextRise`.\n * @private\n */\n Operators.setTextRise = 'Ts';\n /**\n * Specifies the value of `setTextScaling`.\n * @private\n */\n Operators.setTextScaling = 'Tz';\n /**\n * Specifies the value of `setCoords`.\n * @private\n */\n Operators.setCoords = 'Td';\n /**\n * Specifies the value of `goToNextLine`.\n * @private\n */\n Operators.goToNextLine = 'T*';\n /**\n * Specifies the value of `setText`.\n * @private\n */\n Operators.setText = 'Tj';\n /**\n * Specifies the value of `setTextWithFormatting`.\n * @private\n */\n Operators.setTextWithFormatting = 'TJ';\n /**\n * Specifies the value of `setTextOnNewLine`.\n * @private\n */\n Operators.setTextOnNewLine = '\\'';\n /**\n * Specifies the value of `selectcolorspaceforstroking`.\n * @private\n */\n Operators.selectcolorspaceforstroking = 'CS';\n /**\n * Specifies the value of `selectcolorspacefornonstroking`.\n * @private\n */\n Operators.selectcolorspacefornonstroking = 'cs';\n /**\n * Specifies the value of `setrbgcolorforstroking`.\n * @private\n */\n Operators.setrbgcolorforstroking = 'RG';\n /**\n * Specifies the value of `setrbgcolorfornonstroking`.\n * @private\n */\n Operators.setrbgcolorfornonstroking = 'rg';\n /**\n * Specifies the value of `K`.\n * @private\n */\n Operators.setcmykcolorforstroking = 'K';\n /**\n * Specifies the value of `k`.\n * @private\n */\n Operators.setcmykcolorfornonstroking = 'k';\n /**\n * Specifies the value of `G`.\n * @private\n */\n Operators.setgraycolorforstroking = 'G';\n /**\n * Specifies the value of `g`.\n * @private\n */\n Operators.setgraycolorfornonstroking = 'g';\n /**\n * Specifies the value of `W`.\n * @private\n */\n Operators.clipPath = 'W';\n /**\n * Specifies the value of `clipPathEvenOdd`.\n * @private\n */\n Operators.clipPathEvenOdd = 'W*';\n /**\n * Specifies the value of `n`.\n * @private\n */\n Operators.endPath = 'n';\n /**\n * Specifies the value of `setGraphicsState`.\n * @private\n */\n Operators.setGraphicsState = 'gs';\n /**\n * Specifies the value of `%`.\n * @private\n */\n Operators.comment = '%';\n /**\n * Specifies the value of `*`.\n * @private\n */\n Operators.evenOdd = '*';\n /**\n * Specifies the value of `M`.\n * @private\n */\n Operators.setMiterLimit = 'M';\n /**\n * Same as SC, but also supports Pattern, Separation, DeviceN, and ICCBased color spaces. For non-stroking operations.\n * @public\n */\n Operators.setColorAndPattern = 'scn';\n /**\n * Same as SC, but also supports Pattern, Separation, DeviceN, and ICCBased color spaces. For stroking.\n */\n Operators.setColorAndPatternStroking = 'SCN';\n return Operators;\n}());\nexport { Operators };\n","/**\n * dictionaryProperties.ts class for EJ2-PDF\n * PDF dictionary properties.\n * @private\n */\nvar DictionaryProperties = /** @class */ (function () {\n /**\n * Initialize an instance for `PdfDictionaryProperties` class.\n * @private\n */\n function DictionaryProperties() {\n /**\n * Specifies the value of `Pages`.\n * @private\n */\n this.pages = 'Pages';\n /**\n * Specifies the value of `Kids`.\n * @private\n */\n this.kids = 'Kids';\n /**\n * Specifies the value of `Count`.\n * @private\n */\n this.count = 'Count';\n /**\n * Specifies the value of `Resources`.\n * @private\n */\n this.resources = 'Resources';\n /**\n * Specifies the value of `Type`.\n * @private\n */\n this.type = 'Type';\n /**\n * Specifies the value of `Size`.\n * @private\n */\n this.size = 'Size';\n /**\n * Specifies the value of `MediaBox`.\n * @private\n */\n this.mediaBox = 'MediaBox';\n /**\n * Specifies the value of `Parent`.\n * @private\n */\n this.parent = 'Parent';\n /**\n * Specifies the value of `Root`.\n * @private\n */\n this.root = 'Root';\n /**\n * Specifies the value of `DecodeParms`.\n * @private\n */\n this.decodeParms = 'DecodeParms';\n /**\n * Specifies the value of `Filter`.\n * @private\n */\n this.filter = 'Filter';\n /**\n * Specifies the value of `Font`.\n * @private\n */\n this.font = 'Font';\n /**\n * Specifies the value of `Type1`.\n * @private\n */\n this.type1 = 'Type1';\n /**\n * Specifies the value of `BaseFont`.\n * @private\n */\n this.baseFont = 'BaseFont';\n /**\n * Specifies the value of `Encoding`.\n * @private\n */\n this.encoding = 'Encoding';\n /**\n * Specifies the value of `Subtype`.\n * @private\n */\n this.subtype = 'Subtype';\n /**\n * Specifies the value of `Contents`.\n * @private\n */\n this.contents = 'Contents';\n /**\n * Specifies the value of `ProcSet`.\n * @private\n */\n this.procset = 'ProcSet';\n /**\n * Specifies the value of `ColorSpace`.\n * @private\n */\n this.colorSpace = 'ColorSpace';\n /**\n * Specifies the value of `ExtGState`.\n * @private\n */\n this.extGState = 'ExtGState';\n /**\n * Specifies the value of `Pattern`.\n * @private\n */\n this.pattern = 'Pattern';\n /**\n * Specifies the value of `XObject`.\n * @private\n */\n this.xObject = 'XObject';\n /**\n * Specifies the value of `Length`.\n * @private\n */\n this.length = 'Length';\n /**\n * Specifies the value of `Width`.\n * @private\n */\n this.width = 'Width';\n /**\n * Specifies the value of `Height`.\n * @private\n */\n this.height = 'Height';\n /**\n * Specifies the value of `BitsPerComponent`.\n * @private\n */\n this.bitsPerComponent = 'BitsPerComponent';\n /**\n * Specifies the value of `Image`.\n * @private\n */\n this.image = 'Image';\n /**\n * Specifies the value of `dctdecode`.\n * @private\n */\n this.dctdecode = 'DCTDecode';\n /**\n * Specifies the value of `Columns`.\n * @private\n */\n this.columns = 'Columns';\n /**\n * Specifies the value of `BlackIs1`.\n * @private\n */\n this.blackIs1 = 'BlackIs1';\n /**\n * Specifies the value of `K`.\n * @private\n */\n this.k = 'K';\n /**\n * Specifies the value of `S`.\n * @private\n */\n this.s = 'S';\n /**\n * Specifies the value of `Predictor`.\n * @private\n */\n this.predictor = 'Predictor';\n /**\n * Specifies the value of `DeviceRGB`.\n * @private\n */\n this.deviceRgb = 'DeviceRGB';\n /**\n * Specifies the value of `Next`.\n * @private\n */\n this.next = 'Next';\n /**\n * Specifies the value of `Action`.\n * @private\n */\n this.action = 'Action';\n /**\n * Specifies the value of `Link`.\n * @private\n */\n this.link = 'Link';\n /**\n *\n * Specifies the value of `A`.\n * @private\n */\n this.a = 'A';\n /**\n * Specifies the value of `Annot`.\n * @private\n */\n this.annot = 'Annot';\n /**\n * Specifies the value of `P`.\n * @private\n */\n this.p = 'P';\n /**\n * Specifies the value of `C`.\n * @private\n */\n this.c = 'C';\n /**\n * Specifies the value of `Rect`.\n * @private\n */\n this.rect = 'Rect';\n /**\n * Specifies the value of `URI`.\n * @private\n */\n this.uri = 'URI';\n /**\n * Specifies the value of `Annots`.\n * @private\n */\n this.annots = 'Annots';\n /**\n * Specifies the value of `ca`.\n * @private\n */\n this.ca = 'ca';\n /**\n * Specifies the value of `CA`.\n * @private\n */\n this.CA = 'CA';\n /**\n * Specifies the value of `XYZ`.\n * @private\n */\n this.xyz = 'XYZ';\n /**\n * Specifies the value of `Fit`.\n * @private\n */\n this.fit = 'Fit';\n /**\n * Specifies the value of `Dest`.\n * @private\n */\n this.dest = 'Dest';\n /**\n * Specifies the value of `BM`.\n * @private\n */\n this.BM = 'BM';\n /**\n * Specifies the value of `flatedecode`.\n * @private\n */\n this.flatedecode = 'FlateDecode';\n /**\n * Specifies the value of `Rotate`.\n * @private\n */\n this.rotate = 'Rotate';\n /**\n * Specifies the value of 'bBox'.\n * @private\n */\n this.bBox = 'BBox';\n /**\n * Specifies the value of 'form'.\n * @private\n */\n this.form = 'Form';\n /**\n * Specifies the value of 'w'.\n * @private\n */\n this.w = 'W';\n /**\n * Specifies the value of 'cIDFontType2'.\n * @private\n */\n this.cIDFontType2 = 'CIDFontType2';\n /**\n * Specifies the value of 'cIDToGIDMap'.\n * @private\n */\n this.cIDToGIDMap = 'CIDToGIDMap';\n /**\n * Specifies the value of 'identity'.\n * @private\n */\n this.identity = 'Identity';\n /**\n * Specifies the value of 'dw'.\n * @private\n */\n this.dw = 'DW';\n /**\n * Specifies the value of 'fontDescriptor'.\n * @private\n */\n this.fontDescriptor = 'FontDescriptor';\n /**\n * Specifies the value of 'cIDSystemInfo'.\n * @private\n */\n this.cIDSystemInfo = 'CIDSystemInfo';\n /**\n * Specifies the value of 'fontName'.\n * @private\n */\n this.fontName = 'FontName';\n /**\n * Specifies the value of 'flags'.\n * @private\n */\n this.flags = 'Flags';\n /**\n * Specifies the value of 'fontBBox'.\n * @private\n */\n this.fontBBox = 'FontBBox';\n /**\n * Specifies the value of 'missingWidth'.\n * @private\n */\n this.missingWidth = 'MissingWidth';\n /**\n * Specifies the value of 'stemV'.\n * @private\n */\n this.stemV = 'StemV';\n /**\n * Specifies the value of 'italicAngle'.\n * @private\n */\n this.italicAngle = 'ItalicAngle';\n /**\n * Specifies the value of 'capHeight'.\n * @private\n */\n this.capHeight = 'CapHeight';\n /**\n * Specifies the value of 'ascent'.\n * @private\n */\n this.ascent = 'Ascent';\n /**\n * Specifies the value of 'descent'.\n * @private\n */\n this.descent = 'Descent';\n /**\n * Specifies the value of 'leading'.\n * @private\n */\n this.leading = 'Leading';\n /**\n * Specifies the value of 'avgWidth'.\n * @private\n */\n this.avgWidth = 'AvgWidth';\n /**\n * Specifies the value of 'fontFile2'.\n * @private\n */\n this.fontFile2 = 'FontFile2';\n /**\n * Specifies the value of 'maxWidth'.\n * @private\n */\n this.maxWidth = 'MaxWidth';\n /**\n * Specifies the value of 'xHeight'.\n * @private\n */\n this.xHeight = 'XHeight';\n /**\n * Specifies the value of 'stemH'.\n * @private\n */\n this.stemH = 'StemH';\n /**\n * Specifies the value of 'registry'.\n * @private\n */\n this.registry = 'Registry';\n /**\n * Specifies the value of 'ordering'.\n * @private\n */\n this.ordering = 'Ordering';\n /**\n * Specifies the value of 'supplement'.\n * @private\n */\n this.supplement = 'Supplement';\n /**\n * Specifies the value of 'type0'.\n * @private\n */\n this.type0 = 'Type0';\n /**\n * Specifies the value of 'identityH'.\n * @private\n */\n this.identityH = 'Identity-H';\n /**\n * Specifies the value of 'toUnicode'.\n * @private\n */\n this.toUnicode = 'ToUnicode';\n /**\n * Specifies the value of 'descendantFonts'.\n * @private\n */\n this.descendantFonts = 'DescendantFonts';\n /**\n * Specifies the value of 'background'.\n * @private\n */\n this.background = 'Background';\n /**\n * Specifies the value of 'shading'.\n * @private\n */\n this.shading = 'Shading';\n /**\n * Specifies the value of 'matrix'.\n * @private\n */\n this.matrix = 'Matrix';\n /**\n * Specifies the value of 'antiAlias'.\n * @private\n */\n this.antiAlias = 'AntiAlias';\n /**\n * Specifies the value of 'function'.\n * @private\n */\n this.function = 'Function';\n /**\n * Specifies the value of 'extend'.\n * @private\n */\n this.extend = 'Extend';\n /**\n * Specifies the value of 'shadingType'.\n * @private\n */\n this.shadingType = 'ShadingType';\n /**\n * Specifies the value of 'coords'.\n * @private\n */\n this.coords = 'Coords';\n /**\n * Specifies the value of 'domain'.\n * @private\n */\n this.domain = 'Domain';\n /**\n * Specifies the value of 'range'.\n * @private\n */\n this.range = 'Range';\n /**\n * Specifies the value of 'functionType'.\n * @private\n */\n this.functionType = 'FunctionType';\n /**\n * Specifies the value of 'bitsPerSample'.\n * @private\n */\n this.bitsPerSample = 'BitsPerSample';\n /**\n * Specifies the value of 'patternType'.\n * @private\n */\n this.patternType = 'PatternType';\n /**\n * Specifies the value of 'paintType'.\n * @private\n */\n this.paintType = 'PaintType';\n /**\n * Specifies the value of 'tilingType'.\n * @private\n */\n this.tilingType = 'TilingType';\n /**\n * Specifies the value of 'xStep'.\n * @private\n */\n this.xStep = 'XStep';\n /**\n * Specifies the value of 'yStep'.\n * @private\n */\n this.yStep = 'YStep';\n //\n }\n return DictionaryProperties;\n}());\nexport { DictionaryProperties };\n","import { Dictionary } from './../collections/dictionary';\nimport { PdfName } from './pdf-name';\nimport { Operators } from './../input-output/pdf-operators';\nimport { DictionaryProperties } from './../input-output/pdf-dictionary-properties';\n/**\n * `PdfDictionary` class is used to perform primitive operations.\n * @private\n */\nvar PdfDictionary = /** @class */ (function () {\n function PdfDictionary(dictionary) {\n /**\n * Internal variable to store the `position`.\n * @default -1\n * @private\n */\n this.position7 = -1;\n /**\n * The `IPdfSavable` with the specified key.\n * @private\n */\n this.primitiveItems = new Dictionary();\n /**\n * `Start marker` for dictionary.\n * @private\n */\n this.prefix = '<<';\n /**\n * `End marker` for dictionary.\n * @private\n */\n this.suffix = '>>';\n /**\n * @hidden\n * @private\n */\n this.resources = [];\n /**\n * Internal variable to hold `cloned object`.\n * @default null\n * @private\n */\n this.object = null;\n /**\n * Flag for PDF file formar 1.5 is dictionary `archiving` needed.\n * @default true\n * @private\n */\n this.archive = true;\n /**\n * Represents the Font dictionary.\n * @hidden\n * @private\n */\n this.isFont = false;\n if (typeof dictionary === 'undefined') {\n this.primitiveItems = new Dictionary();\n this.encrypt = true;\n this.dictionaryProperties = new DictionaryProperties();\n }\n else {\n this.primitiveItems = new Dictionary();\n var keys = dictionary.items.keys();\n var values = dictionary.items.values();\n for (var index = 0; index < dictionary.items.size(); index++) {\n this.primitiveItems.setValue(keys[index], values[index]);\n }\n this.status = dictionary.status;\n this.freezeChanges(this);\n this.encrypt = true;\n this.dictionaryProperties = new DictionaryProperties();\n }\n }\n Object.defineProperty(PdfDictionary.prototype, \"items\", {\n //Properties\n /**\n * Gets or sets the `IPdfSavable` with the specified key.\n * @private\n */\n get: function () {\n return this.primitiveItems;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDictionary.prototype, \"status\", {\n /**\n * Gets or sets the `Status` of the specified object.\n * @private\n */\n get: function () {\n return this.status7;\n },\n set: function (value) {\n this.status7 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDictionary.prototype, \"isSaving\", {\n /**\n * Gets or sets a value indicating whether this document `is saving` or not.\n * @private\n */\n get: function () {\n return this.isSaving7;\n },\n set: function (value) {\n this.isSaving7 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDictionary.prototype, \"objectCollectionIndex\", {\n /**\n * Gets or sets the `index` value of the specified object.\n * @private\n */\n get: function () {\n return this.index7;\n },\n set: function (value) {\n this.index7 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDictionary.prototype, \"clonedObject\", {\n /**\n * Returns `cloned object`.\n * @private\n */\n get: function () {\n return this.object;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDictionary.prototype, \"position\", {\n /**\n * Gets or sets the `position` of the object.\n * @private\n */\n get: function () {\n return this.position7;\n },\n set: function (value) {\n this.position7 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDictionary.prototype, \"Count\", {\n /**\n * Gets the `count`.\n * @private\n */\n get: function () {\n return this.primitiveItems.size();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDictionary.prototype, \"Dictionary\", {\n /**\n * Collection of `items` in the object.\n * @private\n */\n get: function () {\n return this;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Get flag if need to `archive` dictionary.\n * @private\n */\n PdfDictionary.prototype.getArchive = function () {\n return this.archive;\n };\n /**\n * Set flag if need to `archive` dictionary.\n * @private\n */\n PdfDictionary.prototype.setArchive = function (value) {\n this.archive = value;\n };\n /**\n * Sets flag if `encryption` is needed.\n * @private\n */\n PdfDictionary.prototype.setEncrypt = function (value) {\n this.encrypt = value;\n this.modify();\n };\n /**\n * Gets flag if `encryption` is needed.\n * @private\n */\n PdfDictionary.prototype.getEncrypt = function () {\n return this.encrypt;\n };\n /**\n * `Freezes` the changes.\n * @private\n */\n PdfDictionary.prototype.freezeChanges = function (freezer) {\n this.bChanged = false;\n };\n /**\n * Creates a `copy of PdfDictionary`.\n * @private\n */\n PdfDictionary.prototype.clone = function (crossTable) {\n //Need to add more codings\n var newDict = new PdfDictionary();\n return newDict;\n };\n /**\n * `Mark` this instance modified.\n * @private\n */\n PdfDictionary.prototype.modify = function () {\n this.bChanged = true;\n };\n /**\n * `Removes` the specified key.\n * @private\n */\n PdfDictionary.prototype.remove = function (key) {\n if (typeof key !== 'string') {\n this.primitiveItems.remove(key.value);\n this.modify();\n }\n else {\n this.remove(new PdfName(key));\n }\n };\n /**\n * `Determines` whether the dictionary contains the key.\n * @private\n */\n PdfDictionary.prototype.containsKey = function (key) {\n var returnValue = false;\n returnValue = this.primitiveItems.containsKey(key.toString());\n return returnValue;\n };\n /**\n * Raises event `BeginSave`.\n * @private\n */\n PdfDictionary.prototype.onBeginSave = function () {\n this.beginSave.sender.beginSave();\n };\n /**\n * Raises event `Font Dictionary BeginSave`.\n * @private\n */\n PdfDictionary.prototype.onFontDictionaryBeginSave = function () {\n this.fontDictionaryBeginSave.sender.fontDictionaryBeginSave();\n };\n /**\n * Raises event `Descendant Font BeginSave`.\n * @private\n */\n PdfDictionary.prototype.onDescendantFontBeginSave = function () {\n this.descendantFontBeginSave.sender.descendantFontBeginSave();\n };\n /**\n * Raises event 'BeginSave'.\n * @private\n */\n PdfDictionary.prototype.onTemplateBeginSave = function () {\n this.pageBeginDrawTemplate.sender.pageBeginSave();\n };\n /**\n * Raises event `BeginSave`.\n * @private\n */\n PdfDictionary.prototype.onBeginAnnotationSave = function () {\n this.annotationBeginSave.sender.beginSave();\n };\n /**\n * Raises event `BeginSave`.\n * @private\n */\n PdfDictionary.prototype.onSectionBeginSave = function (writer) {\n var saveEvent = this.sectionBeginSave;\n saveEvent.sender.beginSave(saveEvent.state, writer);\n };\n PdfDictionary.prototype.save = function (writer, bRaiseEvent) {\n if (typeof bRaiseEvent === 'undefined') {\n this.save(writer, true);\n }\n else {\n writer.write(this.prefix);\n if (typeof this.beginSave !== 'undefined') {\n this.onBeginSave();\n }\n if (typeof this.descendantFontBeginSave !== 'undefined') {\n this.onDescendantFontBeginSave();\n }\n if (typeof this.fontDictionaryBeginSave !== 'undefined') {\n this.onFontDictionaryBeginSave();\n }\n if (typeof this.annotationBeginSave !== 'undefined') {\n this.onBeginAnnotationSave();\n }\n if (typeof this.sectionBeginSave !== 'undefined') {\n this.onSectionBeginSave(writer);\n }\n if (typeof this.pageBeginDrawTemplate !== 'undefined') {\n this.onTemplateBeginSave();\n }\n // }\n if (this.Count > 0) {\n this.saveItems(writer);\n }\n writer.write(this.suffix);\n writer.write(Operators.newLine);\n }\n };\n /**\n * `Save dictionary items`.\n * @private\n */\n PdfDictionary.prototype.saveItems = function (writer) {\n writer.write(Operators.newLine);\n var keys = this.primitiveItems.keys();\n var values = this.primitiveItems.values();\n for (var index = 0; index < keys.length; index++) {\n var key = keys[index];\n var name_1 = new PdfName(key);\n name_1.save(writer);\n writer.write(Operators.whiteSpace);\n var resources = values[index];\n resources.save(writer);\n writer.write(Operators.newLine);\n }\n };\n return PdfDictionary;\n}());\nexport { PdfDictionary };\nvar SaveSectionCollectionEventHandler = /** @class */ (function () {\n /**\n * New instance for `save section collection event handler` class.\n * @private\n */\n function SaveSectionCollectionEventHandler(sender) {\n this.sender = sender;\n }\n return SaveSectionCollectionEventHandler;\n}());\nexport { SaveSectionCollectionEventHandler };\nvar SaveDescendantFontEventHandler = /** @class */ (function () {\n /**\n * New instance for `save section collection event handler` class.\n * @private\n */\n function SaveDescendantFontEventHandler(sender) {\n this.sender = sender;\n }\n return SaveDescendantFontEventHandler;\n}());\nexport { SaveDescendantFontEventHandler };\nvar SaveFontDictionaryEventHandler = /** @class */ (function () {\n /**\n * New instance for `save section collection event handler` class.\n * @private\n */\n function SaveFontDictionaryEventHandler(sender) {\n this.sender = sender;\n }\n return SaveFontDictionaryEventHandler;\n}());\nexport { SaveFontDictionaryEventHandler };\nvar SaveAnnotationEventHandler = /** @class */ (function () {\n /**\n * New instance for `save annotation event handler` class.\n * @private\n */\n function SaveAnnotationEventHandler(sender) {\n this.sender = sender;\n }\n return SaveAnnotationEventHandler;\n}());\nexport { SaveAnnotationEventHandler };\nvar SaveSectionEventHandler = /** @class */ (function () {\n // constructors\n /**\n * New instance for `save section event handler` class.\n * @private\n */\n function SaveSectionEventHandler(sender, state) {\n this.sender = sender;\n this.state = state;\n }\n return SaveSectionEventHandler;\n}());\nexport { SaveSectionEventHandler };\n/**\n * SaveTemplateEventHandler class used to store information about template elements.\n * @private\n * @hidden\n */\nvar SaveTemplateEventHandler = /** @class */ (function () {\n /**\n * New instance for save section collection event handler class.\n * @public\n */\n function SaveTemplateEventHandler(sender) {\n this.sender = sender;\n }\n return SaveTemplateEventHandler;\n}());\nexport { SaveTemplateEventHandler };\n","/**\n * `PdfNumber` class is used to perform number related primitive operations.\n * @private\n */\nvar PdfNumber = /** @class */ (function () {\n /**\n * Initializes a new instance of the `PdfNumber` class.\n * @private\n */\n function PdfNumber(value) {\n /**\n * Sotres the `position`.\n * @default -1\n * @private\n */\n this.position5 = -1;\n this.value = value;\n }\n Object.defineProperty(PdfNumber.prototype, \"intValue\", {\n /**\n * Gets or sets the `integer` value.\n * @private\n */\n get: function () {\n return this.value;\n },\n set: function (value) {\n this.value = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfNumber.prototype, \"isInteger\", {\n /**\n * Gets or sets a value indicating whether this instance `is integer`.\n * @private\n */\n get: function () {\n return this.integer;\n },\n set: function (value) {\n this.integer = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfNumber.prototype, \"status\", {\n /**\n * Gets or sets the `Status` of the specified object.\n * @private\n */\n get: function () {\n return this.status5;\n },\n set: function (value) {\n this.status5 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfNumber.prototype, \"isSaving\", {\n /**\n * Gets or sets a value indicating whether this document `is saving` or not.\n * @private\n */\n get: function () {\n return this.isSaving5;\n },\n set: function (value) {\n this.isSaving5 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfNumber.prototype, \"objectCollectionIndex\", {\n /**\n * Gets or sets the `index` value of the specified object.\n * @private\n */\n get: function () {\n return this.index5;\n },\n set: function (value) {\n this.index5 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfNumber.prototype, \"position\", {\n /**\n * Gets or sets the `position` of the object.\n * @private\n */\n get: function () {\n return this.position5;\n },\n set: function (value) {\n this.position5 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfNumber.prototype, \"clonedObject\", {\n /**\n * Returns `cloned object`.\n * @private\n */\n get: function () {\n var rValue = null;\n return rValue;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * `Saves the object`.\n * @private\n */\n PdfNumber.prototype.save = function (writer) {\n writer.write(this.intValue.toString()); //tostring(CultureInfo.InletiantCulture)\n };\n /**\n * Creates a `copy of PdfNumber`.\n * @private\n */\n PdfNumber.prototype.clone = function (crossTable) {\n var newNumber = new PdfNumber(this.value);\n return newNumber;\n };\n /**\n * Converts a `float value to a string` using Adobe PDF rules.\n * @private\n */\n PdfNumber.floatToString = function (number) {\n // let tempString1 : string = number.toString();\n // let tempString2 : string = tempString1.indexOf('.') != -1 ? tempString1.substring(0, tempString1.indexOf('.')) : tempString1;\n var returnString = number.toFixed(2);\n if (returnString === '0.00') {\n returnString = '.00';\n }\n // let prefixLength : number = (22 - tempString2.length) >= 0 ? (22 - tempString2.length) : 0;\n // for (let index : number = 0; index < prefixLength; index++) {\n // returnString += '0';\n // }\n // returnString += tempString2 + '.00';\n // returnString += (tempString3.length > 6) ? tempString3.substring(0,6) : tempString3;\n // let suffixLength : number = (6 - tempString3.length) >= 0 ? (6 - tempString3.length) : 0;\n // for (let index : number = 0; index < suffixLength; index++) {\n // returnString += '0';\n // }\n return returnString;\n };\n /**\n * Determines the `minimum of the three values`.\n * @private\n */\n PdfNumber.min = function (x, y, z) {\n var r = Math.min(x, y);\n return Math.min(z, r);\n };\n return PdfNumber;\n}());\nexport { PdfNumber };\n","import { PdfNumber } from './pdf-number';\nimport { Operators } from './../input-output/pdf-operators';\n/**\n * `PdfArray` class is used to perform array related primitive operations.\n * @private\n */\nvar PdfArray = /** @class */ (function () {\n function PdfArray(array) {\n //Fields\n /**\n * `startMark` - '['\n * @private\n */\n this.startMark = '[';\n /**\n * `endMark` - ']'.\n * @private\n */\n this.endMark = ']';\n /**\n * Internal variable to store the `position`.\n * @default -1\n * @private\n */\n this.position9 = -1;\n /**\n * Internal variable to hold `cloned object`.\n * @default null\n * @private\n */\n this.clonedObject9 = null;\n /**\n * Represents the Font dictionary.\n * @hidden\n * @private\n */\n this.isFont = false;\n if (typeof array === 'undefined') {\n this.internalElements = [];\n }\n else {\n if (typeof array !== 'undefined' && !(array instanceof PdfArray)) {\n var tempNumberArray = array;\n for (var index = 0; index < tempNumberArray.length; index++) {\n var pdfNumber = new PdfNumber(tempNumberArray[index]);\n this.add(pdfNumber);\n }\n // } else if (typeof array !== 'undefined' && (array instanceof PdfArray)) {\n }\n else {\n var tempArray = array;\n // if (tempArray.Elements.length > 0) {\n this.internalElements = [];\n for (var index = 0; index < tempArray.elements.length; index++) {\n this.internalElements.push(tempArray.elements[index]);\n }\n // }\n }\n }\n }\n //property\n /**\n * Gets the `IPdfSavable` at the specified index.\n * @private\n */\n PdfArray.prototype.items = function (index) {\n // if (index < 0 || index >= this.Count) {\n // throw new Error('ArgumentOutOfRangeException : index, The index can\"t be less then zero or greater then Count.');\n // }\n return this.internalElements[index];\n };\n Object.defineProperty(PdfArray.prototype, \"count\", {\n /**\n * Gets the `count`.\n * @private\n */\n get: function () {\n return this.internalElements.length;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfArray.prototype, \"status\", {\n /**\n * Gets or sets the `Status` of the specified object.\n * @private\n */\n get: function () {\n return this.status9;\n },\n set: function (value) {\n this.status9 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfArray.prototype, \"isSaving\", {\n /**\n * Gets or sets a value indicating whether this document `is saving` or not.\n * @private\n */\n get: function () {\n return this.isSaving9;\n },\n set: function (value) {\n this.isSaving9 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfArray.prototype, \"clonedObject\", {\n /**\n * Returns `cloned object`.\n * @private\n */\n get: function () {\n return this.clonedObject9;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfArray.prototype, \"position\", {\n /**\n * Gets or sets the `position` of the object.\n * @private\n */\n get: function () {\n return this.position9;\n },\n set: function (value) {\n this.position9 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfArray.prototype, \"objectCollectionIndex\", {\n /**\n * Gets or sets the `index` value of the specified object.\n * @private\n */\n get: function () {\n return this.index9;\n },\n set: function (value) {\n this.index9 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfArray.prototype, \"CrossTable\", {\n /**\n * Returns `PdfCrossTable` associated with the object.\n * @private\n */\n get: function () {\n return this.pdfCrossTable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfArray.prototype, \"elements\", {\n /**\n * Gets the `elements` of the Pdf Array.\n * @private\n */\n get: function () {\n return this.internalElements;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * `Adds` the specified element to the PDF array.\n * @private\n */\n PdfArray.prototype.add = function (element) {\n // if (element === null) {\n // throw new Error('ArgumentNullException : obj');\n // }\n if (typeof this.internalElements === 'undefined') {\n this.internalElements = [];\n }\n this.internalElements.push(element);\n this.markedChange();\n };\n /**\n * `Marks` the object changed.\n * @private\n */\n PdfArray.prototype.markedChange = function () {\n this.bChanged = true;\n };\n /**\n * `Determines` whether the specified element is within the array.\n * @private\n */\n PdfArray.prototype.contains = function (element) {\n var returnValue = false;\n for (var index = 0; index < this.internalElements.length; index++) {\n var tempElement = this.internalElements[index];\n var inputElement = element;\n if (tempElement != null && typeof tempElement !== 'undefined' && inputElement != null && typeof inputElement !== 'undefined') {\n if (tempElement.value === inputElement.value) {\n return true;\n }\n }\n // if (this.internalElements[index] === element) {\n // returnValue = true;\n // }\n }\n return returnValue;\n };\n /**\n * Returns the `primitive object` of input index.\n * @private\n */\n PdfArray.prototype.getItems = function (index) {\n // if (index < 0 || index >= this.Count) {\n // throw new Error('ArgumentOutOfRangeException : index , The index can\"t be less then zero or greater then Count.');\n // }\n return this.internalElements[index];\n };\n /**\n * `Saves` the object using the specified writer.\n * @private\n */\n PdfArray.prototype.save = function (writer) {\n // if (writer === null) {\n // throw new Error('ArgumentNullException : writer');\n // }\n writer.write(this.startMark);\n for (var i = 0, len = this.count; i < len; i++) {\n this.getItems(i).save(writer);\n if (i + 1 !== len) {\n writer.write(Operators.whiteSpace);\n }\n }\n writer.write(this.endMark);\n };\n /**\n * Creates a `copy of PdfArray`.\n * @private\n */\n PdfArray.prototype.clone = function (crossTable) {\n // if (this.clonedObject9 !== null && this.clonedObject9.CrossTable === crossTable) {\n // return this.clonedObject9;\n // } else {\n this.clonedObject9 = null;\n // Else clone the object.\n var newArray = new PdfArray();\n for (var index = 0; index < this.internalElements.length; index++) {\n var obj = this.internalElements[index];\n newArray.add(obj.clone(crossTable));\n }\n newArray.pdfCrossTable = crossTable;\n this.clonedObject9 = newArray;\n return newArray;\n };\n /**\n * Creates filled PDF array `from the rectangle`.\n * @private\n */\n PdfArray.fromRectangle = function (bounds) {\n var values = [bounds.x, bounds.y, bounds.width, bounds.height];\n var array = new PdfArray(values);\n return array;\n };\n // /**\n // * Creates the rectangle from filled PDF array.\n // * @private\n // */\n // public ToRectangle() : RectangleF {\n // if (this.Count < 4) {\n // throw Error('InvalidOperationException-Can not convert to rectangle.');\n // }\n // let x1 : number;\n // let x2 : number;\n // let y1 : number;\n // let y2 : number;\n // let num : PdfNumber = this.getItems(0) as PdfNumber;\n // x1 = num.IntValue;\n // num = this.getItems(1) as PdfNumber;\n // y1 = num.IntValue;\n // num = this.getItems(2) as PdfNumber;\n // x2 = num.IntValue;\n // num = this.getItems(3) as PdfNumber;\n // y2 = num.IntValue;\n // let x : number = Math.min(x1, x2);\n // let y : number = Math.min(y1, y2);\n // let width : number = Math.abs(x1 - x2);\n // let height : number = Math.abs(y1 - y2);\n // let rect : RectangleF = new RectangleF(new PointF(x, y), new SizeF(width, height));\n // return rect;\n // }\n /**\n * `Inserts` the element into the array.\n * @private\n */\n PdfArray.prototype.insert = function (index, element) {\n if (index < this.internalElements.length && index > 0) {\n var tempElements = [];\n for (var i = 0; i < index; i++) {\n tempElements.push(this.internalElements[i]);\n }\n tempElements.push(element);\n for (var i = index; i < this.internalElements.length; i++) {\n tempElements.push(this.internalElements[i]);\n }\n this.internalElements = tempElements;\n }\n else {\n this.internalElements.push(element);\n }\n this.markChanged();\n };\n /**\n * `Checks whether array contains the element`.\n * @private\n */\n PdfArray.prototype.indexOf = function (element) {\n return this.internalElements.indexOf(element);\n };\n /**\n * `Removes` element from the array.\n * @private\n */\n PdfArray.prototype.remove = function (element) {\n // if (element === null) {\n // throw new Error('ArgumentNullException : element');\n // }\n var index = this.internalElements.indexOf(element);\n // if (index >= 0 && index < this.internalElements.length) {\n this.internalElements[index] = null;\n // }\n this.markChanged();\n };\n /**\n * `Remove` the element from the array by its index.\n * @private\n */\n PdfArray.prototype.removeAt = function (index) {\n // this.internalElements.RemoveAt(index);\n if (this.internalElements.length > index) {\n var tempArray = [];\n for (var i = 0; i < index; i++) {\n tempArray.push(this.internalElements[i]);\n }\n for (var i = index + 1; i < this.internalElements.length; i++) {\n tempArray.push(this.internalElements[i]);\n }\n this.internalElements = tempArray;\n }\n this.markChanged();\n };\n /**\n * `Clear` the array.\n * @private\n */\n PdfArray.prototype.clear = function () {\n this.internalElements = [];\n this.markChanged();\n };\n /**\n * `Marks` the object changed.\n * @private\n */\n PdfArray.prototype.markChanged = function () {\n this.bChanged = true;\n };\n return PdfArray;\n}());\nexport { PdfArray };\n","import { Encoding } from '@syncfusion/ej2-file-utils';\n/**\n * array literal codes\n */\nvar ARR_LITERAL_CODES = new Int16Array(286);\nvar ARR_LITERAL_LENGTHS = new Uint8Array(286);\nvar ARR_DISTANCE_CODES = new Int16Array(30);\nvar ARR_DISTANCE_LENGTHS = new Uint8Array(30);\n/**\n * represent compression stream writer\n * ```typescript\n * let compressedWriter = new CompressedStreamWriter();\n * let text: string = 'Hello world!!!';\n * compressedWriter.write(text, 0, text.length);\n * compressedWriter.close();\n * ```\n */\nvar CompressedStreamWriter = /** @class */ (function () {\n /**\n * Initializes compressor and writes ZLib header if needed.\n * @param {boolean} noWrap - optional if true, ZLib header and checksum will not be written.\n */\n function CompressedStreamWriter(noWrap) {\n this.pendingBuffer = new Uint8Array(1 << 16);\n this.pendingBufLength = 0;\n this.pendingBufCache = 0;\n this.pendingBufBitsInCache = 0;\n this.bufferPosition = 0;\n this.extraBits = 0;\n this.currentHash = 0;\n this.matchStart = 0;\n this.matchLength = 0;\n this.matchPrevAvail = false;\n this.blockStart = 0;\n this.stringStart = 0;\n this.lookAhead = 0;\n this.totalBytesIn = 0;\n this.inputOffset = 0;\n this.inputEnd = 0;\n this.windowSize = 1 << 15;\n this.windowMask = this.windowSize - 1;\n this.hashSize = 1 << 15;\n this.hashMask = this.hashSize - 1;\n this.hashShift = Math.floor((15 + 3 - 1) / 3);\n this.maxDist = this.windowSize - 262;\n this.checkSum = 1;\n this.noWrap = false;\n if (!CompressedStreamWriter.isHuffmanTreeInitiated) {\n CompressedStreamWriter.initHuffmanTree();\n CompressedStreamWriter.isHuffmanTreeInitiated = true;\n }\n this.treeLiteral = new CompressorHuffmanTree(this, 286, 257, 15);\n this.treeDistances = new CompressorHuffmanTree(this, 30, 1, 15);\n this.treeCodeLengths = new CompressorHuffmanTree(this, 19, 4, 7);\n this.arrDistances = new Uint16Array((1 << 14));\n this.arrLiterals = new Uint8Array((1 << 14));\n this.stream = [];\n this.dataWindow = new Uint8Array(2 * this.windowSize);\n this.hashHead = new Int16Array(this.hashSize);\n this.hashPrevious = new Int16Array(this.windowSize);\n this.blockStart = this.stringStart = 1;\n this.noWrap = noWrap;\n if (!noWrap) {\n this.writeZLibHeader();\n }\n }\n Object.defineProperty(CompressedStreamWriter.prototype, \"compressedData\", {\n /**\n * get compressed data\n */\n get: function () {\n return this.stream;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CompressedStreamWriter.prototype, \"getCompressedString\", {\n get: function () {\n var compressedString = '';\n if (this.stream !== undefined) {\n for (var i = 0; i < this.stream.length; i++) {\n compressedString += String.fromCharCode.apply(null, this.stream[i]);\n }\n }\n return compressedString;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Compresses data and writes it to the stream.\n * @param {Uint8Array} data - data to compress\n * @param {number} offset - offset in data\n * @param {number} length - length of the data\n * @returns {void}\n */\n CompressedStreamWriter.prototype.write = function (data, offset, length) {\n if (data === undefined || data === null) {\n throw new Error('ArgumentException: data cannot null or undefined');\n }\n var end = offset + length;\n if (0 > offset || offset > end || end > data.length) {\n throw new Error('ArgumentOutOfRangeException: Offset or length is incorrect');\n }\n if (typeof data === 'string') {\n var encode = new Encoding(false);\n encode.type = 'Utf8';\n data = new Uint8Array(encode.getBytes(data, 0, data.length));\n end = offset + data.length;\n }\n this.inputBuffer = data;\n this.inputOffset = offset;\n this.inputEnd = end;\n if (!this.noWrap) {\n this.checkSum = ChecksumCalculator.checksumUpdate(this.checkSum, this.inputBuffer, this.inputOffset, end);\n }\n while (!(this.inputEnd === this.inputOffset) || !(this.pendingBufLength === 0)) {\n this.pendingBufferFlush();\n this.compressData(false);\n }\n };\n /**\n * write ZLib header to the compressed data\n * @return {void}\n */\n CompressedStreamWriter.prototype.writeZLibHeader = function () {\n /* Initialize header.*/\n var headerDate = (8 + (7 << 4)) << 8;\n /* Save compression level.*/\n headerDate |= ((5 >> 2) & 3) << 6;\n /* Align header.*/\n headerDate += 31 - (headerDate % 31);\n /* Write header to stream.*/\n this.pendingBufferWriteShortBytes(headerDate);\n };\n /**\n * Write Most Significant Bytes in to stream\n * @param {number} s - check sum value\n */\n CompressedStreamWriter.prototype.pendingBufferWriteShortBytes = function (s) {\n this.pendingBuffer[this.pendingBufLength++] = s >> 8;\n this.pendingBuffer[this.pendingBufLength++] = s;\n };\n CompressedStreamWriter.prototype.compressData = function (finish) {\n var success;\n do {\n this.fillWindow();\n var canFlush = (finish && this.inputEnd === this.inputOffset);\n success = this.compressSlow(canFlush, finish);\n } while (this.pendingBufLength === 0 && success);\n return success;\n };\n CompressedStreamWriter.prototype.compressSlow = function (flush, finish) {\n if (this.lookAhead < 262 && !flush) {\n return false;\n }\n while (this.lookAhead >= 262 || flush) {\n if (this.lookAhead === 0) {\n return this.lookAheadCompleted(finish);\n }\n if (this.stringStart >= 2 * this.windowSize - 262) {\n this.slideWindow();\n }\n var prevMatch = this.matchStart;\n var prevLen = this.matchLength;\n if (this.lookAhead >= 3) {\n this.discardMatch();\n }\n if (prevLen >= 3 && this.matchLength <= prevLen) {\n prevLen = this.matchPreviousBest(prevMatch, prevLen);\n }\n else {\n this.matchPreviousAvailable();\n }\n if (this.bufferPosition >= (1 << 14)) {\n return this.huffmanIsFull(finish);\n }\n }\n return true;\n };\n CompressedStreamWriter.prototype.discardMatch = function () {\n var hashHead = this.insertString();\n if (hashHead !== 0 && this.stringStart - hashHead <= this.maxDist && this.findLongestMatch(hashHead)) {\n if (this.matchLength <= 5 && (this.matchLength === 3 && this.stringStart - this.matchStart > 4096)) {\n this.matchLength = 3 - 1;\n }\n }\n };\n CompressedStreamWriter.prototype.matchPreviousAvailable = function () {\n if (this.matchPrevAvail) {\n this.huffmanTallyLit(this.dataWindow[this.stringStart - 1] & 0xff);\n }\n this.matchPrevAvail = true;\n this.stringStart++;\n this.lookAhead--;\n };\n CompressedStreamWriter.prototype.matchPreviousBest = function (prevMatch, prevLen) {\n this.huffmanTallyDist(this.stringStart - 1 - prevMatch, prevLen);\n prevLen -= 2;\n do {\n this.stringStart++;\n this.lookAhead--;\n if (this.lookAhead >= 3) {\n this.insertString();\n }\n } while (--prevLen > 0);\n this.stringStart++;\n this.lookAhead--;\n this.matchPrevAvail = false;\n this.matchLength = 3 - 1;\n return prevLen;\n };\n CompressedStreamWriter.prototype.lookAheadCompleted = function (finish) {\n if (this.matchPrevAvail) {\n this.huffmanTallyLit(this.dataWindow[this.stringStart - 1] & 0xff);\n }\n this.matchPrevAvail = false;\n this.huffmanFlushBlock(this.dataWindow, this.blockStart, this.stringStart - this.blockStart, finish);\n this.blockStart = this.stringStart;\n return false;\n };\n CompressedStreamWriter.prototype.huffmanIsFull = function (finish) {\n var len = this.stringStart - this.blockStart;\n if (this.matchPrevAvail) {\n len--;\n }\n var lastBlock = (finish && this.lookAhead === 0 && !this.matchPrevAvail);\n this.huffmanFlushBlock(this.dataWindow, this.blockStart, len, lastBlock);\n this.blockStart += len;\n return !lastBlock;\n };\n CompressedStreamWriter.prototype.fillWindow = function () {\n if (this.stringStart >= this.windowSize + this.maxDist) {\n this.slideWindow();\n }\n while (this.lookAhead < 262 && this.inputOffset < this.inputEnd) {\n var more = 2 * this.windowSize - this.lookAhead - this.stringStart;\n if (more > this.inputEnd - this.inputOffset) {\n more = this.inputEnd - this.inputOffset;\n }\n this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset, this.inputOffset + more), this.stringStart + this.lookAhead);\n this.inputOffset += more;\n this.totalBytesIn += more;\n this.lookAhead += more;\n }\n if (this.lookAhead >= 3) {\n this.updateHash();\n }\n };\n CompressedStreamWriter.prototype.slideWindow = function () {\n this.dataWindow.set(this.dataWindow.subarray(this.windowSize, this.windowSize + this.windowSize), 0);\n this.matchStart -= this.windowSize;\n this.stringStart -= this.windowSize;\n this.blockStart -= this.windowSize;\n for (var i = 0; i < this.hashSize; ++i) {\n var m = this.hashHead[i] & 0xffff;\n this.hashHead[i] = (((m >= this.windowSize) ? (m - this.windowSize) : 0));\n }\n for (var i = 0; i < this.windowSize; i++) {\n var m = this.hashPrevious[i] & 0xffff;\n this.hashPrevious[i] = ((m >= this.windowSize) ? (m - this.windowSize) : 0);\n }\n };\n CompressedStreamWriter.prototype.insertString = function () {\n var match;\n var hash = ((this.currentHash << this.hashShift) ^ this.dataWindow[this.stringStart + (3 - 1)]) & this.hashMask;\n this.hashPrevious[this.stringStart & this.windowMask] = match = this.hashHead[hash];\n this.hashHead[hash] = this.stringStart;\n this.currentHash = hash;\n return match & 0xffff;\n };\n CompressedStreamWriter.prototype.findLongestMatch = function (curMatch) {\n var chainLen = 4096;\n var niceLen = 258;\n var scan = this.stringStart;\n var match;\n var bestEnd = this.stringStart + this.matchLength;\n var bestLength = Math.max(this.matchLength, 3 - 1);\n var limit = Math.max(this.stringStart - this.maxDist, 0);\n var stringEnd = this.stringStart + 258 - 1;\n var scanEnd1 = this.dataWindow[bestEnd - 1];\n var scanEnd = this.dataWindow[bestEnd];\n var data = this.dataWindow;\n if (bestLength >= 32) {\n chainLen >>= 2;\n }\n if (niceLen > this.lookAhead) {\n niceLen = this.lookAhead;\n }\n do {\n if (data[curMatch + bestLength] !== scanEnd ||\n data[curMatch + bestLength - 1] !== scanEnd1 ||\n data[curMatch] !== data[scan] ||\n data[curMatch + 1] !== data[scan + 1]) {\n continue;\n }\n match = curMatch + 2;\n scan += 2;\n /* tslint:disable */\n while (data[++scan] === data[++match] && data[++scan] === data[++match] &&\n data[++scan] === data[++match] && data[++scan] === data[++match] &&\n data[++scan] === data[++match] && data[++scan] === data[++match] &&\n data[++scan] === data[++match] && data[++scan] === data[++match] && scan < stringEnd) {\n /* tslint:disable */\n }\n if (scan > bestEnd) {\n this.matchStart = curMatch;\n bestEnd = scan;\n bestLength = scan - this.stringStart;\n if (bestLength >= niceLen) {\n break;\n }\n scanEnd1 = data[bestEnd - 1];\n scanEnd = data[bestEnd];\n }\n scan = this.stringStart;\n } while ((curMatch = (this.hashPrevious[curMatch & this.windowMask] & 0xffff)) > limit && --chainLen !== 0);\n this.matchLength = Math.min(bestLength, this.lookAhead);\n return this.matchLength >= 3;\n };\n CompressedStreamWriter.prototype.updateHash = function () {\n this.currentHash = (this.dataWindow[this.stringStart] << this.hashShift) ^ this.dataWindow[this.stringStart + 1];\n };\n CompressedStreamWriter.prototype.huffmanTallyLit = function (literal) {\n this.arrDistances[this.bufferPosition] = 0;\n this.arrLiterals[this.bufferPosition++] = literal;\n this.treeLiteral.codeFrequencies[literal]++;\n return this.bufferPosition >= (1 << 14);\n };\n CompressedStreamWriter.prototype.huffmanTallyDist = function (dist, len) {\n this.arrDistances[this.bufferPosition] = dist;\n this.arrLiterals[this.bufferPosition++] = (len - 3);\n var lc = this.huffmanLengthCode(len - 3);\n this.treeLiteral.codeFrequencies[lc]++;\n if (lc >= 265 && lc < 285) {\n this.extraBits += Math.floor((lc - 261) / 4);\n }\n var dc = this.huffmanDistanceCode(dist - 1);\n this.treeDistances.codeFrequencies[dc]++;\n if (dc >= 4) {\n this.extraBits += Math.floor((dc / 2 - 1));\n }\n return this.bufferPosition >= (1 << 14);\n };\n CompressedStreamWriter.prototype.huffmanFlushBlock = function (stored, storedOffset, storedLength, lastBlock) {\n this.treeLiteral.codeFrequencies[256]++;\n this.treeLiteral.buildTree();\n this.treeDistances.buildTree();\n this.treeLiteral.calculateBLFreq(this.treeCodeLengths);\n this.treeDistances.calculateBLFreq(this.treeCodeLengths);\n this.treeCodeLengths.buildTree();\n var blTreeCodes = 4;\n for (var i = 18; i > blTreeCodes; i--) {\n if (this.treeCodeLengths.codeLengths[CompressorHuffmanTree.huffCodeLengthOrders[i]] > 0) {\n blTreeCodes = i + 1;\n }\n }\n var opt_len = 14 + blTreeCodes * 3 + this.treeCodeLengths.getEncodedLength() +\n this.treeLiteral.getEncodedLength() + this.treeDistances.getEncodedLength() + this.extraBits;\n var static_len = this.extraBits;\n for (var i = 0; i < 286; i++) {\n static_len += this.treeLiteral.codeFrequencies[i] * ARR_LITERAL_LENGTHS[i];\n }\n for (var i = 0; i < 30; i++) {\n static_len += this.treeDistances.codeFrequencies[i] * ARR_DISTANCE_LENGTHS[i];\n }\n if (opt_len >= static_len) {\n // Force static trees.\n opt_len = static_len;\n }\n if (storedOffset >= 0 && storedLength + 4 < opt_len >> 3) {\n this.huffmanFlushStoredBlock(stored, storedOffset, storedLength, lastBlock);\n }\n else if (opt_len == static_len) {\n // Encode with static tree.\n this.pendingBufferWriteBits((1 << 1) + (lastBlock ? 1 : 0), 3);\n this.treeLiteral.setStaticCodes(ARR_LITERAL_CODES, ARR_LITERAL_LENGTHS);\n this.treeDistances.setStaticCodes(ARR_DISTANCE_CODES, ARR_DISTANCE_LENGTHS);\n this.huffmanCompressBlock();\n this.huffmanReset();\n }\n else {\n this.pendingBufferWriteBits((2 << 1) + (lastBlock ? 1 : 0), 3);\n this.huffmanSendAllTrees(blTreeCodes);\n this.huffmanCompressBlock();\n this.huffmanReset();\n }\n };\n CompressedStreamWriter.prototype.huffmanFlushStoredBlock = function (stored, storedOffset, storedLength, lastBlock) {\n this.pendingBufferWriteBits((0 << 1) + (lastBlock ? 1 : 0), 3);\n this.pendingBufferAlignToByte();\n this.pendingBufferWriteShort(storedLength);\n this.pendingBufferWriteShort(~storedLength);\n this.pendingBufferWriteByteBlock(stored, storedOffset, storedLength);\n this.huffmanReset();\n };\n CompressedStreamWriter.prototype.huffmanLengthCode = function (len) {\n if (len === 255) {\n return 285;\n }\n var code = 257;\n while (len >= 8) {\n code += 4;\n len >>= 1;\n }\n return code + len;\n };\n CompressedStreamWriter.prototype.huffmanDistanceCode = function (distance) {\n var code = 0;\n while (distance >= 4) {\n code += 2;\n distance >>= 1;\n }\n return code + distance;\n };\n CompressedStreamWriter.prototype.huffmanSendAllTrees = function (blTreeCodes) {\n this.treeCodeLengths.buildCodes();\n this.treeLiteral.buildCodes();\n this.treeDistances.buildCodes();\n this.pendingBufferWriteBits(this.treeLiteral.treeLength - 257, 5);\n this.pendingBufferWriteBits(this.treeDistances.treeLength - 1, 5);\n this.pendingBufferWriteBits(blTreeCodes - 4, 4);\n for (var rank = 0; rank < blTreeCodes; rank++) {\n this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[CompressorHuffmanTree.huffCodeLengthOrders[rank]], 3);\n }\n this.treeLiteral.writeTree(this.treeCodeLengths);\n this.treeDistances.writeTree(this.treeCodeLengths);\n };\n CompressedStreamWriter.prototype.huffmanReset = function () {\n this.bufferPosition = 0;\n this.extraBits = 0;\n this.treeLiteral.reset();\n this.treeDistances.reset();\n this.treeCodeLengths.reset();\n };\n CompressedStreamWriter.prototype.huffmanCompressBlock = function () {\n for (var i = 0; i < this.bufferPosition; i++) {\n var literalLen = this.arrLiterals[i] & 255;\n var dist = this.arrDistances[i];\n if (dist-- !== 0) {\n var lc = this.huffmanLengthCode(literalLen);\n this.treeLiteral.writeCodeToStream(lc);\n var bits = Math.floor((lc - 261) / 4);\n if (bits > 0 && bits <= 5) {\n this.pendingBufferWriteBits(literalLen & ((1 << bits) - 1), bits);\n }\n var dc = this.huffmanDistanceCode(dist);\n this.treeDistances.writeCodeToStream(dc);\n bits = Math.floor(dc / 2 - 1);\n if (bits > 0) {\n this.pendingBufferWriteBits(dist & ((1 << bits) - 1), bits);\n }\n }\n else {\n this.treeLiteral.writeCodeToStream(literalLen);\n }\n }\n this.treeLiteral.writeCodeToStream(256);\n };\n /**\n * write bits in to internal buffer\n * @param {number} b - source of bits\n * @param {number} count - count of bits to write\n */\n CompressedStreamWriter.prototype.pendingBufferWriteBits = function (b, count) {\n var uint = new Uint32Array(1);\n uint[0] = this.pendingBufCache | (b << this.pendingBufBitsInCache);\n this.pendingBufCache = uint[0];\n this.pendingBufBitsInCache += count;\n this.pendingBufferFlushBits();\n };\n CompressedStreamWriter.prototype.pendingBufferFlush = function (isClose) {\n this.pendingBufferFlushBits();\n if (this.pendingBufLength > 0) {\n var array = new Uint8Array(this.pendingBufLength);\n array.set(this.pendingBuffer.subarray(0, this.pendingBufLength), 0);\n this.stream.push(array);\n }\n this.pendingBufLength = 0;\n };\n CompressedStreamWriter.prototype.pendingBufferFlushBits = function () {\n var result = 0;\n while (this.pendingBufBitsInCache >= 8 && this.pendingBufLength < (1 << 16)) {\n this.pendingBuffer[this.pendingBufLength++] = this.pendingBufCache;\n this.pendingBufCache >>= 8;\n this.pendingBufBitsInCache -= 8;\n result++;\n }\n return result;\n };\n CompressedStreamWriter.prototype.pendingBufferWriteByteBlock = function (data, offset, length) {\n var array = data.subarray(offset, offset + length);\n this.pendingBuffer.set(array, this.pendingBufLength);\n this.pendingBufLength += length;\n };\n CompressedStreamWriter.prototype.pendingBufferWriteShort = function (s) {\n this.pendingBuffer[this.pendingBufLength++] = s;\n this.pendingBuffer[this.pendingBufLength++] = (s >> 8);\n };\n CompressedStreamWriter.prototype.pendingBufferAlignToByte = function () {\n if (this.pendingBufBitsInCache > 0) {\n this.pendingBuffer[this.pendingBufLength++] = this.pendingBufCache;\n }\n this.pendingBufCache = 0;\n this.pendingBufBitsInCache = 0;\n };\n /**\n * Huffman Tree literal calculation\n * @private\n */\n CompressedStreamWriter.initHuffmanTree = function () {\n var i = 0;\n while (i < 144) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x030 + i) << 8);\n ARR_LITERAL_LENGTHS[i++] = 8;\n }\n while (i < 256) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x190 - 144 + i) << 7);\n ARR_LITERAL_LENGTHS[i++] = 9;\n }\n while (i < 280) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x000 - 256 + i) << 9);\n ARR_LITERAL_LENGTHS[i++] = 7;\n }\n while (i < 286) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x0c0 - 280 + i) << 8);\n ARR_LITERAL_LENGTHS[i++] = 8;\n }\n for (i = 0; i < 30; i++) {\n ARR_DISTANCE_CODES[i] = CompressorHuffmanTree.bitReverse(i << 11);\n ARR_DISTANCE_LENGTHS[i] = 5;\n }\n };\n /**\n * close the stream and write all pending buffer in to stream\n * @returns {void}\n */\n CompressedStreamWriter.prototype.close = function () {\n do {\n this.pendingBufferFlush(true);\n if (!this.compressData(true)) {\n this.pendingBufferFlush(true);\n this.pendingBufferAlignToByte();\n if (!this.noWrap) {\n this.pendingBufferWriteShortBytes(this.checkSum >> 16);\n this.pendingBufferWriteShortBytes(this.checkSum & 0xffff);\n }\n this.pendingBufferFlush(true);\n }\n } while (!(this.inputEnd === this.inputOffset) ||\n !(this.pendingBufLength === 0));\n };\n /**\n * release allocated un-managed resource\n * @returns {void}\n */\n CompressedStreamWriter.prototype.destroy = function () {\n this.stream = [];\n this.stream = undefined;\n this.pendingBuffer = undefined;\n this.treeLiteral = undefined;\n this.treeDistances = undefined;\n this.treeCodeLengths = undefined;\n this.arrLiterals = undefined;\n this.arrDistances = undefined;\n this.hashHead = undefined;\n this.hashPrevious = undefined;\n this.dataWindow = undefined;\n this.inputBuffer = undefined;\n this.pendingBufLength = undefined;\n this.pendingBufCache = undefined;\n this.pendingBufBitsInCache = undefined;\n this.bufferPosition = undefined;\n this.extraBits = undefined;\n this.currentHash = undefined;\n this.matchStart = undefined;\n this.matchLength = undefined;\n this.matchPrevAvail = undefined;\n this.blockStart = undefined;\n this.stringStart = undefined;\n this.lookAhead = undefined;\n this.totalBytesIn = undefined;\n this.inputOffset = undefined;\n this.inputEnd = undefined;\n this.windowSize = undefined;\n this.windowMask = undefined;\n this.hashSize = undefined;\n this.hashMask = undefined;\n this.hashShift = undefined;\n this.maxDist = undefined;\n this.checkSum = undefined;\n this.noWrap = undefined;\n };\n CompressedStreamWriter.isHuffmanTreeInitiated = false;\n return CompressedStreamWriter;\n}());\nexport { CompressedStreamWriter };\n/**\n * represent the Huffman Tree\n */\nvar CompressorHuffmanTree = /** @class */ (function () {\n /**\n * Create new Huffman Tree\n * @param {CompressedStreamWriter} writer instance\n * @param {number} elementCount - element count\n * @param {number} minCodes - minimum count\n * @param {number} maxLength - maximum count\n */\n function CompressorHuffmanTree(writer, elementCount, minCodes, maxLength) {\n this.writer = writer;\n this.codeMinCount = minCodes;\n this.maxLength = maxLength;\n this.codeFrequency = new Uint16Array(elementCount);\n this.lengthCount = new Int32Array(maxLength);\n }\n Object.defineProperty(CompressorHuffmanTree.prototype, \"treeLength\", {\n get: function () {\n return this.codeCount;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CompressorHuffmanTree.prototype, \"codeLengths\", {\n get: function () {\n return this.codeLength;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CompressorHuffmanTree.prototype, \"codeFrequencies\", {\n get: function () {\n return this.codeFrequency;\n },\n enumerable: true,\n configurable: true\n });\n CompressorHuffmanTree.prototype.setStaticCodes = function (codes, lengths) {\n var temp = new Int16Array(codes.length);\n temp.set(codes, 0);\n this.codes = temp;\n var lengthTemp = new Uint8Array(lengths.length);\n lengthTemp.set(lengths, 0);\n this.codeLength = lengthTemp;\n };\n /**\n * reset all code data in tree\n * @returns {void}\n */\n CompressorHuffmanTree.prototype.reset = function () {\n for (var i = 0; i < this.codeFrequency.length; i++) {\n this.codeFrequency[i] = 0;\n }\n this.codes = undefined;\n this.codeLength = undefined;\n };\n /**\n * write code to the compressor output stream\n * @param {number} code - code to be written\n * @returns {void}\n */\n CompressorHuffmanTree.prototype.writeCodeToStream = function (code) {\n this.writer.pendingBufferWriteBits(this.codes[code] & 0xffff, this.codeLength[code]);\n };\n /**\n * calculate code from their frequencies\n * @returns {void}\n */\n CompressorHuffmanTree.prototype.buildCodes = function () {\n var nextCode = new Int32Array(this.maxLength);\n this.codes = new Int16Array(this.codeCount);\n var code = 0;\n for (var bitsCount = 0; bitsCount < this.maxLength; bitsCount++) {\n nextCode[bitsCount] = code;\n code += this.lengthCount[bitsCount] << (15 - bitsCount);\n }\n for (var i = 0; i < this.codeCount; i++) {\n var bits = this.codeLength[i];\n if (bits > 0) {\n this.codes[i] = CompressorHuffmanTree.bitReverse(nextCode[bits - 1]);\n nextCode[bits - 1] += 1 << (16 - bits);\n }\n }\n };\n CompressorHuffmanTree.bitReverse = function (value) {\n return (CompressorHuffmanTree.reverseBits[value & 15] << 12\n | CompressorHuffmanTree.reverseBits[(value >> 4) & 15] << 8\n | CompressorHuffmanTree.reverseBits[(value >> 8) & 15] << 4\n | CompressorHuffmanTree.reverseBits[value >> 12]);\n };\n /**\n * calculate length of compressed data\n * @returns {number}\n */\n CompressorHuffmanTree.prototype.getEncodedLength = function () {\n var len = 0;\n for (var i = 0; i < this.codeFrequency.length; i++) {\n len += this.codeFrequency[i] * this.codeLength[i];\n }\n return len;\n };\n /**\n * calculate code frequencies\n * @param {CompressorHuffmanTree} blTree\n * @returns {void}\n */\n CompressorHuffmanTree.prototype.calculateBLFreq = function (blTree) {\n var maxCount;\n var minCount;\n var count;\n var curLen = -1;\n var i = 0;\n while (i < this.codeCount) {\n count = 1;\n var nextLen = this.codeLength[i];\n if (nextLen === 0) {\n maxCount = 138;\n minCount = 3;\n }\n else {\n maxCount = 6;\n minCount = 3;\n if (curLen !== nextLen) {\n blTree.codeFrequency[nextLen]++;\n count = 0;\n }\n }\n curLen = nextLen;\n i++;\n while (i < this.codeCount && curLen === this.codeLength[i]) {\n i++;\n if (++count >= maxCount) {\n break;\n }\n }\n if (count < minCount) {\n blTree.codeFrequency[curLen] += count;\n }\n else if (curLen !== 0) {\n blTree.codeFrequency[16]++;\n }\n else if (count <= 10) {\n blTree.codeFrequency[17]++;\n }\n else {\n blTree.codeFrequency[18]++;\n }\n }\n };\n /**\n * @param {CompressorHuffmanTree} blTree - write tree to output stream\n * @returns {void}\n */\n CompressorHuffmanTree.prototype.writeTree = function (blTree) {\n var maxRepeatCount;\n var minRepeatCount;\n var currentRepeatCount;\n var currentCodeLength = -1;\n var i = 0;\n while (i < this.codeCount) {\n currentRepeatCount = 1;\n var nextLen = this.codeLength[i];\n if (nextLen === 0) {\n maxRepeatCount = 138;\n minRepeatCount = 3;\n }\n else {\n maxRepeatCount = 6;\n minRepeatCount = 3;\n if (currentCodeLength !== nextLen) {\n blTree.writeCodeToStream(nextLen);\n currentRepeatCount = 0;\n }\n }\n currentCodeLength = nextLen;\n i++;\n while (i < this.codeCount && currentCodeLength === this.codeLength[i]) {\n i++;\n if (++currentRepeatCount >= maxRepeatCount) {\n break;\n }\n }\n if (currentRepeatCount < minRepeatCount) {\n while (currentRepeatCount-- > 0) {\n blTree.writeCodeToStream(currentCodeLength);\n }\n }\n else if (currentCodeLength !== 0) {\n blTree.writeCodeToStream(16);\n this.writer.pendingBufferWriteBits(currentRepeatCount - 3, 2);\n }\n else if (currentRepeatCount <= 10) {\n blTree.writeCodeToStream(17);\n this.writer.pendingBufferWriteBits(currentRepeatCount - 3, 3);\n }\n else {\n blTree.writeCodeToStream(18);\n this.writer.pendingBufferWriteBits(currentRepeatCount - 11, 7);\n }\n }\n };\n /**\n * Build huffman tree\n * @returns {void}\n */\n CompressorHuffmanTree.prototype.buildTree = function () {\n var codesCount = this.codeFrequency.length;\n var arrTree = new Int32Array(codesCount);\n var treeLength = 0;\n var maxCount = 0;\n for (var n = 0; n < codesCount; n++) {\n var freq = this.codeFrequency[n];\n if (freq !== 0) {\n var pos = treeLength++;\n var pPos = 0;\n while (pos > 0 && this.codeFrequency[arrTree[pPos = Math.floor((pos - 1) / 2)]] > freq) {\n arrTree[pos] = arrTree[pPos];\n pos = pPos;\n }\n arrTree[pos] = n;\n maxCount = n;\n }\n }\n while (treeLength < 2) {\n arrTree[treeLength++] =\n (maxCount < 2) ? ++maxCount : 0;\n }\n this.codeCount = Math.max(maxCount + 1, this.codeMinCount);\n var leafsCount = treeLength;\n var nodesCount = leafsCount;\n var child = new Int32Array(4 * treeLength - 2);\n var values = new Int32Array(2 * treeLength - 1);\n for (var i = 0; i < treeLength; i++) {\n var node = arrTree[i];\n var iIndex = 2 * i;\n child[iIndex] = node;\n child[iIndex + 1] = -1;\n values[i] = (this.codeFrequency[node] << 8);\n arrTree[i] = i;\n }\n this.constructHuffmanTree(arrTree, treeLength, values, nodesCount, child);\n this.buildLength(child);\n };\n CompressorHuffmanTree.prototype.constructHuffmanTree = function (arrTree, treeLength, values, nodesCount, child) {\n do {\n var first = arrTree[0];\n var last = arrTree[--treeLength];\n var lastVal = values[last];\n var pPos = 0;\n var path = 1;\n while (path < treeLength) {\n if (path + 1 < treeLength && values[arrTree[path]] > values[arrTree[path + 1]]) {\n path++;\n }\n arrTree[pPos] = arrTree[path];\n pPos = path;\n path = pPos * 2 + 1;\n }\n while ((path = pPos) > 0 && values[arrTree[pPos = Math.floor((path - 1) / 2)]] > lastVal) {\n arrTree[path] = arrTree[pPos];\n }\n arrTree[path] = last;\n var second = arrTree[0];\n last = nodesCount++;\n child[2 * last] = first;\n child[2 * last + 1] = second;\n var minDepth = Math.min(values[first] & 0xff, values[second] & 0xff);\n values[last] = lastVal = values[first] + values[second] - minDepth + 1;\n pPos = 0;\n path = 1;\n /* tslint:disable */\n while (path < treeLength) {\n if (path + 1 < treeLength && values[arrTree[path]] > values[arrTree[path + 1]]) {\n path++;\n }\n arrTree[pPos] = arrTree[path];\n pPos = path;\n path = pPos * 2 + 1;\n } /* tslint:disable */\n while ((path = pPos) > 0 && values[arrTree[pPos = Math.floor((path - 1) / 2)]] > lastVal) {\n arrTree[path] = arrTree[pPos];\n }\n arrTree[path] = last;\n } while (treeLength > 1);\n };\n CompressorHuffmanTree.prototype.buildLength = function (child) {\n this.codeLength = new Uint8Array(this.codeFrequency.length);\n var numNodes = Math.floor(child.length / 2);\n var numLeafs = Math.floor((numNodes + 1) / 2);\n var overflow = 0;\n for (var i = 0; i < this.maxLength; i++) {\n this.lengthCount[i] = 0;\n }\n overflow = this.calculateOptimalCodeLength(child, overflow, numNodes);\n if (overflow === 0) {\n return;\n }\n var iIncreasableLength = this.maxLength - 1;\n do {\n while (this.lengthCount[--iIncreasableLength] === 0) {\n /* tslint:disable */\n }\n do {\n this.lengthCount[iIncreasableLength]--;\n this.lengthCount[++iIncreasableLength]++;\n overflow -= (1 << (this.maxLength - 1 - iIncreasableLength));\n } while (overflow > 0 && iIncreasableLength < this.maxLength - 1);\n } while (overflow > 0);\n this.recreateTree(child, overflow, numLeafs);\n };\n CompressorHuffmanTree.prototype.recreateTree = function (child, overflow, numLeafs) {\n this.lengthCount[this.maxLength - 1] += overflow;\n this.lengthCount[this.maxLength - 2] -= overflow;\n var nodePtr = 2 * numLeafs;\n for (var bits = this.maxLength; bits !== 0; bits--) {\n var n = this.lengthCount[bits - 1];\n while (n > 0) {\n var childPtr = 2 * child[nodePtr++];\n if (child[childPtr + 1] === -1) {\n this.codeLength[child[childPtr]] = bits;\n n--;\n }\n }\n }\n };\n CompressorHuffmanTree.prototype.calculateOptimalCodeLength = function (child, overflow, numNodes) {\n var lengths = new Int32Array(numNodes);\n lengths[numNodes - 1] = 0;\n for (var i = numNodes - 1; i >= 0; i--) {\n var childIndex = 2 * i + 1;\n if (child[childIndex] !== -1) {\n var bitLength = lengths[i] + 1;\n if (bitLength > this.maxLength) {\n bitLength = this.maxLength;\n overflow++;\n }\n lengths[child[childIndex - 1]] = lengths[child[childIndex]] = bitLength;\n }\n else {\n var bitLength = lengths[i];\n this.lengthCount[bitLength - 1]++;\n this.codeLength[child[childIndex - 1]] = lengths[i];\n }\n }\n return overflow;\n };\n CompressorHuffmanTree.reverseBits = [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15];\n CompressorHuffmanTree.huffCodeLengthOrders = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n return CompressorHuffmanTree;\n}());\nexport { CompressorHuffmanTree };\n/**\n * Checksum calculator, based on Adler32 algorithm.\n */\nvar ChecksumCalculator = /** @class */ (function () {\n function ChecksumCalculator() {\n }\n /**\n * Updates checksum by calculating checksum of the\n * given buffer and adding it to current value.\n * @param {number} checksum - current checksum.\n * @param {Uint8Array} buffer - data byte array.\n * @param {number} offset - offset in the buffer.\n * @param {number} length - length of data to be used from the stream.\n * @returns {number}\n */\n ChecksumCalculator.checksumUpdate = function (checksum, buffer, offset, length) {\n var uint = new Uint32Array(1);\n uint[0] = checksum;\n var checksum_uint = uint[0];\n var s1 = uint[0] = checksum_uint & 65535;\n var s2 = uint[0] = checksum_uint >> ChecksumCalculator.checkSumBitOffset;\n while (length > 0) {\n var steps = Math.min(length, ChecksumCalculator.checksumIterationCount);\n length -= steps;\n while (--steps >= 0) {\n s1 = s1 + (uint[0] = (buffer[offset++] & 255));\n s2 = s2 + s1;\n }\n s1 %= ChecksumCalculator.checksumBase;\n s2 %= ChecksumCalculator.checksumBase;\n }\n checksum_uint = (s2 << ChecksumCalculator.checkSumBitOffset) | s1;\n return checksum_uint;\n };\n ChecksumCalculator.checkSumBitOffset = 16;\n ChecksumCalculator.checksumBase = 65521;\n ChecksumCalculator.checksumIterationCount = 3800;\n return ChecksumCalculator;\n}());\nexport { ChecksumCalculator };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { PdfDictionary } from './pdf-dictionary';\nimport { PdfNumber } from './pdf-number';\nimport { Operators } from './../input-output/pdf-operators';\nimport { PdfName } from './pdf-name';\nimport { PdfArray } from './pdf-array';\nimport { PdfReferenceHolder } from './pdf-reference';\nimport { CompressedStreamWriter } from '@syncfusion/ej2-compression';\n/**\n * `PdfStream` class is used to perform stream related primitive operations.\n * @private\n */\nvar PdfStream = /** @class */ (function (_super) {\n __extends(PdfStream, _super);\n function PdfStream(dictionary, data) {\n var _this = _super.call(this, dictionary) || this;\n //Constants\n /**\n * @hidden\n * @private\n */\n _this.dicPrefix = 'stream';\n /**\n * @hidden\n * @private\n */\n _this.dicSuffix = 'endstream';\n /**\n * Internal variable to hold `cloned object`.\n * @private\n */\n _this.clonedObject2 = null;\n /**\n * @hidden\n * @private\n */\n _this.bCompress = true;\n /**\n * @hidden\n * @private\n */\n _this.isImageStream = false;\n /**\n * @hidden\n * @private\n */\n _this.isFontStream = false;\n if (typeof dictionary !== 'undefined' || typeof data !== 'undefined') {\n _this.dataStream2 = [];\n _this.dataStream2 = data;\n _this.bCompress2 = false;\n }\n else {\n _this.dataStream2 = [];\n _this.bCompress2 = true;\n //Pending\n }\n return _this;\n }\n Object.defineProperty(PdfStream.prototype, \"internalStream\", {\n /**\n * Gets the `internal` stream.\n * @private\n */\n get: function () {\n return this.dataStream2;\n },\n set: function (value) {\n this.dataStream2 = [];\n this.dataStream2 = value;\n this.modify();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStream.prototype, \"isImage\", {\n /**\n * Gets or sets 'is image' flag.\n * @private\n */\n get: function () {\n return this.isImageStream;\n },\n set: function (value) {\n this.isImageStream = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStream.prototype, \"isFont\", {\n /**\n * Gets or sets 'is font' flag.\n * @private\n */\n get: function () {\n return this.isFontStream;\n },\n set: function (value) {\n this.isFontStream = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStream.prototype, \"compress\", {\n /**\n * Gets or sets `compression` flag.\n * @private\n */\n get: function () {\n return this.bCompress;\n },\n set: function (value) {\n this.bCompress = value;\n this.modify();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStream.prototype, \"data\", {\n /**\n * Gets or sets the `data`.\n * @private\n */\n get: function () {\n return this.dataStream2;\n },\n set: function (value) {\n this.dataStream2 = [];\n this.dataStream2 = value;\n this.modify();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * `Clear` the internal stream.\n * @private\n */\n PdfStream.prototype.clearStream = function () {\n this.internalStream = [];\n if (this.items.containsKey(this.dictionaryProperties.filter)) {\n this.remove(this.dictionaryProperties.filter);\n }\n this.bCompress = true;\n this.modify();\n };\n /**\n * `Writes` the specified string.\n * @private\n */\n PdfStream.prototype.write = function (text) {\n if (text == null) {\n throw new Error('ArgumentNullException:text');\n }\n if (text.length <= 0) {\n throw new Error('ArgumentException: Can not write an empty string, text');\n }\n this.dataStream2.push(text);\n this.modify();\n };\n /**\n * `Writes` the specified bytes.\n * @private\n */\n PdfStream.prototype.writeBytes = function (data) {\n if (data === null) {\n throw new Error('ArgumentNullException:data');\n }\n if (data.length <= 0) {\n throw new Error('ArgumentException: Can not write an empty bytes, data');\n }\n var text = '';\n for (var i = 0; i < data.length; i++) {\n text += String.fromCharCode(data[i]);\n }\n this.dataStream2.push(text);\n this.modify();\n };\n /**\n * Raises event `Cmap BeginSave`.\n * @private\n */\n PdfStream.prototype.onCmapBeginSave = function () {\n this.cmapBeginSave.sender.cmapBeginSave();\n };\n /**\n * Raises event `Font Program BeginSave`.\n * @private\n */\n PdfStream.prototype.onFontProgramBeginSave = function () {\n this.fontProgramBeginSave.sender.fontProgramBeginSave();\n };\n /**\n * `Compresses the content` if it's required.\n * @private\n */\n PdfStream.prototype.compressContent = function (data, writer) {\n if (this.bCompress) {\n var byteArray = [];\n for (var i = 0; i < data.length; i++) {\n byteArray.push(data.charCodeAt(i));\n }\n var dataArray = new Uint8Array(byteArray);\n var sw = new CompressedStreamWriter();\n // data = 'Hello World!!!';\n sw.write(dataArray, 0, dataArray.length);\n sw.close();\n data = sw.getCompressedString;\n this.addFilter(this.dictionaryProperties.flatedecode);\n }\n return data;\n };\n /**\n * `Adds a filter` to the filter array.\n * @private\n */\n PdfStream.prototype.addFilter = function (filterName) {\n var obj = this.items.getValue(this.dictionaryProperties.filter);\n if (obj instanceof PdfReferenceHolder) {\n var rh = obj;\n obj = rh.object;\n }\n var array = obj;\n var name = obj;\n if (name != null) {\n array = new PdfArray();\n array.insert(0, name);\n this.items.setValue(this.dictionaryProperties.filter, array);\n }\n name = new PdfName(filterName);\n if (array == null) {\n this.items.setValue(this.dictionaryProperties.filter, name);\n }\n else {\n array.insert(0, name);\n }\n };\n /**\n * `Saves` the object using the specified writer.\n * @private\n */\n PdfStream.prototype.save = function (writer) {\n if (typeof this.cmapBeginSave !== 'undefined') {\n this.onCmapBeginSave();\n }\n if (typeof this.fontProgramBeginSave !== 'undefined') {\n this.onFontProgramBeginSave();\n }\n var data = '';\n for (var i = 0; i < this.data.length; i++) {\n data = data + this.data[i];\n }\n if (data.length > 1 && !this.isImage && !this.isFont) {\n data = 'q\\r\\n' + data + 'Q\\r\\n';\n }\n data = this.compressContent(data, writer);\n var length = data.length;\n this.items.setValue(this.dictionaryProperties.length, new PdfNumber(length));\n _super.prototype.save.call(this, writer, false);\n writer.write(this.dicPrefix);\n writer.write(Operators.newLine);\n if (data.length > 0) {\n writer.write(data);\n }\n writer.write(Operators.newLine);\n writer.write(this.dicSuffix);\n writer.write(Operators.newLine);\n };\n /**\n * Converts `bytes to string`.\n * @private\n */\n PdfStream.bytesToString = function (byteArray) {\n var output = '';\n for (var i = 0; i < byteArray.length; i++) {\n output = output + String.fromCharCode(byteArray[i]);\n }\n return output;\n };\n return PdfStream;\n}(PdfDictionary));\nexport { PdfStream };\nvar SaveCmapEventHandler = /** @class */ (function () {\n /**\n * New instance for `save section collection event handler` class.\n * @private\n */\n function SaveCmapEventHandler(sender) {\n this.sender = sender;\n }\n return SaveCmapEventHandler;\n}());\nexport { SaveCmapEventHandler };\nvar SaveFontProgramEventHandler = /** @class */ (function () {\n /**\n * New instance for `save section collection event handler` class.\n * @private\n */\n function SaveFontProgramEventHandler(sender) {\n this.sender = sender;\n }\n return SaveFontProgramEventHandler;\n}());\nexport { SaveFontProgramEventHandler };\n","/**\n * public Enum for `ObjectType`.\n * @private\n */\nexport var ObjectType;\n(function (ObjectType) {\n /**\n * Specifies the type of `Free`.\n * @private\n */\n ObjectType[ObjectType[\"Free\"] = 0] = \"Free\";\n /**\n * Specifies the type of `Normal`.\n * @private\n */\n ObjectType[ObjectType[\"Normal\"] = 1] = \"Normal\";\n /**\n * Specifies the type of `Packed`.\n * @private\n */\n ObjectType[ObjectType[\"Packed\"] = 2] = \"Packed\";\n})(ObjectType || (ObjectType = {}));\n","import { DictionaryProperties } from './../input-output/pdf-dictionary-properties';\nimport { PdfStream } from './../primitives/pdf-stream';\nimport { PdfArray } from './../primitives/pdf-array';\nimport { PdfNumber } from './../primitives/pdf-number';\nimport { PdfName } from './../primitives/pdf-name';\nimport { PdfDictionary } from './../primitives/pdf-dictionary';\nimport { PdfString } from './../primitives/pdf-string';\n/**\n * `PdfReference` class is used to perform reference related primitive operations.\n * @private\n */\nvar PdfReference = /** @class */ (function () {\n function PdfReference(objNumber, genNumber) {\n /**\n * Holds the `index` number of the object.\n * @default -1\n * @private\n */\n this.index3 = -1;\n /**\n * Internal variable to store the `position`.\n * @default -1\n * @private\n */\n this.position3 = -1;\n /**\n * Holds the `object number`.\n * @default 0\n * @private\n */\n this.objNumber = 0;\n /**\n * Holds the `generation number` of the object.\n * @default 0\n * @private\n */\n this.genNumber = 0;\n if (typeof objNumber === 'number' && typeof genNumber === 'number') {\n this.objNumber = objNumber;\n this.genNumber = genNumber;\n // } else if (typeof objNum === 'string' && typeof genNum === 'string') {\n }\n else {\n this.objNumber = Number(objNumber);\n this.genNumber = Number(genNumber);\n }\n }\n Object.defineProperty(PdfReference.prototype, \"status\", {\n //Property\n /**\n * Gets or sets the `Status` of the specified object.\n * @private\n */\n get: function () {\n return this.status3;\n },\n set: function (value) {\n this.status3 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReference.prototype, \"isSaving\", {\n /**\n * Gets or sets a value indicating whether this document `is saving` or not.\n * @private\n */\n get: function () {\n return this.isSaving3;\n },\n set: function (value) {\n this.isSaving3 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReference.prototype, \"objectCollectionIndex\", {\n /**\n * Gets or sets the `index` value of the specified object.\n * @private\n */\n get: function () {\n return this.index3;\n },\n set: function (value) {\n this.index3 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReference.prototype, \"position\", {\n /**\n * Gets or sets the `position` of the object.\n * @private\n */\n get: function () {\n return this.position3;\n },\n set: function (value) {\n this.position3 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReference.prototype, \"clonedObject\", {\n /**\n * Returns `cloned object`.\n * @private\n */\n get: function () {\n var returnObject3 = null;\n return returnObject3;\n },\n enumerable: true,\n configurable: true\n });\n //IPdfPrimitives methods\n /**\n * `Saves` the object.\n * @private\n */\n PdfReference.prototype.save = function (writer) {\n writer.write(this.toString());\n };\n /**\n * Returns a `string` representing the object.\n * @private\n */\n PdfReference.prototype.toString = function () {\n return this.objNumber.toString() + ' ' + this.genNumber.toString() + ' R';\n };\n /**\n * Creates a `deep copy` of the IPdfPrimitive object.\n * @private\n */\n PdfReference.prototype.clone = function (crossTable) {\n return null;\n };\n return PdfReference;\n}());\nexport { PdfReference };\n/**\n * `PdfReferenceHolder` class is used to perform reference holder related primitive operations.\n * @private\n */\nvar PdfReferenceHolder = /** @class */ (function () {\n function PdfReferenceHolder(obj1, obj2) {\n /**\n * Holds the `index` number of the object.\n * @default -1\n * @private\n */\n this.index4 = -1;\n /**\n * Internal variable to store the `position`.\n * @default -1\n * @private\n */\n this.position4 = -1;\n /**\n * The `index` of the object within the object collection.\n * @default -1\n * @private\n */\n this.objectIndex = -1;\n /**\n * @hidden\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n // if (typeof obj2 === 'undefined') {\n this.initialize(obj1);\n // }\n // else {\n // if (obj2 === null) {\n // throw new Error('ArgumentNullException : crossTable');\n // }\n // if (obj1 === null) {\n // throw new Error('ArgumentNullException : reference');\n // }\n // this.crossTable = obj2;\n // let tempObj1 : PdfReference = obj1;\n // this.reference = tempObj1;\n // }\n }\n Object.defineProperty(PdfReferenceHolder.prototype, \"status\", {\n //Properties\n /**\n * Gets or sets the `Status` of the specified object.\n * @private\n */\n get: function () {\n return this.status4;\n },\n set: function (value) {\n this.status4 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReferenceHolder.prototype, \"isSaving\", {\n /**\n * Gets or sets a value indicating whether this document `is saving` or not.\n * @private\n */\n get: function () {\n return this.isSaving4;\n },\n set: function (value) {\n this.isSaving4 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReferenceHolder.prototype, \"objectCollectionIndex\", {\n /**\n * Gets or sets the `index` value of the specified object.\n * @private\n */\n get: function () {\n return this.index4;\n },\n set: function (value) {\n this.index4 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReferenceHolder.prototype, \"position\", {\n /**\n * Gets or sets the `position` of the object.\n * @private\n */\n get: function () {\n return this.position4;\n },\n set: function (value) {\n this.position4 = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReferenceHolder.prototype, \"clonedObject\", {\n /**\n * Returns `cloned object`.\n * @private\n */\n get: function () {\n return null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReferenceHolder.prototype, \"object\", {\n /**\n * Gets the `object` the reference is of.\n * @private\n */\n get: function () {\n // if ((this.reference != null) || (this.object == null)) {\n // this.object = this.GetterObject();\n // }\n return this.primitiveObject;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReferenceHolder.prototype, \"reference\", {\n /**\n * Gets the `reference`.\n * @private\n */\n get: function () {\n return this.pdfReference;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReferenceHolder.prototype, \"index\", {\n /**\n * Gets the `index` of the object.\n * @private\n */\n get: function () {\n // let items : PdfMainObjectCollection = this.crossTable.PdfObjects;\n // this.objectIndex = items.GetObjectIndex(this.reference);\n // if (this.objectIndex < 0) {\n // let obj : IPdfPrimitive = this.crossTable.GetObject(this.reference);\n // this.objectIndex = items.Count - 1;\n // }\n return this.objectIndex;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfReferenceHolder.prototype, \"element\", {\n /**\n * Gets the `element`.\n * @private\n */\n get: function () {\n return this.primitiveObject;\n },\n enumerable: true,\n configurable: true\n });\n PdfReferenceHolder.prototype.initialize = function (obj1) {\n if (obj1 instanceof PdfArray\n || obj1 instanceof PdfDictionary\n || obj1 instanceof PdfName\n || obj1 instanceof PdfNumber\n || obj1 instanceof PdfStream\n || obj1 instanceof PdfReference\n || obj1 instanceof PdfString) {\n this.primitiveObject = obj1;\n }\n else {\n var tempObj = obj1;\n this.initialize(tempObj.element);\n }\n };\n /**\n * `Writes` a reference into a PDF document.\n * @private\n */\n PdfReferenceHolder.prototype.save = function (writer) {\n // if (writer == null) {\n // throw new Error('ArgumentNullException : writer');\n // }\n var position = writer.position;\n var cTable = writer.document.crossTable;\n // if (cTable.Document instanceof PdfDocument) {\n this.object.isSaving = true;\n // }\n var reference = null;\n // if (writer.Document.FileStructure.IncrementalUpdate === true && writer.Document.isStreamCopied === true) {\n // if (this.reference === null) {\n // reference = cTable.GetReference(this.Object);\n // } else {\n // reference = this.reference;\n // }\n // } else {\n // reference = cTable.GetReference(this.Object);\n // }\n // if (!(writer.Document.FileStructure.IncrementalUpdate === true && writer.Document.isStreamCopied === true)) {\n reference = cTable.getReference(this.object);\n // }\n // if (writer.Position !== position) {\n // writer.Position = position;\n // }\n reference.save(writer);\n };\n /**\n * Creates a `copy of PdfReferenceHolder`.\n * @private\n */\n PdfReferenceHolder.prototype.clone = function (crossTable) {\n var refHolder = null;\n var temp = null;\n var refNum = '';\n var reference = null;\n // Restricts addition of same object multiple time.\n /* if (this.Reference != null && this.crossTable != null && this.crossTable.PageCorrespondance.containsKey(this.Reference)) {\n refHolder = new PdfReferenceHolder(this.crossTable.PageCorrespondance.getValue(this.Reference) as PdfReference, crossTable);\n return refHolder;\n }\n if (Object instanceof PdfNumber) {\n return new PdfNumber((Object as PdfNumber).IntValue);\n }\n */\n // if (Object instanceof PdfDictionary) {\n // // Meaning the referenced page is not available for import.\n // let type : PdfName = new PdfName(this.dictionaryProperties.type);\n // let dict : PdfDictionary = Object as PdfDictionary;\n // if (dict.ContainsKey(type)) {\n // let pageName : PdfName = dict.Items.getValue(type.Value) as PdfName;\n // if (pageName !== null) {\n // if (pageName.Value === 'Page') {\n // return new PdfNull();\n // }\n // }\n // }\n // }\n /* if (Object instanceof PdfName) {\n return new PdfName ((Object as PdfName ).Value);\n }\n */\n // Resolves circular references.\n // if (crossTable.PrevReference !== null && (crossTable.PrevReference.indexOf(this.Reference) !== -1)) {\n // let obj : IPdfPrimitive = this.crossTable.GetObject(this.Reference).ClonedObject;\n // if (obj !== null) {\n // reference = crossTable.GetReference(obj);\n // return new PdfReferenceHolder(reference, crossTable);\n // } else {\n // return new PdfNull();\n // }\n // }\n /*if (this.Reference !== null) {\n crossTable.PrevReference.push(this.Reference);\n }\n reference = crossTable.GetReference(temp);\n refHolder = new PdfReferenceHolder(reference, crossTable);\n return refHolder;\n */\n return null;\n };\n return PdfReferenceHolder;\n}());\nexport { PdfReferenceHolder };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * PdfCatalog.ts class for EJ2-PDF\n */\nimport { PdfDictionary } from './../primitives/pdf-dictionary';\nimport { DictionaryProperties } from './../input-output/pdf-dictionary-properties';\nimport { PdfName } from './../primitives/pdf-name';\nimport { PdfReferenceHolder } from './../primitives/pdf-reference';\n/**\n * `PdfCatalog` class represents internal catalog of the Pdf document.\n * @private\n */\nvar PdfCatalog = /** @class */ (function (_super) {\n __extends(PdfCatalog, _super);\n //constructor\n /**\n * Initializes a new instance of the `PdfCatalog` class.\n * @private\n */\n function PdfCatalog() {\n var _this = _super.call(this) || this;\n //fields\n /**\n * Internal variable to store collection of `sections`.\n * @default null\n * @private\n */\n _this.sections = null;\n /**\n * Internal variable for accessing fields from `DictionryProperties` class.\n * @private\n */\n _this.tempDictionaryProperties = new DictionaryProperties();\n _this.items.setValue(new DictionaryProperties().type, new PdfName('Catalog'));\n return _this;\n }\n Object.defineProperty(PdfCatalog.prototype, \"pages\", {\n //Properties\n /**\n * Gets or sets the sections, which contain `pages`.\n * @private\n */\n get: function () {\n return this.sections;\n },\n set: function (value) {\n var dictionary = value.element;\n // if (this.sections !== value) {\n // this.sections = value;\n // this.Items.setValue(this.tempDictionaryProperties.pages, new PdfReferenceHolder(value));\n // }\n this.sections = value;\n this.items.setValue(this.tempDictionaryProperties.pages, new PdfReferenceHolder(value));\n },\n enumerable: true,\n configurable: true\n });\n return PdfCatalog;\n}(PdfDictionary));\nexport { PdfCatalog };\n","/**\n * public Enum for `PdfHorizontalAlignment`.\n * @private\n */\nexport var PdfHorizontalAlignment;\n(function (PdfHorizontalAlignment) {\n /**\n * Specifies the type of `Left`.\n * @private\n */\n PdfHorizontalAlignment[PdfHorizontalAlignment[\"Left\"] = 0] = \"Left\";\n /**\n * Specifies the type of `Center`.\n * @private\n */\n PdfHorizontalAlignment[PdfHorizontalAlignment[\"Center\"] = 1] = \"Center\";\n /**\n * Specifies the type of `Right`.\n * @private\n */\n PdfHorizontalAlignment[PdfHorizontalAlignment[\"Right\"] = 2] = \"Right\";\n})(PdfHorizontalAlignment || (PdfHorizontalAlignment = {}));\n/**\n * public Enum for `PdfVerticalAlignment`.\n * @private\n */\nexport var PdfVerticalAlignment;\n(function (PdfVerticalAlignment) {\n /**\n * Specifies the type of `Top`.\n * @private\n */\n PdfVerticalAlignment[PdfVerticalAlignment[\"Top\"] = 0] = \"Top\";\n /**\n * Specifies the type of `Middle`.\n * @private\n */\n PdfVerticalAlignment[PdfVerticalAlignment[\"Middle\"] = 1] = \"Middle\";\n /**\n * Specifies the type of `Bottom`.\n * @private\n */\n PdfVerticalAlignment[PdfVerticalAlignment[\"Bottom\"] = 2] = \"Bottom\";\n})(PdfVerticalAlignment || (PdfVerticalAlignment = {}));\n/**\n * public Enum for `public`.\n * @private\n */\nexport var PdfTextAlignment;\n(function (PdfTextAlignment) {\n /**\n * Specifies the type of `Left`.\n * @private\n */\n PdfTextAlignment[PdfTextAlignment[\"Left\"] = 0] = \"Left\";\n /**\n * Specifies the type of `Center`.\n * @private\n */\n PdfTextAlignment[PdfTextAlignment[\"Center\"] = 1] = \"Center\";\n /**\n * Specifies the type of `Right`.\n * @private\n */\n PdfTextAlignment[PdfTextAlignment[\"Right\"] = 2] = \"Right\";\n /**\n * Specifies the type of `Justify`.\n * @private\n */\n PdfTextAlignment[PdfTextAlignment[\"Justify\"] = 3] = \"Justify\";\n})(PdfTextAlignment || (PdfTextAlignment = {}));\n/**\n * public Enum for `TextRenderingMode`.\n * @private\n */\nexport var TextRenderingMode;\n(function (TextRenderingMode) {\n /**\n * Specifies the type of `Fill`.\n * @private\n */\n TextRenderingMode[TextRenderingMode[\"Fill\"] = 0] = \"Fill\";\n /**\n * Specifies the type of `Stroke`.\n * @private\n */\n TextRenderingMode[TextRenderingMode[\"Stroke\"] = 1] = \"Stroke\";\n /**\n * Specifies the type of `FillStroke`.\n * @private\n */\n TextRenderingMode[TextRenderingMode[\"FillStroke\"] = 2] = \"FillStroke\";\n /**\n * Specifies the type of `None`.\n * @private\n */\n TextRenderingMode[TextRenderingMode[\"None\"] = 3] = \"None\";\n /**\n * Specifies the type of `ClipFlag`.\n * @private\n */\n TextRenderingMode[TextRenderingMode[\"ClipFlag\"] = 4] = \"ClipFlag\";\n /**\n * Specifies the type of `ClipFill`.\n * @private\n */\n TextRenderingMode[TextRenderingMode[\"ClipFill\"] = 4] = \"ClipFill\";\n /**\n * Specifies the type of `ClipStroke`.\n * @private\n */\n TextRenderingMode[TextRenderingMode[\"ClipStroke\"] = 5] = \"ClipStroke\";\n /**\n * Specifies the type of `ClipFillStroke`.\n * @private\n */\n TextRenderingMode[TextRenderingMode[\"ClipFillStroke\"] = 6] = \"ClipFillStroke\";\n /**\n * Specifies the type of `Clip`.\n * @private\n */\n TextRenderingMode[TextRenderingMode[\"Clip\"] = 7] = \"Clip\";\n})(TextRenderingMode || (TextRenderingMode = {}));\n/**\n * public Enum for `PdfLineJoin`.\n * @private\n */\nexport var PdfLineJoin;\n(function (PdfLineJoin) {\n /**\n * Specifies the type of `Miter`.\n * @private\n */\n PdfLineJoin[PdfLineJoin[\"Miter\"] = 0] = \"Miter\";\n /**\n * Specifies the type of `Round`.\n * @private\n */\n PdfLineJoin[PdfLineJoin[\"Round\"] = 1] = \"Round\";\n /**\n * Specifies the type of `Bevel`.\n * @private\n */\n PdfLineJoin[PdfLineJoin[\"Bevel\"] = 2] = \"Bevel\";\n})(PdfLineJoin || (PdfLineJoin = {}));\n/**\n * public Enum for `PdfLineCap`.\n * @private\n */\nexport var PdfLineCap;\n(function (PdfLineCap) {\n /**\n * Specifies the type of `Flat`.\n * @private\n */\n PdfLineCap[PdfLineCap[\"Flat\"] = 0] = \"Flat\";\n /**\n * Specifies the type of `Round`.\n * @private\n */\n PdfLineCap[PdfLineCap[\"Round\"] = 1] = \"Round\";\n /**\n * Specifies the type of `Square`.\n * @private\n */\n PdfLineCap[PdfLineCap[\"Square\"] = 2] = \"Square\";\n})(PdfLineCap || (PdfLineCap = {}));\n/**\n * public Enum for `PdfDashStyle`.\n * @private\n */\nexport var PdfDashStyle;\n(function (PdfDashStyle) {\n /**\n * Specifies the type of `Solid`.\n * @private\n */\n PdfDashStyle[PdfDashStyle[\"Solid\"] = 0] = \"Solid\";\n /**\n * Specifies the type of `Dash`.\n * @private\n */\n PdfDashStyle[PdfDashStyle[\"Dash\"] = 1] = \"Dash\";\n /**\n * Specifies the type of `Dot`.\n * @private\n */\n PdfDashStyle[PdfDashStyle[\"Dot\"] = 2] = \"Dot\";\n /**\n * Specifies the type of `DashDot`.\n * @private\n */\n PdfDashStyle[PdfDashStyle[\"DashDot\"] = 3] = \"DashDot\";\n /**\n * Specifies the type of `DashDotDot`.\n * @private\n */\n PdfDashStyle[PdfDashStyle[\"DashDotDot\"] = 4] = \"DashDotDot\";\n /**\n * Specifies the type of `Custom`.\n * @private\n */\n PdfDashStyle[PdfDashStyle[\"Custom\"] = 5] = \"Custom\";\n})(PdfDashStyle || (PdfDashStyle = {}));\n/**\n * public Enum for `PdfFillMode`.\n * @private\n */\nexport var PdfFillMode;\n(function (PdfFillMode) {\n /**\n * Specifies the type of `Winding`.\n * @private\n */\n PdfFillMode[PdfFillMode[\"Winding\"] = 0] = \"Winding\";\n /**\n * Specifies the type of `Alternate`.\n * @private\n */\n PdfFillMode[PdfFillMode[\"Alternate\"] = 1] = \"Alternate\";\n})(PdfFillMode || (PdfFillMode = {}));\n/**\n * public Enum for `PdfColorSpace`.\n * @private\n */\nexport var PdfColorSpace;\n(function (PdfColorSpace) {\n /**\n * Specifies the type of `Rgb`.\n * @private\n */\n PdfColorSpace[PdfColorSpace[\"Rgb\"] = 0] = \"Rgb\";\n /**\n * Specifies the type of `Cmyk`.\n * @private\n */\n PdfColorSpace[PdfColorSpace[\"Cmyk\"] = 1] = \"Cmyk\";\n /**\n * Specifies the type of `GrayScale`.\n * @private\n */\n PdfColorSpace[PdfColorSpace[\"GrayScale\"] = 2] = \"GrayScale\";\n /**\n * Specifies the type of `Indexed`.\n * @private\n */\n PdfColorSpace[PdfColorSpace[\"Indexed\"] = 3] = \"Indexed\";\n})(PdfColorSpace || (PdfColorSpace = {}));\n/**\n * public Enum for `PdfBlendMode`.\n * @private\n */\nexport var PdfBlendMode;\n(function (PdfBlendMode) {\n /**\n * Specifies the type of `Normal`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Normal\"] = 0] = \"Normal\";\n /**\n * Specifies the type of `Multiply`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Multiply\"] = 1] = \"Multiply\";\n /**\n * Specifies the type of `Screen`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Screen\"] = 2] = \"Screen\";\n /**\n * Specifies the type of `Overlay`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Overlay\"] = 3] = \"Overlay\";\n /**\n * Specifies the type of `Darken`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Darken\"] = 4] = \"Darken\";\n /**\n * Specifies the type of `Lighten`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Lighten\"] = 5] = \"Lighten\";\n /**\n * Specifies the type of `ColorDodge`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"ColorDodge\"] = 6] = \"ColorDodge\";\n /**\n * Specifies the type of `ColorBurn`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"ColorBurn\"] = 7] = \"ColorBurn\";\n /**\n * Specifies the type of `HardLight`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"HardLight\"] = 8] = \"HardLight\";\n /**\n * Specifies the type of `SoftLight`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"SoftLight\"] = 9] = \"SoftLight\";\n /**\n * Specifies the type of `Difference`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Difference\"] = 10] = \"Difference\";\n /**\n * Specifies the type of `Exclusion`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Exclusion\"] = 11] = \"Exclusion\";\n /**\n * Specifies the type of `Hue`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Hue\"] = 12] = \"Hue\";\n /**\n * Specifies the type of `Saturation`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Saturation\"] = 13] = \"Saturation\";\n /**\n * Specifies the type of `Color`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Color\"] = 14] = \"Color\";\n /**\n * Specifies the type of `Luminosity`.\n * @private\n */\n PdfBlendMode[PdfBlendMode[\"Luminosity\"] = 15] = \"Luminosity\";\n})(PdfBlendMode || (PdfBlendMode = {}));\n/**\n * public Enum for `PdfGraphicsUnit`.\n * @private\n */\nexport var PdfGraphicsUnit;\n(function (PdfGraphicsUnit) {\n /**\n * Specifies the type of `Centimeter`.\n * @private\n */\n PdfGraphicsUnit[PdfGraphicsUnit[\"Centimeter\"] = 0] = \"Centimeter\";\n /**\n * Specifies the type of `Pica`.\n * @private\n */\n PdfGraphicsUnit[PdfGraphicsUnit[\"Pica\"] = 1] = \"Pica\";\n /**\n * Specifies the type of `Pixel`.\n * @private\n */\n PdfGraphicsUnit[PdfGraphicsUnit[\"Pixel\"] = 2] = \"Pixel\";\n /**\n * Specifies the type of `Point`.\n * @private\n */\n PdfGraphicsUnit[PdfGraphicsUnit[\"Point\"] = 3] = \"Point\";\n /**\n * Specifies the type of `Inch`.\n * @private\n */\n PdfGraphicsUnit[PdfGraphicsUnit[\"Inch\"] = 4] = \"Inch\";\n /**\n * Specifies the type of `Document`.\n * @private\n */\n PdfGraphicsUnit[PdfGraphicsUnit[\"Document\"] = 5] = \"Document\";\n /**\n * Specifies the type of `Millimeter`.\n * @private\n */\n PdfGraphicsUnit[PdfGraphicsUnit[\"Millimeter\"] = 6] = \"Millimeter\";\n})(PdfGraphicsUnit || (PdfGraphicsUnit = {}));\n/**\n * public Enum for `PdfGridImagePosition`.\n * @private\n */\nexport var PdfGridImagePosition;\n(function (PdfGridImagePosition) {\n /**\n * Specifies the type of `Fit`.\n * @private\n */\n PdfGridImagePosition[PdfGridImagePosition[\"Fit\"] = 0] = \"Fit\";\n /**\n * Specifies the type of `Center`.\n * @private\n */\n PdfGridImagePosition[PdfGridImagePosition[\"Center\"] = 1] = \"Center\";\n /**\n * Specifies the type of `Stretch`.\n * @private\n */\n PdfGridImagePosition[PdfGridImagePosition[\"Stretch\"] = 2] = \"Stretch\";\n /**\n * Specifies the type of `Tile`.\n * @private\n */\n PdfGridImagePosition[PdfGridImagePosition[\"Tile\"] = 3] = \"Tile\";\n})(PdfGridImagePosition || (PdfGridImagePosition = {}));\n/**\n * public Enum for `the text rendering direction`.\n * @private\n */\nexport var PdfTextDirection;\n(function (PdfTextDirection) {\n /**\n * Specifies the type of `None`.\n * @private\n */\n PdfTextDirection[PdfTextDirection[\"None\"] = 0] = \"None\";\n /**\n * Specifies the type of `LeftToRight`.\n * @private\n */\n PdfTextDirection[PdfTextDirection[\"LeftToRight\"] = 1] = \"LeftToRight\";\n /**\n * Specifies the type of `RightToLeft`.\n * @private\n */\n PdfTextDirection[PdfTextDirection[\"RightToLeft\"] = 2] = \"RightToLeft\";\n})(PdfTextDirection || (PdfTextDirection = {}));\n","/**\n * public Enum for `PdfFontStyle`.\n * @private\n */\nexport var PdfFontStyle;\n(function (PdfFontStyle) {\n /**\n * Specifies the type of `Regular`.\n * @private\n */\n PdfFontStyle[PdfFontStyle[\"Regular\"] = 0] = \"Regular\";\n /**\n * Specifies the type of `Bold`.\n * @private\n */\n PdfFontStyle[PdfFontStyle[\"Bold\"] = 1] = \"Bold\";\n /**\n * Specifies the type of `Italic`.\n * @private\n */\n PdfFontStyle[PdfFontStyle[\"Italic\"] = 2] = \"Italic\";\n /**\n * Specifies the type of `Underline`.\n * @private\n */\n PdfFontStyle[PdfFontStyle[\"Underline\"] = 4] = \"Underline\";\n /**\n * Specifies the type of `Strikeout`.\n * @private\n */\n PdfFontStyle[PdfFontStyle[\"Strikeout\"] = 8] = \"Strikeout\";\n})(PdfFontStyle || (PdfFontStyle = {}));\n/**\n * Specifies the font family from the standard font.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a new page to the document\n * let page1 : PdfPage = document.pages.add();\n * // create new standard font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // create black brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(0, 0));\n * // save the document\n * document.save('output.pdf');\n * ```\n */\nexport var PdfFontFamily;\n(function (PdfFontFamily) {\n /**\n * Specifies the `Helvetica` font.\n */\n PdfFontFamily[PdfFontFamily[\"Helvetica\"] = 0] = \"Helvetica\";\n /**\n * Specifies the `Courier` font.\n */\n PdfFontFamily[PdfFontFamily[\"Courier\"] = 1] = \"Courier\";\n /**\n * Specifies the `TimesRoman` font.\n */\n PdfFontFamily[PdfFontFamily[\"TimesRoman\"] = 2] = \"TimesRoman\";\n /**\n * Specifies the `Symbol` font.\n */\n PdfFontFamily[PdfFontFamily[\"Symbol\"] = 3] = \"Symbol\";\n /**\n * Specifies the `ZapfDingbats` font.\n */\n PdfFontFamily[PdfFontFamily[\"ZapfDingbats\"] = 4] = \"ZapfDingbats\";\n})(PdfFontFamily || (PdfFontFamily = {}));\n/**\n * public Enum for `PdfFontType`.\n * @private\n */\nexport var PdfFontType;\n(function (PdfFontType) {\n /**\n * Specifies the type of `Standard`.\n * @private\n */\n PdfFontType[PdfFontType[\"Standard\"] = 0] = \"Standard\";\n /**\n * Specifies the type of `TrueType`.\n * @private\n */\n PdfFontType[PdfFontType[\"TrueType\"] = 1] = \"TrueType\";\n /**\n * Specifies the type of `TrueTypeEmbedded`.\n * @private\n */\n PdfFontType[PdfFontType[\"TrueTypeEmbedded\"] = 2] = \"TrueTypeEmbedded\";\n})(PdfFontType || (PdfFontType = {}));\n/**\n * public Enum for `PdfWordWrapType`.\n * @private\n */\nexport var PdfWordWrapType;\n(function (PdfWordWrapType) {\n /**\n * Specifies the type of `None`.\n * @private\n */\n PdfWordWrapType[PdfWordWrapType[\"None\"] = 0] = \"None\";\n /**\n * Specifies the type of `Word`.\n * @private\n */\n PdfWordWrapType[PdfWordWrapType[\"Word\"] = 1] = \"Word\";\n /**\n * Specifies the type of `WordOnly`.\n * @private\n */\n PdfWordWrapType[PdfWordWrapType[\"WordOnly\"] = 2] = \"WordOnly\";\n /**\n * Specifies the type of `Character`.\n * @private\n */\n PdfWordWrapType[PdfWordWrapType[\"Character\"] = 3] = \"Character\";\n})(PdfWordWrapType || (PdfWordWrapType = {}));\n/**\n * public Enum for `PdfSubSuperScript`.\n * @private\n */\nexport var PdfSubSuperScript;\n(function (PdfSubSuperScript) {\n /**\n * Specifies the type of `None`.\n * @private\n */\n PdfSubSuperScript[PdfSubSuperScript[\"None\"] = 0] = \"None\";\n /**\n * Specifies the type of `SuperScript`.\n * @private\n */\n PdfSubSuperScript[PdfSubSuperScript[\"SuperScript\"] = 1] = \"SuperScript\";\n /**\n * Specifies the type of `SubScript`.\n * @private\n */\n PdfSubSuperScript[PdfSubSuperScript[\"SubScript\"] = 2] = \"SubScript\";\n})(PdfSubSuperScript || (PdfSubSuperScript = {}));\n/**\n * public Enum for `FontEncoding`.\n * @private\n */\nexport var FontEncoding;\n(function (FontEncoding) {\n /**\n * Specifies the type of `Unknown`.\n * @private\n */\n FontEncoding[FontEncoding[\"Unknown\"] = 0] = \"Unknown\";\n /**\n * Specifies the type of `StandardEncoding`.\n * @private\n */\n FontEncoding[FontEncoding[\"StandardEncoding\"] = 1] = \"StandardEncoding\";\n /**\n * Specifies the type of `MacRomanEncoding`.\n * @private\n */\n FontEncoding[FontEncoding[\"MacRomanEncoding\"] = 2] = \"MacRomanEncoding\";\n /**\n * Specifies the type of `MacExpertEncoding`.\n * @private\n */\n FontEncoding[FontEncoding[\"MacExpertEncoding\"] = 3] = \"MacExpertEncoding\";\n /**\n * Specifies the type of `WinAnsiEncoding`.\n * @private\n */\n FontEncoding[FontEncoding[\"WinAnsiEncoding\"] = 4] = \"WinAnsiEncoding\";\n /**\n * Specifies the type of `PdfDocEncoding`.\n * @private\n */\n FontEncoding[FontEncoding[\"PdfDocEncoding\"] = 5] = \"PdfDocEncoding\";\n /**\n * Specifies the type of `IdentityH`.\n * @private\n */\n FontEncoding[FontEncoding[\"IdentityH\"] = 6] = \"IdentityH\";\n})(FontEncoding || (FontEncoding = {}));\n/**\n * public Enum for `TtfCmapFormat`.\n * @private\n */\nexport var TtfCmapFormat;\n(function (TtfCmapFormat) {\n /**\n * This is the Apple standard character to glyph index mapping table.\n * @private\n */\n TtfCmapFormat[TtfCmapFormat[\"Apple\"] = 0] = \"Apple\";\n /**\n * This is the Microsoft standard character to glyph index mapping table.\n * @private\n */\n TtfCmapFormat[TtfCmapFormat[\"Microsoft\"] = 4] = \"Microsoft\";\n /**\n * Format 6: Trimmed table mapping.\n * @private\n */\n TtfCmapFormat[TtfCmapFormat[\"Trimmed\"] = 6] = \"Trimmed\";\n})(TtfCmapFormat || (TtfCmapFormat = {}));\n/**\n * Enumerator that implements CMAP encodings.\n * @private\n */\nexport var TtfCmapEncoding;\n(function (TtfCmapEncoding) {\n /**\n * Unknown encoding.\n * @private\n */\n TtfCmapEncoding[TtfCmapEncoding[\"Unknown\"] = 0] = \"Unknown\";\n /**\n * When building a symbol font for Windows.\n * @private\n */\n TtfCmapEncoding[TtfCmapEncoding[\"Symbol\"] = 1] = \"Symbol\";\n /**\n * When building a Unicode font for Windows.\n * @private\n */\n TtfCmapEncoding[TtfCmapEncoding[\"Unicode\"] = 2] = \"Unicode\";\n /**\n * For font that will be used on a Macintosh.\n * @private\n */\n TtfCmapEncoding[TtfCmapEncoding[\"Macintosh\"] = 3] = \"Macintosh\";\n})(TtfCmapEncoding || (TtfCmapEncoding = {}));\n/**\n * Ttf platform ID.\n * @private\n */\nexport var TtfPlatformID;\n(function (TtfPlatformID) {\n /**\n * Apple platform.\n * @private\n */\n TtfPlatformID[TtfPlatformID[\"AppleUnicode\"] = 0] = \"AppleUnicode\";\n /**\n * Macintosh platform.\n * @private\n */\n TtfPlatformID[TtfPlatformID[\"Macintosh\"] = 1] = \"Macintosh\";\n /**\n * Iso platform.\n * @private\n */\n TtfPlatformID[TtfPlatformID[\"Iso\"] = 2] = \"Iso\";\n /**\n * Microsoft platform.\n * @private\n */\n TtfPlatformID[TtfPlatformID[\"Microsoft\"] = 3] = \"Microsoft\";\n})(TtfPlatformID || (TtfPlatformID = {}));\n/**\n * Microsoft encoding ID.\n * @private\n */\nexport var TtfMicrosoftEncodingID;\n(function (TtfMicrosoftEncodingID) {\n /**\n * Undefined encoding.\n * @private\n */\n TtfMicrosoftEncodingID[TtfMicrosoftEncodingID[\"Undefined\"] = 0] = \"Undefined\";\n /**\n * Unicode encoding.\n * @private\n */\n TtfMicrosoftEncodingID[TtfMicrosoftEncodingID[\"Unicode\"] = 1] = \"Unicode\";\n})(TtfMicrosoftEncodingID || (TtfMicrosoftEncodingID = {}));\n/**\n * Macintosh encoding ID.\n * @private\n */\nexport var TtfMacintoshEncodingID;\n(function (TtfMacintoshEncodingID) {\n /**\n * Roman encoding.\n * @private\n */\n TtfMacintoshEncodingID[TtfMacintoshEncodingID[\"Roman\"] = 0] = \"Roman\";\n /**\n * Japanese encoding.\n * @private\n */\n TtfMacintoshEncodingID[TtfMacintoshEncodingID[\"Japanese\"] = 1] = \"Japanese\";\n /**\n * Chinese encoding.\n * @private\n */\n TtfMacintoshEncodingID[TtfMacintoshEncodingID[\"Chinese\"] = 2] = \"Chinese\";\n})(TtfMacintoshEncodingID || (TtfMacintoshEncodingID = {}));\n/**\n * Enumerator that implements font descriptor flags.\n * @private\n */\nexport var FontDescriptorFlags;\n(function (FontDescriptorFlags) {\n /**\n * All glyphs have the same width (as opposed to proportional or variable-pitch fonts, which have different widths).\n * @private\n */\n FontDescriptorFlags[FontDescriptorFlags[\"FixedPitch\"] = 1] = \"FixedPitch\";\n /**\n * Glyphs have serifs, which are short strokes drawn at an angle on the top and\n * bottom of glyph stems (as opposed to sans serif fonts, which do not).\n * @private\n */\n FontDescriptorFlags[FontDescriptorFlags[\"Serif\"] = 2] = \"Serif\";\n /**\n * Font contains glyphs outside the Adobe standard Latin character set. The\n * flag and the nonsymbolic flag cannot both be set or both be clear.\n * @private\n */\n FontDescriptorFlags[FontDescriptorFlags[\"Symbolic\"] = 4] = \"Symbolic\";\n /**\n * Glyphs resemble cursive handwriting.\n * @private\n */\n FontDescriptorFlags[FontDescriptorFlags[\"Script\"] = 8] = \"Script\";\n /**\n * Font uses the Adobe standard Latin character set or a subset of it.\n * @private\n */\n FontDescriptorFlags[FontDescriptorFlags[\"Nonsymbolic\"] = 32] = \"Nonsymbolic\";\n /**\n * Glyphs have dominant vertical strokes that are slanted.\n * @private\n */\n FontDescriptorFlags[FontDescriptorFlags[\"Italic\"] = 64] = \"Italic\";\n /**\n * Bold font.\n * @private\n */\n FontDescriptorFlags[FontDescriptorFlags[\"ForceBold\"] = 262144] = \"ForceBold\";\n})(FontDescriptorFlags || (FontDescriptorFlags = {}));\n/**\n * true type font composite glyph flags.\n * @private\n */\nexport var TtfCompositeGlyphFlags;\n(function (TtfCompositeGlyphFlags) {\n /**\n * The Arg1And2AreWords.\n * @private\n */\n TtfCompositeGlyphFlags[TtfCompositeGlyphFlags[\"Arg1And2AreWords\"] = 1] = \"Arg1And2AreWords\";\n /**\n * The ArgsAreXyValues.\n * @private\n */\n TtfCompositeGlyphFlags[TtfCompositeGlyphFlags[\"ArgsAreXyValues\"] = 2] = \"ArgsAreXyValues\";\n /**\n * The RoundXyToGrid.\n * @private\n */\n TtfCompositeGlyphFlags[TtfCompositeGlyphFlags[\"RoundXyToGrid\"] = 4] = \"RoundXyToGrid\";\n /**\n * The WeHaveScale.\n * @private\n */\n TtfCompositeGlyphFlags[TtfCompositeGlyphFlags[\"WeHaveScale\"] = 8] = \"WeHaveScale\";\n /**\n * The Reserved.\n * @private\n */\n TtfCompositeGlyphFlags[TtfCompositeGlyphFlags[\"Reserved\"] = 16] = \"Reserved\";\n /**\n * The MoreComponents.\n * @private\n */\n TtfCompositeGlyphFlags[TtfCompositeGlyphFlags[\"MoreComponents\"] = 32] = \"MoreComponents\";\n /**\n * The WeHaveAnXyScale.\n * @private\n */\n TtfCompositeGlyphFlags[TtfCompositeGlyphFlags[\"WeHaveAnXyScale\"] = 64] = \"WeHaveAnXyScale\";\n /**\n * The WeHaveTwoByTwo\n */\n TtfCompositeGlyphFlags[TtfCompositeGlyphFlags[\"WeHaveTwoByTwo\"] = 128] = \"WeHaveTwoByTwo\";\n /**\n * The WeHaveInstructions.\n */\n TtfCompositeGlyphFlags[TtfCompositeGlyphFlags[\"WeHaveInstructions\"] = 256] = \"WeHaveInstructions\";\n /**\n * The UseMyMetrics.\n */\n TtfCompositeGlyphFlags[TtfCompositeGlyphFlags[\"UseMyMetrics\"] = 512] = \"UseMyMetrics\";\n})(TtfCompositeGlyphFlags || (TtfCompositeGlyphFlags = {}));\n","import { ObjectStatus } from './../input-output/enum';\nimport { PdfDictionary } from './../primitives/pdf-dictionary';\nimport { DictionaryProperties } from './pdf-dictionary-properties';\nimport { Operators } from './pdf-operators';\nimport { Dictionary } from './../collections/dictionary';\nimport { PdfReference } from './../primitives/pdf-reference';\nimport { ObjectType } from './cross-table';\nimport { PdfStream } from './../primitives/pdf-stream';\nimport { PdfNumber } from './../primitives/pdf-number';\nimport { PdfCatalog } from './../document/pdf-catalog';\n/**\n * `PdfCrossTable` is responsible for intermediate level parsing\n * and savingof a PDF document.\n * @private\n */\nvar PdfCrossTable = /** @class */ (function () {\n function PdfCrossTable() {\n /**\n * The modified `objects` that should be saved.\n * @private\n */\n this.objects = new Dictionary();\n /**\n * Holds `maximal generation number` or offset to object.\n * @default 0\n * @private\n */\n this.maxGenNumIndex = 0;\n /**\n * The `number of the objects`.\n * @default 0\n * @private\n */\n this.objectCount = 0;\n /**\n * Internal variable for accessing fields from `DictionryProperties` class.\n * @default new PdfDictionaryProperties()\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n }\n Object.defineProperty(PdfCrossTable.prototype, \"isMerging\", {\n //Properties\n /**\n * Gets or sets if the document `is merged`.\n * @private\n */\n get: function () {\n return this.merging;\n },\n set: function (value) {\n this.merging = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfCrossTable.prototype, \"trailer\", {\n /**\n * Gets the `trailer`.\n * @private\n */\n get: function () {\n if (this.internalTrailer == null) {\n this.internalTrailer = new PdfStream();\n }\n return this.internalTrailer;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfCrossTable.prototype, \"document\", {\n /**\n * Gets or sets the main `PdfDocument` class instance.\n * @private\n */\n get: function () {\n return this.pdfDocument;\n },\n set: function (value) {\n this.pdfDocument = value;\n this.items = this.pdfDocument.pdfObjects;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfCrossTable.prototype, \"pdfObjects\", {\n /**\n * Gets the catched `PDF object` main collection.\n * @private\n */\n get: function () {\n return this.items;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfCrossTable.prototype, \"objectCollection\", {\n /**\n * Gets the `object collection`.\n * @private\n */\n get: function () {\n return this.pdfDocument.pdfObjects;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfCrossTable.prototype, \"count\", {\n /**\n * Gets or sets the `number of the objects` within the document.\n * @private\n */\n get: function () {\n return this.objectCount;\n },\n set: function (value) {\n this.objectCount = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfCrossTable.prototype, \"nextObjNumber\", {\n /**\n * Returns `next available object number`.\n * @private\n */\n get: function () {\n this.count = this.count + 1;\n return this.count;\n },\n enumerable: true,\n configurable: true\n });\n PdfCrossTable.prototype.save = function (writer, filename) {\n this.saveHead(writer);\n var state = false;\n this.mappedReferences = null;\n this.objects.clear();\n this.markTrailerReferences();\n this.saveObjects(writer);\n var saveCount = this.count;\n var xrefPos = writer.position;\n this.registerObject(0, new PdfReference(0, -1), true);\n var prevXRef = 0;\n writer.write(Operators.xref);\n writer.write(Operators.newLine);\n this.saveSections(writer);\n this.saveTrailer(writer, this.count, prevXRef);\n this.saveTheEndess(writer, xrefPos);\n this.count = saveCount;\n for (var i = 0; i < this.objectCollection.count; ++i) {\n var oi = this.objectCollection.items(i);\n oi.object.isSaving = false;\n }\n if (typeof filename === 'undefined') {\n return writer.stream.buffer;\n }\n else {\n writer.stream.save(filename);\n }\n };\n /**\n * `Saves the endess` of the file.\n * @private\n */\n PdfCrossTable.prototype.saveTheEndess = function (writer, xrefPos) {\n writer.write(Operators.newLine + Operators.startxref + Operators.newLine);\n writer.write(xrefPos.toString() + Operators.newLine);\n writer.write(Operators.eof + Operators.newLine);\n };\n /**\n * `Saves the new trailer` dictionary.\n * @private\n */\n PdfCrossTable.prototype.saveTrailer = function (writer, count, prevXRef) {\n writer.write(Operators.trailer + Operators.newLine);\n // Save the dictionary.\n var trailer = this.trailer;\n trailer.items.setValue(this.dictionaryProperties.size, new PdfNumber(this.objectCount + 1));\n trailer = new PdfDictionary(trailer); // Make it real dictionary.\n trailer.setEncrypt(false);\n trailer.save(writer);\n };\n /**\n * `Saves the xref section`.\n * @private\n */\n PdfCrossTable.prototype.saveSections = function (writer) {\n var objectNum = 0;\n var count = 0;\n do {\n count = this.prepareSubsection(objectNum);\n this.saveSubsection(writer, objectNum, count);\n objectNum += count;\n } while (count !== 0);\n };\n /**\n * `Saves a subsection`.\n * @private\n */\n PdfCrossTable.prototype.saveSubsection = function (writer, objectNum, count) {\n if (count <= 0 || objectNum >= this.count) {\n return;\n }\n var subsectionHead = '{0} {1}{2}';\n writer.write(objectNum + ' ' + (count + 1) + Operators.newLine);\n for (var i = objectNum; i <= objectNum + count; ++i) {\n var obj = this.objects.getValue(i);\n var str = '';\n if (obj.type === ObjectType.Free) {\n str = this.getItem(obj.offset, 65535, true);\n }\n else {\n str = this.getItem(obj.offset, obj.generation, false);\n }\n writer.write(str);\n }\n };\n /**\n * Generates string for `xref table item`.\n * @private\n */\n PdfCrossTable.prototype.getItem = function (offset, genNumber, isFree) {\n var returnString = '';\n var addOffsetLength = 10 - offset.toString().length;\n if (genNumber <= 0) {\n genNumber = 0;\n }\n var addGenNumberLength = (5 - genNumber.toString().length) <= 0 ? 0 : (5 - genNumber.toString().length);\n for (var index = 0; index < addOffsetLength; index++) {\n returnString = returnString + '0';\n }\n returnString = returnString + offset.toString() + ' ';\n for (var index = 0; index < addGenNumberLength; index++) {\n returnString = returnString + '0';\n }\n returnString = returnString + genNumber.toString() + ' ';\n returnString = returnString + ((isFree) ? Operators.f : Operators.n) + Operators.newLine;\n return returnString;\n };\n /**\n * `Prepares a subsection` of the current section within the cross-reference table.\n * @private\n */\n PdfCrossTable.prototype.prepareSubsection = function (objectNum) {\n var count = 0;\n var i;\n var total = this.count;\n for (var k = 0; k < this.document.pdfObjects.count; k++) {\n var reference = this.document.pdfObjects.items(k).reference;\n var refString = reference.toString();\n var refArray = refString.split(' ');\n }\n if (objectNum >= total) {\n return count;\n }\n // search for first changed indirect object.\n for (i = objectNum; i < total; ++i) {\n break;\n }\n objectNum = i;\n // look up for all indirect objects in one subsection.\n for (; i < total; ++i) {\n ++count;\n }\n return count;\n };\n /**\n * `Marks the trailer references` being saved.\n * @private\n */\n PdfCrossTable.prototype.markTrailerReferences = function () {\n var tempArray;\n var keys = this.trailer.items.keys();\n var values = this.trailer.items.values();\n };\n /**\n * `Saves the head`.\n * @private\n */\n PdfCrossTable.prototype.saveHead = function (writer) {\n var version = this.generateFileVersion(writer.document);\n writer.write('%PDF-' + version);\n writer.write(Operators.newLine);\n };\n /**\n * Generates the `version` of the file.\n * @private\n */\n PdfCrossTable.prototype.generateFileVersion = function (document) {\n var iVersion = 4;\n var version = '1.' + iVersion.toString();\n return version;\n };\n PdfCrossTable.prototype.getReference = function (obj, bNew) {\n if (typeof bNew === 'undefined') {\n var wasNew = false;\n return this.getReference(obj, wasNew);\n }\n else {\n //code splitted for reducing lines of code exceeds 100.\n return this.getSubReference(obj, bNew);\n }\n };\n /**\n * Retrieves the `reference` of the object given.\n * @private\n */\n PdfCrossTable.prototype.getSubReference = function (obj, bNew) {\n var isNew = false;\n var wasNew;\n var reference = null;\n // if (obj.IsSaving) {\n if (this.items.count > 0 && obj.objectCollectionIndex > 0 && this.items.count > obj.objectCollectionIndex - 1) {\n var tempObj = this.document.pdfObjects.getReference(obj, wasNew);\n reference = tempObj.reference;\n wasNew = tempObj.wasNew;\n }\n if (reference == null) {\n if (obj.status === ObjectStatus.Registered) {\n wasNew = false;\n }\n else {\n wasNew = true;\n }\n }\n else {\n wasNew = false;\n }\n // need to add mapped reference code\n if (reference == null) {\n var objnumber = this.nextObjNumber;\n reference = new PdfReference(objnumber, 0);\n var found = void 0;\n if (wasNew) {\n this.document.pdfObjects.add(obj);\n this.document.pdfObjects.trySetReference(obj, reference, found);\n var tempIndex = this.document.pdfObjects.count - 1;\n var tempkey = this.document.pdfObjects.objectCollections[tempIndex].reference.objNumber;\n var tempvalue = this.document.pdfObjects.objectCollections[this.document.pdfObjects.count - 1];\n this.document.pdfObjects.mainObjectCollection.setValue(tempkey, tempvalue);\n obj.position = -1;\n }\n else {\n this.document.pdfObjects.trySetReference(obj, reference, found);\n }\n obj.objectCollectionIndex = reference.objNumber;\n obj.status = ObjectStatus.None;\n isNew = true;\n }\n bNew = isNew || this.bForceNew;\n return reference;\n };\n /**\n * `Saves all objects` in the collection.\n * @private\n */\n PdfCrossTable.prototype.saveObjects = function (writer) {\n var objectCollection = this.objectCollection;\n for (var i = 0; i < objectCollection.count; ++i) {\n var oi = objectCollection.items(i);\n var obj = oi.object;\n obj.isSaving = true;\n this.saveIndirectObject(obj, writer);\n }\n };\n /**\n * `Saves indirect object`.\n * @private\n */\n PdfCrossTable.prototype.saveIndirectObject = function (obj, writer) {\n var reference = this.getReference(obj);\n if (obj instanceof PdfCatalog) {\n this.trailer.items.setValue(this.dictionaryProperties.root, reference);\n }\n // NOTE : This is needed for correct string objects encryption.\n this.pdfDocument.currentSavingObj = reference;\n var tempArchive = false;\n tempArchive = obj.getArchive();\n var allowedType = !((obj instanceof PdfStream) || !tempArchive || (obj instanceof PdfCatalog));\n var sigFlag = false;\n this.registerObject(writer.position, reference);\n this.doSaveObject(obj, reference, writer);\n };\n /**\n * Performs `real saving` of the save object.\n * @private\n */\n PdfCrossTable.prototype.doSaveObject = function (obj, reference, writer) {\n var correctPosition = writer.length;\n writer.write(reference.objNumber.toString());\n writer.write(Operators.whiteSpace);\n writer.write(reference.genNumber.toString());\n writer.write(Operators.whiteSpace);\n writer.write(Operators.obj);\n writer.write(Operators.newLine);\n obj.save(writer);\n var stream = writer.stream;\n writer.write(Operators.endObj);\n writer.write(Operators.newLine);\n };\n PdfCrossTable.prototype.registerObject = function (offset, reference, free) {\n if (typeof free === 'boolean') {\n // Register the object by its number.\n this.objects.setValue(reference.objNumber, new RegisteredObject(offset, reference, free));\n this.maxGenNumIndex = Math.max(this.maxGenNumIndex, reference.genNumber);\n }\n else if (typeof free === 'undefined') {\n // Register the object by its number.\n this.objects.setValue(reference.objNumber, new RegisteredObject(offset, reference));\n this.maxGenNumIndex = Math.max(this.maxGenNumIndex, reference.genNumber);\n }\n };\n /**\n * `Dereferences` the specified primitive object.\n * @private\n */\n PdfCrossTable.dereference = function (obj) {\n var rh = obj;\n if (rh != null) {\n obj = rh.object;\n }\n return obj;\n };\n return PdfCrossTable;\n}());\nexport { PdfCrossTable };\nvar RegisteredObject = /** @class */ (function () {\n function RegisteredObject(offset, reference, free) {\n var tempOffset = offset;\n this.offsetNumber = tempOffset;\n var tempReference = reference;\n this.generation = tempReference.genNumber;\n this.object = tempReference.objNumber;\n if (typeof free === 'undefined') {\n this.type = ObjectType.Normal;\n }\n else {\n this.type = ObjectType.Free;\n }\n }\n Object.defineProperty(RegisteredObject.prototype, \"objectNumber\", {\n //Properties\n /**\n * Gets the `object number`.\n * @private\n */\n get: function () {\n return this.object;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RegisteredObject.prototype, \"offset\", {\n /**\n * Gets the `offset`.\n * @private\n */\n get: function () {\n var result;\n result = this.offsetNumber;\n return result;\n },\n enumerable: true,\n configurable: true\n });\n return RegisteredObject;\n}());\nexport { RegisteredObject };\n","/**\n * Coordinates of Position for `PointF`.\n * @private\n */\nvar PointF = /** @class */ (function () {\n function PointF(x, y) {\n if (typeof x === 'undefined') {\n this.x = 0;\n this.y = 0;\n }\n else {\n if (x !== null) {\n this.x = x;\n }\n else {\n this.x = 0;\n }\n if (y !== null) {\n this.y = y;\n }\n else {\n this.y = 0;\n }\n }\n }\n return PointF;\n}());\nexport { PointF };\n/**\n * Width and Height as `Size`.\n * @private\n */\nvar SizeF = /** @class */ (function () {\n function SizeF(width, height) {\n if (typeof height === 'undefined') {\n this.height = 0;\n this.width = 0;\n }\n else {\n if (height !== null) {\n this.height = height;\n }\n else {\n this.height = 0;\n }\n if (width !== null) {\n this.width = width;\n }\n else {\n this.width = 0;\n }\n }\n }\n return SizeF;\n}());\nexport { SizeF };\n/**\n * `RectangleF` with Position and size.\n * @private\n */\nvar RectangleF = /** @class */ (function () {\n function RectangleF(arg1, arg2, arg3, arg4) {\n if (typeof arg1 === typeof arg1 && typeof arg1 === 'undefined') {\n this.x = 0;\n this.y = 0;\n this.height = 0;\n this.width = 0;\n }\n else {\n if (arg1 instanceof PointF && arg2 instanceof SizeF && typeof arg3 === 'undefined') {\n var pointf = arg1;\n this.x = pointf.x;\n this.y = pointf.y;\n var sizef = arg2;\n this.height = sizef.height;\n this.width = sizef.width;\n }\n else {\n var x = arg1;\n var y = arg2;\n var width = arg3;\n var height = arg4;\n this.x = x;\n this.y = y;\n this.height = height;\n this.width = width;\n }\n }\n }\n return RectangleF;\n}());\nexport { RectangleF };\n/**\n * `Rectangle` with left, right, top and bottom.\n * @private\n */\nvar Rectangle = /** @class */ (function () {\n /**\n * Instance of `RectangleF` class with X, Y, Width and Height.\n * @private\n */\n function Rectangle(left, top, right, bottom) {\n this.left = left;\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n }\n Object.defineProperty(Rectangle.prototype, \"width\", {\n /**\n * Gets a value of width\n */\n get: function () {\n return this.right - this.left;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"height\", {\n /**\n * Gets a value of height\n */\n get: function () {\n return this.bottom - this.top;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"topLeft\", {\n /**\n * Gets a value of Top and Left\n */\n get: function () {\n return new PointF(this.left, this.top);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"size\", {\n /**\n * Gets a value of size\n */\n get: function () {\n return new SizeF(this.width, this.height);\n },\n enumerable: true,\n configurable: true\n });\n Rectangle.prototype.toString = function () {\n return this.topLeft + 'x' + this.size;\n };\n return Rectangle;\n}());\nexport { Rectangle };\n","/**\n * PdfPageSize.ts class for EJ2-PDF\n */\nimport { SizeF } from './../drawing/pdf-drawing';\n/**\n * Represents information about various predefined `page sizes`.\n */\nvar PdfPageSize = /** @class */ (function () {\n //constructor\n /**\n * Initialize an instance for `PdfPageSize` class.\n * @private\n */\n function PdfPageSize() {\n // \n }\n /**\n * Specifies the size of `letter`.\n * @private\n */\n PdfPageSize.letter = new SizeF(612, 792);\n /**\n * Specifies the size of `note`.\n * @private\n */\n PdfPageSize.note = new SizeF(540, 720);\n /**\n * Specifies the size of `legal`.\n * @private\n */\n PdfPageSize.legal = new SizeF(612, 1008);\n /**\n * Specifies the size of `a0`.\n * @private\n */\n PdfPageSize.a0 = new SizeF(2380, 3368);\n /**\n * Specifies the size of `a1`.\n * @private\n */\n PdfPageSize.a1 = new SizeF(1684, 2380);\n /**\n * Specifies the size of `a2`.\n * @private\n */\n PdfPageSize.a2 = new SizeF(1190, 1684);\n /**\n * Specifies the size of `a3`.\n * @private\n */\n PdfPageSize.a3 = new SizeF(842, 1190);\n /**\n * Specifies the size of `a4`.\n * @private\n */\n PdfPageSize.a4 = new SizeF(595, 842);\n /**\n * Specifies the size of `a5`.\n * @private\n */\n PdfPageSize.a5 = new SizeF(421, 595);\n /**\n * Specifies the size of `a6`.\n * @private\n */\n PdfPageSize.a6 = new SizeF(297, 421);\n /**\n * Specifies the size of `a7`.\n * @private\n */\n PdfPageSize.a7 = new SizeF(210, 297);\n /**\n * Specifies the size of `a8`.\n * @private\n */\n PdfPageSize.a8 = new SizeF(148, 210);\n /**\n * Specifies the size of `a9`.\n * @private\n */\n PdfPageSize.a9 = new SizeF(105, 148);\n /**\n * Specifies the size of `a10`.\n * @private\n */\n PdfPageSize.a10 = new SizeF(74, 105);\n /**\n * Specifies the size of `b0`.\n * @private\n */\n PdfPageSize.b0 = new SizeF(2836, 4008);\n /**\n * Specifies the size of `b1`.\n * @private\n */\n PdfPageSize.b1 = new SizeF(2004, 2836);\n /**\n * Specifies the size of `b2`.\n * @private\n */\n PdfPageSize.b2 = new SizeF(1418, 2004);\n /**\n * Specifies the size of `b3`.\n * @private\n */\n PdfPageSize.b3 = new SizeF(1002, 1418);\n /**\n * Specifies the size of `b4`.\n * @private\n */\n PdfPageSize.b4 = new SizeF(709, 1002);\n /**\n * Specifies the size of `b5`.\n * @private\n */\n PdfPageSize.b5 = new SizeF(501, 709);\n /**\n * Specifies the size of `archE`.\n * @private\n */\n PdfPageSize.archE = new SizeF(2592, 3456);\n /**\n * Specifies the size of `archD`.\n * @private\n */\n PdfPageSize.archD = new SizeF(1728, 2592);\n /**\n * Specifies the size of `archC`.\n * @private\n */\n PdfPageSize.archC = new SizeF(1296, 1728);\n /**\n * Specifies the size of `archB`.\n * @private\n */\n PdfPageSize.archB = new SizeF(864, 1296);\n /**\n * Specifies the size of `archA`.\n * @private\n */\n PdfPageSize.archA = new SizeF(648, 864);\n /**\n * Specifies the size of `flsa`.\n * @private\n */\n PdfPageSize.flsa = new SizeF(612, 936);\n /**\n * Specifies the size of `halfLetter`.\n * @private\n */\n PdfPageSize.halfLetter = new SizeF(396, 612);\n /**\n * Specifies the size of `letter11x17`.\n * @private\n */\n PdfPageSize.letter11x17 = new SizeF(792, 1224);\n /**\n * Specifies the size of `ledger`.\n * @private\n */\n PdfPageSize.ledger = new SizeF(1224, 792);\n return PdfPageSize;\n}());\nexport { PdfPageSize };\n","/**\n * PdfMargins.ts class for EJ2-PDF\n * A class representing PDF page margins.\n */\nvar PdfMargins = /** @class */ (function () {\n /**\n * Initializes a new instance of the `PdfMargins` class.\n * @private\n */\n function PdfMargins() {\n /**\n * Represents the `Default Page Margin` value.\n * @default 0.0\n * @private\n */\n this.pdfMargin = 40.0;\n this.setMargins(this.pdfMargin);\n }\n Object.defineProperty(PdfMargins.prototype, \"left\", {\n //Properties\n /**\n * Gets or sets the `left margin` size.\n * @private\n */\n get: function () {\n return this.leftMargin;\n },\n set: function (value) {\n this.leftMargin = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfMargins.prototype, \"top\", {\n /**\n * Gets or sets the `top margin` size.\n * @private\n */\n get: function () {\n return this.topMargin;\n },\n set: function (value) {\n this.topMargin = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfMargins.prototype, \"right\", {\n /**\n * Gets or sets the `right margin` size.\n * @private\n */\n get: function () {\n return this.rightMargin;\n },\n set: function (value) {\n this.rightMargin = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfMargins.prototype, \"bottom\", {\n /**\n * Gets or sets the `bottom margin` size.\n * @private\n */\n get: function () {\n return this.bottomMargin;\n },\n set: function (value) {\n this.bottomMargin = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfMargins.prototype, \"all\", {\n /**\n * Sets the `margins`.\n * @private\n */\n set: function (value) {\n this.setMargins(value);\n },\n enumerable: true,\n configurable: true\n });\n PdfMargins.prototype.setMargins = function (margin1, margin2, margin3, margin4) {\n if (typeof margin2 === 'undefined') {\n this.leftMargin = this.topMargin = this.rightMargin = this.bottomMargin = margin1;\n }\n else {\n if (typeof margin3 === 'undefined') {\n this.leftMargin = this.rightMargin = margin1;\n this.bottomMargin = this.topMargin = margin2;\n }\n else {\n this.leftMargin = margin1;\n this.topMargin = margin2;\n this.rightMargin = margin3;\n this.bottomMargin = margin4;\n }\n }\n };\n /**\n * `Clones` the object.\n * @private\n */\n PdfMargins.prototype.clone = function () {\n return this;\n };\n return PdfMargins;\n}());\nexport { PdfMargins };\n","/**\n * PdfPageSettings.ts class for EJ2-PDF\n */\nimport { SizeF, PointF } from './../drawing/pdf-drawing';\nimport { PdfPageSize } from './pdf-page-size';\nimport { PdfPageRotateAngle, PdfPageOrientation } from './enum';\nimport { PdfMargins } from './../graphics/pdf-margins';\n/**\n * The class provides various `setting` related with PDF pages.\n */\nvar PdfPageSettings = /** @class */ (function () {\n function PdfPageSettings(margins) {\n //Fields\n /**\n * The page `margins`.\n * @private\n */\n this.pageMargins = new PdfMargins();\n /**\n * The page `size`.\n * @default a4\n * @private\n */\n this.pageSize = PdfPageSize.a4;\n /**\n * The page `rotation angle`.\n * @default PdfPageRotateAngle.RotateAngle0\n * @private\n */\n this.rotateAngle = PdfPageRotateAngle.RotateAngle0;\n /**\n * The page `orientation`.\n * @default PdfPageOrientation.Portrait\n * @private\n */\n this.pageOrientation = PdfPageOrientation.Portrait;\n /**\n * The page `origin`.\n * @default 0,0\n * @private\n */\n this.pageOrigin = new PointF(0, 0);\n /**\n * Checks the Whether the `rotation` is applied or not.\n * @default false\n * @private\n */\n this.isRotation = false;\n if (typeof margins === 'number') {\n this.pageMargins.setMargins(margins);\n }\n }\n Object.defineProperty(PdfPageSettings.prototype, \"size\", {\n //Properties\n /**\n * Gets or sets the `size` of the page.\n * @private\n */\n get: function () {\n return this.pageSize;\n },\n set: function (value) {\n this.setSize(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageSettings.prototype, \"orientation\", {\n /**\n * Gets or sets the page `orientation`.\n * @private\n */\n get: function () {\n return this.pageOrientation;\n },\n set: function (orientation) {\n if (this.pageOrientation !== orientation) {\n this.pageOrientation = orientation;\n this.updateSize(orientation);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageSettings.prototype, \"margins\", {\n /**\n * Gets or sets the `margins` of the page.\n * @private\n */\n get: function () {\n return this.pageMargins;\n },\n set: function (value) {\n this.pageMargins = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageSettings.prototype, \"width\", {\n /**\n * Gets or sets the `width` of the page.\n * @private\n */\n get: function () {\n return this.pageSize.width;\n },\n set: function (value) {\n this.pageSize.width = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageSettings.prototype, \"height\", {\n /**\n * Gets or sets the `height` of the page.\n * @private\n */\n get: function () {\n return this.pageSize.height;\n },\n set: function (value) {\n this.pageSize.height = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageSettings.prototype, \"origin\", {\n /**\n * Gets or sets the `origin` of the page.\n * @private\n */\n get: function () {\n return this.pageOrigin;\n },\n set: function (value) {\n this.pageOrigin = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageSettings.prototype, \"rotate\", {\n /**\n * Gets or sets the number of degrees by which the page should be `rotated` clockwise when displayed or printed.\n * @private\n */\n get: function () {\n return this.rotateAngle;\n },\n set: function (value) {\n this.rotateAngle = value;\n this.isRotation = true;\n },\n enumerable: true,\n configurable: true\n });\n //Methods\n /**\n * `Update page size` depending on orientation.\n * @private\n */\n PdfPageSettings.prototype.updateSize = function (orientation) {\n var min = Math.min(this.pageSize.width, this.pageSize.height);\n var max = Math.max(this.pageSize.width, this.pageSize.height);\n switch (orientation) {\n case PdfPageOrientation.Portrait:\n this.pageSize = new SizeF(min, max);\n break;\n case PdfPageOrientation.Landscape:\n this.pageSize = new SizeF(max, min);\n break;\n }\n };\n /**\n * Creates a `clone` of the object.\n * @private\n */\n PdfPageSettings.prototype.clone = function () {\n var settings = this;\n settings.pageMargins = this.pageMargins.clone();\n // if (GetTransition() != null)\n // {\n // settings.Transition = (PdfPageTransition)Transition.clone();\n // }\n return settings;\n };\n /**\n * Returns `size`, shrinked by the margins.\n * @private\n */\n PdfPageSettings.prototype.getActualSize = function () {\n var width = this.width - (this.margins.left + this.margins.right);\n var height = this.height - (this.margins.top + this.margins.bottom);\n var size = new SizeF(width, height);\n return size;\n };\n /**\n * Sets `size` to the page aaccording to the orientation.\n * @private\n */\n PdfPageSettings.prototype.setSize = function (size) {\n var min = Math.min(size.width, size.height);\n var max = Math.max(size.width, size.height);\n if (this.orientation === PdfPageOrientation.Portrait) {\n this.pageSize = new SizeF(min, max);\n }\n else {\n this.pageSize = new SizeF(max, min);\n }\n };\n return PdfPageSettings;\n}());\nexport { PdfPageSettings };\n","import { Operators } from './pdf-operators';\nimport { PdfNumber } from './../primitives/pdf-number';\nimport { PointF, RectangleF } from './../drawing/pdf-drawing';\nimport { PdfString } from './../primitives/pdf-string';\nimport { PdfName } from './../primitives/pdf-name';\n/**\n * Helper class to `write PDF graphic streams` easily.\n * @private\n */\nvar PdfStreamWriter = /** @class */ (function () {\n /**\n * Initialize an instance of `PdfStreamWriter` class.\n * @private\n */\n function PdfStreamWriter(stream) {\n if (stream == null) {\n throw new Error('ArgumentNullException:stream');\n }\n this.stream = stream;\n }\n //Implementation\n /**\n * `Clear` the stream.\n * @public\n */\n PdfStreamWriter.prototype.clear = function () {\n this.stream.clearStream();\n };\n PdfStreamWriter.prototype.setGraphicsState = function (dictionaryName) {\n if (dictionaryName instanceof PdfName) {\n this.stream.write(dictionaryName.toString());\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setGraphicsState);\n }\n else {\n this.stream.write(Operators.slash);\n this.stream.write(dictionaryName);\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setGraphicsState);\n }\n };\n /**\n * `Executes the XObject`.\n * @private\n */\n PdfStreamWriter.prototype.executeObject = function (name) {\n this.stream.write(name.toString());\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.paintXObject);\n this.stream.write(Operators.newLine);\n };\n /**\n * `Closes path object`.\n * @private\n */\n PdfStreamWriter.prototype.closePath = function () {\n this.writeOperator(Operators.closePath);\n };\n /**\n * `Clips the path`.\n * @private\n */\n PdfStreamWriter.prototype.clipPath = function (useEvenOddRule) {\n this.stream.write(Operators.clipPath);\n if (useEvenOddRule) {\n this.stream.write(Operators.evenOdd);\n }\n this.stream.write(Operators.whiteSpace);\n this.stream.write(Operators.endPath);\n this.stream.write(Operators.newLine);\n };\n /**\n * `Closes, then fills and strokes the path`.\n * @private\n */\n PdfStreamWriter.prototype.closeFillStrokePath = function (useEvenOddRule) {\n this.stream.write(Operators.closeFillStrokePath);\n if (useEvenOddRule) {\n this.stream.write(Operators.evenOdd);\n this.stream.write(Operators.newLine);\n }\n else {\n this.stream.write(Operators.newLine);\n }\n };\n /**\n * `Fills and strokes path`.\n * @private\n */\n PdfStreamWriter.prototype.fillStrokePath = function (useEvenOddRule) {\n this.stream.write(Operators.fillStroke);\n if (useEvenOddRule) {\n this.stream.write(Operators.evenOdd);\n this.stream.write(Operators.newLine);\n }\n else {\n this.stream.write(Operators.newLine);\n }\n };\n /**\n * `Fills path`.\n * @private\n */\n PdfStreamWriter.prototype.fillPath = function (useEvenOddRule) {\n this.stream.write(Operators.fill);\n if (useEvenOddRule) {\n this.stream.write(Operators.evenOdd);\n this.stream.write(Operators.newLine);\n }\n else {\n this.stream.write(Operators.newLine);\n }\n };\n /**\n * `Ends the path`.\n * @private\n */\n PdfStreamWriter.prototype.endPath = function () {\n this.writeOperator(Operators.n);\n };\n /**\n * `Closes and fills the path`.\n * @private\n */\n PdfStreamWriter.prototype.closeFillPath = function (useEvenOddRule) {\n this.writeOperator(Operators.closePath);\n this.stream.write(Operators.fill);\n if (useEvenOddRule) {\n this.stream.write(Operators.evenOdd);\n this.stream.write(Operators.newLine);\n }\n else {\n this.stream.write(Operators.newLine);\n }\n };\n /**\n * `Closes and strokes the path`.\n * @private\n */\n PdfStreamWriter.prototype.closeStrokePath = function () {\n this.writeOperator(Operators.closeStrokePath);\n };\n /**\n * `Sets the text scaling`.\n * @private\n */\n PdfStreamWriter.prototype.setTextScaling = function (textScaling) {\n this.stream.write(PdfNumber.floatToString(textScaling));\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setTextScaling);\n };\n /**\n * `Strokes path`.\n * @private\n */\n PdfStreamWriter.prototype.strokePath = function () {\n this.writeOperator(Operators.stroke);\n };\n /**\n * `Restores` the graphics state.\n * @private\n */\n PdfStreamWriter.prototype.restoreGraphicsState = function () {\n this.writeOperator(Operators.restoreState);\n };\n /**\n * `Saves` the graphics state.\n * @private\n */\n PdfStreamWriter.prototype.saveGraphicsState = function () {\n this.writeOperator(Operators.saveState);\n };\n PdfStreamWriter.prototype.startNextLine = function (arg1, arg2) {\n if (typeof arg1 === 'undefined') {\n this.writeOperator(Operators.goToNextLine);\n }\n else if (arg1 instanceof PointF) {\n this.writePoint(arg1);\n this.writeOperator(Operators.setCoords);\n }\n else {\n this.writePoint(arg1, arg2);\n this.writeOperator(Operators.setCoords);\n }\n };\n /**\n * Shows the `text`.\n * @private\n */\n PdfStreamWriter.prototype.showText = function (text) {\n this.checkTextParam(text);\n this.writeText(text);\n this.writeOperator(Operators.setText);\n };\n /**\n * Sets `text leading`.\n * @private\n */\n PdfStreamWriter.prototype.setLeading = function (leading) {\n this.stream.write(PdfNumber.floatToString(leading));\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setTextLeading);\n };\n /**\n * `Begins the path`.\n * @private\n */\n PdfStreamWriter.prototype.beginPath = function (x, y) {\n this.writePoint(x, y);\n this.writeOperator(Operators.beginPath);\n };\n /**\n * `Begins text`.\n * @private\n */\n PdfStreamWriter.prototype.beginText = function () {\n this.writeOperator(Operators.beginText);\n };\n /**\n * `Ends text`.\n * @private\n */\n PdfStreamWriter.prototype.endText = function () {\n this.writeOperator(Operators.endText);\n };\n PdfStreamWriter.prototype.appendRectangle = function (arg1, arg2, arg3, arg4) {\n if (arg1 instanceof RectangleF) {\n this.appendRectangle(arg1.x, arg1.y, arg1.width, arg1.height);\n }\n else {\n this.writePoint(arg1, arg2);\n this.writePoint(arg3, arg4);\n this.writeOperator(Operators.appendRectangle);\n }\n };\n PdfStreamWriter.prototype.appendLineSegment = function (arg1, arg2) {\n if (arg1 instanceof PointF) {\n this.appendLineSegment(arg1.x, arg1.y);\n }\n else {\n this.writePoint(arg1, arg2);\n this.writeOperator(Operators.appendLineSegment);\n }\n };\n /**\n * Sets the `text rendering mode`.\n * @private\n */\n PdfStreamWriter.prototype.setTextRenderingMode = function (renderingMode) {\n this.stream.write(renderingMode.toString());\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setRenderingMode);\n };\n /**\n * Sets the `character spacing`.\n * @private\n */\n PdfStreamWriter.prototype.setCharacterSpacing = function (charSpacing) {\n this.stream.write(PdfNumber.floatToString(charSpacing));\n this.stream.write(Operators.whiteSpace);\n this.stream.write(Operators.setCharacterSpace);\n this.stream.write(Operators.newLine);\n };\n /**\n * Sets the `word spacing`.\n * @private\n */\n PdfStreamWriter.prototype.setWordSpacing = function (wordSpacing) {\n this.stream.write(PdfNumber.floatToString(wordSpacing));\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setWordSpace);\n };\n PdfStreamWriter.prototype.showNextLineText = function (arg1, arg2) {\n if (arg1 instanceof PdfString) {\n this.checkTextParam(arg1);\n this.writeText(arg1);\n this.writeOperator(Operators.setTextOnNewLine);\n }\n else {\n this.checkTextParam(arg1);\n this.writeText(arg1, arg2);\n this.writeOperator(Operators.setTextOnNewLine);\n }\n };\n PdfStreamWriter.prototype.setColorSpace = function (arg1, arg2) {\n if (arg1 instanceof PdfName && typeof arg2 === 'boolean') {\n var temparg1 = arg1;\n var temparg2 = arg2;\n // if (temparg1 == null) {\n // throw new Error('ArgumentNullException:name');\n // }\n var op = (temparg2) ? Operators.selectcolorspaceforstroking : Operators.selectcolorspacefornonstroking;\n this.stream.write(temparg1.toString());\n this.stream.write(Operators.whiteSpace);\n this.stream.write(op);\n this.stream.write(Operators.newLine);\n }\n else {\n var temparg1 = arg1;\n var temparg2 = arg2;\n this.setColorSpace(new PdfName(temparg1), temparg2);\n }\n };\n /**\n * Modifies current `transformation matrix`.\n * @private\n */\n PdfStreamWriter.prototype.modifyCtm = function (matrix) {\n if (matrix == null) {\n throw new Error('ArgumentNullException:matrix');\n }\n this.stream.write(matrix.toString());\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.modifyCtm);\n };\n PdfStreamWriter.prototype.setFont = function (font, name, size) {\n if (typeof name === 'string') {\n this.setFont(font, new PdfName(name), size);\n }\n else {\n if (font == null) {\n throw new Error('ArgumentNullException:font');\n }\n this.stream.write(name.toString());\n this.stream.write(Operators.whiteSpace);\n this.stream.write(PdfNumber.floatToString(size));\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setFont);\n }\n };\n /**\n * `Writes the operator`.\n * @private\n */\n PdfStreamWriter.prototype.writeOperator = function (opcode) {\n this.stream.write(opcode);\n this.stream.write(Operators.newLine);\n };\n PdfStreamWriter.prototype.checkTextParam = function (text) {\n if (text == null) {\n throw new Error('ArgumentNullException:text');\n }\n if (typeof text === 'string' && text === '') {\n throw new Error('ArgumentException:The text can not be an empty string, text');\n }\n };\n PdfStreamWriter.prototype.writeText = function (arg1, arg2) {\n if ((arg1 instanceof PdfString) && (typeof arg2 === 'undefined')) {\n this.stream.write(arg1.pdfEncode());\n }\n else {\n var start = void 0;\n var end = void 0;\n if (arg2) {\n start = PdfString.hexStringMark[0];\n end = PdfString.hexStringMark[1];\n }\n else {\n start = PdfString.stringMark[0];\n end = PdfString.stringMark[1];\n }\n this.stream.write(start);\n this.stream.write(arg1);\n this.stream.write(end);\n }\n };\n PdfStreamWriter.prototype.writePoint = function (arg1, arg2) {\n if ((arg1 instanceof PointF) && (typeof arg2 === 'undefined')) {\n this.writePoint(arg1.x, arg1.y);\n }\n else {\n var temparg1 = arg1;\n this.stream.write(PdfNumber.floatToString(temparg1));\n this.stream.write(Operators.whiteSpace);\n // NOTE: Change Y co-ordinate because we shifted co-ordinate system only.\n arg2 = this.updateY(arg2);\n this.stream.write(PdfNumber.floatToString(arg2));\n this.stream.write(Operators.whiteSpace);\n }\n };\n /**\n * `Updates y` co-ordinate.\n * @private\n */\n PdfStreamWriter.prototype.updateY = function (arg) {\n return -arg;\n };\n /**\n * `Writes string` to the file.\n * @private\n */\n PdfStreamWriter.prototype.write = function (string) {\n var builder = '';\n builder += string;\n builder += Operators.newLine;\n this.writeOperator(builder);\n };\n /**\n * `Writes comment` to the file.\n * @private\n */\n PdfStreamWriter.prototype.writeComment = function (comment) {\n if (comment != null && comment.length > 0) {\n var builder = '';\n builder += Operators.comment;\n builder += Operators.whiteSpace;\n builder += comment;\n //builder.Append( Operators.NewLine );\n this.writeOperator(builder);\n }\n else {\n throw new Error('Invalid comment');\n }\n };\n /**\n * Sets the `color and space`.\n * @private\n */\n PdfStreamWriter.prototype.setColorAndSpace = function (color, colorSpace, forStroking) {\n if (!color.isEmpty) {\n // bool test = color is PdfExtendedColor;\n this.stream.write(color.toString(colorSpace, forStroking));\n this.stream.write(Operators.newLine);\n }\n };\n // public setLineDashPattern(pattern : number[], patternOffset : number) : void\n // {\n // let pat : PdfArray = new PdfArray(pattern);\n // let off : PdfNumber = new PdfNumber(patternOffset);\n // this.setLineDashPatternHelper(pat, off);\n // }\n // private setLineDashPatternHelper(pattern : PdfArray, patternOffset : PdfNumber) : void\n // {\n // pattern.Save(this);\n // this.m_stream.write(Operators.whiteSpace);\n // patternOffset.Save(this);\n // this.m_stream.write(Operators.whiteSpace);\n // this.writeOperator(Operators.setDashPattern);\n // }\n /**\n * Sets the `line dash pattern`.\n * @private\n */\n PdfStreamWriter.prototype.setLineDashPattern = function (pattern, patternOffset) {\n // let pat : PdfArray = new PdfArray(pattern);\n // let off : PdfNumber = new PdfNumber(patternOffset);\n // this.setLineDashPatternHelper(pat, off);\n this.setLineDashPatternHelper(pattern, patternOffset);\n };\n /**\n * Sets the `line dash pattern`.\n * @private\n */\n PdfStreamWriter.prototype.setLineDashPatternHelper = function (pattern, patternOffset) {\n var tempPattern = '[';\n if (pattern.length > 1) {\n for (var index = 0; index < pattern.length; index++) {\n if (index === pattern.length - 1) {\n tempPattern += pattern[index].toString();\n }\n else {\n tempPattern += pattern[index].toString() + ' ';\n }\n }\n }\n tempPattern += '] ';\n tempPattern += patternOffset.toString();\n tempPattern += ' ' + Operators.setDashPattern;\n this.stream.write(tempPattern);\n this.stream.write(Operators.newLine);\n };\n /**\n * Sets the `miter limit`.\n * @private\n */\n PdfStreamWriter.prototype.setMiterLimit = function (miterLimit) {\n this.stream.write(PdfNumber.floatToString(miterLimit));\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setMiterLimit);\n };\n /**\n * Sets the `width of the line`.\n * @private\n */\n PdfStreamWriter.prototype.setLineWidth = function (width) {\n this.stream.write(PdfNumber.floatToString(width));\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setLineWidth);\n };\n /**\n * Sets the `line cap`.\n * @private\n */\n PdfStreamWriter.prototype.setLineCap = function (lineCapStyle) {\n this.stream.write((lineCapStyle).toString());\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setLineCapStyle);\n };\n /**\n * Sets the `line join`.\n * @private\n */\n PdfStreamWriter.prototype.setLineJoin = function (lineJoinStyle) {\n this.stream.write((lineJoinStyle).toString());\n this.stream.write(Operators.whiteSpace);\n this.writeOperator(Operators.setLineJoinStyle);\n };\n Object.defineProperty(PdfStreamWriter.prototype, \"position\", {\n //IPdfWriter members\n /**\n * Gets or sets the current `position` within the stream.\n * @private\n */\n get: function () {\n return this.stream.position;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStreamWriter.prototype, \"length\", {\n /**\n * Gets `stream length`.\n * @private\n */\n get: function () {\n var returnValue = 0;\n if (this.stream.data.length !== 0 && this.stream.data.length !== -1) {\n for (var index = 0; index < this.stream.data.length; index++) {\n returnValue += this.stream.data[index].length;\n }\n }\n return returnValue;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStreamWriter.prototype, \"document\", {\n /**\n * Gets and Sets the `current document`.\n * @private\n */\n get: function () {\n return null;\n },\n enumerable: true,\n configurable: true\n });\n /* tslint:disable-next-line:max-line-length */\n PdfStreamWriter.prototype.appendBezierSegment = function (arg1, arg2, arg3, arg4, arg5, arg6) {\n if (arg1 instanceof PointF && arg2 instanceof PointF && arg3 instanceof PointF) {\n this.writePoint(arg1.x, arg1.y);\n this.writePoint(arg2.x, arg2.y);\n this.writePoint(arg3.x, arg3.y);\n }\n else {\n this.writePoint(arg1, arg2);\n this.writePoint(arg3, arg4);\n this.writePoint(arg5, arg6);\n }\n this.writeOperator(Operators.appendbeziercurve);\n };\n PdfStreamWriter.prototype.setColourWithPattern = function (colours, patternName, forStroking) {\n if ((colours != null)) {\n var count = colours.length;\n var i = 0;\n for (i = 0; i < count; ++i) {\n this.stream.write(colours[i].toString());\n this.stream.write(Operators.whiteSpace);\n }\n }\n if ((patternName != null)) {\n this.stream.write(patternName.toString());\n this.stream.write(Operators.whiteSpace);\n }\n if (forStroking) {\n this.writeOperator(Operators.setColorAndPatternStroking);\n }\n else {\n this.writeOperator(Operators.setColorAndPattern);\n }\n };\n return PdfStreamWriter;\n}());\nexport { PdfStreamWriter };\n","import { SizeF, RectangleF, PointF } from './../../drawing/pdf-drawing';\nimport { PdfWordWrapType } from './enum';\nimport { StringTokenizer } from './string-tokenizer';\n/**\n * Class `lay outing the text`.\n */\nvar PdfStringLayouter = /** @class */ (function () {\n // Constructors\n /**\n * Initializes a new instance of the `StringLayouter` class.\n * @private\n */\n function PdfStringLayouter() {\n /**\n * Checks whether the x co-ordinate is need to set as client size or not.\n * @hidden\n * @private\n */\n this.isOverloadWithPosition = false;\n //\n }\n PdfStringLayouter.prototype.layout = function (arg1, arg2, arg3, arg4, arg5, arg6, arg7) {\n if (arg4 instanceof RectangleF) {\n this.initialize(arg1, arg2, arg3, arg4, arg5);\n this.isOverloadWithPosition = arg6;\n this.clientSize = arg7;\n var result = this.doLayout();\n this.clear();\n return result;\n }\n else {\n this.initialize(arg1, arg2, arg3, arg4);\n this.isOverloadWithPosition = arg5;\n this.clientSize = arg6;\n var result = this.doLayout();\n this.clear();\n return result;\n }\n };\n PdfStringLayouter.prototype.initialize = function (text, font, format, rectSize, pageHeight) {\n if (typeof pageHeight === 'number') {\n if (text == null) {\n throw new Error('ArgumentNullException:text');\n }\n if (font == null) {\n throw new Error('ArgumentNullException:font');\n }\n this.text = text;\n this.font = font;\n this.format = format;\n this.size = new SizeF(rectSize.width, rectSize.height);\n this.rectangle = rectSize;\n this.pageHeight = pageHeight;\n this.reader = new StringTokenizer(text);\n }\n else {\n this.initialize(text, font, format, new RectangleF(new PointF(0, 0), rectSize), 0);\n }\n };\n /**\n * `Clear` all resources.\n * @private\n */\n PdfStringLayouter.prototype.clear = function () {\n this.font = null;\n this.format = null;\n this.reader.close();\n this.reader = null;\n this.text = null;\n };\n /**\n * `Layouts` the text.\n * @private\n */\n PdfStringLayouter.prototype.doLayout = function () {\n var result = new PdfStringLayoutResult();\n var lineResult = new PdfStringLayoutResult();\n var lines = [];\n var line = this.reader.peekLine();\n var lineIndent = this.getLineIndent(true);\n while (line != null) {\n lineResult = this.layoutLine(line, lineIndent);\n if (lineResult !== null || typeof lineResult !== 'undefined') {\n var numSymbolsInserted = 0;\n /* tslint:disable */\n var returnedValue = this.copyToResult(result, lineResult, lines, /*out*/ numSymbolsInserted);\n /* tslint:enable */\n var success = returnedValue.success;\n numSymbolsInserted = returnedValue.numInserted;\n if (!success) {\n this.reader.read(numSymbolsInserted);\n break;\n }\n }\n // if (lineResult.textRemainder != null && lineResult.textRemainder.length > 0 ) {\n // break;\n // }\n this.reader.readLine();\n line = this.reader.peekLine();\n lineIndent = this.getLineIndent(false);\n }\n this.finalizeResult(result, lines);\n return result;\n };\n /**\n * Returns `line indent` for the line.\n * @private\n */\n PdfStringLayouter.prototype.getLineIndent = function (firstLine) {\n var lineIndent = 0;\n if (this.format != null) {\n lineIndent = (firstLine) ? this.format.firstLineIndent : this.format.paragraphIndent;\n lineIndent = (this.size.width > 0) ? Math.min(this.size.width, lineIndent) : lineIndent;\n }\n return lineIndent;\n };\n /**\n * Calculates `height` of the line.\n * @private\n */\n PdfStringLayouter.prototype.getLineHeight = function () {\n var height = this.font.height;\n if (this.format != null && this.format.lineSpacing !== 0) {\n height = this.format.lineSpacing + this.font.height;\n }\n return height;\n };\n /**\n * Calculates `width` of the line.\n * @private\n */\n PdfStringLayouter.prototype.getLineWidth = function (line) {\n var width = this.font.getLineWidth(line, this.format);\n return width;\n };\n // tslint:disable\n /**\n * `Layouts` line.\n * @private\n */\n PdfStringLayouter.prototype.layoutLine = function (line, lineIndent) {\n var lineResult = new PdfStringLayoutResult();\n lineResult.layoutLineHeight = this.getLineHeight();\n var lines = [];\n var maxWidth = this.size.width;\n var lineWidth = this.getLineWidth(line) + lineIndent;\n var lineType = LineType.FirstParagraphLine;\n var readWord = true;\n // line is in bounds.\n if (maxWidth <= 0 || Math.round(lineWidth) <= Math.round(maxWidth)) {\n this.addToLineResult(lineResult, lines, line, lineWidth, LineType.NewLineBreak | lineType);\n }\n else {\n var builder = '';\n var curLine = '';\n lineWidth = lineIndent;\n var curIndent = lineIndent;\n var reader = new StringTokenizer(line);\n var word = reader.peekWord();\n var isSingleWord = false;\n if (word.length !== reader.length) {\n if (word === ' ') {\n curLine = curLine + word;\n builder = builder + word;\n reader.position += 1;\n word = reader.peekWord();\n }\n }\n while (word != null) {\n curLine = curLine + word;\n var curLineWidth = this.getLineWidth(curLine.toString()) + curIndent /*)*/;\n if (curLine.toString() === ' ') {\n curLine = '';\n curLineWidth = 0;\n }\n if (curLineWidth > maxWidth) {\n if (this.getWrapType() === PdfWordWrapType.None) {\n break;\n }\n if (curLine.length === word.length) {\n // Character wrap is disabled or one symbol is greater than bounds.\n if (this.getWrapType() === PdfWordWrapType.WordOnly) {\n lineResult.textRemainder = line.substring(reader.position);\n break;\n }\n else if (curLine.length === 1) {\n builder = builder + word;\n break;\n }\n else {\n readWord = false;\n curLine = '';\n word = reader.peek().toString();\n continue;\n }\n }\n else {\n if (this.getLineWidth(word.toString()) > maxWidth) {\n this.format.wordWrap = PdfWordWrapType.Character;\n }\n else {\n if (typeof this.format !== 'undefined' && this.format !== null) {\n this.format.wordWrap = PdfWordWrapType.Word;\n }\n }\n if (this.getWrapType() !== PdfWordWrapType.Character || !readWord) {\n var ln = builder.toString();\n // if (ln.indexOf(' ') === -1) {\n // isSingleWord = true;\n // this.addToLineResult(lineResult, lines, curLine, lineWidth, LineType.LayoutBreak | lineType);\n // } else {\n // this.addToLineResult(lineResult, lines, ln, lineWidth, LineType.LayoutBreak | lineType);\n // } \n if (ln !== ' ') {\n this.addToLineResult(lineResult, lines, ln, lineWidth, LineType.LayoutBreak | lineType);\n }\n if (this.isOverloadWithPosition) {\n maxWidth = this.clientSize.width;\n }\n curLine = '';\n builder = '';\n lineWidth = 0;\n curIndent = 0;\n curLineWidth = 0;\n lineType = LineType.None;\n // if (isSingleWord) {\n // reader.readWord();\n // readWord = false;\n // }\n word = (readWord) ? word : reader.peekWord();\n //isSingleWord = false;\n readWord = true;\n }\n else {\n readWord = false;\n curLine = '';\n curLine = curLine + builder.toString();\n word = reader.peek().toString();\n }\n continue;\n }\n }\n /*tslint:disable:max-func-body-length */\n builder = builder + word;\n lineWidth = curLineWidth;\n if (readWord) {\n reader.readWord();\n word = reader.peekWord();\n //isSingleWord = false;\n }\n else {\n reader.read();\n word = reader.peek().toString();\n }\n }\n if (builder.length > 0) {\n var ln = builder.toString();\n this.addToLineResult(lineResult, lines, ln, lineWidth, LineType.NewLineBreak | LineType.LastParagraphLine);\n }\n reader.close();\n }\n lineResult.layoutLines = [];\n for (var index = 0; index < lines.length; index++) {\n lineResult.layoutLines.push(lines[index]);\n }\n lines = [];\n return lineResult;\n };\n /**\n * `Adds` line to line result.\n * @private\n */\n PdfStringLayouter.prototype.addToLineResult = function (lineResult, lines, line, lineWidth, breakType) {\n var info = new LineInfo();\n info.text = line;\n info.width = lineWidth;\n info.lineType = breakType;\n lines.push(info);\n var size = lineResult.actualSize;\n size.height += this.getLineHeight();\n size.width = Math.max(size.width, lineWidth);\n lineResult.size = size;\n };\n /**\n * `Copies` layout result from line result to entire result. Checks whether we can proceed lay outing or not.\n * @private\n */\n PdfStringLayouter.prototype.copyToResult = function (result, lineResult, lines, \n /*out*/ numInserted) {\n var success = true;\n var allowPartialLines = (this.format != null && !this.format.lineLimit);\n var height = result.actualSize.height;\n var maxHeight = this.size.height;\n if ((this.pageHeight > 0) && (maxHeight + this.rectangle.y > this.pageHeight)) {\n maxHeight = this.rectangle.y - this.pageHeight;\n maxHeight = Math.max(maxHeight, -maxHeight);\n }\n numInserted = 0;\n if (lineResult.lines != null) {\n for (var i = 0, len = lineResult.lines.length; i < len; i++) {\n var expHeight = height + lineResult.lineHeight;\n if (expHeight <= maxHeight || maxHeight <= 0 || allowPartialLines) {\n var info = lineResult.lines[i];\n numInserted += info.text.length;\n info = this.trimLine(info, (lines.length === 0));\n lines.push(info);\n // Update width.\n var size = result.actualSize;\n size.width = Math.max(size.width, info.width);\n result.size = size;\n // The part of the line fits only and it's allowed to use partial lines.\n // if (expHeight >= maxHeight && maxHeight > 0 && allowPartialLines)\n // {\n // let shouldClip : boolean = (this.format == null || !this.format.noClip);\n // if (shouldClip)\n // {\n // let exceededHeight : number = expHeight - maxHeight;\n // let fitHeight : number = /*Utils.Round(*/ lineResult.lineHeight - exceededHeight /*)*/;\n // height = /*Utils.Round(*/ height + fitHeight /*)*/;\n // }\n // else\n // {\n // height = expHeight;\n // }\n // success = false;\n // break;\n // } else {\n height = expHeight;\n // }\n }\n else {\n success = false;\n break;\n }\n }\n }\n if (height != result.size.height) {\n var size1 = result.actualSize;\n size1.height = height;\n result.size = size1;\n }\n return { success: success, numInserted: numInserted };\n };\n /**\n * `Finalizes` final result.\n * @private\n */\n PdfStringLayouter.prototype.finalizeResult = function (result, lines) {\n result.layoutLines = [];\n for (var index = 0; index < lines.length; index++) {\n result.layoutLines.push(lines[index]);\n }\n result.layoutLineHeight = this.getLineHeight();\n if (!this.reader.end) {\n result.textRemainder = this.reader.readToEnd();\n }\n lines = [];\n };\n /**\n * `Trims` whitespaces at the line.\n * @private\n */\n PdfStringLayouter.prototype.trimLine = function (info, firstLine) {\n var line = info.text;\n var lineWidth = info.width;\n // Trim start whitespaces if the line is not a start of the paragraph only.\n var trimStartSpaces = ((info.lineType & LineType.FirstParagraphLine) === 0);\n var start = (this.format == null || !this.format.rightToLeft);\n var spaces = StringTokenizer.spaces;\n line = (start) ? line.trim() : line.trim();\n // Recalculate line width.\n if (line.length !== info.text.length) {\n lineWidth = this.getLineWidth(line);\n if ((info.lineType & LineType.FirstParagraphLine) > 0) {\n lineWidth += this.getLineIndent(firstLine);\n }\n }\n info.text = line;\n info.width = lineWidth;\n return info;\n };\n /**\n * Returns `wrap` type.\n * @private\n */\n PdfStringLayouter.prototype.getWrapType = function () {\n var wrapType = (this.format != null) ? this.format.wordWrap : PdfWordWrapType.Word;\n return wrapType;\n };\n return PdfStringLayouter;\n}());\nexport { PdfStringLayouter };\n//Internal declaration\nvar PdfStringLayoutResult = /** @class */ (function () {\n function PdfStringLayoutResult() {\n }\n Object.defineProperty(PdfStringLayoutResult.prototype, \"remainder\", {\n // Properties\n /**\n * Gets the `text` which is not lay outed.\n * @private\n */\n get: function () {\n return this.textRemainder;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringLayoutResult.prototype, \"actualSize\", {\n /**\n * Gets the actual layout text `bounds`.\n * @private\n */\n get: function () {\n if (typeof this.size === 'undefined') {\n this.size = new SizeF(0, 0);\n }\n return this.size;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringLayoutResult.prototype, \"lines\", {\n /**\n * Gets layout `lines` information.\n * @private\n */\n get: function () {\n return this.layoutLines;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringLayoutResult.prototype, \"lineHeight\", {\n /**\n * Gets the `height` of the line.\n * @private\n */\n get: function () {\n return this.layoutLineHeight;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringLayoutResult.prototype, \"empty\", {\n /**\n * Gets value that indicates whether any layout text [`empty`].\n * @private\n */\n get: function () {\n return (this.layoutLines == null || this.layoutLines.length === 0);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringLayoutResult.prototype, \"lineCount\", {\n /**\n * Gets `number of` the layout lines.\n * @private\n */\n get: function () {\n var count = (!this.empty) ? this.layoutLines.length : 0;\n return count;\n },\n enumerable: true,\n configurable: true\n });\n return PdfStringLayoutResult;\n}());\nexport { PdfStringLayoutResult };\nvar LineInfo = /** @class */ (function () {\n function LineInfo() {\n }\n Object.defineProperty(LineInfo.prototype, \"lineType\", {\n //Properties\n /**\n * Gets the `type` of the line text.\n * @private\n */\n get: function () {\n return this.type;\n },\n set: function (value) {\n this.type = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(LineInfo.prototype, \"text\", {\n /**\n * Gets the line `text`.\n * @private\n */\n get: function () {\n return this.content;\n },\n set: function (value) {\n this.content = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(LineInfo.prototype, \"width\", {\n /**\n * Gets `width` of the line text.\n * @private\n */\n get: function () {\n return this.lineWidth;\n },\n set: function (value) {\n this.lineWidth = value;\n },\n enumerable: true,\n configurable: true\n });\n return LineInfo;\n}());\nexport { LineInfo };\n/**\n* Break type of the `line`.\n* @private\n*/\nexport var LineType;\n(function (LineType) {\n /**\n * Specifies the type of `None`.\n * @private\n */\n LineType[LineType[\"None\"] = 0] = \"None\";\n /**\n * Specifies the type of `NewLineBreak`.\n * @private\n */\n LineType[LineType[\"NewLineBreak\"] = 1] = \"NewLineBreak\";\n /**\n * Specifies the type of `LayoutBreak`.\n * @private\n */\n LineType[LineType[\"LayoutBreak\"] = 2] = \"LayoutBreak\";\n /**\n * Specifies the type of `FirstParagraphLine`.\n * @private\n */\n LineType[LineType[\"FirstParagraphLine\"] = 4] = \"FirstParagraphLine\";\n /**\n * Specifies the type of `LastParagraphLine`.\n * @private\n */\n LineType[LineType[\"LastParagraphLine\"] = 8] = \"LastParagraphLine\";\n})(LineType || (LineType = {}));\n","import { PdfColorSpace } from './enum';\nimport { Operators } from './../input-output/pdf-operators';\nimport { Dictionary } from './../collections/dictionary';\nimport { PdfNumber } from './../primitives/pdf-number';\nimport { PdfArray } from './../primitives/pdf-array';\n/**\n * Implements structures and routines working with `color`.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a new page to the document\n * let page1 : PdfPage = document.pages.add();\n * // set the font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * //\n * // set color\n * let brushColor : PdfColor = new PdfColor(0, 0, 0);\n * //\n * // create black brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(brushColor);\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(0, 0));\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n * @default black color\n */\nvar PdfColor = /** @class */ (function () {\n function PdfColor(color1, color2, color3, color4) {\n if (typeof color1 === 'undefined') {\n if (typeof color2 !== 'undefined' && typeof color3 !== 'undefined' && typeof color4 !== 'undefined') {\n this.assignRGB(color2, color3, color4);\n }\n else {\n this.filled = false;\n }\n }\n else if (color1 instanceof PdfColor) {\n this.redColor = color1.r;\n this.greenColor = color1.g;\n this.blueColor = color1.b;\n this.grayColor = color1.gray;\n this.alpha = color1.alpha;\n this.filled = (this.alpha !== 0);\n /* tslint:disable-next-line:max-line-length */\n }\n else if (typeof color1 === 'number' && typeof color2 === 'undefined' && typeof color3 === 'undefined' && typeof color4 === 'undefined') {\n if (color1 < 0) {\n color1 = 0;\n }\n if (color1 > 1) {\n color1 = 1;\n }\n this.redColor = color1 * PdfColor.maxColourChannelValue;\n this.greenColor = color1 * PdfColor.maxColourChannelValue;\n this.blueColor = color1 * PdfColor.maxColourChannelValue;\n this.cyanColor = color1;\n this.magentaColor = color1;\n this.yellowColor = color1;\n this.blackColor = color1;\n this.grayColor = color1;\n this.alpha = PdfColor.maxColourChannelValue;\n this.filled = true;\n }\n else if (typeof color4 === 'undefined') {\n this.assignRGB(color1, color2, color3);\n }\n else {\n this.assignRGB(color2, color3, color4, color1);\n }\n }\n /**\n * `Assign` red, green, blue colors with alpha value..\n * @private\n */\n PdfColor.prototype.assignRGB = function (r, g, b, a) {\n if (typeof r === 'undefined' || typeof g === 'undefined' || typeof b === 'undefined') {\n this.filled = false;\n }\n else {\n this.cyanColor = 0;\n this.magentaColor = 0;\n this.yellowColor = 0;\n this.blackColor = 0;\n this.grayColor = 0;\n this.redColor = r;\n this.greenColor = g;\n this.blueColor = b;\n if (typeof a === 'undefined') {\n this.alpha = PdfColor.maxColourChannelValue;\n }\n else {\n this.alpha = a;\n }\n this.filled = true;\n this.assignCMYK(r, g, b);\n }\n };\n /**\n * `Calculate and assign` cyan, megenta, yellow colors from rgb values..\n * @private\n */\n PdfColor.prototype.assignCMYK = function (r, g, b) {\n var red = r / PdfColor.maxColourChannelValue;\n var green = g / PdfColor.maxColourChannelValue;\n var blue = b / PdfColor.maxColourChannelValue;\n var black = PdfNumber.min(1 - red, 1 - green, 1 - blue);\n var cyan = (black === 1.0) ? 0 : (1 - red - black) / (1 - black);\n var magenta = (black === 1.0) ? 0 : (1 - green - black) / (1 - black);\n var yellow = (black === 1.0) ? 0 : (1 - blue - black) / (1 - black);\n this.blackColor = black;\n this.cyanColor = cyan;\n this.magentaColor = magenta;\n this.yellowColor = yellow;\n };\n Object.defineProperty(PdfColor.prototype, \"r\", {\n //Properties\n // public static get Empty():PdfColor\n // {\n // return this.s_emptyColor\n // }\n /**\n * Gets or sets `Red` channel value.\n * @private\n */\n get: function () {\n return this.redColor;\n },\n set: function (value) {\n this.redColor = value;\n this.assignCMYK(this.redColor, this.greenColor, this.blueColor);\n this.filled = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"red\", {\n /**\n * Gets the `Red` color\n * @private\n */\n get: function () {\n return (this.r / PdfColor.maxColourChannelValue);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"b\", {\n /**\n * Gets or sets `Blue` channel value.\n * @private\n */\n get: function () {\n return this.blueColor;\n },\n set: function (value) {\n this.blueColor = value;\n this.assignCMYK(this.redColor, this.greenColor, this.blueColor);\n this.filled = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"blue\", {\n /**\n * Gets the `blue` color.\n * @private\n */\n get: function () {\n return (this.b / PdfColor.maxColourChannelValue);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"c\", {\n /**\n * Gets or sets `Cyan` channel value.\n * @private\n */\n get: function () {\n return this.cyanColor;\n },\n set: function (value) {\n if (value < 0) {\n this.cyanColor = 0;\n }\n else if (value > 1) {\n this.cyanColor = 1;\n }\n else {\n this.cyanColor = value;\n }\n this.assignRGB(this.cyanColor, this.magentaColor, this.yellowColor, this.blackColor);\n this.filled = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"k\", {\n /**\n * Gets or sets `Black` channel value.\n * @private\n */\n get: function () {\n return this.blackColor;\n },\n set: function (value) {\n if ((value < 0)) {\n this.blackColor = 0;\n }\n else if ((value > 1)) {\n this.blackColor = 1;\n }\n else {\n this.blackColor = value;\n }\n this.assignRGB(this.cyanColor, this.magentaColor, this.yellowColor, this.blackColor);\n this.filled = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"m\", {\n /**\n * Gets or sets `Magenta` channel value.\n * @private\n */\n get: function () {\n return this.magentaColor;\n },\n set: function (value) {\n if ((value < 0)) {\n this.magentaColor = 0;\n }\n else if ((value > 1)) {\n this.magentaColor = 1;\n }\n else {\n this.magentaColor = value;\n }\n this.assignRGB(this.cyanColor, this.magentaColor, this.yellowColor, this.blackColor);\n this.filled = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"y\", {\n /**\n * Gets or sets `Yellow` channel value.\n * @private\n */\n get: function () {\n return this.yellowColor;\n },\n set: function (value) {\n if ((value < 0)) {\n this.yellowColor = 0;\n }\n else if ((value > 1)) {\n this.yellowColor = 1;\n }\n else {\n this.yellowColor = value;\n }\n this.assignRGB(this.cyanColor, this.magentaColor, this.yellowColor, this.blackColor);\n this.filled = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"g\", {\n /**\n * Gets or sets `Green` channel value.\n * @private\n */\n get: function () {\n return this.greenColor;\n },\n set: function (value) {\n this.greenColor = value;\n this.assignCMYK(this.redColor, this.greenColor, this.blueColor);\n this.filled = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"green\", {\n /**\n * Gets the `Green` color.\n * @private\n */\n get: function () {\n return (this.g / PdfColor.maxColourChannelValue);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"gray\", {\n /**\n * Gets or sets `Gray` channel value.\n * @private\n */\n get: function () {\n return ((((this.redColor + this.greenColor) + this.blueColor)) / (PdfColor.maxColourChannelValue * 3));\n },\n set: function (value) {\n if (value < 0) {\n this.grayColor = 0;\n }\n else if (value > 1) {\n this.grayColor = 1;\n }\n else {\n this.grayColor = value;\n }\n this.r = (this.grayColor * PdfColor.maxColourChannelValue);\n this.g = (this.grayColor * PdfColor.maxColourChannelValue);\n this.b = (this.grayColor * PdfColor.maxColourChannelValue);\n this.assignCMYK(this.redColor, this.greenColor, this.blueColor);\n this.filled = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"isEmpty\", {\n /**\n * Gets whether the PDFColor `is Empty` or not.\n * @private\n */\n get: function () {\n return !this.filled;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfColor.prototype, \"a\", {\n /**\n * Gets or sets `Alpha` channel value.\n * @private\n */\n get: function () {\n return this.alpha;\n },\n set: function (value) {\n if (value < 0) {\n this.alpha = 0;\n }\n else {\n // if (this.alpha !== value) {\n this.alpha = value;\n // }\n }\n this.filled = true;\n },\n enumerable: true,\n configurable: true\n });\n //Public methods\n /**\n * Converts `PDFColor to PDF string` representation.\n * @private\n */\n PdfColor.prototype.toString = function (colorSpace, stroke) {\n if (this.isEmpty) {\n return '';\n }\n var str = '';\n switch (colorSpace) {\n case PdfColorSpace.Rgb:\n str = this.rgbToString(stroke);\n break;\n case PdfColorSpace.GrayScale:\n str = this.grayScaleToString(stroke);\n break;\n case PdfColorSpace.Cmyk:\n str = this.cmykToString(stroke);\n break;\n }\n return str;\n };\n /**\n * Sets `GrayScale` color.\n * @private\n */\n PdfColor.prototype.grayScaleToString = function (ifStroking) {\n var gray = this.gray;\n var colour = '';\n var obj = null;\n /* tslint:disable-next-line:max-line-length */\n obj = (ifStroking) ? PdfColor.grayStringsSroke.containsKey(gray) ? PdfColor.grayStringsSroke.getValue(gray) : null : PdfColor.grayStringsFill.containsKey(gray) ? PdfColor.grayStringsFill.getValue(gray) : null;\n if (obj == null) {\n if (ifStroking) {\n colour = gray.toString() + ' G';\n PdfColor.grayStringsSroke.setValue(gray, colour);\n }\n }\n else {\n colour = obj.toString();\n }\n return colour + Operators.newLine;\n };\n /**\n * Sets `RGB` color.\n * @private\n */\n PdfColor.prototype.rgbToString = function (ifStroking) {\n var r = this.r;\n var g = this.g;\n var b = this.b;\n var key = (r << 16) + (g << 8) + b;\n if (ifStroking) {\n key += 1 << 24;\n }\n var colour = '';\n var obj = null;\n if (PdfColor.rgbStrings.containsKey(key)) {\n obj = PdfColor.rgbStrings.getValue(key);\n }\n if (obj == null) {\n var red = r / PdfColor.maxColourChannelValue;\n var green = g / PdfColor.maxColourChannelValue;\n var blue = b / PdfColor.maxColourChannelValue;\n if (ifStroking) {\n colour = red.toString() + ' ' + green.toString() + ' ' + blue.toString() + ' RG';\n }\n else {\n colour = red.toString() + ' ' + green.toString() + ' ' + blue.toString() + ' rg';\n }\n PdfColor.rgbStrings.setValue(key, colour);\n }\n else {\n colour = obj.toString();\n }\n return colour + Operators.newLine;\n };\n /***\n * Sets `CMYK` color.\n * @private\n */\n PdfColor.prototype.cmykToString = function (ifStroking) {\n var cyan = this.c;\n var magenta = this.m;\n var yellow = this.y;\n var black = this.b;\n var colour = '';\n colour = cyan.toString() + ' ' + magenta.toString() + ' ' + yellow.toString() + ' ' + black.toString() + ' K';\n return colour + Operators.newLine;\n };\n /**\n * Converts `colour to a PDF array`.\n * @private\n */\n PdfColor.prototype.toArray = function (colorSpace) {\n var array = new PdfArray();\n switch (colorSpace) {\n case PdfColorSpace.Rgb:\n array.add(new PdfNumber(this.red));\n array.add(new PdfNumber(this.green));\n array.add(new PdfNumber(this.blue));\n break;\n }\n return array;\n };\n //Fields\n /**\n * Holds `RGB colors` converted into strings.\n * @private\n */\n PdfColor.rgbStrings = new Dictionary();\n /**\n * Holds Gray scale colors converted into strings for `stroking`.\n * @private\n */\n PdfColor.grayStringsSroke = new Dictionary();\n /**\n * Holds Gray scale colors converted into strings for `filling`.\n * @private\n */\n PdfColor.grayStringsFill = new Dictionary();\n /**\n * `Max value` of color channel.\n * @private\n */\n PdfColor.maxColourChannelValue = 255.0;\n return PdfColor;\n}());\nexport { PdfColor };\n","/**\n * `PdfBrush` class provides objects used to fill the interiors of graphical shapes such as rectangles,\n * ellipses, pies, polygons, and paths.\n * @private\n */\nvar PdfBrush = /** @class */ (function () {\n /**\n * Creates instanceof `PdfBrush` class.\n * @hidden\n * @private\n */\n function PdfBrush() {\n //\n }\n //IClonable implementation\n PdfBrush.prototype.clone = function () {\n return this;\n };\n return PdfBrush;\n}());\nexport { PdfBrush };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { PdfColor } from './../pdf-color';\nimport { PdfColorSpace } from './../enum';\nimport { PdfBrush } from './pdf-brush';\n/**\n * Represents a brush that fills any object with a solid color.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a pages to the document\n * let page1 : PdfPage = document.pages.add();\n * // set font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // set brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(10, 10));\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\nvar PdfSolidBrush = /** @class */ (function (_super) {\n __extends(PdfSolidBrush, _super);\n //Constructors\n /**\n * Initializes a new instance of the `PdfSolidBrush` class.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a pages to the document\n * let page1 : PdfPage = document.pages.add();\n * // set font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // set brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(10, 10));\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n * @param color color of the brush\n */\n function PdfSolidBrush(color) {\n var _this = _super.call(this) || this;\n _this.pdfColor = color;\n return _this;\n }\n Object.defineProperty(PdfSolidBrush.prototype, \"color\", {\n //Properties\n /**\n * Gets or sets the `color` of the brush.\n * @private\n */\n get: function () {\n return this.pdfColor;\n },\n set: function (value) {\n this.pdfColor = value;\n },\n enumerable: true,\n configurable: true\n });\n //Implementation\n /**\n * `Monitors` the changes of the brush and modify PDF state respectively.\n * @private\n */\n PdfSolidBrush.prototype.monitorChanges = function (brush, streamWriter, getResources, saveChanges, currentColorSpace) {\n if (streamWriter == null) {\n throw new Error('ArgumentNullException:streamWriter');\n }\n var diff = false;\n if (brush == null) {\n diff = true;\n streamWriter.setColorAndSpace(this.pdfColor, currentColorSpace, false);\n return diff;\n }\n else {\n var sBrush = brush;\n diff = true;\n streamWriter.setColorAndSpace(this.pdfColor, currentColorSpace, false);\n return diff;\n }\n };\n /**\n * `Resets` the changes, which were made by the brush.\n * @private\n */\n PdfSolidBrush.prototype.resetChanges = function (streamWriter) {\n streamWriter.setColorAndSpace(new PdfColor(0, 0, 0), PdfColorSpace.Rgb, false);\n };\n return PdfSolidBrush;\n}(PdfBrush));\nexport { PdfSolidBrush };\n","/**\n * PdfPen.ts class for EJ2-PDF\n */\nimport { PdfColor } from './pdf-color';\nimport { PdfSolidBrush } from './brushes/pdf-solid-brush';\nimport { PdfDashStyle, PdfColorSpace } from './enum';\nimport { PdfBrush } from './brushes/pdf-brush';\n/**\n * `PdfPen` class defining settings for drawing operations, that determines the color,\n * width, and style of the drawing elements.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // create a new page\n * let page1 : PdfPage = document.pages.add();\n * // set pen\n * let pen : PdfPen = new PdfPen(new PdfColor(0, 0, 0));\n * // draw rectangle\n * page1.graphics.drawRectangle(pen, new RectangleF({x : 0, y : 0}, {width : 100, height : 50}));\n * // save the document.\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\nvar PdfPen = /** @class */ (function () {\n function PdfPen(arg1, arg2) {\n //Fields\n /**\n * Specifies the `color of the pen`.\n * @default new PdfColor()\n * @private\n */\n this.pdfColor = new PdfColor(0, 0, 0);\n /**\n * Specifies the `dash offset of the pen`.\n * @default 0\n * @private\n */\n this.dashOffsetValue = 0;\n /**\n * Specifies the `dash pattern of the pen`.\n * @default [0]\n * @private\n */\n this.penDashPattern = [0];\n /**\n * Specifies the `dash style of the pen`.\n * @default Solid\n * @private\n */\n this.pdfDashStyle = PdfDashStyle.Solid;\n /**\n * Specifies the `line cap of the pen`.\n * @default 0\n * @private\n */\n this.pdfLineCap = 0;\n /**\n * Specifies the `line join of the pen`.\n * @default 0\n * @private\n */\n this.pdfLineJoin = 0;\n /**\n * Specifies the `width of the pen`.\n * @default 1.0\n * @private\n */\n this.penWidth = 1.0;\n /**\n * Specifies the `mitter limit of the pen`.\n * @default 0.0\n * @private\n */\n this.internalMiterLimit = 0.0;\n /**\n * Stores the `colorspace` value.\n * @default Rgb\n * @private\n */\n this.colorSpace = PdfColorSpace.Rgb;\n if (arg1 instanceof PdfBrush) {\n this.setBrush(arg1);\n }\n else if (arg1 instanceof PdfColor) {\n this.color = arg1;\n }\n if (typeof arg2 === 'number') {\n this.width = arg2;\n }\n }\n Object.defineProperty(PdfPen.prototype, \"color\", {\n //Properties\n /**\n * Gets or sets the `color of the pen`.\n * @private\n */\n get: function () {\n return this.pdfColor;\n },\n set: function (value) {\n this.pdfColor = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPen.prototype, \"dashOffset\", {\n /**\n * Gets or sets the `dash offset of the pen`.\n * @private\n */\n get: function () {\n if (typeof this.dashOffsetValue === 'undefined' || this.dashOffsetValue == null) {\n return 0;\n }\n else {\n return this.dashOffsetValue;\n }\n },\n set: function (value) {\n this.dashOffsetValue = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPen.prototype, \"dashPattern\", {\n /**\n * Gets or sets the `dash pattern of the pen`.\n * @private\n */\n get: function () {\n return this.penDashPattern;\n },\n set: function (value) {\n this.penDashPattern = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPen.prototype, \"dashStyle\", {\n /**\n * Gets or sets the `dash style of the pen`.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // create a new page\n * let page1 : PdfPage = document.pages.add();\n * // set pen\n * let pen : PdfPen = new PdfPen(new PdfColor(0, 0, 0));\n * //\n * // set pen style\n * pen.dashStyle = PdfDashStyle.DashDot;\n * // get pen style\n * let style : PdfDashStyle = pen.dashStyle;\n * //\n * // draw rectangle\n * page1.graphics.drawRectangle(pen, new RectangleF({x : 0, y : 0}, {width : 100, height : 50}));\n * // save the document.\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n get: function () {\n return this.pdfDashStyle;\n },\n set: function (value) {\n if (this.pdfDashStyle !== value) {\n this.pdfDashStyle = value;\n switch (this.pdfDashStyle) {\n case PdfDashStyle.Custom:\n break;\n case PdfDashStyle.Dash:\n this.penDashPattern = [3, 1];\n break;\n case PdfDashStyle.Dot:\n this.penDashPattern = [1, 1];\n break;\n case PdfDashStyle.DashDot:\n this.penDashPattern = [3, 1, 1, 1];\n break;\n case PdfDashStyle.DashDotDot:\n this.penDashPattern = [3, 1, 1, 1, 1, 1];\n break;\n case PdfDashStyle.Solid:\n break;\n default:\n this.pdfDashStyle = PdfDashStyle.Solid;\n this.penDashPattern = [0];\n break;\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPen.prototype, \"lineCap\", {\n /**\n * Gets or sets the `line cap of the pen`.\n * @private\n */\n get: function () {\n return this.pdfLineCap;\n },\n set: function (value) {\n this.pdfLineCap = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPen.prototype, \"lineJoin\", {\n /**\n * Gets or sets the `line join style of the pen`.\n * @private\n */\n get: function () {\n return this.pdfLineJoin;\n },\n set: function (value) {\n this.pdfLineJoin = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPen.prototype, \"miterLimit\", {\n /**\n * Gets or sets the `miter limit`.\n * @private\n */\n get: function () {\n return this.internalMiterLimit;\n },\n set: function (value) {\n this.internalMiterLimit = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPen.prototype, \"width\", {\n /**\n * Gets or sets the `width of the pen`.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // create a new page\n * let page1 : PdfPage = document.pages.add();\n * // set pen\n * let pen : PdfPen = new PdfPen(new PdfColor(0, 0, 0));\n * //\n * // set pen width\n * pen.width = 2;\n * //\n * // draw rectangle\n * page1.graphics.drawRectangle(pen, new RectangleF({x : 0, y : 0}, {width : 100, height : 50}));\n * // save the document.\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n get: function () {\n return this.penWidth;\n },\n set: function (value) {\n this.penWidth = value;\n },\n enumerable: true,\n configurable: true\n });\n //Helper\n /**\n * `Clones` this instance of PdfPen class.\n * @private\n */\n PdfPen.prototype.clone = function () {\n var pen = this;\n return pen;\n };\n /**\n * `Sets the brush`.\n * @private\n */\n PdfPen.prototype.setBrush = function (brush) {\n var sBrush = brush;\n if ((sBrush != null && sBrush instanceof PdfSolidBrush)) {\n this.color = sBrush.color;\n this.pdfBrush = sBrush;\n }\n this.color = sBrush.color;\n this.pdfBrush = sBrush;\n };\n /**\n * `Monitors the changes`.\n * @private\n */\n PdfPen.prototype.monitorChanges = function (currentPen, streamWriter, getResources, saveState, currentColorSpace, matrix) {\n var diff = false;\n saveState = true;\n if (currentPen == null) {\n diff = true;\n }\n diff = this.dashControl(currentPen, saveState, streamWriter);\n streamWriter.setLineWidth(this.width);\n streamWriter.setLineJoin(this.lineJoin);\n streamWriter.setLineCap(this.lineCap);\n var miterLimit = this.miterLimit;\n if (miterLimit > 0) {\n streamWriter.setMiterLimit(miterLimit);\n diff = true;\n }\n var brush = this.pdfBrush;\n streamWriter.setColorAndSpace(this.color, currentColorSpace, true);\n diff = true;\n return diff;\n };\n /**\n * `Controls the dash style` and behaviour of each line.\n * @private\n */\n PdfPen.prototype.dashControl = function (pen, saveState, streamWriter) {\n saveState = true;\n var lineWidth = this.width;\n var pattern = this.getPattern();\n streamWriter.setLineDashPattern(pattern, this.dashOffset * lineWidth);\n return saveState;\n };\n /**\n * `Gets the pattern` of PdfPen.\n * @private\n */\n PdfPen.prototype.getPattern = function () {\n var pattern = this.dashPattern;\n for (var i = 0; i < pattern.length; ++i) {\n pattern[i] *= this.width;\n }\n return pattern;\n };\n return PdfPen;\n}());\nexport { PdfPen };\n","/**\n * PdfStringFormat.ts class for EJ2-PDF\n */\nimport { PdfVerticalAlignment } from './../../graphics/enum';\nimport { PdfSubSuperScript, PdfWordWrapType } from './../../graphics/fonts/enum';\n/**\n * `PdfStringFormat` class represents the text layout information on PDF.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a pages to the document\n * let page1 : PdfPage = document.pages.add();\n * // set font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // set brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * //\n * // set the format for string\n * let stringFormat : PdfStringFormat = new PdfStringFormat();\n * // set the text alignment\n * stringFormat.alignment = PdfTextAlignment.Center;\n * // set the vertical alignment\n * stringFormat.lineAlignment = PdfVerticalAlignment.Middle;\n * //\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(10, 10), stringFormat);\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\nvar PdfStringFormat = /** @class */ (function () {\n function PdfStringFormat(arg1, arg2) {\n /**\n * The `scaling factor` of the text being drawn.\n * @private\n */\n this.scalingFactor = 100.0;\n /**\n * Indicates text `wrapping` type.\n * @private\n */\n this.wordWrapType = PdfWordWrapType.Word;\n this.internalLineLimit = true;\n this.wordWrapType = PdfWordWrapType.Word;\n if ((typeof arg1 !== 'undefined') && (typeof arg1 !== 'string')) {\n this.textAlignment = arg1;\n }\n if (typeof arg2 !== 'undefined') {\n this.verticalAlignment = arg2;\n }\n }\n Object.defineProperty(PdfStringFormat.prototype, \"alignment\", {\n //Properties\n /**\n * Gets or sets the `horizontal` text alignment\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a pages to the document\n * let page1 : PdfPage = document.pages.add();\n * // set font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // set brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * //\n * // set the format for string\n * let stringFormat : PdfStringFormat = new PdfStringFormat();\n * // set the text alignment\n * stringFormat.alignment = PdfTextAlignment.Center;\n * //\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(10, 10), stringFormat);\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n get: function () {\n return this.textAlignment;\n },\n set: function (value) {\n this.textAlignment = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"textDirection\", {\n get: function () {\n return this.direction;\n },\n set: function (value) {\n this.direction = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"lineAlignment\", {\n /**\n * Gets or sets the `vertical` text alignment.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a pages to the document\n * let page1 : PdfPage = document.pages.add();\n * // set font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // set brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * //\n * // set the format for string\n * let stringFormat : PdfStringFormat = new PdfStringFormat();\n * // set the vertical alignment\n * stringFormat.lineAlignment = PdfVerticalAlignment.Middle;\n * //\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(10, 10), stringFormat);\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n get: function () {\n if (typeof this.verticalAlignment === 'undefined' || this.verticalAlignment == null) {\n return PdfVerticalAlignment.Top;\n }\n else {\n return this.verticalAlignment;\n }\n },\n set: function (value) {\n this.verticalAlignment = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"rightToLeft\", {\n /**\n * Gets or sets the value that indicates text `direction` mode.\n * @private\n */\n get: function () {\n if (typeof this.isRightToLeft === 'undefined' || this.isRightToLeft == null) {\n return false;\n }\n else {\n return this.isRightToLeft;\n }\n },\n set: function (value) {\n this.isRightToLeft = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"characterSpacing\", {\n /**\n * Gets or sets value that indicates a `size` among the characters in the text.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a pages to the document\n * let page1 : PdfPage = document.pages.add();\n * // set font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // set brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * //\n * // set the format for string\n * let stringFormat : PdfStringFormat = new PdfStringFormat();\n * // set character spacing\n * stringFormat.characterSpacing = 10;\n * //\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(10, 10), stringFormat);\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n get: function () {\n if (typeof this.internalCharacterSpacing === 'undefined' || this.internalCharacterSpacing == null) {\n return 0;\n }\n else {\n return this.internalCharacterSpacing;\n }\n },\n set: function (value) {\n this.internalCharacterSpacing = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"wordSpacing\", {\n /**\n * Gets or sets value that indicates a `size` among the words in the text.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a pages to the document\n * let page1 : PdfPage = document.pages.add();\n * // set font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // set brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * //\n * // set the format for string\n * let stringFormat : PdfStringFormat = new PdfStringFormat();\n * // set word spacing\n * stringFormat.wordSpacing = 10;\n * //\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(10, 10), stringFormat);\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n get: function () {\n if (typeof this.internalWordSpacing === 'undefined' || this.internalWordSpacing == null) {\n return 0;\n }\n else {\n return this.internalWordSpacing;\n }\n },\n set: function (value) {\n this.internalWordSpacing = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"lineSpacing\", {\n /**\n * Gets or sets value that indicates the `vertical distance` between the baselines of adjacent lines of text.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a pages to the document\n * let page1 : PdfPage = document.pages.add();\n * // set font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // set brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // set string\n * let text : string = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor\n * incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitati';\n * // set rectangle bounds\n * let rectangle : RectangleF = new RectangleF({x : 0, y : 0}, {width : 300, height : 100})\n * //\n * // set the format for string\n * let stringFormat : PdfStringFormat = new PdfStringFormat();\n * // set line spacing\n * stringFormat.lineSpacing = 10;\n * //\n * // draw the text\n * page1.graphics.drawString(text, font, blackBrush, rectangle, stringFormat);\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n get: function () {\n if (typeof this.leading === 'undefined' || this.leading == null) {\n return 0;\n }\n else {\n return this.leading;\n }\n },\n set: function (value) {\n this.leading = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"clipPath\", {\n /**\n * Gets or sets a value indicating whether the text is `clipped` or not.\n * @private\n */\n get: function () {\n if (typeof this.clip === 'undefined' || this.clip == null) {\n return false;\n }\n else {\n return this.clip;\n }\n },\n set: function (value) {\n this.clip = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"subSuperScript\", {\n /**\n * Gets or sets value indicating whether the text is in `subscript or superscript` mode.\n * @private\n */\n get: function () {\n if (typeof this.pdfSubSuperScript === 'undefined' || this.pdfSubSuperScript == null) {\n return PdfSubSuperScript.None;\n }\n else {\n return this.pdfSubSuperScript;\n }\n },\n set: function (value) {\n this.pdfSubSuperScript = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"paragraphIndent\", {\n /**\n * Gets or sets the `indent` of the first line in the paragraph.\n * @private\n */\n get: function () {\n if (typeof this.internalParagraphIndent === 'undefined' || this.internalParagraphIndent == null) {\n return 0;\n }\n else {\n return this.internalParagraphIndent;\n }\n },\n set: function (value) {\n this.internalParagraphIndent = value;\n this.firstLineIndent = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"lineLimit\", {\n /**\n * Gets or sets a value indicating whether [`line limit`].\n * @private\n */\n get: function () {\n return this.internalLineLimit;\n },\n set: function (value) {\n this.internalLineLimit = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"measureTrailingSpaces\", {\n /**\n * Gets or sets a value indicating whether [`measure trailing spaces`].\n * @private\n */\n get: function () {\n if (typeof this.trailingSpaces === 'undefined' || this.trailingSpaces == null) {\n return false;\n }\n else {\n return this.trailingSpaces;\n }\n },\n set: function (value) {\n this.trailingSpaces = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"noClip\", {\n /**\n * Gets or sets a value indicating whether [`no clip`].\n * @private\n */\n get: function () {\n if (typeof this.isNoClip === 'undefined' || this.isNoClip == null) {\n return false;\n }\n else {\n return this.isNoClip;\n }\n },\n set: function (value) {\n this.isNoClip = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"wordWrap\", {\n /**\n * Gets or sets value indicating type of the text `wrapping`.\n * @private\n */\n get: function () {\n // if (typeof this.wrapType === 'undefined' || this.wrapType == null) {\n // return PdfWordWrapType.Word;\n // } else {\n return this.wordWrapType;\n // }\n },\n set: function (value) {\n this.wordWrapType = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"horizontalScalingFactor\", {\n /**\n * Gets or sets the `scaling factor`.\n * @private\n */\n get: function () {\n // if (typeof this.scalingFactor === 'undefined' || this.scalingFactor == null) {\n // return 100;\n // } else {\n return this.scalingFactor;\n // }\n },\n set: function (value) {\n if (value <= 0) {\n throw new Error('ArgumentOutOfRangeException:The scaling factor cant be less of equal to zero, ScalingFactor');\n }\n this.scalingFactor = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfStringFormat.prototype, \"firstLineIndent\", {\n /**\n * Gets or sets the `indent` of the first line in the text.\n * @private\n */\n get: function () {\n if (typeof this.initialLineIndent === 'undefined' || this.initialLineIndent == null) {\n return 0;\n }\n else {\n return this.initialLineIndent;\n }\n },\n set: function (value) {\n this.initialLineIndent = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * `Clones` the object.\n * @private\n */\n //IClonable implementation\n PdfStringFormat.prototype.clone = function () {\n var format = this;\n return format;\n };\n return PdfStringFormat;\n}());\nexport { PdfStringFormat };\n","/**\n * StringTokenizer.ts class for EJ2-PDF\n * Utility class for working with strings.\n * @private\n */\nvar StringTokenizer = /** @class */ (function () {\n // Constructors\n /**\n * Initializes a new instance of the `StringTokenizer` class.\n * @private\n */\n function StringTokenizer(textValue) {\n /**\n * Current `position`.\n * @private\n */\n this.currentPosition = 0;\n if (textValue == null) {\n throw new Error('ArgumentNullException:text');\n }\n this.text = textValue;\n }\n Object.defineProperty(StringTokenizer.prototype, \"length\", {\n // Properties\n /**\n * Gets text `length`.\n * @private\n */\n get: function () {\n return this.text.length;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StringTokenizer.prototype, \"end\", {\n get: function () {\n return (this.currentPosition === this.text.length);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StringTokenizer.prototype, \"position\", {\n /**\n * Gets or sets the position.\n * @private\n */\n get: function () {\n return this.currentPosition;\n },\n set: function (value) {\n this.currentPosition = value;\n },\n enumerable: true,\n configurable: true\n });\n StringTokenizer.getCharsCount = function (text, symbols) {\n if (typeof symbols === 'string') {\n if (text == null) {\n throw new Error('ArgumentNullException:wholeText');\n }\n var numSymbols = 0;\n var curIndex = 0;\n for (;;) {\n curIndex = text.indexOf(symbols, curIndex);\n if (curIndex === -1) {\n break;\n }\n else {\n numSymbols++;\n curIndex++;\n }\n }\n return numSymbols;\n }\n else {\n if (text == null) {\n throw new Error('ArgumentNullException:text');\n }\n if (symbols == null) {\n throw new Error('ArgumentNullException:symbols');\n }\n var count = 0;\n for (var i = 0, len = text.length; i < len; i++) {\n var ch = text[i];\n if (this.contains(symbols, ch)) {\n count++;\n }\n }\n return count;\n }\n };\n /**\n * Reads line of the text.\n * @private\n */\n StringTokenizer.prototype.readLine = function () {\n var pos = this.currentPosition;\n while (pos < this.length) {\n var ch = this.text[pos];\n switch (ch) {\n case '\\r':\n case '\\n': {\n var text = this.text.substr(this.currentPosition, pos - this.currentPosition);\n this.currentPosition = pos + 1;\n if (((ch === '\\r') && (this.currentPosition < this.length)) && (this.text[this.currentPosition] === '\\n')) {\n this.currentPosition++;\n }\n return text;\n }\n }\n pos++;\n }\n // The remaining text.\n if (pos > this.currentPosition) {\n var text2 = this.text.substr(this.currentPosition, pos - this.currentPosition);\n this.currentPosition = pos;\n return text2;\n }\n return null;\n };\n /**\n * Reads line of the text.\n * @private\n */\n StringTokenizer.prototype.peekLine = function () {\n var pos = this.currentPosition;\n var line = this.readLine();\n this.currentPosition = pos;\n return line;\n };\n /**\n * Reads a word from the text.\n * @private\n */\n StringTokenizer.prototype.readWord = function () {\n var pos = this.currentPosition;\n while (pos < this.length) {\n var ch = this.text[pos];\n switch (ch) {\n case '\\r':\n case '\\n':\n var textValue = this.text.substr(this.currentPosition, pos - this.currentPosition);\n this.currentPosition = pos + 1;\n if (((ch === '\\r') && (this.currentPosition < this.length)) && (this.text[this.currentPosition] === '\\n')) {\n this.currentPosition++;\n }\n return textValue;\n case ' ':\n case '\\t': {\n if (pos === this.currentPosition) {\n pos++;\n }\n var text = this.text.substr(this.currentPosition, pos - this.currentPosition);\n this.currentPosition = pos;\n return text;\n }\n }\n pos++;\n }\n // The remaining text.\n if (pos > this.currentPosition) {\n var text2 = this.text.substr(this.currentPosition, pos - this.currentPosition);\n this.currentPosition = pos;\n return text2;\n }\n return null;\n };\n /**\n * Peeks a word from the text.\n * @private\n */\n StringTokenizer.prototype.peekWord = function () {\n var pos = this.currentPosition;\n var word = this.readWord();\n this.currentPosition = pos;\n return word;\n };\n StringTokenizer.prototype.read = function (count) {\n if (typeof count === 'undefined') {\n var ch = '0';\n if (!this.end) {\n ch = this.text[this.currentPosition];\n this.currentPosition++;\n }\n return ch;\n }\n else {\n var num = 0;\n var builder = '';\n while (!this.end && num < count) {\n var ch = this.read();\n builder = builder + ch;\n num++;\n }\n return builder;\n }\n };\n /**\n * Peeks char form the data.\n * @private\n */\n StringTokenizer.prototype.peek = function () {\n var ch = '0';\n if (!this.end) {\n ch = this.text[this.currentPosition];\n }\n return ch;\n };\n /**\n * Closes a reader.\n * @private\n */\n StringTokenizer.prototype.close = function () {\n this.text = null;\n };\n StringTokenizer.prototype.readToEnd = function () {\n var text;\n if (this.currentPosition === 0) {\n text = this.text;\n }\n else {\n text = this.text.substr(this.currentPosition, this.length - this.currentPosition);\n }\n this.currentPosition = this.length;\n return text;\n };\n //Implementation\n /**\n * Checks whether array contains a symbol.\n * @private\n */\n StringTokenizer.contains = function (array, symbol) {\n var contains = false;\n for (var i = 0; i < array.length; i++) {\n if (array[i] === symbol) {\n contains = true;\n break;\n }\n }\n return contains;\n };\n // Constants\n /**\n * `Whitespace` symbol.\n * @private\n */\n StringTokenizer.whiteSpace = ' ';\n /**\n * `tab` symbol.\n * @private\n */\n StringTokenizer.tab = '\\t';\n /**\n * Array of `spaces`.\n * @private\n */\n StringTokenizer.spaces = [StringTokenizer.whiteSpace, StringTokenizer.tab];\n /**\n * `Pattern` for WhiteSpace.\n * @private\n */\n StringTokenizer.whiteSpacePattern = '^[ \\t]+$';\n return StringTokenizer;\n}());\nexport { StringTokenizer };\n","/**\n * PdfFont.ts class for EJ2-PDF\n */\nimport { PdfFontStyle } from './enum';\nimport { SizeF } from './../../drawing/pdf-drawing';\nimport { PdfStringFormat } from './pdf-string-format';\nimport { PdfStringLayouter } from './string-layouter';\nimport { StringTokenizer } from './string-tokenizer';\n/**\n * Defines a particular format for text, including font face, size, and style attributes.\n * @private\n */\nvar PdfFont = /** @class */ (function () {\n function PdfFont(size, style) {\n /**\n * `Style` of the font.\n * @private\n */\n this.fontStyle = PdfFontStyle.Regular;\n if (typeof size === 'number' && typeof style === 'undefined') {\n this.fontSize = size;\n }\n else {\n this.fontSize = size;\n this.setStyle(style);\n }\n }\n Object.defineProperty(PdfFont.prototype, \"name\", {\n //Properties\n /**\n * Gets the face name of this Font.\n * @private\n */\n get: function () {\n return this.metrics.name;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfFont.prototype, \"size\", {\n /**\n * Gets the size of this font.\n * @private\n */\n get: function () {\n return this.fontSize;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfFont.prototype, \"height\", {\n /**\n * Gets the height of the font in points.\n * @private\n */\n get: function () {\n return this.metrics.getHeight(null);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfFont.prototype, \"style\", {\n /**\n * Gets the style information for this font.\n * @private\n */\n get: function () {\n return this.fontStyle;\n },\n set: function (value) {\n this.fontStyle = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfFont.prototype, \"bold\", {\n /**\n * Gets a value indicating whether this `PdfFont` is `bold`.\n * @private\n */\n get: function () {\n return ((this.style & PdfFontStyle.Bold) > 0);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfFont.prototype, \"italic\", {\n /**\n * Gets a value indicating whether this `PdfFont` has the `italic` style applied.\n * @private\n */\n get: function () {\n return ((this.style & PdfFontStyle.Italic) > 0);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfFont.prototype, \"strikeout\", {\n /**\n * Gets a value indicating whether this `PdfFont` is `strikeout`.\n * @private\n */\n get: function () {\n return ((this.style & PdfFontStyle.Strikeout) > 0);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfFont.prototype, \"underline\", {\n /**\n * Gets a value indicating whether this `PdfFont` is `underline`.\n * @private\n */\n get: function () {\n return ((this.style & PdfFontStyle.Underline) > 0);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfFont.prototype, \"metrics\", {\n /**\n * Gets or sets the `metrics` for this font.\n * @private\n */\n get: function () {\n return this.fontMetrics;\n },\n set: function (value) {\n this.fontMetrics = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfFont.prototype, \"element\", {\n // /**\n // * Gets and Sets the font `internals`.\n // * @private\n // */\n // public get fontInternal() : IPdfPrimitive {\n // return this.pdfFontInternals;\n // }\n // public set fontInternal(value : IPdfPrimitive) {\n // this.pdfFontInternals = value;\n // }\n //IPdfWrapper Members\n /**\n * Gets the `element` representing the font.\n * @private\n */\n get: function () {\n return this.pdfFontInternals;\n },\n enumerable: true,\n configurable: true\n });\n PdfFont.prototype.measureString = function (text, arg2, arg3, arg4, arg5) {\n if (typeof text === 'string' && typeof arg2 === 'undefined') {\n return this.measureString(text, null);\n }\n else if (typeof text === 'string' && (arg2 instanceof PdfStringFormat || arg2 == null) && typeof arg3 === 'undefined' && typeof arg4 === 'undefined') {\n var temparg2 = arg2;\n var charactersFitted = 0;\n var linesFilled = 0;\n return this.measureString(text, temparg2, charactersFitted, linesFilled);\n }\n else if (typeof text === 'string' && (arg2 instanceof PdfStringFormat || arg2 == null) && typeof arg3 === 'number' && typeof arg4 === 'number') {\n var temparg2 = arg2;\n return this.measureString(text, 0, temparg2, arg3, arg4);\n // } else if (typeof text === 'string' && typeof arg2 === 'number' && typeof arg3 === 'undefined') {\n // return this.measureString(text, arg2, null);\n // } else if (typeof text === 'string' && typeof arg2 === 'number' && (arg3 instanceof PdfStringFormat || arg3 == null) && typeof arg4 === 'undefined' && typeof arg5 === 'undefined') {\n // let temparg3 : PdfStringFormat = arg3 as PdfStringFormat;\n // let charactersFitted : number = 0;\n // let linesFilled : number = 0;\n // return this.measureString(text, arg2, temparg3, charactersFitted, linesFilled);\n }\n else if (typeof text === 'string' && typeof arg2 === 'number' && (arg3 instanceof PdfStringFormat || arg3 == null) && typeof arg4 === 'number' && typeof arg5 === 'number') {\n var layoutArea = new SizeF(arg2, 0);\n var temparg3 = arg3;\n return this.measureString(text, layoutArea, temparg3, arg4, arg5);\n // } else if (typeof text === 'string' && arg2 instanceof SizeF && typeof arg3 === 'undefined') {\n // return this.measureString(text, arg2, null);\n // } else if (typeof text === 'string' && arg2 instanceof SizeF && (arg3 instanceof PdfStringFormat || arg3 == null) && typeof arg4 === 'undefined' && typeof arg5 === 'undefined') {\n // let temparg3 : PdfStringFormat = arg3 as PdfStringFormat;\n // let charactersFitted : number = 0;\n // let linesFilled : number = 0;\n // return this.measureString(text, arg2, temparg3, charactersFitted, linesFilled);\n }\n else {\n if (text == null) {\n throw Error(\"ArgumentNullException(\\\"text\\\")\");\n }\n var temparg2 = arg2;\n var temparg3 = arg3;\n var layouter = new PdfStringLayouter();\n var result = layouter.layout(text, this, temparg3, temparg2, false, new SizeF(0, 0));\n // arg4 = (result.Remainder == null) ? text.length : text.length - result.Remainder.length;\n arg4 = text.length;\n arg5 = (result.empty) ? 0 : result.lines.length;\n return result.actualSize;\n }\n };\n /* tslint:enable */\n //IPdfCache Members\n /**\n * `Checks` whether the object is similar to another object.\n * @private\n */\n PdfFont.prototype.equalsTo = function (obj) {\n var result = this.equalsToFont(obj);\n return result;\n };\n /**\n * Returns `internals` of the object.\n * @private\n */\n PdfFont.prototype.getInternals = function () {\n return this.pdfFontInternals;\n };\n /**\n * Sets `internals` to the object.\n * @private\n */\n PdfFont.prototype.setInternals = function (internals) {\n if (internals == null) {\n throw new Error('ArgumentNullException:internals');\n }\n this.pdfFontInternals = internals;\n };\n /**\n * Sets the `style` of the font.\n * @private\n */\n PdfFont.prototype.setStyle = function (style) {\n this.fontStyle = style;\n };\n /**\n * Applies `settings` to the default line width.\n * @private\n */\n PdfFont.prototype.applyFormatSettings = function (line, format, width) {\n // if (line == null) {\n // throw new Error(`ArgumentNullException:line`);\n // }\n var realWidth = width;\n if (format != null && width > 0) {\n // Space among characters is not default.\n if (format.characterSpacing !== 0) {\n realWidth += (line.length - 1) * format.characterSpacing;\n }\n // Space among words is not default.\n if (format.wordSpacing !== 0) {\n var symbols = StringTokenizer.spaces;\n var whitespacesCount = StringTokenizer.getCharsCount(line, symbols);\n realWidth += whitespacesCount * format.wordSpacing;\n }\n }\n return realWidth;\n };\n //Constants\n /**\n * `Multiplier` of the symbol width.\n * @default 0.001\n * @private\n */\n PdfFont.charSizeMultiplier = 0.001;\n /**\n * `Synchronization` object.\n * @private\n */\n PdfFont.syncObject = new Object();\n return PdfFont;\n}());\nexport { PdfFont };\n","/**\n * public Enum for `PdfLayoutType`.\n * @private\n */\nexport var PdfLayoutType;\n(function (PdfLayoutType) {\n /**\n * Specifies the type of `Paginate`.\n * @private\n */\n PdfLayoutType[PdfLayoutType[\"Paginate\"] = 0] = \"Paginate\";\n /**\n * Specifies the type of `OnePage`.\n * @private\n */\n PdfLayoutType[PdfLayoutType[\"OnePage\"] = 1] = \"OnePage\";\n})(PdfLayoutType || (PdfLayoutType = {}));\n/**\n * public Enum for `PdfLayoutBreakType`.\n * @private\n */\nexport var PdfLayoutBreakType;\n(function (PdfLayoutBreakType) {\n /**\n * Specifies the type of `FitPage`.\n * @private\n */\n PdfLayoutBreakType[PdfLayoutBreakType[\"FitPage\"] = 0] = \"FitPage\";\n /**\n * Specifies the type of `FitElement`.\n * @private\n */\n PdfLayoutBreakType[PdfLayoutBreakType[\"FitElement\"] = 1] = \"FitElement\";\n /**\n * Specifies the type of `FitColumnsToPage`.\n * @private\n */\n PdfLayoutBreakType[PdfLayoutBreakType[\"FitColumnsToPage\"] = 2] = \"FitColumnsToPage\";\n})(PdfLayoutBreakType || (PdfLayoutBreakType = {}));\nexport var PathPointType;\n(function (PathPointType) {\n /**\n * Specifies the path point type of `Start`.\n * @private\n */\n PathPointType[PathPointType[\"Start\"] = 0] = \"Start\";\n /**\n * Specifies the path point type of `Line`.\n * @private\n */\n PathPointType[PathPointType[\"Line\"] = 1] = \"Line\";\n /**\n * Specifies the path point type of `Bezier3`.\n * @private\n */\n PathPointType[PathPointType[\"Bezier3\"] = 3] = \"Bezier3\";\n /**\n * Specifies the path point type of `Bezier`.\n * @private\n */\n PathPointType[PathPointType[\"Bezier\"] = 3] = \"Bezier\";\n /**\n * Specifies the path point type of `PathTypeMask`.\n * @private\n */\n PathPointType[PathPointType[\"PathTypeMask\"] = 7] = \"PathTypeMask\";\n /**\n * Specifies the path point type of `DashMode`.\n * @private\n */\n PathPointType[PathPointType[\"DashMode\"] = 16] = \"DashMode\";\n /**\n * Specifies the path point type of `PathMarker`.\n * @private\n */\n PathPointType[PathPointType[\"PathMarker\"] = 32] = \"PathMarker\";\n /**\n * Specifies the path point type of `CloseSubpath`.\n * @private\n */\n PathPointType[PathPointType[\"CloseSubpath\"] = 128] = \"CloseSubpath\";\n})(PathPointType || (PathPointType = {}));\n","/**\n * PdfTransformationMatrix.ts class for EJ2-PDF\n */\nimport { PointF } from './../drawing/pdf-drawing';\nimport { PdfNumber } from './../primitives/pdf-number';\n/**\n * Class for representing Root `transformation matrix`.\n */\nvar PdfTransformationMatrix = /** @class */ (function () {\n function PdfTransformationMatrix(value) {\n /**\n * Value for `angle converting`.\n * @default 180.0 / Math.PI\n * @private\n */\n this.radDegFactor = 180.0 / Math.PI;\n if (typeof value === 'undefined') {\n this.transformationMatrix = new Matrix(1.00, 0.00, 0.00, 1.00, 0.00, 0.00);\n }\n else {\n this.transformationMatrix = new Matrix(1.00, 0.00, 0.00, -1.00, 0.00, 0.00);\n }\n }\n Object.defineProperty(PdfTransformationMatrix.prototype, \"matrix\", {\n // Properties\n /**\n * Gets or sets the `internal matrix object`.\n * @private\n */\n get: function () {\n return this.transformationMatrix;\n },\n set: function (value) {\n this.transformationMatrix = value;\n },\n enumerable: true,\n configurable: true\n });\n // Public methods\n /**\n * `Translates` coordinates by specified coordinates.\n * @private\n */\n PdfTransformationMatrix.prototype.translate = function (offsetX, offsetY) {\n this.transformationMatrix.translate(offsetX, offsetY);\n };\n /**\n * `Scales` coordinates by specified coordinates.\n * @private\n */\n PdfTransformationMatrix.prototype.scale = function (scaleX, scaleY) {\n this.transformationMatrix.elements[0] = scaleX;\n this.transformationMatrix.elements[3] = scaleY;\n };\n /**\n * `Rotates` coordinate system in counterclockwise direction.\n * @private\n */\n PdfTransformationMatrix.prototype.rotate = function (angle) {\n //Convert from degree to radian \n angle = (angle * Math.PI) / 180;\n //Rotation \n this.transformationMatrix.elements[0] = Math.cos(angle);\n this.transformationMatrix.elements[1] = Math.sin(angle);\n this.transformationMatrix.elements[2] = -Math.sin(angle);\n this.transformationMatrix.elements[3] = Math.cos(angle);\n };\n // Overrides\n /**\n * Gets `PDF representation`.\n * @private\n */\n PdfTransformationMatrix.prototype.toString = function () {\n var builder = '';\n var whitespace = ' ';\n for (var i = 0, len = this.transformationMatrix.elements.length; i < len; i++) {\n var temp = this.matrix.elements[i];\n builder += PdfNumber.floatToString(this.transformationMatrix.elements[i]);\n builder += whitespace;\n }\n return builder;\n };\n // Implementation\n /**\n * `Multiplies` matrices (changes coordinate system.)\n * @private\n */\n PdfTransformationMatrix.prototype.multiply = function (matrix) {\n this.transformationMatrix.multiply(matrix.matrix);\n };\n /**\n * Converts `degrees to radians`.\n * @private\n */\n PdfTransformationMatrix.degreesToRadians = function (degreesX) {\n return this.degRadFactor * degreesX;\n };\n /**\n * Converts `radians to degrees`.\n * @private\n */\n PdfTransformationMatrix.prototype.radiansToDegrees = function (radians) {\n return this.radDegFactor * radians;\n };\n /**\n * `Clones` this instance of PdfTransformationMatrix.\n * @private\n */\n PdfTransformationMatrix.prototype.clone = function () {\n return this;\n };\n // Constants\n /**\n * Value for `angle converting`.\n * @default Math.PI / 180.0\n * @private\n */\n PdfTransformationMatrix.degRadFactor = Math.PI / 180.0;\n return PdfTransformationMatrix;\n}());\nexport { PdfTransformationMatrix };\nvar Matrix = /** @class */ (function () {\n function Matrix(arg1, arg2, arg3, arg4, arg5, arg6) {\n if (typeof arg1 === 'undefined') {\n this.metrixElements = [];\n }\n else if (typeof arg1 === 'number') {\n this.metrixElements = [];\n this.metrixElements.push(arg1);\n this.metrixElements.push(arg2);\n this.metrixElements.push(arg3);\n this.metrixElements.push(arg4);\n this.metrixElements.push(arg5);\n this.metrixElements.push(arg6);\n }\n else {\n this.metrixElements = arg1;\n }\n }\n Object.defineProperty(Matrix.prototype, \"elements\", {\n // Properties\n /**\n * Gets the `elements`.\n * @private\n */\n get: function () {\n return this.metrixElements;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Matrix.prototype, \"offsetX\", {\n /**\n * Gets the off set `X`.\n * @private\n */\n get: function () {\n return this.metrixElements[4];\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Matrix.prototype, \"offsetY\", {\n /**\n * Gets the off set `Y`.\n * @private\n */\n get: function () {\n return this.metrixElements[5];\n },\n enumerable: true,\n configurable: true\n });\n // Implementation\n /**\n * `Translates` coordinates by specified coordinates.\n * @private\n */\n Matrix.prototype.translate = function (offsetX, offsetY) {\n this.metrixElements[4] = offsetX;\n this.metrixElements[5] = offsetY;\n };\n /**\n * `Translates` the specified offset X.\n * @private\n */\n Matrix.prototype.transform = function (point) {\n var x = point.x;\n var y = point.y;\n var x2 = x * this.elements[0] + y * this.elements[2] + this.offsetX;\n var y2 = x * this.elements[1] + y * this.elements[3] + this.offsetY;\n return new PointF(x2, y2);\n };\n /**\n * `Multiplies matrices` (changes coordinate system.)\n * @private\n */\n Matrix.prototype.multiply = function (matrix) {\n var tempMatrix = [];\n tempMatrix.push(this.elements[0] * matrix.elements[0] + this.elements[1] * matrix.elements[2]);\n tempMatrix[1] = (this.elements[0] * matrix.elements[1] + this.elements[1] * matrix.elements[3]);\n tempMatrix[2] = (this.elements[2] * matrix.elements[0] + this.elements[3] * matrix.elements[2]);\n tempMatrix[3] = (this.elements[2] * matrix.elements[1] + this.elements[3] * matrix.elements[3]);\n tempMatrix[4] = (this.offsetX * matrix.elements[0] + this.offsetY * matrix.elements[2] + matrix.offsetX);\n tempMatrix[5] = (this.offsetX * matrix.elements[1] + this.offsetY * matrix.elements[3] + matrix.offsetY);\n for (var i = 0; i < tempMatrix.length; i++) {\n this.elements[i] = tempMatrix[i];\n }\n };\n // IDisposable Members\n /**\n * `Dispose` this instance of PdfTransformationMatrix class.\n * @private\n */\n Matrix.prototype.dispose = function () {\n this.metrixElements = null;\n };\n // ICloneable Members\n /**\n * `Clones` this instance of PdfTransformationMatrix class.\n * @private\n */\n Matrix.prototype.clone = function () {\n var m = new Matrix(this.metrixElements);\n return m;\n };\n return Matrix;\n}());\nexport { Matrix };\n","/**\n * `constants.ts` class for EJ2-PDF\n * @private\n */\nvar ProcedureSets = /** @class */ (function () {\n function ProcedureSets() {\n /**\n * Specifies the `PDF` procedure set.\n * @private\n */\n this.pdf = 'PDF';\n /**\n * Specifies the `Text` procedure set.\n * @private\n */\n this.text = 'Text';\n /**\n * Specifies the `ImageB` procedure set.\n * @private\n */\n this.imageB = 'ImageB';\n /**\n * Specifies the `ImageC` procedure set.\n * @private\n */\n this.imageC = 'ImageC';\n /**\n * Specifies the `ImageI` procedure set.\n * @private\n */\n this.imageI = 'ImageI';\n }\n return ProcedureSets;\n}());\nexport { ProcedureSets };\n","/**\n * Dictionary class\n * @private\n * @hidden\n */\nvar TemporaryDictionary = /** @class */ (function () {\n function TemporaryDictionary() {\n /**\n * @hidden\n * @private\n */\n this.mKeys = [];\n /**\n * @hidden\n * @private\n */\n this.mValues = [];\n }\n /**\n * @hidden\n * @private\n */\n TemporaryDictionary.prototype.size = function () {\n return this.mKeys.length;\n };\n /**\n * @hidden\n * @private\n */\n TemporaryDictionary.prototype.add = function (key, value) {\n if (key === undefined || key === null || value === undefined || value === null) {\n throw new ReferenceError('Provided key or value is not valid.');\n }\n var index = this.mKeys.indexOf(key);\n if (index < 0) {\n this.mKeys.push(key);\n this.mValues.push(value);\n return 1;\n }\n else {\n throw new RangeError('An item with the same key has already been added.');\n }\n };\n /**\n * @hidden\n * @private\n */\n TemporaryDictionary.prototype.keys = function () {\n return this.mKeys;\n };\n /**\n * @hidden\n * @private\n */\n TemporaryDictionary.prototype.values = function () {\n return this.mValues;\n };\n /**\n * @hidden\n * @private\n */\n TemporaryDictionary.prototype.getValue = function (key) {\n if (key === undefined || key === null) {\n throw new ReferenceError('Provided key is not valid.');\n }\n var index = this.mKeys.indexOf(key);\n if (index < 0) {\n throw new RangeError('No item with the specified key has been added.');\n }\n else {\n return this.mValues[index];\n }\n };\n /**\n * @hidden\n * @private\n */\n TemporaryDictionary.prototype.setValue = function (key, value) {\n if (key === undefined || key === null) {\n throw new ReferenceError('Provided key is not valid.');\n }\n var index = this.mKeys.indexOf(key);\n if (index < 0) {\n this.mKeys.push(key);\n this.mValues.push(value);\n }\n else {\n this.mValues[index] = value;\n }\n };\n /**\n * @hidden\n * @private\n */\n TemporaryDictionary.prototype.remove = function (key) {\n if (key === undefined || key === null) {\n throw new ReferenceError('Provided key is not valid.');\n }\n var index = this.mKeys.indexOf(key);\n if (index < 0) {\n throw new RangeError('No item with the specified key has been added.');\n }\n else {\n this.mKeys.splice(index, 1);\n this.mValues.splice(index, 1);\n return true;\n }\n };\n /**\n * @hidden\n * @private\n */\n TemporaryDictionary.prototype.containsKey = function (key) {\n if (key === undefined || key === null) {\n throw new ReferenceError('Provided key is not valid.');\n }\n var index = this.mKeys.indexOf(key);\n if (index < 0) {\n return false;\n }\n return true;\n };\n /**\n * @hidden\n * @private\n */\n TemporaryDictionary.prototype.clear = function () {\n this.mKeys = [];\n this.mValues = [];\n };\n return TemporaryDictionary;\n}());\nexport { TemporaryDictionary };\n","import { PdfDictionary } from './../primitives/pdf-dictionary';\nimport { PdfNumber } from './../primitives/pdf-number';\nimport { PdfName } from './../primitives/pdf-name';\nimport { DictionaryProperties } from './../input-output/pdf-dictionary-properties';\n/**\n * Represents a simple `transparency`.\n * @private\n */\nvar PdfTransparency = /** @class */ (function () {\n // Properties\n // /**\n // * Gets the `stroke` operation alpha value.\n // * @private\n // */\n // public get stroke() : number {\n // let result : number = this.getNumber(this.dictionaryProperties.CA);\n // return result;\n // }\n // /**\n // * Gets the `fill` operation alpha value.\n // * @private\n // */\n // public get fill() : number {\n // let result : number = this.getNumber(this.dictionaryProperties.ca);\n // return result;\n // }\n // /**\n // * Gets the `blend mode`.\n // * @private\n // */\n // public get mode() : PdfBlendMode {\n // let result : string = this.getName(this.dictionaryProperties.ca);\n // return PdfBlendMode.Normal;\n // }\n // Constructors\n /**\n * Initializes a new instance of the `Transparency` class.\n * @private\n */\n function PdfTransparency(stroke, fill, mode) {\n // Fields\n /**\n * Internal variable to store `dictionary`.\n * @default new PdfDictionary()\n * @private\n */\n this.dictionary = new PdfDictionary();\n /**\n * Internal variable for accessing fields from `DictionryProperties` class.\n * @default new DictionaryProperties()\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n this.dictionary.items.setValue(this.dictionaryProperties.CA, new PdfNumber(stroke));\n this.dictionary.items.setValue(this.dictionaryProperties.ca, new PdfNumber(fill));\n this.dictionary.items.setValue(this.dictionaryProperties.BM, new PdfName(mode.toString()));\n }\n Object.defineProperty(PdfTransparency.prototype, \"element\", {\n // // Implementation\n // /**\n // * Gets the `number value`.\n // * @private\n // */\n // private getNumber(keyName : string) : number {\n // let result : number = 0.0;\n // let numb : PdfNumber = this.dictionary.items.getValue(keyName) as PdfNumber;\n // result = numb.intValue;\n // return result;\n // }\n // /**\n // * Gets the `name value`.\n // * @private\n // */\n // private getName(keyName : string) : string {\n // let result : string = null;\n // let name : PdfName = this.dictionary.items.getValue(keyName) as PdfName;\n // result = name.value;\n // return result;\n // }\n // IPdfWrapper Members\n /**\n * Gets the `element`.\n * @private\n */\n get: function () {\n return this.dictionary;\n },\n enumerable: true,\n configurable: true\n });\n return PdfTransparency;\n}());\nexport { PdfTransparency };\n","/**\n * Represent a `collection of automatic fields information`.\n * @private\n */\nvar PdfAutomaticFieldInfoCollection = /** @class */ (function () {\n /**\n * Initializes a new instance of the 'PdfPageNumberFieldInfoCollection' class.\n * @private\n */\n function PdfAutomaticFieldInfoCollection() {\n /**\n * Internal variable to store instance of `pageNumberFields` class.\n * @private\n */\n this.automaticFieldsInformation = [];\n //\n }\n Object.defineProperty(PdfAutomaticFieldInfoCollection.prototype, \"automaticFields\", {\n /**\n * Gets the `page number fields collection`.\n * @private\n */\n get: function () {\n return this.automaticFieldsInformation;\n },\n enumerable: true,\n configurable: true\n });\n // Public methods\n /// Adds the specified field info.\n /**\n * Add page number field into collection.\n * @private\n */\n PdfAutomaticFieldInfoCollection.prototype.add = function (fieldInfo) {\n return this.automaticFields.push(fieldInfo);\n };\n return PdfAutomaticFieldInfoCollection;\n}());\nexport { PdfAutomaticFieldInfoCollection };\n","/**\n * Represents a base class for all page graphics elements.\n */\nvar PdfGraphicsElement = /** @class */ (function () {\n // Constructors\n function PdfGraphicsElement() {\n //\n }\n /**\n * `Draws` the page number field.\n * @public\n */\n PdfGraphicsElement.prototype.drawHelper = function (graphics, x, y) {\n var bNeedSave = (x !== 0 || y !== 0);\n var gState = null;\n // Translate co-ordinates.\n if (bNeedSave) {\n // Save state.\n gState = graphics.save();\n graphics.translateTransform(x, y);\n }\n this.drawInternal(graphics);\n if (bNeedSave) {\n // Restore state.\n graphics.restore(gState);\n }\n };\n return PdfGraphicsElement;\n}());\nexport { PdfGraphicsElement };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * PdfAutomaticField.ts class for EJ2-PDF\n */\nimport { RectangleF, SizeF, PointF } from './../../drawing/pdf-drawing';\nimport { PdfSolidBrush } from './../../graphics/brushes/pdf-solid-brush';\nimport { PdfColor } from './../../graphics/pdf-color';\nimport { PdfDocument } from './../pdf-document';\nimport { PdfGraphicsElement } from './../../graphics/figures/base/graphics-element';\nimport { PdfAutomaticFieldInfo } from './automatic-field-info';\n/**\n * Represents a fields which is calculated before the document saves.\n */\nvar PdfAutomaticField = /** @class */ (function (_super) {\n __extends(PdfAutomaticField, _super);\n // Constructors\n function PdfAutomaticField() {\n var _this = _super.call(this) || this;\n // Fields\n _this.internalBounds = new RectangleF(0, 0, 0, 0);\n _this.internalTemplateSize = new SizeF(0, 0);\n return _this;\n }\n Object.defineProperty(PdfAutomaticField.prototype, \"bounds\", {\n // Properties\n get: function () {\n return this.internalBounds;\n },\n set: function (value) {\n this.internalBounds = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfAutomaticField.prototype, \"size\", {\n get: function () {\n return new SizeF(this.bounds.width, this.bounds.height);\n },\n set: function (value) {\n this.bounds.width = value.width;\n this.bounds.height = value.height;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfAutomaticField.prototype, \"location\", {\n get: function () {\n return new PointF(this.bounds.x, this.bounds.y);\n },\n set: function (value) {\n this.bounds.x = value.x;\n this.bounds.y = value.y;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfAutomaticField.prototype, \"font\", {\n get: function () {\n return this.internalFont;\n },\n set: function (value) {\n this.internalFont = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfAutomaticField.prototype, \"brush\", {\n get: function () {\n return this.internalBrush;\n },\n set: function (value) {\n this.internalBrush = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfAutomaticField.prototype, \"pen\", {\n get: function () {\n return this.internalPen;\n },\n set: function (value) {\n this.internalPen = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfAutomaticField.prototype, \"stringFormat\", {\n get: function () {\n return this.internalStringFormat;\n },\n set: function (value) {\n this.internalStringFormat = value;\n },\n enumerable: true,\n configurable: true\n });\n PdfAutomaticField.prototype.performDrawHelper = function (graphics, location, scalingX, scalingY) {\n if (this.bounds.height === 0 || this.bounds.width === 0) {\n var text = this.getValue(graphics);\n this.internalTemplateSize = this.getFont().measureString(text, this.size, this.stringFormat);\n }\n };\n PdfAutomaticField.prototype.draw = function (arg1, arg2, arg3) {\n if (typeof arg2 === 'undefined') {\n var location_1 = new PointF(0, 0);\n this.draw(arg1, location_1);\n }\n else if (arg2 instanceof PointF) {\n this.draw(arg1, arg2.x, arg2.y);\n }\n else {\n this.drawHelper(arg1, arg2, arg3);\n var info = new PdfAutomaticFieldInfo(this, new PointF(arg2, arg3));\n arg1.automaticFields.add(info);\n }\n };\n PdfAutomaticField.prototype.getSize = function () {\n if (this.bounds.height === 0 || this.bounds.width === 0) {\n return this.internalTemplateSize;\n }\n else {\n return this.size;\n }\n };\n PdfAutomaticField.prototype.drawInternal = function (graphics) {\n //\n };\n /* tslint:disable */\n PdfAutomaticField.prototype.getBrush = function () {\n return (typeof this.internalBrush === 'undefined' || this.internalBrush == null) ? new PdfSolidBrush(new PdfColor(0, 0, 0)) : this.internalBrush;\n };\n PdfAutomaticField.prototype.getFont = function () {\n return (typeof this.internalFont === 'undefined' || this.internalFont == null) ? PdfDocument.defaultFont : this.internalFont;\n };\n /* tslint:enable */\n PdfAutomaticField.prototype.getPageFromGraphics = function (graphics) {\n if (typeof graphics.page !== 'undefined' && graphics.page !== null) {\n var page = graphics.page;\n return page;\n }\n else {\n var page = graphics.currentPage;\n return page;\n }\n };\n return PdfAutomaticField;\n}(PdfGraphicsElement));\nexport { PdfAutomaticField };\n","/**\n * PdfAutomaticFieldInfo.ts class for EJ2-PDF\n * @private\n */\nimport { PointF } from './../../drawing/pdf-drawing';\nimport { PdfAutomaticField } from './automatic-field';\n/**\n * Represents information about the automatic field.\n * @private\n */\nvar PdfAutomaticFieldInfo = /** @class */ (function () {\n function PdfAutomaticFieldInfo(field, location, scaleX, scaleY) {\n // Fields\n /**\n * Internal variable to store location of the field.\n * @private\n */\n this.pageNumberFieldLocation = new PointF();\n /**\n * Internal variable to store field.\n * @private\n */\n this.pageNumberField = null;\n /**\n * Internal variable to store x scaling factor.\n * @private\n */\n this.scaleX = 1;\n /**\n * Internal variable to store y scaling factor.\n * @private\n */\n this.scaleY = 1;\n if (typeof location === 'undefined' && field instanceof PdfAutomaticFieldInfo) {\n this.pageNumberField = field.field;\n this.pageNumberFieldLocation = field.location;\n this.scaleX = field.scalingX;\n this.scaleY = field.scalingY;\n }\n else if (typeof scaleX === 'undefined' && location instanceof PointF && field instanceof PdfAutomaticField) {\n this.pageNumberField = field;\n this.pageNumberFieldLocation = location;\n }\n else {\n this.pageNumberField = field;\n this.pageNumberFieldLocation = location;\n this.scaleX = scaleX;\n this.scaleY = scaleY;\n }\n }\n Object.defineProperty(PdfAutomaticFieldInfo.prototype, \"location\", {\n /* tslint:enable */\n // Properties\n /**\n * Gets or sets the location.\n * @private\n */\n get: function () {\n return this.pageNumberFieldLocation;\n },\n set: function (value) {\n this.pageNumberFieldLocation = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfAutomaticFieldInfo.prototype, \"field\", {\n /**\n * Gets or sets the field.\n * @private\n */\n get: function () {\n return this.pageNumberField;\n },\n set: function (value) {\n this.pageNumberField = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfAutomaticFieldInfo.prototype, \"scalingX\", {\n /**\n * Gets or sets the scaling X factor.\n * @private\n */\n get: function () {\n return this.scaleX;\n },\n set: function (value) {\n this.scaleX = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfAutomaticFieldInfo.prototype, \"scalingY\", {\n /**\n * Gets or sets the scaling Y factor.\n * @private\n */\n get: function () {\n return this.scaleY;\n },\n set: function (value) {\n this.scaleY = value;\n },\n enumerable: true,\n configurable: true\n });\n return PdfAutomaticFieldInfo;\n}());\nexport { PdfAutomaticFieldInfo };\n","/**\n * ByteArray class\n * Used to keep information about image stream as byte array.\n * @private\n */\nvar ByteArray = /** @class */ (function () {\n /**\n * Initialize the new instance for `byte-array` class\n * @hidden\n * @private\n */\n function ByteArray(length) {\n /**\n * Current stream `position`.\n * @default 0\n * @private\n */\n this.mPosition = 0;\n this.buffer = new Uint8Array(length);\n this.dataView = new DataView(this.buffer.buffer);\n }\n Object.defineProperty(ByteArray.prototype, \"position\", {\n /**\n * Gets and Sets a current `position` of byte array.\n * @hidden\n * @private\n */\n get: function () {\n return this.mPosition;\n },\n set: function (value) {\n this.mPosition = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * `Read` from current stream position.\n * @default 0\n * @hidden\n * @private\n */\n ByteArray.prototype.read = function (buffer, offset, count) {\n for (var index = offset; index < count; index++) {\n var position = this.position;\n buffer.buffer[index] = this.readByte(position);\n this.position++;\n }\n };\n /**\n * @hidden\n */\n ByteArray.prototype.getBuffer = function (index) {\n return this.buffer[index];\n };\n /**\n * @hidden\n */\n ByteArray.prototype.writeFromBase64String = function (base64) {\n var arr = this.encodedString(base64);\n this.buffer = arr;\n };\n /**\n * @hidden\n */\n ByteArray.prototype.encodedString = function (input) {\n var keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var chr1;\n var chr2;\n var chr3;\n var enc1;\n var enc2;\n var enc3;\n var enc4;\n var i = 0;\n var resultIndex = 0;\n var dataUrlPrefix = 'data:';\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n var totalLength = input.length * 3 / 4;\n if (input.charAt(input.length - 1) === keyStr.charAt(64)) {\n totalLength--;\n }\n var output = new Uint8Array(totalLength | 0);\n while (i < input.length) {\n enc1 = keyStr.indexOf(input.charAt(i++));\n enc2 = keyStr.indexOf(input.charAt(i++));\n enc3 = keyStr.indexOf(input.charAt(i++));\n enc4 = keyStr.indexOf(input.charAt(i++));\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n output[resultIndex++] = chr1;\n output[resultIndex++] = chr2;\n output[resultIndex++] = chr3;\n }\n return output;\n };\n /**\n * @hidden\n */\n ByteArray.prototype.readByte = function (offset) {\n return (this.buffer[offset]);\n };\n Object.defineProperty(ByteArray.prototype, \"internalBuffer\", {\n /**\n * @hidden\n */\n get: function () {\n return this.buffer;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ByteArray.prototype, \"count\", {\n /**\n * @hidden\n */\n get: function () {\n return this.buffer.byteLength;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * 'readNextTwoBytes' stream\n * @hidden\n * @private\n */\n ByteArray.prototype.readNextTwoBytes = function (stream) {\n var data = stream.readByte(this.position);\n this.position++;\n data <<= 8;\n data |= stream.readByte(this.position);\n this.position++;\n return data;\n };\n return ByteArray;\n}());\nexport { ByteArray };\n","/**\n * TtfTableInfo.ts class for EJ2-PDF\n */\nvar TtfTableInfo = /** @class */ (function () {\n function TtfTableInfo() {\n }\n Object.defineProperty(TtfTableInfo.prototype, \"empty\", {\n //Properties\n /**\n * Gets a value indicating whether this table is empty.\n * @private\n */\n get: function () {\n var empty = (this.offset === this.length && this.length === this.checksum && this.checksum === 0);\n return empty;\n },\n enumerable: true,\n configurable: true\n });\n return TtfTableInfo;\n}());\nexport { TtfTableInfo };\n","var TtfNameTable = /** @class */ (function () {\n function TtfNameTable() {\n }\n return TtfNameTable;\n}());\nexport { TtfNameTable };\n","/**\n * TtfNameRecord.ts class for EJ2-PDF\n */\nvar TtfNameRecord = /** @class */ (function () {\n function TtfNameRecord() {\n }\n return TtfNameRecord;\n}());\nexport { TtfNameRecord };\n","/**\n * TtfHeadTable.ts class for EJ2-PDF\n */\nvar TtfHeadTable = /** @class */ (function () {\n function TtfHeadTable() {\n }\n return TtfHeadTable;\n}());\nexport { TtfHeadTable };\n","var TtfMetrics = /** @class */ (function () {\n function TtfMetrics() {\n }\n Object.defineProperty(TtfMetrics.prototype, \"isItalic\", {\n //Properties\n /**\n * Gets a value indicating whether this instance is italic.\n */\n get: function () {\n return ((this.macStyle & 2) !== 0);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TtfMetrics.prototype, \"isBold\", {\n /**\n * Gets a value indicating whether this instance is bold.\n */\n get: function () {\n return ((this.macStyle & 1) !== 0);\n },\n enumerable: true,\n configurable: true\n });\n return TtfMetrics;\n}());\nexport { TtfMetrics };\n","/**\n * TtfHorizontalHeaderTable.ts class for EJ2-PDF\n */\nvar TtfHorizontalHeaderTable = /** @class */ (function () {\n function TtfHorizontalHeaderTable() {\n }\n return TtfHorizontalHeaderTable;\n}());\nexport { TtfHorizontalHeaderTable };\n","/**\n * TtfOS2Table.ts class for EJ2-PDF\n * The OS/2 table consists of a set of metrics that are required by Windows and OS/2.\n */\nvar TtfOS2Table = /** @class */ (function () {\n function TtfOS2Table() {\n }\n return TtfOS2Table;\n}());\nexport { TtfOS2Table };\n","/**\n * TtfPostTable.ts class for EJ2-PDF\n */\nvar TtfPostTable = /** @class */ (function () {\n function TtfPostTable() {\n }\n return TtfPostTable;\n}());\nexport { TtfPostTable };\n","/**\n * TtfLongHorMetric.ts class for EJ2-PDF\n */\nvar TtfLongHorMetric = /** @class */ (function () {\n function TtfLongHorMetric() {\n }\n return TtfLongHorMetric;\n}());\nexport { TtfLongHorMetric };\n","/**\n * TtfCmapSubTable.ts class for EJ2-PDF\n */\nvar TtfCmapSubTable = /** @class */ (function () {\n function TtfCmapSubTable() {\n }\n return TtfCmapSubTable;\n}());\nexport { TtfCmapSubTable };\n","/**\n * TtfCmapTable.ts class for EJ2-PDF\n */\nvar TtfCmapTable = /** @class */ (function () {\n function TtfCmapTable() {\n }\n return TtfCmapTable;\n}());\nexport { TtfCmapTable };\n","/**\n * TtfGlyphInfo.ts class for EJ2-PDF\n */\nvar TtfGlyphInfo = /** @class */ (function () {\n function TtfGlyphInfo() {\n }\n Object.defineProperty(TtfGlyphInfo.prototype, \"empty\", {\n //Properties\n /**\n * Gets a value indicating whether this TtfGlyphInfo is empty.\n */\n get: function () {\n var empty = (this.index === this.width && this.width === this.charCode && this.charCode === 0);\n return empty;\n },\n enumerable: true,\n configurable: true\n });\n //IComparable implementation\n /**\n * Compares two WidthDescriptor objects.\n */\n TtfGlyphInfo.prototype.compareTo = function (obj) {\n var glyph = obj;\n return this.index - glyph.index;\n };\n return TtfGlyphInfo;\n}());\nexport { TtfGlyphInfo };\n","/**\n * TtfLocaTable.ts class for EJ2-PDF\n */\nvar TtfLocaTable = /** @class */ (function () {\n function TtfLocaTable() {\n }\n return TtfLocaTable;\n}());\nexport { TtfLocaTable };\n","/**\n * TtfAppleCmapSubTable.ts class for EJ2-PDF\n */\nvar TtfAppleCmapSubTable = /** @class */ (function () {\n function TtfAppleCmapSubTable() {\n }\n return TtfAppleCmapSubTable;\n}());\nexport { TtfAppleCmapSubTable };\n","/**\n * TtfMicrosoftCmapSubTable.ts class for EJ2-PDF\n */\nvar TtfMicrosoftCmapSubTable = /** @class */ (function () {\n function TtfMicrosoftCmapSubTable() {\n }\n return TtfMicrosoftCmapSubTable;\n}());\nexport { TtfMicrosoftCmapSubTable };\n","/**\n * TtfTrimmedCmapSubTable.ts class for EJ2-PDF\n */\nvar TtfTrimmedCmapSubTable = /** @class */ (function () {\n function TtfTrimmedCmapSubTable() {\n }\n return TtfTrimmedCmapSubTable;\n}());\nexport { TtfTrimmedCmapSubTable };\n","/**\n * TtfLocaTable.ts class for EJ2-PDF\n */\nvar TtfGlyphHeader = /** @class */ (function () {\n function TtfGlyphHeader() {\n }\n return TtfGlyphHeader;\n}());\nexport { TtfGlyphHeader };\n","/**\n * Writes data in BigEndian order.\n */\nvar BigEndianWriter = /** @class */ (function () {\n //Constructors\n /**\n * Creates a new writer.\n */\n function BigEndianWriter(capacity) {\n //Constants\n /**\n * Size of Int32 type.\n */\n this.int32Size = 4;\n /**\n * Size of Int16 type.\n */\n this.int16Size = 2;\n /**\n * Size of long type.\n */\n this.int64Size = 8;\n this.bufferLength = capacity;\n this.buffer = [];\n }\n Object.defineProperty(BigEndianWriter.prototype, \"data\", {\n //Properties\n /**\n * Gets data written to the writer.\n */\n get: function () {\n if (this.buffer.length < this.bufferLength) {\n var length_1 = this.bufferLength - this.buffer.length;\n for (var i = 0; i < length_1; i++) {\n this.buffer.push(0);\n }\n }\n return this.buffer;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BigEndianWriter.prototype, \"position\", {\n /// \n /// Gets position of the internal buffer.\n /// \n get: function () {\n if (this.internalPosition === undefined || this.internalPosition === null) {\n this.internalPosition = 0;\n }\n return this.internalPosition;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Writes short value.\n */\n BigEndianWriter.prototype.writeShort = function (value) {\n var bytes = [((value & 0x0000ff00) >> 8), value & 0x000000ff];\n this.flush(bytes);\n };\n /**\n * Writes int value.\n */\n BigEndianWriter.prototype.writeInt = function (value) {\n var i1 = (value & 0xff000000) >> 24;\n i1 = i1 < 0 ? 256 + i1 : i1;\n var i2 = (value & 0x00ff0000) >> 16;\n i2 = i2 < 0 ? 256 + i2 : i2;\n var i3 = (value & 0x0000ff00) >> 8;\n i3 = i3 < 0 ? 256 + i3 : i3;\n var i4 = value & 0x000000ff;\n i4 = i4 < 0 ? 256 + i4 : i4;\n var bytes = [(value & 0xff000000) >> 24, (value & 0x00ff0000) >> 16, (value & 0x0000ff00) >> 8, value & 0x000000ff];\n this.flush(bytes);\n };\n /**\n * Writes u int value.\n */\n BigEndianWriter.prototype.writeUInt = function (value) {\n var buff = [(value & 0xff000000) >> 24, (value & 0x00ff0000) >> 16, (value & 0x0000ff00) >> 8, value & 0x000000ff];\n this.flush(buff);\n };\n /**\n * Writes string value.\n */\n BigEndianWriter.prototype.writeString = function (value) {\n if (value == null) {\n throw new Error('Argument Null Exception : value');\n }\n var bytes = [];\n for (var i = 0; i < value.length; i++) {\n bytes.push(value.charCodeAt(i));\n }\n this.flush(bytes);\n };\n /**\n * Writes byte[] value.\n */\n BigEndianWriter.prototype.writeBytes = function (value) {\n this.flush(value);\n };\n // //Implementation\n BigEndianWriter.prototype.flush = function (buff) {\n if (buff === null) {\n throw new Error('Argument Null Exception : buff');\n }\n var position = this.position;\n for (var i = 0; i < buff.length; i++) {\n this.buffer[position] = buff[i];\n position++;\n }\n this.internalPosition += buff.length;\n };\n return BigEndianWriter;\n}());\nexport { BigEndianWriter };\n","/**\n * TtfReader.ts class for EJ2-PDF\n */\nimport { TtfTableInfo } from './ttf-table-info';\nimport { Dictionary } from './../../collections/dictionary';\nimport { TtfNameTable } from './ttf-name-table';\nimport { TtfNameRecord } from './ttf-name-record';\nimport { TtfHeadTable } from './ttf-head-table';\nimport { TtfMetrics } from './ttf-metrics';\nimport { TtfHorizontalHeaderTable } from './ttf-horizontal-header-table';\nimport { TtfOS2Table } from './ttf-OS2-Table';\nimport { TtfPostTable } from './ttf-post-table';\nimport { TtfLongHorMetric } from './ttf-long-hor-metric';\nimport { TtfCmapSubTable } from './ttf-cmap-sub-table';\nimport { TtfCmapTable } from './ttf-cmap-table';\nimport { TtfGlyphInfo } from './ttf-glyph-info';\nimport { TtfLocaTable } from './ttf-loca-table';\nimport { TtfAppleCmapSubTable } from './ttf-apple-cmap-sub-table';\nimport { TtfMicrosoftCmapSubTable } from './ttf-microsoft-cmap-sub-table';\nimport { TtfTrimmedCmapSubTable } from './ttf-trimmed-cmap-sub-table';\nimport { TtfGlyphHeader } from './ttf-glyph-header';\nimport { Rectangle } from './../../drawing/pdf-drawing';\nimport { StringTokenizer } from './string-tokenizer';\nimport { TtfCmapFormat, TtfCmapEncoding, TtfPlatformID } from './enum';\nimport { TtfMicrosoftEncodingID, TtfMacintoshEncodingID, TtfCompositeGlyphFlags } from './enum';\nimport { BigEndianWriter } from './../../input-output/big-endian-writer';\nvar TtfReader = /** @class */ (function () {\n //Constructors\n function TtfReader(fontData) {\n this.int32Size = 4;\n this.isTtcFont = false;\n this.isMacTtf = false;\n this.metricsName = '';\n this.isMacTTF = false;\n this.missedGlyphs = 0;\n this.tableNames = ['cvt ', 'fpgm', 'glyf', 'head', 'hhea', 'hmtx', 'loca', 'maxp', 'prep'];\n this.entrySelectors = [0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4];\n this.fontData = fontData;\n this.initialize();\n }\n Object.defineProperty(TtfReader.prototype, \"macintosh\", {\n //Properties\n /**\n * Gets glyphs for Macintosh or Symbol fonts (char - key, glyph - value).\n */\n get: function () {\n if (this.macintoshDictionary === null || this.macintoshDictionary === undefined) {\n this.macintoshDictionary = new Dictionary();\n }\n return this.macintoshDictionary;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TtfReader.prototype, \"microsoft\", {\n /**\n * Gets glyphs for Microsoft or Symbol fonts (char - key, glyph - value).\n */\n get: function () {\n if (this.microsoftDictionary === null || this.microsoftDictionary === undefined) {\n this.microsoftDictionary = new Dictionary();\n }\n return this.microsoftDictionary;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TtfReader.prototype, \"macintoshGlyphs\", {\n /**\n * Gets glyphs for Macintosh or Symbol fonts (glyph index - key, glyph - value).\n */\n get: function () {\n if (this.internalMacintoshGlyphs === null || this.internalMacintoshGlyphs === undefined) {\n this.internalMacintoshGlyphs = new Dictionary();\n }\n return this.internalMacintoshGlyphs;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TtfReader.prototype, \"microsoftGlyphs\", {\n /**\n * Gets glyphs for Microsoft Unicode fonts (glyph index - key, glyph - value).\n */\n get: function () {\n if (this.internalMicrosoftGlyphs === null || this.internalMicrosoftGlyphs === undefined) {\n this.internalMicrosoftGlyphs = new Dictionary();\n }\n return this.internalMicrosoftGlyphs;\n },\n enumerable: true,\n configurable: true\n });\n //Implementation\n TtfReader.prototype.initialize = function () {\n if (this.metrics === undefined) {\n this.metrics = new TtfMetrics();\n }\n this.readFontDictionary();\n var nameTable = this.readNameTable();\n var headTable = this.readHeadTable();\n this.initializeFontName(nameTable);\n this.metrics.macStyle = headTable.macStyle;\n };\n TtfReader.prototype.readFontDictionary = function () {\n this.offset = 0;\n var version = this.checkPreambula();\n //this.offset += 4;\n var numTables = this.readInt16(this.offset);\n var searchRange = this.readInt16(this.offset);\n var entrySelector = this.readInt16(this.offset);\n var rangeShift = this.readInt16(this.offset);\n if (this.tableDirectory === undefined) {\n this.tableDirectory = new Dictionary();\n }\n for (var i = 0; i < numTables; ++i) {\n var table = new TtfTableInfo();\n var tableKey = this.readString(this.int32Size);\n table.checksum = this.readInt32(this.offset);\n table.offset = this.readInt32(this.offset);\n table.length = this.readInt32(this.offset);\n this.tableDirectory.setValue(tableKey, table);\n }\n this.lowestPosition = this.offset;\n if (!this.isTtcFont) {\n this.fixOffsets();\n }\n };\n TtfReader.prototype.fixOffsets = function () {\n var minOffset = Number.MAX_VALUE;\n // Search for a smallest offset and compare it with the lowest position found.\n var tableKeys = this.tableDirectory.keys();\n for (var i = 0; i < tableKeys.length; i++) {\n var value = this.tableDirectory.getValue(tableKeys[i]);\n var offset = value.offset;\n if (minOffset > offset) {\n minOffset = offset;\n if (minOffset <= this.lowestPosition) {\n break;\n }\n }\n }\n var shift = minOffset - this.lowestPosition;\n if (shift !== 0) {\n var table = new Dictionary();\n for (var i = 0; i < tableKeys.length; i++) {\n var value = this.tableDirectory.getValue(tableKeys[i]);\n value.offset -= shift;\n table.setValue(tableKeys[i], value);\n }\n this.tableDirectory = table;\n }\n };\n TtfReader.prototype.checkPreambula = function () {\n var version = this.readInt32(this.offset);\n this.isMacTtf = (version === 0x74727565) ? true : false;\n if (version !== 0x10000 && version !== 0x74727565 && version !== 0x4f54544f) {\n this.isTtcFont = true;\n this.offset = 0;\n var fontTag = this.readString(4);\n if (fontTag !== 'ttcf') {\n throw new Error('Can not read TTF font data');\n }\n //skip 4\n this.offset += 4;\n var ttcIdentificationNumber = this.readInt32(this.offset);\n if (ttcIdentificationNumber < 0) {\n throw new Error('Can not read TTF font data');\n }\n this.offset = this.readInt32(this.offset);\n version = this.readInt32(this.offset);\n }\n return version;\n };\n TtfReader.prototype.readNameTable = function () {\n var tableInfo = this.getTable('name');\n this.offset = tableInfo.offset;\n var table = new TtfNameTable();\n table.formatSelector = this.readUInt16(this.offset);\n table.recordsCount = this.readUInt16(this.offset);\n table.offset = this.readUInt16(this.offset);\n table.nameRecords = [];\n var recordSize = 12;\n var position = this.offset;\n for (var i = 0; i < table.recordsCount; i++) {\n this.offset = position;\n var record = new TtfNameRecord();\n record.platformID = this.readUInt16(this.offset);\n record.encodingID = this.readUInt16(this.offset);\n record.languageID = this.readUInt16(this.offset);\n record.nameID = this.readUInt16(this.offset);\n record.length = this.readUInt16(this.offset);\n record.offset = this.readUInt16(this.offset);\n this.offset = tableInfo.offset + table.offset + record.offset;\n var unicode = (record.platformID === 0 || record.platformID === 3);\n record.name = this.readString(record.length, unicode);\n table.nameRecords[i] = record;\n position += recordSize;\n }\n return table;\n };\n TtfReader.prototype.readHeadTable = function () {\n var tableInfo = this.getTable('head');\n this.offset = tableInfo.offset;\n var table = new TtfHeadTable();\n table.version = this.readFixed(this.offset);\n table.fontRevision = this.readFixed(this.offset);\n table.checkSumAdjustment = this.readUInt32(this.offset);\n table.magicNumber = this.readUInt32(this.offset);\n table.flags = this.readUInt16(this.offset);\n table.unitsPerEm = this.readUInt16(this.offset);\n table.created = this.readInt64(this.offset);\n table.modified = this.readInt64(this.offset);\n table.xMin = this.readInt16(this.offset);\n table.yMin = this.readInt16(this.offset);\n table.xMax = this.readInt16(this.offset);\n table.yMax = this.readInt16(this.offset);\n table.macStyle = this.readUInt16(this.offset);\n table.lowestReadableSize = this.readUInt16(this.offset);\n table.fontDirectionHint = this.readInt16(this.offset);\n table.indexToLocalFormat = this.readInt16(this.offset);\n table.glyphDataFormat = this.readInt16(this.offset);\n return table;\n };\n TtfReader.prototype.readHorizontalHeaderTable = function () {\n var tableInfo = this.getTable('hhea');\n this.offset = tableInfo.offset;\n var table = new TtfHorizontalHeaderTable();\n table.version = this.readFixed(this.offset);\n table.ascender = this.readInt16(this.offset);\n table.descender = this.readInt16(this.offset);\n table.lineGap = this.readInt16(this.offset);\n table.advanceWidthMax = this.readUInt16(this.offset);\n table.minLeftSideBearing = this.readInt16(this.offset);\n table.minRightSideBearing = this.readInt16(this.offset);\n table.xMaxExtent = this.readInt16(this.offset);\n table.caretSlopeRise = this.readInt16(this.offset);\n table.caretSlopeRun = this.readInt16(this.offset);\n //skip 2 * 5\n this.offset += 10;\n table.metricDataFormat = this.readInt16(this.offset);\n table.numberOfHMetrics = this.readUInt16(this.offset);\n return table;\n };\n TtfReader.prototype.readOS2Table = function () {\n var tableInfo = this.getTable('OS/2');\n this.offset = tableInfo.offset;\n var table = new TtfOS2Table();\n table.version = this.readUInt16(this.offset);\n table.xAvgCharWidth = this.readInt16(this.offset);\n table.usWeightClass = this.readUInt16(this.offset);\n table.usWidthClass = this.readUInt16(this.offset);\n table.fsType = this.readInt16(this.offset);\n table.ySubscriptXSize = this.readInt16(this.offset);\n table.ySubscriptYSize = this.readInt16(this.offset);\n table.ySubscriptXOffset = this.readInt16(this.offset);\n table.ySubscriptYOffset = this.readInt16(this.offset);\n table.ySuperscriptXSize = this.readInt16(this.offset);\n table.ySuperscriptYSize = this.readInt16(this.offset);\n table.ySuperscriptXOffset = this.readInt16(this.offset);\n table.ySuperscriptYOffset = this.readInt16(this.offset);\n table.yStrikeoutSize = this.readInt16(this.offset);\n table.yStrikeoutPosition = this.readInt16(this.offset);\n table.sFamilyClass = this.readInt16(this.offset);\n table.panose = this.readBytes(10);\n table.ulUnicodeRange1 = this.readUInt32(this.offset);\n table.ulUnicodeRange2 = this.readUInt32(this.offset);\n table.ulUnicodeRange3 = this.readUInt32(this.offset);\n table.ulUnicodeRange4 = this.readUInt32(this.offset);\n table.vendorIdentifier = this.readBytes(4);\n table.fsSelection = this.readUInt16(this.offset);\n table.usFirstCharIndex = this.readUInt16(this.offset);\n table.usLastCharIndex = this.readUInt16(this.offset);\n table.sTypoAscender = this.readInt16(this.offset);\n table.sTypoDescender = this.readInt16(this.offset);\n table.sTypoLineGap = this.readInt16(this.offset);\n table.usWinAscent = this.readUInt16(this.offset);\n table.usWinDescent = this.readUInt16(this.offset);\n table.ulCodePageRange1 = this.readUInt32(this.offset);\n table.ulCodePageRange2 = this.readUInt32(this.offset);\n if (table.version > 1) {\n table.sxHeight = this.readInt16(this.offset);\n table.sCapHeight = this.readInt16(this.offset);\n table.usDefaultChar = this.readUInt16(this.offset);\n table.usBreakChar = this.readUInt16(this.offset);\n table.usMaxContext = this.readUInt16(this.offset);\n }\n else {\n table.sxHeight = 0;\n table.sCapHeight = 0;\n table.usDefaultChar = 0;\n table.usBreakChar = 0;\n table.usMaxContext = 0;\n }\n return table;\n };\n TtfReader.prototype.readPostTable = function () {\n var tableInfo = this.getTable('post');\n this.offset = tableInfo.offset;\n var table = new TtfPostTable();\n table.formatType = this.readFixed(this.offset);\n table.italicAngle = this.readFixed(this.offset);\n table.underlinePosition = this.readInt16(this.offset);\n table.underlineThickness = this.readInt16(this.offset);\n table.isFixedPitch = this.readUInt32(this.offset);\n table.minType42 = this.readUInt32(this.offset);\n table.maxType42 = this.readUInt32(this.offset);\n table.minType1 = this.readUInt32(this.offset);\n table.maxType1 = this.readUInt32(this.offset);\n return table;\n };\n /**\n * Reads Width of the glyphs.\n */\n TtfReader.prototype.readWidthTable = function (glyphCount, unitsPerEm) {\n var tableInfo = this.getTable('hmtx');\n this.offset = tableInfo.offset;\n var width = [];\n for (var i = 0; i < glyphCount; i++) {\n var glyph = new TtfLongHorMetric();\n glyph.advanceWidth = this.readUInt16(this.offset);\n glyph.lsb = this.readInt16(this.offset);\n var glyphWidth = glyph.advanceWidth * 1000 / unitsPerEm;\n width.push(Math.floor(glyphWidth));\n }\n return width;\n };\n /**\n * Reads the cmap table.\n */\n TtfReader.prototype.readCmapTable = function () {\n var tableInfo = this.getTable('cmap');\n this.offset = tableInfo.offset;\n var table = new TtfCmapTable();\n table.version = this.readUInt16(this.offset);\n table.tablesCount = this.readUInt16(this.offset);\n var position = this.offset;\n var subTables = [];\n for (var i = 0; i < table.tablesCount; i++) {\n this.offset = position;\n var subTable = new TtfCmapSubTable();\n subTable.platformID = this.readUInt16(this.offset);\n subTable.encodingID = this.readUInt16(this.offset);\n subTable.offset = this.readUInt32(this.offset);\n position = this.offset;\n this.readCmapSubTable(subTable);\n subTables[i] = subTable;\n }\n return subTables;\n };\n /**\n * Reads the cmap sub table.\n */\n TtfReader.prototype.readCmapSubTable = function (subTable) {\n var tableInfo = this.getTable('cmap');\n this.offset = tableInfo.offset + subTable.offset;\n var format = this.readUInt16(this.offset);\n var encoding = this.getCmapEncoding(subTable.platformID, subTable.encodingID);\n var platform = (encoding === TtfCmapEncoding.Macintosh) ? TtfPlatformID.Macintosh : TtfPlatformID.Microsoft;\n if (encoding !== TtfCmapEncoding.Unknown) {\n switch (format) {\n case TtfCmapFormat.Apple:\n this.readAppleCmapTable(subTable, encoding);\n break;\n case TtfCmapFormat.Microsoft:\n this.readMicrosoftCmapTable(subTable, encoding);\n break;\n case TtfCmapFormat.Trimmed:\n this.readTrimmedCmapTable(subTable, encoding);\n break;\n }\n }\n };\n /**\n * Reads Symbol cmap table.\n */\n TtfReader.prototype.readAppleCmapTable = function (subTable, encoding) {\n var tableInfo = this.getTable('cmap');\n this.offset = tableInfo.offset + subTable.offset;\n var table = new TtfAppleCmapSubTable();\n table.format = this.readUInt16(this.offset);\n table.length = this.readUInt16(this.offset);\n table.version = this.readUInt16(this.offset);\n if (this.maxMacIndex === null || this.maxMacIndex === undefined) {\n this.maxMacIndex = 0;\n }\n for (var i = 0; i < 256; ++i) {\n var glyphInfo = new TtfGlyphInfo();\n glyphInfo.index = this.readByte(this.offset);\n glyphInfo.width = this.getWidth(glyphInfo.index);\n glyphInfo.charCode = i;\n this.macintosh.setValue(i, glyphInfo);\n this.addGlyph(glyphInfo, encoding);\n // NOTE: this code fixes char codes that extends 0x100. However, it might corrupt something.\n this.maxMacIndex = Math.max(i, this.maxMacIndex);\n }\n };\n /**\n * Reads Symbol cmap table.\n */\n TtfReader.prototype.readMicrosoftCmapTable = function (subTable, encoding) {\n var tableInfo = this.getTable('cmap');\n this.offset = tableInfo.offset + subTable.offset;\n var collection = (encoding === TtfCmapEncoding.Unicode) ? this.microsoft : this.macintosh;\n var table = new TtfMicrosoftCmapSubTable();\n table.format = this.readUInt16(this.offset);\n table.length = this.readUInt16(this.offset);\n table.version = this.readUInt16(this.offset);\n table.segCountX2 = this.readUInt16(this.offset);\n table.searchRange = this.readUInt16(this.offset);\n table.entrySelector = this.readUInt16(this.offset);\n table.rangeShift = this.readUInt16(this.offset);\n var segCount = table.segCountX2 / 2;\n table.endCount = this.readUshortArray(segCount);\n table.reservedPad = this.readUInt16(this.offset);\n table.startCount = this.readUshortArray(segCount);\n table.idDelta = this.readUshortArray(segCount);\n table.idRangeOffset = this.readUshortArray(segCount);\n var length = (table.length / 2 - 8) - (segCount * 4);\n table.glyphID = this.readUshortArray(length);\n // Process glyphIdArray array.\n var codeOffset = 0;\n var index = 0;\n for (var j = 0; j < segCount; j++) {\n for (var k = table.startCount[j]; k <= table.endCount[j] && k !== 65535; k++) {\n if (table.idRangeOffset[j] === 0) {\n codeOffset = (k + table.idDelta[j]) & 65535;\n }\n else {\n index = j + table.idRangeOffset[j] / 2 - segCount + k - table.startCount[j];\n if (index >= table.glyphID.length) {\n continue;\n }\n codeOffset = (table.glyphID[index] + table.idDelta[j]) & 65535;\n }\n var glyph = new TtfGlyphInfo();\n glyph.index = codeOffset;\n glyph.width = this.getWidth(glyph.index);\n var id = (encoding === TtfCmapEncoding.Symbol) ? ((k & 0xff00) === 0xf000 ? k & 0xff : k) : k;\n glyph.charCode = id;\n collection.setValue(id, glyph);\n this.addGlyph(glyph, encoding);\n }\n }\n };\n /**\n * Reads Trimed cmap table.\n */\n TtfReader.prototype.readTrimmedCmapTable = function (subTable, encoding) {\n var tableInfo = this.getTable('cmap');\n this.offset = tableInfo.offset + subTable.offset;\n var table = new TtfTrimmedCmapSubTable();\n table.format = this.readUInt16(this.offset);\n table.length = this.readUInt16(this.offset);\n table.version = this.readUInt16(this.offset);\n table.firstCode = this.readUInt16(this.offset);\n table.entryCount = this.readUInt16(this.offset);\n for (var i = 0; i < table.entryCount; ++i) {\n var glyphInfo = new TtfGlyphInfo();\n glyphInfo.index = this.readUInt16(this.offset);\n glyphInfo.width = this.getWidth(glyphInfo.index);\n glyphInfo.charCode = i + table.firstCode;\n this.macintosh.setValue(i, glyphInfo);\n this.addGlyph(glyphInfo, encoding);\n // NOTE: this code fixes char codes that extends 0x100. However, it might corrupt something.\n this.maxMacIndex = Math.max(i, this.maxMacIndex);\n }\n };\n TtfReader.prototype.initializeFontName = function (nameTable) {\n for (var i = 0; i < nameTable.recordsCount; i++) {\n var record = nameTable.nameRecords[i];\n if (record.nameID === 1) {\n //font family\n this.metrics.fontFamily = record.name;\n }\n else if (record.nameID === 6) {\n //post script name\n this.metrics.postScriptName = record.name;\n }\n /* tslint:disable */\n if (this.metrics.fontFamily !== null && this.metrics.fontFamily !== undefined && this.metrics.postScriptName !== null && this.metrics.postScriptName !== undefined) {\n break;\n }\n /* tslint:disable */\n }\n };\n TtfReader.prototype.getTable = function (name) {\n // if (name === null) {\n // throw new Error('Argument Null Exception : name');\n // }\n var table = new TtfTableInfo();\n var obj;\n if (this.tableDirectory.containsKey(name)) {\n obj = this.tableDirectory.getValue(name);\n }\n if (obj !== null && obj !== undefined) {\n table = obj;\n }\n return table;\n };\n /**\n * Returns width of the glyph.\n */\n TtfReader.prototype.getWidth = function (glyphCode) {\n glyphCode = (glyphCode < this.width.length) ? glyphCode : this.width.length - 1;\n return this.width[glyphCode];\n };\n /**\n * Gets CMAP encoding based on platform ID and encoding ID.\n */\n /* tslint:disable */\n TtfReader.prototype.getCmapEncoding = function (platformID, encodingID) {\n var format = TtfCmapEncoding.Unknown;\n if (platformID == TtfPlatformID.Microsoft && encodingID == TtfMicrosoftEncodingID.Undefined) {\n // When building a symbol font for Windows,\n // the platform ID should be 3 and the encoding ID should be 0.\n format = TtfCmapEncoding.Symbol;\n }\n else if (platformID == TtfPlatformID.Microsoft && encodingID == TtfMicrosoftEncodingID.Unicode) {\n // When building a Unicode font for Windows,\n // the platform ID should be 3 and the encoding ID should be 1.\n format = TtfCmapEncoding.Unicode;\n }\n else if (platformID == TtfPlatformID.Macintosh && encodingID == TtfMacintoshEncodingID.Roman) {\n // When building a font that will be used on the Macintosh,\n // the platform ID should be 1 and the encoding ID should be 0.\n format = TtfCmapEncoding.Macintosh;\n }\n return format;\n };\n /* tslint:enable */\n /**\n * Adds glyph to the collection.\n */\n TtfReader.prototype.addGlyph = function (glyph, encoding) {\n var collection = null;\n switch (encoding) {\n case TtfCmapEncoding.Unicode:\n collection = this.microsoftGlyphs;\n break;\n case TtfCmapEncoding.Macintosh:\n case TtfCmapEncoding.Symbol:\n collection = this.macintoshGlyphs;\n break;\n }\n collection.setValue(glyph.index, glyph);\n };\n /**\n * Initializes metrics.\n */\n /* tslint:disable */\n TtfReader.prototype.initializeMetrics = function (nameTable, headTable, horizontalHeadTable, os2Table, postTable, cmapTables) {\n /* tslint:enable */\n // if (cmapTables === null) {\n // throw new Error('ArgumentNullException : cmapTables');\n // }\n this.initializeFontName(nameTable);\n // Get font encoding.\n var bSymbol = false;\n for (var i = 0; i < cmapTables.length; i++) {\n var subTable = cmapTables[i];\n var encoding = this.getCmapEncoding(subTable.platformID, subTable.encodingID);\n if (encoding === TtfCmapEncoding.Symbol) {\n bSymbol = true;\n break;\n }\n }\n this.metrics.isSymbol = bSymbol;\n this.metrics.macStyle = headTable.macStyle;\n this.metrics.isFixedPitch = (postTable.isFixedPitch !== 0);\n this.metrics.italicAngle = postTable.italicAngle;\n var factor = 1000 / headTable.unitsPerEm;\n this.metrics.winAscent = os2Table.sTypoAscender * factor;\n this.metrics.macAscent = horizontalHeadTable.ascender * factor;\n //m_metrics.MacAscent = os2Table.UsWinAscent * factor;\n // NOTE: This is stange workaround. The value is good if os2Table.SCapHeight != 0, otherwise it should be properly computed.\n this.metrics.capHeight = (os2Table.sCapHeight !== 0) ? os2Table.sCapHeight : 0.7 * headTable.unitsPerEm * factor;\n this.metrics.winDescent = os2Table.sTypoDescender * factor;\n this.metrics.macDescent = horizontalHeadTable.descender * factor;\n //m_metrics.MacDescent = -os2Table.UsWinDescent * factor;\n this.metrics.leading = (os2Table.sTypoAscender - os2Table.sTypoDescender + os2Table.sTypoLineGap) * factor;\n this.metrics.lineGap = Math.ceil(horizontalHeadTable.lineGap * factor);\n var left = headTable.xMin * factor;\n var top = Math.ceil(this.metrics.macAscent + this.metrics.lineGap);\n var right = headTable.xMax * factor;\n var bottom = this.metrics.macDescent;\n this.metrics.fontBox = new Rectangle(left, top, right, bottom);\n // NOTE: Strange!\n this.metrics.stemV = 80;\n this.metrics.widthTable = this.updateWidth();\n this.metrics.contains = this.tableDirectory.containsKey('CFF');\n this.metrics.subScriptSizeFactor = headTable.unitsPerEm / os2Table.ySubscriptYSize;\n this.metrics.superscriptSizeFactor = headTable.unitsPerEm / os2Table.ySuperscriptYSize;\n };\n /**\n * Updates chars structure which is used in the case of ansi encoding (256 bytes).\n */\n TtfReader.prototype.updateWidth = function () {\n var count = 256;\n var bytes = [];\n if (this.metrics.isSymbol) {\n for (var i = 0; i < count; i++) {\n var glyphInfo = this.getGlyph(String.fromCharCode(i));\n bytes[i] = (glyphInfo.empty) ? 0 : glyphInfo.width;\n }\n }\n else {\n var byteToProcess = [];\n var unknown = '?';\n var space = String.fromCharCode(32);\n for (var i = 0; i < count; i++) {\n byteToProcess[0] = i;\n var text = this.getString(byteToProcess, 0, byteToProcess.length);\n var ch = (text.length > 0) ? text[0] : unknown;\n var glyphInfo = this.getGlyph(ch);\n if (!glyphInfo.empty) {\n bytes[i] = glyphInfo.width;\n }\n else {\n glyphInfo = this.getGlyph(space);\n bytes[i] = (glyphInfo.empty) ? 0 : glyphInfo.width;\n }\n }\n }\n return bytes;\n };\n /**\n * Returns default glyph.\n */\n TtfReader.prototype.getDefaultGlyph = function () {\n var glyph = this.getGlyph(StringTokenizer.whiteSpace);\n return glyph;\n };\n /**\n * Reads unicode string from byte array.\n */\n TtfReader.prototype.getString = function (byteToProcess, start, length) {\n var result = '';\n for (var index = 0; index < length; index++) {\n result += String.fromCharCode(byteToProcess[index + start]);\n }\n return result;\n };\n /**\n * Reads loca table.\n */\n TtfReader.prototype.readLocaTable = function (bShort) {\n var tableInfo = this.getTable('loca');\n this.offset = tableInfo.offset;\n var table = new TtfLocaTable();\n var buffer = null;\n if (bShort) {\n var len = tableInfo.length / 2;\n buffer = [];\n for (var i = 0; i < len; i++) {\n buffer[i] = this.readUInt16(this.offset) * 2;\n }\n }\n else {\n var len = tableInfo.length / 4;\n buffer = [];\n for (var i = 0; i < len; i++) {\n buffer[i] = this.readUInt32(this.offset);\n }\n }\n table.offsets = buffer;\n return table;\n };\n /**\n * Updates hash table of used glyphs.\n */\n TtfReader.prototype.updateGlyphChars = function (glyphChars, locaTable) {\n // if (glyphChars === null) {\n // throw new Error('Argument Null Exception : glyphChars');\n // }\n // Add zero key.\n if (!glyphChars.containsKey(0)) {\n glyphChars.setValue(0, 0);\n }\n var clone = new Dictionary();\n var glyphCharKeys = glyphChars.keys();\n for (var i = 0; i < glyphCharKeys.length; i++) {\n clone.setValue(glyphCharKeys[i], glyphChars.getValue(glyphCharKeys[i]));\n }\n for (var i = 0; i < glyphCharKeys.length; i++) {\n var nextKey = glyphCharKeys[i];\n this.processCompositeGlyph(glyphChars, nextKey, locaTable);\n }\n };\n /**\n * Checks if glyph is composite or not.\n */\n TtfReader.prototype.processCompositeGlyph = function (glyphChars, glyph, locaTable) {\n // if (glyphChars === null) {\n // throw new Error('Argument Null Exception : glyphChars');\n // }\n // Is in range.\n if (glyph < locaTable.offsets.length - 1) {\n var glyphOffset = locaTable.offsets[glyph];\n if (glyphOffset !== locaTable.offsets[glyph + 1]) {\n var tableInfo = this.getTable('glyf');\n this.offset = tableInfo.offset + glyphOffset;\n var glyphHeader = new TtfGlyphHeader();\n glyphHeader.numberOfContours = this.readInt16(this.offset);\n glyphHeader.xMin = this.readInt16(this.offset);\n glyphHeader.yMin = this.readInt16(this.offset);\n glyphHeader.xMax = this.readInt16(this.offset);\n glyphHeader.yMax = this.readInt16(this.offset);\n // Glyph is composite.\n if (glyphHeader.numberOfContours < 0) {\n var skipBytes = 0;\n var entry = true;\n while (entry) {\n var flags = this.readUInt16(this.offset);\n var glyphIndex = this.readUInt16(this.offset);\n if (!glyphChars.containsKey(glyphIndex)) {\n glyphChars.setValue(glyphIndex, 0);\n }\n if ((flags & TtfCompositeGlyphFlags.MoreComponents) === 0) {\n break;\n }\n skipBytes = ((flags & TtfCompositeGlyphFlags.Arg1And2AreWords) !== 0) ? 4 : 2;\n if ((flags & TtfCompositeGlyphFlags.WeHaveScale) !== 0) {\n skipBytes += 2;\n }\n else if ((flags & TtfCompositeGlyphFlags.WeHaveAnXyScale) !== 0) {\n skipBytes += 4;\n }\n else if ((flags & TtfCompositeGlyphFlags.WeHaveTwoByTwo) !== 0) {\n skipBytes += 2 * 4;\n }\n this.offset += skipBytes;\n }\n }\n }\n }\n };\n /**\n * Creates new glyph tables based on chars that are used for output.\n */\n /* tslint:disable */\n TtfReader.prototype.generateGlyphTable = function (glyphChars, locaTable, newLocaTable, newGlyphTable) {\n /* tslint:enable */\n // if (glyphChars === null) {\n // throw new Error('Argument Null Exception : glyphChars');\n // }\n newLocaTable = [];\n // Sorting used glyphs keys.\n var activeGlyphs = glyphChars.keys();\n activeGlyphs.sort(function (a, b) { return a - b; });\n var glyphSize = 0;\n for (var i = 0; i < activeGlyphs.length; i++) {\n var glyphIndex = activeGlyphs[i];\n if (locaTable.offsets.length > 0) {\n glyphSize += locaTable.offsets[glyphIndex + 1] - locaTable.offsets[glyphIndex];\n }\n }\n var glyphSizeAligned = this.align(glyphSize);\n newGlyphTable = [];\n for (var i = 0; i < glyphSizeAligned; i++) {\n newGlyphTable.push(0);\n }\n var nextGlyphOffset = 0;\n var nextGlyphIndex = 0;\n var table = this.getTable('glyf');\n // Creating NewLocaTable - that would hold offsets for filtered glyphs.\n for (var i = 0; i < locaTable.offsets.length; i++) {\n newLocaTable.push(nextGlyphOffset);\n if (nextGlyphIndex < activeGlyphs.length && activeGlyphs[nextGlyphIndex] === i) {\n ++nextGlyphIndex;\n newLocaTable[i] = nextGlyphOffset;\n var oldGlyphOffset = locaTable.offsets[i];\n var oldNextGlyphOffset = locaTable.offsets[i + 1] - oldGlyphOffset;\n if (oldNextGlyphOffset > 0) {\n this.offset = table.offset + oldGlyphOffset;\n var result = this.read(newGlyphTable, nextGlyphOffset, oldNextGlyphOffset);\n newGlyphTable = result.buffer;\n nextGlyphOffset += oldNextGlyphOffset;\n }\n }\n }\n return { glyphTableSize: glyphSize, newLocaTable: newLocaTable, newGlyphTable: newGlyphTable };\n };\n /**\n * Updates new Loca table.\n */\n /* tslint:disable */\n TtfReader.prototype.updateLocaTable = function (newLocaTable, bLocaIsShort, newLocaTableOut) {\n /* tslint:enable */\n if (newLocaTable === null) {\n throw new Error('Argument Null Exception : newLocaTable');\n }\n var size = (bLocaIsShort) ? newLocaTable.length * 2 : newLocaTable.length * 4;\n var count = this.align(size);\n //BigEndianWiter\n var writer = new BigEndianWriter(count);\n for (var i = 0; i < newLocaTable.length; i++) {\n var value = newLocaTable[i];\n if (bLocaIsShort) {\n value /= 2;\n writer.writeShort(value);\n }\n else {\n writer.writeInt(value);\n }\n }\n return { newLocaUpdated: writer.data, newLocaSize: size };\n };\n /**\n * Aligns number to be divisible on 4.\n */\n TtfReader.prototype.align = function (value) {\n return (value + 3) & (~3);\n };\n /**\n * Returns font program data.\n */\n /* tslint:disable */\n TtfReader.prototype.getFontProgram = function (newLocaTableOut, newGlyphTable, glyphTableSize, locaTableSize) {\n /* tslint:enable */\n if (newLocaTableOut === null) {\n throw new Error('Argument Null Exception : newLocaTableOut');\n }\n if (newGlyphTable === null) {\n throw new Error('Argument Null Exception : newGlyphTable');\n }\n var tableNames = this.tableNames;\n var result = this.getFontProgramLength(newLocaTableOut, newGlyphTable, 0);\n var fontProgramLength = result.fontProgramLength;\n var numTables = result.numTables;\n var writer = new BigEndianWriter(fontProgramLength);\n writer.writeInt(0x10000);\n writer.writeShort(numTables);\n var entrySelector = this.entrySelectors[numTables];\n writer.writeShort((1 << (entrySelector & 31)) * 16);\n writer.writeShort(entrySelector);\n writer.writeShort((numTables - (1 << (entrySelector & 31))) * 16);\n // Writing to destination buffer - checksums && sizes of used tables.\n this.writeCheckSums(writer, numTables, newLocaTableOut, newGlyphTable, glyphTableSize, locaTableSize);\n // // Writing to destination buffer - used glyphs.\n this.writeGlyphs(writer, newLocaTableOut, newGlyphTable);\n return writer.data;\n };\n /* tslint:disable */\n TtfReader.prototype.getFontProgramLength = function (newLocaTableOut, newGlyphTable, numTables) {\n /* tslint:enable */\n if (newLocaTableOut === null) {\n throw new Error('Argument Null Exception : newLocaTableOut');\n }\n if (newGlyphTable === null) {\n throw new Error('Argument Null Exception : newGlyphTable');\n }\n // glyf and loca are used by default;\n numTables = 2;\n var tableNames = this.tableNames;\n var fontProgramLength = 0;\n for (var i = 0; i < tableNames.length; i++) {\n var tableName = tableNames[i];\n if (tableName !== 'glyf' && tableName !== 'loca') {\n var table = this.getTable(tableName);\n if (!table.empty) {\n ++numTables;\n fontProgramLength += this.align(table.length);\n }\n }\n }\n fontProgramLength += newLocaTableOut.length;\n fontProgramLength += newGlyphTable.length;\n var usedTablesSize = numTables * 16 + (3 * 4);\n fontProgramLength += usedTablesSize;\n return { fontProgramLength: fontProgramLength, numTables: numTables };\n };\n /**\n * Writing to destination buffer - checksums and sizes of used tables.\n */\n /* tslint:disable */\n TtfReader.prototype.writeCheckSums = function (writer, numTables, newLocaTableOut, newGlyphTable, glyphTableSize, locaTableSize) {\n /* tslint:enable */\n if (writer === null) {\n throw new Error('Argument Null Exception : writer');\n }\n if (newLocaTableOut === null) {\n throw new Error('Argument Null Exception : newLocaTableOut');\n }\n if (newGlyphTable === null) {\n throw new Error('Argument Null Exception : newGlyphTable');\n }\n var tableNames = this.tableNames;\n var usedTablesSize = numTables * 16 + (3 * 4);\n var nextTableSize = 0;\n for (var i = 0; i < tableNames.length; i++) {\n var tableName = tableNames[i];\n var tableInfo = this.getTable(tableName);\n if (tableInfo.empty) {\n continue;\n }\n writer.writeString(tableName);\n if (tableName === 'glyf') {\n var checksum = this.calculateCheckSum(newGlyphTable);\n writer.writeInt(checksum);\n nextTableSize = glyphTableSize;\n }\n else if (tableName === 'loca') {\n var checksum = this.calculateCheckSum(newLocaTableOut);\n writer.writeInt(checksum);\n nextTableSize = locaTableSize;\n }\n else {\n writer.writeInt(tableInfo.checksum);\n nextTableSize = tableInfo.length;\n }\n writer.writeUInt(usedTablesSize);\n writer.writeUInt(nextTableSize);\n usedTablesSize += this.align(nextTableSize);\n }\n };\n /**\n * Gets checksum from source buffer.\n */\n TtfReader.prototype.calculateCheckSum = function (bytes) {\n if (bytes === null) {\n throw new Error('Argument Null Exception : bytes');\n }\n var pos = 0;\n var byte1 = 0;\n var byte2 = 0;\n var byte3 = 0;\n var byte4 = 0;\n for (var i = 0; i < (bytes.length + 1) / 4; i++) {\n byte4 += (bytes[pos++] & 255);\n byte3 += (bytes[pos++] & 255);\n byte2 += (bytes[pos++] & 255);\n byte1 += (bytes[pos++] & 255);\n }\n var result = byte1;\n result += (byte2 << 8);\n result += (byte3 << 16);\n result += (byte4 << 24);\n return result;\n };\n /**\n * Writing to destination buffer - used glyphs.\n */\n TtfReader.prototype.writeGlyphs = function (writer, newLocaTable, newGlyphTable) {\n if (writer === null) {\n throw new Error('Argument Null Exception : writer');\n }\n if (newLocaTable === null) {\n throw new Error('Argument Null Exception : newLocaTableOut');\n }\n if (newGlyphTable === null) {\n throw new Error('Argument Null Exception : newGlyphTable');\n }\n var tableNames = this.tableNames;\n for (var i = 0; i < tableNames.length; i++) {\n var tableName = tableNames[i];\n var tableInfo = this.getTable(tableName);\n if (tableInfo.empty) {\n continue;\n }\n if (tableName === 'glyf') {\n writer.writeBytes(newGlyphTable);\n }\n else if (tableName === 'loca') {\n writer.writeBytes(newLocaTable);\n }\n else {\n var count = this.align(tableInfo.length);\n var buff = [];\n for (var i_1 = 0; i_1 < count; i_1++) {\n buff.push(0);\n }\n this.offset = tableInfo.offset;\n var result = this.read(buff, 0, tableInfo.length);\n writer.writeBytes(result.buffer);\n }\n }\n };\n //public methods\n /**\n * Sets position value of font data.\n */\n TtfReader.prototype.setOffset = function (offset) {\n this.offset = offset;\n };\n /**\n * Creates font Internals\n * @private\n */\n TtfReader.prototype.createInternals = function () {\n this.metrics = new TtfMetrics();\n var nameTable = this.readNameTable();\n var headTable = this.readHeadTable();\n this.bIsLocaShort = (headTable.indexToLocalFormat === 0);\n var horizontalHeadTable = this.readHorizontalHeaderTable();\n var os2Table = this.readOS2Table();\n var postTable = this.readPostTable();\n this.width = this.readWidthTable(horizontalHeadTable.numberOfHMetrics, headTable.unitsPerEm);\n var subTables = this.readCmapTable();\n this.initializeMetrics(nameTable, headTable, horizontalHeadTable, os2Table, postTable, subTables);\n };\n TtfReader.prototype.getGlyph = function (charCode) {\n if (typeof charCode === 'number') {\n var obj1 = null;\n if (!this.metrics.isSymbol && this.microsoftGlyphs != null) {\n if (this.microsoftGlyphs.containsKey(charCode)) {\n obj1 = this.microsoftGlyphs.getValue(charCode);\n }\n }\n else if (this.metrics.isSymbol && this.macintoshGlyphs != null) {\n if (this.macintoshGlyphs.containsKey(charCode)) {\n obj1 = this.macintoshGlyphs.getValue(charCode);\n }\n }\n var glyph = (obj1 != null) ? obj1 : this.getDefaultGlyph();\n return glyph;\n }\n else {\n var obj = null;\n var code = charCode.charCodeAt(0);\n if (!this.metrics.isSymbol && this.microsoft !== null) {\n if (this.microsoft.containsKey(code)) {\n obj = this.microsoft.getValue(code);\n if (code !== StringTokenizer.whiteSpace.charCodeAt(0)) {\n this.isFontPresent = true;\n }\n }\n else if (code !== StringTokenizer.whiteSpace.charCodeAt(0)) {\n this.isFontPresent = false;\n }\n }\n else if (this.metrics.isSymbol && this.macintosh !== null || this.isMacTTF) {\n // NOTE: this code fixes char codes that extends 0x100. However, it might corrupt something.\n if (this.maxMacIndex !== 0) {\n code %= this.maxMacIndex + 1;\n }\n else {\n code = ((code & 0xff00) === 0xf000 ? code & 0xff : code);\n }\n if (this.macintosh.containsKey(code)) {\n obj = this.macintosh.getValue(code);\n this.isFontPresent = true;\n }\n }\n // Fix for StackOverFlow exception in XPS to PDF converter\n if (charCode === StringTokenizer.whiteSpace && obj === null) {\n obj = new TtfGlyphInfo();\n }\n var glyph = (obj !== null) ? obj : this.getDefaultGlyph();\n return glyph;\n }\n };\n /**\n * Gets hash table with chars indexed by glyph index.\n */\n TtfReader.prototype.getGlyphChars = function (chars) {\n if (chars === null || chars === undefined) {\n throw new Error('Argument Null Exception : chars');\n }\n var dictionary = new Dictionary();\n var charKeys = chars.keys();\n for (var i = 0; i < charKeys.length; i++) {\n var ch = charKeys[i];\n var glyph = this.getGlyph(ch);\n if (!glyph.empty) {\n dictionary.setValue(glyph.index, ch.charCodeAt(0));\n }\n }\n return dictionary;\n };\n /**\n * Gets all glyphs.\n */\n TtfReader.prototype.getAllGlyphs = function () {\n var allGlyphInfo = [];\n var info = new TtfGlyphInfo();\n var index = 0;\n for (var i = 0; i < this.width.length; i++) {\n var width = this.width[i];\n info.index = index;\n info.width = width;\n allGlyphInfo.push(info);\n index++;\n }\n return allGlyphInfo;\n };\n /**\n * Reads a font's program.\n * @private\n */\n TtfReader.prototype.readFontProgram = function (chars) {\n var glyphChars = this.getGlyphChars(chars);\n var locaTable = this.readLocaTable(this.bIsLocaShort);\n if (glyphChars.size() < chars.size()) {\n this.missedGlyphs = chars.size() - glyphChars.size();\n }\n this.updateGlyphChars(glyphChars, locaTable);\n /* tslint:disable */\n var result1 = this.generateGlyphTable(glyphChars, locaTable, null, null);\n /* tslint:enable */\n var glyphTableSize = result1.glyphTableSize;\n var newLocaTable = result1.newLocaTable;\n var newGlyphTable = result1.newGlyphTable;\n var result2 = this.updateLocaTable(newLocaTable, this.bIsLocaShort, null);\n var newLocaSize = result2.newLocaSize;\n var newLocaUpdated = result2.newLocaUpdated;\n var fontProgram = this.getFontProgram(newLocaUpdated, newGlyphTable, glyphTableSize, newLocaSize);\n return fontProgram;\n };\n /**\n * Reconverts string to be in proper format saved into PDF file.\n */\n TtfReader.prototype.convertString = function (text) {\n if (text === null) {\n throw new Error('Argument Null Exception : text');\n }\n var glyph = '';\n var i = 0;\n for (var k = 0; k < text.length; k++) {\n var ch = text[k];\n var glyphInfo = this.getGlyph(ch);\n if (!glyphInfo.empty) {\n glyph += String.fromCharCode(glyphInfo.index);\n i++;\n }\n }\n return glyph;\n };\n /**\n * Gets char width.\n */\n TtfReader.prototype.getCharWidth = function (code) {\n var glyphInfo = this.getGlyph(code);\n glyphInfo = (!glyphInfo.empty) ? glyphInfo : this.getDefaultGlyph();\n var codeWidth = (!glyphInfo.empty) ? glyphInfo.width : 0;\n return codeWidth;\n };\n TtfReader.prototype.readString = function (length, isUnicode) {\n if (isUnicode === undefined) {\n return this.readString(length, false);\n }\n else {\n //let buffer : number[] = this.readBytes(length);\n var result = '';\n if (isUnicode) {\n for (var i = 0; i < length; i++) {\n if (i % 2 !== 0) {\n result += String.fromCharCode(this.fontData[this.offset]);\n }\n this.offset += 1;\n }\n }\n else {\n for (var i = 0; i < length; i++) {\n result += String.fromCharCode(this.fontData[this.offset]);\n this.offset += 1;\n }\n }\n return result;\n }\n };\n TtfReader.prototype.readFixed = function (offset) {\n var integer = this.readInt16(offset);\n var sFraction = this.readInt16(offset + 2);\n var fraction = sFraction / 16384;\n return integer + fraction;\n };\n TtfReader.prototype.readInt32 = function (offset) {\n var i1 = this.fontData[offset + 3];\n var i2 = this.fontData[offset + 2];\n var i3 = this.fontData[offset + 1];\n var i4 = this.fontData[offset];\n this.offset += 4;\n return i1 + (i2 << 8) + (i3 << 16) + (i4 << 24);\n };\n TtfReader.prototype.readUInt32 = function (offset) {\n var i1 = this.fontData[offset + 3];\n var i2 = this.fontData[offset + 2];\n var i3 = this.fontData[offset + 1];\n var i4 = this.fontData[offset];\n this.offset += 4;\n return (i1 | i2 << 8 | i3 << 16 | i4 << 24);\n };\n // private readInt16(offset : number) : number {\n // let result : number = (this.fontData[offset] << 8) + this.fontData[offset + 1];\n // this.offset += 2;\n // return result;\n // }\n TtfReader.prototype.readInt16 = function (offset) {\n var result = (this.fontData[offset] << 8) + this.fontData[offset + 1];\n result = result & (1 << 15) ? result - 0x10000 : result;\n this.offset += 2;\n return result;\n };\n TtfReader.prototype.readInt64 = function (offset) {\n var low = this.readInt32(offset + 4);\n var n = this.readInt32(offset) * 4294967296.0 + low;\n if (low < 0) {\n n += 4294967296;\n }\n return n;\n };\n TtfReader.prototype.readUInt16 = function (offset) {\n var result = (this.fontData[offset] << 8) | this.fontData[offset + 1];\n this.offset += 2;\n return result;\n };\n /**\n * Reads ushort array.\n */\n TtfReader.prototype.readUshortArray = function (length) {\n var buffer = [];\n for (var i = 0; i < length; i++) {\n buffer[i] = this.readUInt16(this.offset);\n }\n return buffer;\n };\n TtfReader.prototype.readBytes = function (length) {\n var result = [];\n for (var i = 0; i < length; i++) {\n result.push(this.fontData[this.offset]);\n this.offset += 1;\n }\n return result;\n };\n TtfReader.prototype.readByte = function (offset) {\n var result = this.fontData[offset];\n this.offset += 1;\n return result;\n };\n /**\n * Reads bytes to array in BigEndian order.\n * @private\n */\n TtfReader.prototype.read = function (buffer, index, count) {\n if (buffer === null) {\n throw new Error('Argument Null Exception : buffer');\n }\n var written = 0;\n var read = 0;\n do {\n for (var i = 0; (i < count - written) && (this.offset + i < this.fontData.length); i++) {\n buffer[index + i] = this.fontData[this.offset + i];\n }\n read = count - written;\n this.offset += read;\n written += read;\n } while (written < count);\n return { buffer: buffer, written: written };\n };\n return TtfReader;\n}());\nexport { TtfReader };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { PdfFont } from './pdf-font';\nimport { PdfSubSuperScript } from './enum';\nimport { PdfArray } from './../../primitives/pdf-array';\n/**\n * `Metrics` of the font.\n * @private\n */\nvar PdfFontMetrics = /** @class */ (function () {\n function PdfFontMetrics() {\n /**\n * `Line gap`.\n * @private\n */\n this.lineGap = 0;\n }\n // Public methods\n /**\n * Returns `ascent` taking into consideration font`s size.\n * @private\n */\n PdfFontMetrics.prototype.getAscent = function (format) {\n var returnValue = this.ascent * PdfFont.charSizeMultiplier * this.getSize(format);\n return returnValue;\n };\n /**\n * Returns `descent` taking into consideration font`s size.\n * @private\n */\n PdfFontMetrics.prototype.getDescent = function (format) {\n var returnValue = this.descent * PdfFont.charSizeMultiplier * this.getSize(format);\n return returnValue;\n };\n /**\n * Returns `Line gap` taking into consideration font`s size.\n * @private\n */\n PdfFontMetrics.prototype.getLineGap = function (format) {\n var returnValue = this.lineGap * PdfFont.charSizeMultiplier * this.getSize(format);\n return returnValue;\n };\n /**\n * Returns `height` taking into consideration font`s size.\n * @private\n */\n PdfFontMetrics.prototype.getHeight = function (format) {\n var height;\n var clearTypeFonts = ['cambria', 'candara', 'constantia', 'corbel', 'cariadings'];\n var clearTypeFontCollection = [];\n for (var index = 0; index < clearTypeFonts.length; index++) {\n var font = clearTypeFonts[index];\n clearTypeFontCollection.push(font);\n }\n if (this.getDescent(format) < 0) {\n // if ((clearTypeFontCollection.indexOf(this.name.toLowerCase()) !== -1) && !this.isUnicodeFont) {\n // height = (this.GetAscent(format) - this.GetDescent(format) - this.GetLineGap(format));\n // } else {\n height = (this.getAscent(format) - this.getDescent(format) + this.getLineGap(format));\n // }\n }\n else {\n height = (this.getAscent(format) + this.getDescent(format) + this.getLineGap(format));\n }\n return height;\n };\n /**\n * Calculates `size` of the font depending on the subscript/superscript value.\n * @private\n */\n PdfFontMetrics.prototype.getSize = function (format) {\n var size = this.size;\n if (format != null) {\n switch (format.subSuperScript) {\n case PdfSubSuperScript.SubScript:\n size /= this.subScriptSizeFactor;\n break;\n case PdfSubSuperScript.SuperScript:\n size /= this.superscriptSizeFactor;\n break;\n }\n }\n return size;\n };\n /**\n * `Clones` the metrics.\n * @private\n */\n PdfFontMetrics.prototype.clone = function () {\n var metrics = this;\n metrics.widthTable = WidthTable.clone();\n return metrics;\n };\n Object.defineProperty(PdfFontMetrics.prototype, \"widthTable\", {\n // Properies\n /**\n * Gets or sets the `width table`.\n * @private\n */\n get: function () {\n return this.internalWidthTable;\n },\n set: function (value) {\n this.internalWidthTable = value;\n },\n enumerable: true,\n configurable: true\n });\n return PdfFontMetrics;\n}());\nexport { PdfFontMetrics };\nvar WidthTable = /** @class */ (function () {\n function WidthTable() {\n }\n /**\n * Static `clones` this instance of the WidthTable class.\n * @private\n */\n WidthTable.clone = function () {\n return null;\n };\n return WidthTable;\n}());\nexport { WidthTable };\nvar StandardWidthTable = /** @class */ (function (_super) {\n __extends(StandardWidthTable, _super);\n // Constructors\n /**\n * Initializes a new instance of the `StandardWidthTable` class.\n * @private\n */\n function StandardWidthTable(widths) {\n var _this = _super.call(this) || this;\n if (widths == null) {\n throw new Error('ArgumentNullException:widths');\n }\n _this.widths = widths;\n return _this;\n }\n //Properties\n /**\n * Gets the `32 bit number` at the specified index.\n * @private\n */\n StandardWidthTable.prototype.items = function (index) {\n if (index < 0 || index >= this.widths.length) {\n throw new Error('ArgumentOutOfRangeException:index, The character is not supported by the font.');\n }\n var result = this.widths[index];\n return result;\n };\n Object.defineProperty(StandardWidthTable.prototype, \"length\", {\n /**\n * Gets the `length` of the internal array.\n * @private\n */\n get: function () {\n return this.widths.length;\n },\n enumerable: true,\n configurable: true\n });\n //Overrides\n /**\n * `Clones` this instance of the WidthTable class.\n * @private\n */\n StandardWidthTable.prototype.clone = function () {\n var swt = this;\n swt.widths = this.widths;\n return swt;\n };\n /**\n * Converts width table to a `PDF array`.\n * @private\n */\n StandardWidthTable.prototype.toArray = function () {\n var arr = new PdfArray(this.widths);\n return arr;\n };\n return StandardWidthTable;\n}(WidthTable));\nexport { StandardWidthTable };\n","/**\n * TrueTypeFont.ts class for EJ2-PDF\n */\nimport { ByteArray } from './../../graphics/images/index';\nimport { TtfReader } from './ttf-reader';\nimport { PdfDictionary, SaveDescendantFontEventHandler, SaveFontDictionaryEventHandler } from './../../primitives/pdf-dictionary';\nimport { SaveFontProgramEventHandler, SaveCmapEventHandler } from './../../primitives/pdf-stream';\nimport { PdfStream } from './../../primitives/pdf-stream';\nimport { PdfArray } from './../../primitives/pdf-array';\nimport { PdfName } from './../../primitives/pdf-name';\nimport { PdfNumber } from './../../primitives/pdf-number';\nimport { PdfString } from './../../primitives/pdf-string';\nimport { PdfReferenceHolder } from './../../primitives/pdf-reference';\nimport { PdfFontMetrics } from './pdf-font-metrics';\nimport { StandardWidthTable } from './pdf-font-metrics';\nimport { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';\nimport { Dictionary } from './../../collections/dictionary';\nimport { FontDescriptorFlags } from './enum';\nimport { RectangleF } from './../../drawing/pdf-drawing';\nimport { Operators } from './../../input-output/pdf-operators';\nvar UnicodeTrueTypeFont = /** @class */ (function () {\n /* tslint:enable */\n //Constructors\n /**\n * Initializes a new instance of the `PdfTrueTypeFont` class.\n * @private\n */\n function UnicodeTrueTypeFont(base64String, size) {\n // Fields\n this.nameString = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n /**\n * Specifies the Internal variable to store fields of `PdfDictionaryProperties`.\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n /**\n * Indicates whether the font program is compressed or not.\n * @private\n */\n this.isCompress = false;\n /**\n * Indicates whether the font is embedded or not.\n */\n this.isEmbedFont = false;\n /**\n * Cmap table's start prefix.\n */\n /* tslint:disable */\n this.cmapPrefix = '/CIDInit /ProcSet findresource begin\\n12 dict begin\\nbegincmap' + Operators.newLine + '/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\\n/CMapName ' + '/Adobe-Identity-UCS def\\n/CMapType 2 def\\n1 begincodespacerange' + Operators.newLine;\n /* tslint:enable */\n /**\n * Cmap table's start suffix.\n */\n this.cmapEndCodespaceRange = 'endcodespacerange' + Operators.newLine;\n /**\n * Cmap's begin range marker.\n */\n this.cmapBeginRange = 'beginbfrange' + Operators.newLine;\n /**\n * Cmap's end range marker.\n */\n this.cmapEndRange = 'endbfrange' + Operators.newLine;\n /**\n * Cmap table's end\n */\n /* tslint:disable */\n this.cmapSuffix = 'endbfrange\\nendcmap\\nCMapName currentdict ' + '/CMap defineresource pop\\nend end' + Operators.newLine;\n if (base64String === null || base64String === undefined) {\n throw new Error('ArgumentNullException:base64String');\n }\n this.fontSize = size;\n this.fontString = base64String;\n this.Initialize();\n }\n //Implementation\n /**\n * Returns width of the char symbol.\n */\n UnicodeTrueTypeFont.prototype.getCharWidth = function (charCode) {\n var codeWidth = this.ttfReader.getCharWidth(charCode);\n return codeWidth;\n };\n /**\n * Returns width of the text line.\n */\n UnicodeTrueTypeFont.prototype.getLineWidth = function (line) {\n // if (line == null) {\n // throw new Error('ArgumentNullException : line');\n // }\n var width = 0;\n for (var i = 0, len = line.length; i < len; i++) {\n var ch = line[i];\n var charWidth = this.getCharWidth(ch);\n width += charWidth;\n }\n return width;\n };\n /**\n * Initializes a new instance of the `PdfTrueTypeFont` class.\n * @private\n */\n UnicodeTrueTypeFont.prototype.Initialize = function () {\n var byteArray = new ByteArray(this.fontString.length);\n byteArray.writeFromBase64String(this.fontString);\n this.fontData = byteArray.internalBuffer;\n this.ttfReader = new TtfReader(this.fontData);\n this.ttfMetrics = this.ttfReader.metrics;\n };\n UnicodeTrueTypeFont.prototype.createInternals = function () {\n this.fontDictionary = new PdfDictionary();\n this.fontProgram = new PdfStream();\n this.cmap = new PdfStream();\n this.descendantFont = new PdfDictionary();\n this.metrics = new PdfFontMetrics();\n this.ttfReader.createInternals();\n this.ttfMetrics = this.ttfReader.metrics;\n this.initializeMetrics();\n // Create all the dictionaries of the font.\n this.subsetName = this.getFontName();\n this.createDescendantFont();\n this.createCmap();\n this.createFontDictionary();\n this.createFontProgram();\n };\n UnicodeTrueTypeFont.prototype.getInternals = function () {\n return this.fontDictionary;\n };\n /**\n * Initializes metrics.\n */\n UnicodeTrueTypeFont.prototype.initializeMetrics = function () {\n var ttfMetrics = this.ttfReader.metrics;\n this.metrics.ascent = ttfMetrics.macAscent;\n this.metrics.descent = ttfMetrics.macDescent;\n this.metrics.height = ttfMetrics.macAscent - ttfMetrics.macDescent + ttfMetrics.lineGap;\n this.metrics.name = ttfMetrics.fontFamily;\n this.metrics.postScriptName = ttfMetrics.postScriptName;\n this.metrics.size = this.fontSize;\n this.metrics.widthTable = new StandardWidthTable(ttfMetrics.widthTable);\n this.metrics.lineGap = ttfMetrics.lineGap;\n this.metrics.subScriptSizeFactor = ttfMetrics.subScriptSizeFactor;\n this.metrics.superscriptSizeFactor = ttfMetrics.superscriptSizeFactor;\n this.metrics.isBold = ttfMetrics.isBold;\n };\n /**\n * Gets random string.\n */\n UnicodeTrueTypeFont.prototype.getFontName = function () {\n var builder = '';\n var name;\n // if (this.isEmbed === false) {\n for (var i = 0; i < 6; i++) {\n var index = Math.floor(Math.random() * (25 - 0 + 1)) + 0;\n builder += this.nameString[index];\n }\n builder += '+';\n // }\n builder += this.ttfReader.metrics.postScriptName;\n name = builder.toString();\n // if (name === '') {\n // name = this.ttfReader.metrics.fontFamily;\n // }\n name = this.formatName(name);\n return name;\n };\n /**\n * Generates name of the font.\n */\n UnicodeTrueTypeFont.prototype.formatName = function (fontName) {\n // if (fontName === null) {\n // throw new Error('ArgumentNullException : fontName');\n // }\n // if (fontName === '') {\n // throw new Error('ArgumentOutOfRangeException : fontName, Parameter can not be empty');\n // }\n var ret = fontName.replace('(', '#28');\n ret = ret.replace(')', '#29');\n ret = ret.replace('[', '#5B');\n ret = ret.replace(']', '#5D');\n ret = ret.replace('<', '#3C');\n ret = ret.replace('>', '#3E');\n ret = ret.replace('{', '#7B');\n ret = ret.replace('}', '#7D');\n ret = ret.replace('/', '#2F');\n ret = ret.replace('%', '#25');\n return ret.replace(' ', '#20');\n };\n /**\n * Creates descendant font.\n */\n UnicodeTrueTypeFont.prototype.createDescendantFont = function () {\n // Set property used to clone Font every time\n this.descendantFont.isFont = true;\n this.descendantFont.descendantFontBeginSave = new SaveDescendantFontEventHandler(this);\n this.descendantFont.items.setValue(this.dictionaryProperties.type, new PdfName(this.dictionaryProperties.font));\n this.descendantFont.items.setValue(this.dictionaryProperties.subtype, new PdfName(this.dictionaryProperties.cIDFontType2));\n this.descendantFont.items.setValue(this.dictionaryProperties.baseFont, new PdfName(this.subsetName));\n this.descendantFont.items.setValue(this.dictionaryProperties.cIDToGIDMap, new PdfName(this.dictionaryProperties.identity));\n this.descendantFont.items.setValue(this.dictionaryProperties.dw, new PdfNumber(1000));\n this.fontDescriptor = this.createFontDescriptor();\n this.descendantFont.items.setValue(this.dictionaryProperties.fontDescriptor, new PdfReferenceHolder(this.fontDescriptor));\n var systemInfo = this.createSystemInfo();\n this.descendantFont.items.setValue(this.dictionaryProperties.cIDSystemInfo, systemInfo);\n };\n /**\n * Creates font descriptor.\n */\n UnicodeTrueTypeFont.prototype.createFontDescriptor = function () {\n var descriptor = new PdfDictionary();\n var metrics = this.ttfReader.metrics;\n // Set property used to clone Font every time\n descriptor.isFont = true;\n descriptor.items.setValue(this.dictionaryProperties.type, new PdfName(this.dictionaryProperties.fontDescriptor));\n descriptor.items.setValue(this.dictionaryProperties.fontName, new PdfName(this.subsetName));\n descriptor.items.setValue(this.dictionaryProperties.flags, new PdfNumber(this.getDescriptorFlags()));\n descriptor.items.setValue(this.dictionaryProperties.fontBBox, PdfArray.fromRectangle(this.getBoundBox()));\n descriptor.items.setValue(this.dictionaryProperties.missingWidth, new PdfNumber(metrics.widthTable[32]));\n descriptor.items.setValue(this.dictionaryProperties.stemV, new PdfNumber(metrics.stemV));\n descriptor.items.setValue(this.dictionaryProperties.italicAngle, new PdfNumber(metrics.italicAngle));\n descriptor.items.setValue(this.dictionaryProperties.capHeight, new PdfNumber(metrics.capHeight));\n descriptor.items.setValue(this.dictionaryProperties.ascent, new PdfNumber(metrics.winAscent));\n descriptor.items.setValue(this.dictionaryProperties.descent, new PdfNumber(metrics.winDescent));\n descriptor.items.setValue(this.dictionaryProperties.leading, new PdfNumber(metrics.leading));\n descriptor.items.setValue(this.dictionaryProperties.avgWidth, new PdfNumber(metrics.widthTable[32]));\n descriptor.items.setValue(this.dictionaryProperties.fontFile2, new PdfReferenceHolder(this.fontProgram));\n descriptor.items.setValue(this.dictionaryProperties.maxWidth, new PdfNumber(metrics.widthTable[32]));\n descriptor.items.setValue(this.dictionaryProperties.xHeight, new PdfNumber(0));\n descriptor.items.setValue(this.dictionaryProperties.stemH, new PdfNumber(0));\n return descriptor;\n };\n /**\n * Generates cmap.\n * @private\n */\n UnicodeTrueTypeFont.prototype.createCmap = function () {\n this.cmap.cmapBeginSave = new SaveCmapEventHandler(this);\n };\n /**\n * Generates font dictionary.\n */\n UnicodeTrueTypeFont.prototype.createFontDictionary = function () {\n // Set property used to clone Font every time\n this.fontDictionary.isFont = true;\n this.fontDictionary.fontDictionaryBeginSave = new SaveFontDictionaryEventHandler(this);\n this.fontDictionary.items.setValue(this.dictionaryProperties.type, new PdfName(this.dictionaryProperties.font));\n this.fontDictionary.items.setValue(this.dictionaryProperties.baseFont, new PdfName(this.subsetName));\n this.fontDictionary.items.setValue(this.dictionaryProperties.subtype, new PdfName(this.dictionaryProperties.type0));\n this.fontDictionary.items.setValue(this.dictionaryProperties.encoding, new PdfName(this.dictionaryProperties.identityH));\n var descFonts = new PdfArray();\n var reference = new PdfReferenceHolder(this.descendantFont);\n // Set property used to clone Font every time\n descFonts.isFont = true;\n descFonts.add(reference);\n this.fontDictionary.items.setValue(this.dictionaryProperties.descendantFonts, descFonts);\n };\n /**\n * Creates font program.\n */\n UnicodeTrueTypeFont.prototype.createFontProgram = function () {\n this.fontProgram.fontProgramBeginSave = new SaveFontProgramEventHandler(this);\n };\n /**\n * Creates system info dictionary for CID font.\n * @private\n */\n UnicodeTrueTypeFont.prototype.createSystemInfo = function () {\n var systemInfo = new PdfDictionary();\n systemInfo.items.setValue(this.dictionaryProperties.registry, new PdfString('Adobe'));\n systemInfo.items.setValue(this.dictionaryProperties.ordering, new PdfString(this.dictionaryProperties.identity));\n systemInfo.items.setValue(this.dictionaryProperties.supplement, new PdfNumber(0));\n return systemInfo;\n };\n /**\n * Runs before font Dictionary will be saved.\n */\n UnicodeTrueTypeFont.prototype.descendantFontBeginSave = function () {\n if (this.usedChars !== null && this.usedChars !== undefined && this.usedChars.size() > 0) {\n var width = this.getDescendantWidth();\n if (width !== null) {\n this.descendantFont.items.setValue(this.dictionaryProperties.w, width);\n }\n }\n };\n /**\n * Runs before font Dictionary will be saved.\n */\n UnicodeTrueTypeFont.prototype.cmapBeginSave = function () {\n this.generateCmap();\n };\n /**\n * Runs before font Dictionary will be saved.\n */\n /* tslint:disable */\n UnicodeTrueTypeFont.prototype.fontDictionaryBeginSave = function () {\n if (this.usedChars !== null && this.usedChars !== undefined && this.usedChars.size() > 0 && !this.fontDictionary.containsKey(this.dictionaryProperties.toUnicode)) {\n this.fontDictionary.items.setValue(this.dictionaryProperties.toUnicode, new PdfReferenceHolder(this.cmap));\n }\n };\n /* tslint:enable */\n /**\n * Runs before font program stream save.\n */\n UnicodeTrueTypeFont.prototype.fontProgramBeginSave = function () {\n this.isCompress = true;\n this.generateFontProgram();\n };\n /**\n * Gets width description pad array for c i d font.\n */\n UnicodeTrueTypeFont.prototype.getDescendantWidth = function () {\n var array = new PdfArray();\n if (this.usedChars !== null && this.usedChars !== undefined && this.usedChars.size() > 0) {\n var glyphInfo = [];\n // if (!this.isEmbedFont) {\n var keys = this.usedChars.keys();\n for (var i = 0; i < keys.length; i++) {\n var chLen = keys[i];\n var glyph = this.ttfReader.getGlyph(chLen);\n if (glyph.empty) {\n continue;\n }\n glyphInfo.push(glyph);\n }\n // } else {\n // glyphInfo = this.ttfReader.getAllGlyphs();\n // }\n glyphInfo.sort(function (a, b) { return a.index - b.index; });\n var firstGlyphIndex = 0;\n var lastGlyphIndex = 0;\n var firstGlyphIndexWasSet = false;\n var widthDetails = new PdfArray();\n // if (!this.isEmbedFont) {\n for (var i = 0; i < glyphInfo.length; i++) {\n var glyph = glyphInfo[i];\n if (!firstGlyphIndexWasSet) {\n firstGlyphIndexWasSet = true;\n firstGlyphIndex = glyph.index;\n lastGlyphIndex = glyph.index - 1;\n }\n if ((lastGlyphIndex + 1 !== glyph.index || (i + 1 === glyphInfo.length)) && glyphInfo.length > 1) {\n // Add glyph index / width.\n array.add(new PdfNumber(firstGlyphIndex));\n if (i !== 0) {\n array.add(widthDetails);\n }\n firstGlyphIndex = glyph.index;\n widthDetails = new PdfArray();\n }\n widthDetails.add(new PdfNumber(glyph.width));\n if (i + 1 === glyphInfo.length) {\n array.add(new PdfNumber(firstGlyphIndex));\n array.add(widthDetails);\n }\n lastGlyphIndex = glyph.index;\n }\n // } else {\n // for (let i : number = 0; i < glyphInfo.length; i++) {\n // let glyph : TtfGlyphInfo = glyphInfo[i];\n // if (!firstGlyphIndexWasSet) {\n // firstGlyphIndexWasSet = true;\n // lastGlyphIndex = glyph.index - 1;\n // }\n // firstGlyphIndex = glyph.index;\n // if ((lastGlyphIndex + 1 === glyph.index || (i + 1 === glyphInfo.length)) && glyphInfo.length > 1) {\n // // Add glyph index / width.\n // widthDetails.add(new PdfNumber(glyph.width));\n // array.add(new PdfNumber(firstGlyphIndex));\n // array.add(widthDetails);\n // widthDetails = new PdfArray();\n // }\n // lastGlyphIndex = glyph.index;\n // }\n // }\n }\n return array;\n };\n /**\n * Creates cmap.\n */\n UnicodeTrueTypeFont.prototype.generateCmap = function () {\n if (this.usedChars !== null && this.usedChars !== undefined && this.usedChars.size() > 0) {\n var glyphChars = this.ttfReader.getGlyphChars(this.usedChars);\n if (glyphChars.size() > 0) {\n var keys = glyphChars.keys().sort();\n // add first and last glyph indexes\n var first = keys[0];\n var last = keys[keys.length - 1];\n var middlePart = this.toHexString(first, false) + this.toHexString(last, false) + Operators.newLine;\n var builder = '';\n builder += this.cmapPrefix;\n builder += middlePart;\n builder += this.cmapEndCodespaceRange;\n var nextRange = 0;\n for (var i = 0; i < keys.length; i++) {\n if (nextRange === 0) {\n if (i !== 0) {\n builder += this.cmapEndRange;\n }\n nextRange = Math.min(100, keys.length - i);\n builder += nextRange;\n builder += Operators.whiteSpace;\n builder += this.cmapBeginRange;\n }\n nextRange -= 1;\n var key = keys[i];\n /* tslint:disable */\n builder += this.toHexString(key, true) + this.toHexString(key, true) + this.toHexString(glyphChars.getValue(key), true) + '\\n';\n /* tslint:enable */\n }\n builder += this.cmapSuffix;\n this.cmap.clearStream();\n this.cmap.isFont = true;\n this.cmap.write(builder);\n }\n }\n };\n /**\n * Generates font program.\n */\n UnicodeTrueTypeFont.prototype.generateFontProgram = function () {\n var fontProgram = null;\n this.usedChars = (this.usedChars === null || this.usedChars === undefined) ? new Dictionary() : this.usedChars;\n this.ttfReader.setOffset(0);\n fontProgram = this.ttfReader.readFontProgram(this.usedChars);\n this.fontProgram.clearStream();\n this.fontProgram.isFont = true;\n this.fontProgram.writeBytes(fontProgram);\n };\n /**\n * Calculates flags for the font descriptor.\n * @private\n */\n UnicodeTrueTypeFont.prototype.getDescriptorFlags = function () {\n var flags = 0;\n var metrics = this.ttfReader.metrics;\n if (metrics.isFixedPitch) {\n flags |= FontDescriptorFlags.FixedPitch;\n }\n if (metrics.isSymbol) {\n flags |= FontDescriptorFlags.Symbolic;\n }\n else {\n flags |= FontDescriptorFlags.Nonsymbolic;\n }\n if (metrics.isItalic) {\n flags |= FontDescriptorFlags.Italic;\n }\n if (metrics.isBold) {\n flags |= FontDescriptorFlags.ForceBold;\n }\n return flags;\n };\n /**\n * Calculates BoundBox of the descriptor.\n * @private\n */\n UnicodeTrueTypeFont.prototype.getBoundBox = function () {\n var rect = this.ttfReader.metrics.fontBox;\n var width = Math.abs(rect.right - rect.left);\n var height = Math.abs(rect.top - rect.bottom);\n var rectangle = new RectangleF(rect.left, rect.bottom, width, height);\n return rectangle;\n };\n /**\n * Converts integer of decimal system to hex integer.\n */\n UnicodeTrueTypeFont.prototype.toHexString = function (n, isCaseChange) {\n var s = n.toString(16);\n if (isCaseChange) {\n s = s.toUpperCase();\n }\n return '<0000'.substring(0, 5 - s.length) + s + '>';\n };\n /**\n * Stores used symbols.\n */\n UnicodeTrueTypeFont.prototype.setSymbols = function (text) {\n if (text === null) {\n throw new Error('Argument Null Exception : text');\n }\n if (this.usedChars === null || this.usedChars === undefined) {\n this.usedChars = new Dictionary();\n }\n for (var i = 0; i < text.length; i++) {\n var ch = text[i];\n this.usedChars.setValue(ch, String.fromCharCode(0));\n }\n // else {\n // if (text === null) {\n // throw new Error('Argument Null Exception : glyphs');\n // }\n // if (this.usedChars === null || this.usedChars === undefined) {\n // this.usedChars = new Dictionary();\n // }\n // for (let i : number = 0; i < text.length; i++) {\n // let glyphIndex : number = text[i];\n // let glyph : TtfGlyphInfo = this.ttfReader.getGlyph(glyphIndex);\n // if (!glyph == null) {\n // let c : string = glyph.charCode.toLocaleString();\n // this.usedChars.setValue(c, String.fromCharCode(0));\n // }\n // }\n // }\n if (this.isEmbedFont === false) {\n this.getDescendantWidth();\n }\n };\n return UnicodeTrueTypeFont;\n}());\nexport { UnicodeTrueTypeFont };\n","/**\n * ArabicShapeRenderer.ts class for EJ2-PDF\n */\nimport { Dictionary } from './../../../collections/dictionary';\nvar ArabicShapeRenderer = /** @class */ (function () {\n //#endregion\n //#region Constructor\n function ArabicShapeRenderer() {\n //#region Constants\n this.arabicCharTable = [['\\u0621', '\\uFE80'], ['\\u0622', '\\uFE81', '\\uFE82'],\n ['\\u0623', '\\uFE83', '\\uFE84'],\n ['\\u0624', '\\uFE85', '\\uFE86'],\n ['\\u0625', '\\uFE87', '\\uFE88'],\n ['\\u0626', '\\uFE89', '\\uFE8A', '\\uFE8B', '\\uFE8C'],\n ['\\u0627', '\\uFE8D', '\\uFE8E'],\n ['\\u0628', '\\uFE8F', '\\uFE90', '\\uFE91', '\\uFE92'],\n ['\\u0629', '\\uFE93', '\\uFE94'],\n ['\\u062A', '\\uFE95', '\\uFE96', '\\uFE97', '\\uFE98'],\n ['\\u062B', '\\uFE99', '\\uFE9A', '\\uFE9B', '\\uFE9C'],\n ['\\u062C', '\\uFE9D', '\\uFE9E', '\\uFE9F', '\\uFEA0'],\n ['\\u062D', '\\uFEA1', '\\uFEA2', '\\uFEA3', '\\uFEA4'],\n ['\\u062E', '\\uFEA5', '\\uFEA6', '\\uFEA7', '\\uFEA8'],\n ['\\u062F', '\\uFEA9', '\\uFEAA'],\n ['\\u0630', '\\uFEAB', '\\uFEAC'],\n ['\\u0631', '\\uFEAD', '\\uFEAE'],\n ['\\u0632', '\\uFEAF', '\\uFEB0'],\n ['\\u0633', '\\uFEB1', '\\uFEB2', '\\uFEB3', '\\uFEB4'],\n ['\\u0634', '\\uFEB5', '\\uFEB6', '\\uFEB7', '\\uFEB8'],\n ['\\u0635', '\\uFEB9', '\\uFEBA', '\\uFEBB', '\\uFEBC'],\n ['\\u0636', '\\uFEBD', '\\uFEBE', '\\uFEBF', '\\uFEC0'],\n ['\\u0637', '\\uFEC1', '\\uFEC2', '\\uFEC3', '\\uFEC4'],\n ['\\u0638', '\\uFEC5', '\\uFEC6', '\\uFEC7', '\\uFEC8'],\n ['\\u0639', '\\uFEC9', '\\uFECA', '\\uFECB', '\\uFECC'],\n ['\\u063A', '\\uFECD', '\\uFECE', '\\uFECF', '\\uFED0'],\n ['\\u0640', '\\u0640', '\\u0640', '\\u0640', '\\u0640'],\n ['\\u0641', '\\uFED1', '\\uFED2', '\\uFED3', '\\uFED4'],\n ['\\u0642', '\\uFED5', '\\uFED6', '\\uFED7', '\\uFED8'],\n ['\\u0643', '\\uFED9', '\\uFEDA', '\\uFEDB', '\\uFEDC'],\n ['\\u0644', '\\uFEDD', '\\uFEDE', '\\uFEDF', '\\uFEE0'],\n ['\\u0645', '\\uFEE1', '\\uFEE2', '\\uFEE3', '\\uFEE4'],\n ['\\u0646', '\\uFEE5', '\\uFEE6', '\\uFEE7', '\\uFEE8'],\n ['\\u0647', '\\uFEE9', '\\uFEEA', '\\uFEEB', '\\uFEEC'],\n ['\\u0648', '\\uFEED', '\\uFEEE'],\n ['\\u0649', '\\uFEEF', '\\uFEF0', '\\uFBE8', '\\uFBE9'],\n ['\\u064A', '\\uFEF1', '\\uFEF2', '\\uFEF3', '\\uFEF4'],\n ['\\u0671', '\\uFB50', '\\uFB51'],\n ['\\u0679', '\\uFB66', '\\uFB67', '\\uFB68', '\\uFB69'],\n ['\\u067A', '\\uFB5E', '\\uFB5F', '\\uFB60', '\\uFB61'],\n ['\\u067B', '\\uFB52', '\\uFB53', '\\uFB54', '\\uFB55'],\n ['\\u067E', '\\uFB56', '\\uFB57', '\\uFB58', '\\uFB59'],\n ['\\u067F', '\\uFB62', '\\uFB63', '\\uFB64', '\\uFB65'],\n ['\\u0680', '\\uFB5A', '\\uFB5B', '\\uFB5C', '\\uFB5D'],\n ['\\u0683', '\\uFB76', '\\uFB77', '\\uFB78', '\\uFB79'],\n ['\\u0684', '\\uFB72', '\\uFB73', '\\uFB74', '\\uFB75'],\n ['\\u0686', '\\uFB7A', '\\uFB7B', '\\uFB7C', '\\uFB7D'],\n ['\\u0687', '\\uFB7E', '\\uFB7F', '\\uFB80', '\\uFB81'],\n ['\\u0688', '\\uFB88', '\\uFB89'],\n ['\\u068C', '\\uFB84', '\\uFB85'],\n ['\\u068D', '\\uFB82', '\\uFB83'],\n ['\\u068E', '\\uFB86', '\\uFB87'],\n ['\\u0691', '\\uFB8C', '\\uFB8D'],\n ['\\u0698', '\\uFB8A', '\\uFB8B'],\n ['\\u06A4', '\\uFB6A', '\\uFB6B', '\\uFB6C', '\\uFB6D'],\n ['\\u06A6', '\\uFB6E', '\\uFB6F', '\\uFB70', '\\uFB71'],\n ['\\u06A9', '\\uFB8E', '\\uFB8F', '\\uFB90', '\\uFB91'],\n ['\\u06AD', '\\uFBD3', '\\uFBD4', '\\uFBD5', '\\uFBD6'],\n ['\\u06AF', '\\uFB92', '\\uFB93', '\\uFB94', '\\uFB95'],\n ['\\u06B1', '\\uFB9A', '\\uFB9B', '\\uFB9C', '\\uFB9D'],\n ['\\u06B3', '\\uFB96', '\\uFB97', '\\uFB98', '\\uFB99'],\n ['\\u06BA', '\\uFB9E', '\\uFB9F'],\n ['\\u06BB', '\\uFBA0', '\\uFBA1', '\\uFBA2', '\\uFBA3'],\n ['\\u06BE', '\\uFBAA', '\\uFBAB', '\\uFBAC', '\\uFBAD'],\n ['\\u06C0', '\\uFBA4', '\\uFBA5'],\n ['\\u06C1', '\\uFBA6', '\\uFBA7', '\\uFBA8', '\\uFBA9'],\n ['\\u06C5', '\\uFBE0', '\\uFBE1'],\n ['\\u06C6', '\\uFBD9', '\\uFBDA'],\n ['\\u06C7', '\\uFBD7', '\\uFBD8'],\n ['\\u06C8', '\\uFBDB', '\\uFBDC'],\n ['\\u06C9', '\\uFBE2', '\\uFBE3'],\n ['\\u06CB', '\\uFBDE', '\\uFBDF'],\n ['\\u06CC', '\\uFBFC', '\\uFBFD', '\\uFBFE', '\\uFBFF'],\n ['\\u06D0', '\\uFBE4', '\\uFBE5', '\\uFBE6', '\\uFBE7'],\n ['\\u06D2', '\\uFBAE', '\\uFBAF'],\n ['\\u06D3', '\\uFBB0', '\\uFBB1']\n ];\n this.alef = '\\u0627';\n this.alefHamza = '\\u0623';\n this.alefHamzaBelow = '\\u0625';\n this.alefMadda = '\\u0622';\n this.lam = '\\u0644';\n this.hamza = '\\u0621';\n this.zeroWidthJoiner = '\\u200D';\n this.hamzaAbove = '\\u0654';\n this.hamzaBelow = '\\u0655';\n this.wawHamza = '\\u0624';\n this.yehHamza = '\\u0626';\n this.waw = '\\u0648';\n this.alefMaksura = '\\u0649';\n this.yeh = '\\u064A';\n this.farsiYeh = '\\u06CC';\n this.shadda = '\\u0651';\n this.madda = '\\u0653';\n this.lwa = '\\uFEFB';\n this.lwawh = '\\uFEF7';\n this.lwawhb = '\\uFEF9';\n this.lwawm = '\\uFEF5';\n this.bwhb = '\\u06D3';\n this.fathatan = '\\u064B';\n this.superScriptalef = '\\u0670';\n this.vowel = 0x1;\n // #endregion\n //#region Fields\n this.arabicMapTable = new Dictionary();\n for (var i = 0; i < this.arabicCharTable.length; i++) {\n this.arabicMapTable.setValue(this.arabicCharTable[i][0], this.arabicCharTable[i]);\n }\n }\n //#endregion\n //#region implementation\n ArabicShapeRenderer.prototype.getCharacterShape = function (input, index) {\n if ((input >= this.hamza) && (input <= this.bwhb)) {\n var value = [];\n if (this.arabicMapTable.getValue(input)) {\n value = this.arabicMapTable.getValue(input);\n return value[index + 1];\n }\n }\n else if (input >= this.lwawm && input <= this.lwa) {\n return (input);\n }\n return input;\n };\n ArabicShapeRenderer.prototype.shape = function (text, level) {\n var builder = '';\n var str2 = '';\n for (var i = 0; i < text.length; i++) {\n var c = text[i];\n if (c >= '' && c <= 'ۿ') {\n //if(c>= 0x0600.toString() && c<= 0x06FF.toString()) {\n str2 = str2 + c;\n }\n else {\n if (str2.length > 0) {\n var st = this.doShape(str2.toString(), 0);\n builder = builder + st;\n str2 = '';\n }\n builder = builder + c;\n }\n }\n if (str2.length > 0) {\n var st = this.doShape(str2.toString(), 0);\n builder = builder + st;\n }\n return builder.toString();\n };\n ArabicShapeRenderer.prototype.doShape = function (input, level) {\n var str = '';\n var ligature = 0;\n var len = 0;\n var i = 0;\n var next = '';\n var previous = new ArabicShape();\n var present = new ArabicShape();\n while (i < input.length) {\n next = input[i++];\n ligature = this.ligature(next, present);\n if (ligature === 0) {\n var shapeCount = this.getShapeCount(next);\n len = (shapeCount === 1) ? 0 : 2;\n if (previous.Shapes > 2) {\n len += 1;\n }\n len = len % (present.Shapes);\n present.Value = this.getCharacterShape(present.Value, len);\n str = this.append(str, previous, level);\n previous = present;\n present = new ArabicShape();\n present.Value = next;\n present.Shapes = shapeCount;\n present.Ligature++;\n }\n }\n len = (previous.Shapes > 2) ? 1 : 0;\n len = len % (present.Shapes);\n present.Value = this.getCharacterShape(present.Value, len);\n str = this.append(str, previous, level);\n str = this.append(str, present, level);\n return str.toString();\n };\n ArabicShapeRenderer.prototype.append = function (builder, shape, level) {\n if (shape.Value !== '') {\n builder = builder + shape.Value;\n shape.Ligature -= 1;\n if (shape.Type !== '') {\n if ((level & this.vowel) === 0) {\n builder = builder + shape.Type;\n shape.Ligature -= 1;\n }\n else {\n shape.Ligature -= 1;\n }\n }\n if (shape.vowel !== '') {\n if ((level & this.vowel) === 0) {\n builder = builder + shape.vowel;\n shape.Ligature -= 1;\n }\n else {\n shape.Ligature -= 1;\n }\n }\n }\n return builder;\n };\n ArabicShapeRenderer.prototype.ligature = function (value, shape) {\n if (shape.Value !== '') {\n var result = 0;\n if ((value >= this.fathatan && value <= this.hamzaBelow) || value === this.superScriptalef) {\n result = 1;\n if ((shape.vowel !== '') && (value !== this.shadda)) {\n result = 2;\n }\n if (value === this.shadda) {\n if (shape.Type == null) {\n shape.Type = this.shadda;\n }\n else {\n return 0;\n }\n }\n else if (value === this.hamzaBelow) {\n if (shape.Value === this.alef) {\n shape.Value = this.alefHamzaBelow;\n result = 2;\n }\n else if (value === this.lwa) {\n shape.Value = this.lwawhb;\n result = 2;\n }\n else {\n shape.Type = this.hamzaBelow;\n }\n }\n else if (value === this.hamzaAbove) {\n if (shape.Value === this.alef) {\n shape.Value = this.alefHamza;\n result = 2;\n }\n else if (shape.Value === this.lwa) {\n shape.Value = this.lwawh;\n result = 2;\n }\n else if (shape.Value === this.waw) {\n shape.Value = this.wawHamza;\n result = 2;\n }\n else if (shape.Value === this.yeh || shape.Value === this.alefMaksura || shape.Value === this.farsiYeh) {\n shape.Value = this.yehHamza;\n result = 2;\n }\n else {\n shape.Type = this.hamzaAbove;\n }\n }\n else if (value === this.madda) {\n if (shape.Value === this.alef) {\n shape.Value = this.alefMadda;\n result = 2;\n }\n }\n else {\n shape.vowel = value;\n }\n if (result === 1) {\n shape.Ligature++;\n }\n return result;\n }\n if (shape.vowel !== '') {\n return 0;\n }\n if (shape.Value === this.lam) {\n if (value === this.alef) {\n shape.Value = this.lwa;\n shape.Shapes = 2;\n result = 3;\n }\n else if (value === this.alefHamza) {\n shape.Value = this.lwawh;\n shape.Shapes = 2;\n result = 3;\n }\n else if (value === this.alefHamzaBelow) {\n shape.Value = this.lwawhb;\n shape.Shapes = 2;\n result = 3;\n }\n else if (value === this.alefMadda) {\n shape.Value = this.lwawm;\n shape.Shapes = 2;\n result = 3;\n }\n }\n // else if (shape.Value === '') {\n // shape.Value = value;\n // shape.Shapes = this.getShapeCount(value);\n // result = 1;\n // }\n return result;\n }\n else {\n return 0;\n }\n };\n ArabicShapeRenderer.prototype.getShapeCount = function (shape) {\n if ((shape >= this.hamza) && (shape <= this.bwhb) && !((shape >= this.fathatan && shape <= this.hamzaBelow)\n || shape === this.superScriptalef)) {\n var c = [];\n if (this.arabicMapTable.getValue(shape)) {\n c = this.arabicMapTable.getValue(shape);\n return c.length - 1;\n }\n }\n else if (shape === this.zeroWidthJoiner) {\n return 4;\n }\n return 1;\n };\n return ArabicShapeRenderer;\n}());\nexport { ArabicShapeRenderer };\n//#endregion\n//#region Internals\nvar ArabicShape = /** @class */ (function () {\n function ArabicShape() {\n //#region Fields\n this.shapeValue = '';\n this.shapeType = '';\n this.shapeVowel = '';\n this.shapeLigature = 0;\n this.shapeShapes = 1;\n //#endregion\n }\n Object.defineProperty(ArabicShape.prototype, \"Value\", {\n //#endregion\n //#region Properties \n /**\n * Gets or sets the values.\n * @private\n */\n get: function () {\n return this.shapeValue;\n },\n set: function (value) {\n this.shapeValue = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ArabicShape.prototype, \"Type\", {\n /**\n * Gets or sets the values.\n * @private\n */\n get: function () {\n return this.shapeType;\n },\n set: function (value) {\n this.shapeType = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ArabicShape.prototype, \"vowel\", {\n /**\n * Gets or sets the values.\n * @private\n */\n get: function () {\n return this.shapeVowel;\n },\n set: function (value) {\n this.shapeVowel = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ArabicShape.prototype, \"Ligature\", {\n /**\n * Gets or sets the values.\n * @private\n */\n get: function () {\n return this.shapeLigature;\n },\n set: function (value) {\n this.shapeLigature = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ArabicShape.prototype, \"Shapes\", {\n /**\n * Gets or sets the values.\n * @private\n */\n get: function () {\n return this.shapeShapes;\n },\n set: function (value) {\n this.shapeShapes = value;\n },\n enumerable: true,\n configurable: true\n });\n return ArabicShape;\n}());\nexport { ArabicShape };\n//#endregion\n","/**\n * Bidi.ts class for EJ2-PDF\n */\nimport { Dictionary } from './../../../collections/dictionary';\n/**\n * `Metrics` of the font.\n * @private\n */\nvar Bidi = /** @class */ (function () {\n //#endregion\n //#region Constructor\n function Bidi() {\n //#region Fields\n this.indexes = [];\n this.indexLevels = [];\n this.mirroringShapeCharacters = new Dictionary();\n this.update();\n }\n //#endregion\n //#region implementation\n Bidi.prototype.doMirrorShaping = function (text) {\n var result = [];\n for (var i = 0; i < text.length; i++) {\n if (((this.indexLevels[i] & 1) === 1) && this.mirroringShapeCharacters.containsKey(text[i].charCodeAt(0))) {\n result[i] = String.fromCharCode(this.mirroringShapeCharacters.getValue(text[i].charCodeAt(0)));\n }\n else {\n result[i] = text[i].toString();\n }\n }\n var res = '';\n for (var j = 0; j < result.length; j++) {\n res = res + result[j];\n }\n return res;\n };\n Bidi.prototype.getLogicalToVisualString = function (inputText, isRtl) {\n var rtlCharacters = new RtlCharacters();\n this.indexLevels = rtlCharacters.getVisualOrder(inputText, isRtl);\n this.setDefaultIndexLevel();\n this.doOrder(0, this.indexLevels.length - 1);\n var text = this.doMirrorShaping(inputText);\n //let text : string = inputText;\n var resultBuilder = '';\n for (var i = 0; i < this.indexes.length; i++) {\n var index = this.indexes[i];\n resultBuilder += text[index];\n }\n return resultBuilder.toString();\n };\n Bidi.prototype.setDefaultIndexLevel = function () {\n for (var i = 0; i < this.indexLevels.length; i++) {\n this.indexes[i] = i;\n }\n };\n Bidi.prototype.doOrder = function (sIndex, eIndex) {\n var max = this.indexLevels[sIndex];\n var min = max;\n var odd = max;\n var even = max;\n for (var i = sIndex + 1; i <= eIndex; ++i) {\n var data = this.indexLevels[i];\n if (data > max) {\n max = data;\n }\n else if (data < min) {\n min = data;\n }\n odd &= data;\n even |= data;\n }\n if ((even & 1) === 0) {\n return;\n }\n if ((odd & 1) === 1) {\n this.reArrange(sIndex, eIndex + 1);\n return;\n }\n min |= 1;\n while (max >= min) {\n var pstart = sIndex;\n /*tslint:disable:no-constant-condition */\n while (true) {\n while (pstart <= eIndex) {\n if (this.indexLevels[pstart] >= max) {\n break;\n }\n pstart += 1;\n }\n if (pstart > eIndex) {\n break;\n }\n var pend = pstart + 1;\n while (pend <= eIndex) {\n if (this.indexLevels[pend] < max) {\n break;\n }\n pend += 1;\n }\n this.reArrange(pstart, pend);\n pstart = pend + 1;\n }\n max -= 1;\n }\n };\n Bidi.prototype.reArrange = function (i, j) {\n var length = (i + j) / 2;\n --j;\n for (; i < length; ++i, --j) {\n var temp = this.indexes[i];\n this.indexes[i] = this.indexes[j];\n this.indexes[j] = temp;\n }\n };\n Bidi.prototype.update = function () {\n this.mirroringShapeCharacters.setValue(40, 41);\n this.mirroringShapeCharacters.setValue(41, 40);\n this.mirroringShapeCharacters.setValue(60, 62);\n this.mirroringShapeCharacters.setValue(62, 60);\n this.mirroringShapeCharacters.setValue(91, 93);\n this.mirroringShapeCharacters.setValue(93, 91);\n this.mirroringShapeCharacters.setValue(123, 125);\n this.mirroringShapeCharacters.setValue(125, 123);\n this.mirroringShapeCharacters.setValue(171, 187);\n this.mirroringShapeCharacters.setValue(187, 171);\n this.mirroringShapeCharacters.setValue(8249, 8250);\n this.mirroringShapeCharacters.setValue(8250, 8249);\n this.mirroringShapeCharacters.setValue(8261, 8262);\n this.mirroringShapeCharacters.setValue(8262, 8261);\n this.mirroringShapeCharacters.setValue(8317, 8318);\n this.mirroringShapeCharacters.setValue(8318, 8317);\n this.mirroringShapeCharacters.setValue(8333, 8334);\n this.mirroringShapeCharacters.setValue(8334, 8333);\n this.mirroringShapeCharacters.setValue(8712, 8715);\n this.mirroringShapeCharacters.setValue(8713, 8716);\n this.mirroringShapeCharacters.setValue(8714, 8717);\n this.mirroringShapeCharacters.setValue(8715, 8712);\n this.mirroringShapeCharacters.setValue(8716, 8713);\n this.mirroringShapeCharacters.setValue(8717, 8714);\n this.mirroringShapeCharacters.setValue(8725, 10741);\n this.mirroringShapeCharacters.setValue(8764, 8765);\n this.mirroringShapeCharacters.setValue(8765, 8764);\n this.mirroringShapeCharacters.setValue(8771, 8909);\n this.mirroringShapeCharacters.setValue(8786, 8787);\n this.mirroringShapeCharacters.setValue(8787, 8786);\n this.mirroringShapeCharacters.setValue(8788, 8789);\n this.mirroringShapeCharacters.setValue(8789, 8788);\n this.mirroringShapeCharacters.setValue(8804, 8805);\n this.mirroringShapeCharacters.setValue(8805, 8804);\n this.mirroringShapeCharacters.setValue(8806, 8807);\n this.mirroringShapeCharacters.setValue(8807, 8806);\n this.mirroringShapeCharacters.setValue(8808, 8809);\n this.mirroringShapeCharacters.setValue(8809, 8808);\n this.mirroringShapeCharacters.setValue(8810, 8811);\n this.mirroringShapeCharacters.setValue(8811, 8810);\n this.mirroringShapeCharacters.setValue(8814, 8815);\n this.mirroringShapeCharacters.setValue(8815, 8814);\n this.mirroringShapeCharacters.setValue(8816, 8817);\n this.mirroringShapeCharacters.setValue(8817, 8816);\n this.mirroringShapeCharacters.setValue(8818, 8819);\n this.mirroringShapeCharacters.setValue(8819, 8818);\n this.mirroringShapeCharacters.setValue(8820, 8821);\n this.mirroringShapeCharacters.setValue(8821, 8820);\n this.mirroringShapeCharacters.setValue(8822, 8823);\n this.mirroringShapeCharacters.setValue(8823, 8822);\n this.mirroringShapeCharacters.setValue(8824, 8825);\n this.mirroringShapeCharacters.setValue(8825, 8824);\n this.mirroringShapeCharacters.setValue(8826, 8827);\n this.mirroringShapeCharacters.setValue(8827, 8826);\n this.mirroringShapeCharacters.setValue(8828, 8829);\n this.mirroringShapeCharacters.setValue(8829, 8828);\n this.mirroringShapeCharacters.setValue(8830, 8831);\n this.mirroringShapeCharacters.setValue(8831, 8830);\n this.mirroringShapeCharacters.setValue(8832, 8833);\n this.mirroringShapeCharacters.setValue(8833, 8832);\n this.mirroringShapeCharacters.setValue(8834, 8835);\n this.mirroringShapeCharacters.setValue(8835, 8834);\n this.mirroringShapeCharacters.setValue(8836, 8837);\n this.mirroringShapeCharacters.setValue(8837, 8836);\n this.mirroringShapeCharacters.setValue(8838, 8839);\n this.mirroringShapeCharacters.setValue(8839, 8838);\n this.mirroringShapeCharacters.setValue(8840, 8841);\n this.mirroringShapeCharacters.setValue(8841, 8840);\n this.mirroringShapeCharacters.setValue(8842, 8843);\n this.mirroringShapeCharacters.setValue(8843, 8842);\n this.mirroringShapeCharacters.setValue(8847, 8848);\n this.mirroringShapeCharacters.setValue(8848, 8847);\n this.mirroringShapeCharacters.setValue(8849, 8850);\n this.mirroringShapeCharacters.setValue(8850, 8849);\n this.mirroringShapeCharacters.setValue(8856, 10680);\n this.mirroringShapeCharacters.setValue(8866, 8867);\n this.mirroringShapeCharacters.setValue(8867, 8866);\n this.mirroringShapeCharacters.setValue(8870, 10974);\n this.mirroringShapeCharacters.setValue(8872, 10980);\n this.mirroringShapeCharacters.setValue(8873, 10979);\n this.mirroringShapeCharacters.setValue(8875, 10981);\n this.mirroringShapeCharacters.setValue(8880, 8881);\n this.mirroringShapeCharacters.setValue(8881, 8880);\n this.mirroringShapeCharacters.setValue(8882, 8883);\n this.mirroringShapeCharacters.setValue(8883, 8882);\n this.mirroringShapeCharacters.setValue(8884, 8885);\n this.mirroringShapeCharacters.setValue(8885, 8884);\n /*tslint:disable:max-func-body-length */\n this.mirroringShapeCharacters.setValue(8886, 8887);\n this.mirroringShapeCharacters.setValue(8887, 8886);\n this.mirroringShapeCharacters.setValue(8905, 8906);\n this.mirroringShapeCharacters.setValue(8906, 8905);\n this.mirroringShapeCharacters.setValue(8907, 8908);\n this.mirroringShapeCharacters.setValue(8908, 8907);\n this.mirroringShapeCharacters.setValue(8909, 8771);\n this.mirroringShapeCharacters.setValue(8912, 8913);\n this.mirroringShapeCharacters.setValue(8913, 8912);\n this.mirroringShapeCharacters.setValue(8918, 8919);\n this.mirroringShapeCharacters.setValue(8919, 8918);\n this.mirroringShapeCharacters.setValue(8920, 8921);\n this.mirroringShapeCharacters.setValue(8921, 8920);\n this.mirroringShapeCharacters.setValue(8922, 8923);\n this.mirroringShapeCharacters.setValue(8923, 8922);\n this.mirroringShapeCharacters.setValue(8924, 8925);\n this.mirroringShapeCharacters.setValue(8925, 8924);\n this.mirroringShapeCharacters.setValue(8926, 8927);\n this.mirroringShapeCharacters.setValue(8927, 8926);\n this.mirroringShapeCharacters.setValue(8928, 8929);\n this.mirroringShapeCharacters.setValue(8929, 8928);\n this.mirroringShapeCharacters.setValue(8930, 8931);\n this.mirroringShapeCharacters.setValue(8931, 8930);\n this.mirroringShapeCharacters.setValue(8932, 8933);\n this.mirroringShapeCharacters.setValue(8933, 8932);\n this.mirroringShapeCharacters.setValue(8934, 8935);\n this.mirroringShapeCharacters.setValue(8935, 8934);\n this.mirroringShapeCharacters.setValue(8936, 8937);\n this.mirroringShapeCharacters.setValue(8937, 8936);\n this.mirroringShapeCharacters.setValue(8938, 8939);\n this.mirroringShapeCharacters.setValue(8939, 8938);\n this.mirroringShapeCharacters.setValue(8940, 8941);\n this.mirroringShapeCharacters.setValue(8941, 8940);\n this.mirroringShapeCharacters.setValue(8944, 8945);\n this.mirroringShapeCharacters.setValue(8945, 8944);\n this.mirroringShapeCharacters.setValue(8946, 8954);\n this.mirroringShapeCharacters.setValue(8947, 8955);\n this.mirroringShapeCharacters.setValue(8948, 8956);\n this.mirroringShapeCharacters.setValue(8950, 8957);\n this.mirroringShapeCharacters.setValue(8951, 8958);\n this.mirroringShapeCharacters.setValue(8954, 8946);\n this.mirroringShapeCharacters.setValue(8955, 8947);\n this.mirroringShapeCharacters.setValue(8956, 8948);\n this.mirroringShapeCharacters.setValue(8957, 8950);\n this.mirroringShapeCharacters.setValue(8958, 8951);\n this.mirroringShapeCharacters.setValue(8968, 8969);\n this.mirroringShapeCharacters.setValue(8969, 8968);\n this.mirroringShapeCharacters.setValue(8970, 8971);\n this.mirroringShapeCharacters.setValue(8971, 8970);\n this.mirroringShapeCharacters.setValue(9001, 9002);\n this.mirroringShapeCharacters.setValue(9002, 9001);\n this.mirroringShapeCharacters.setValue(10088, 10089);\n this.mirroringShapeCharacters.setValue(10089, 10088);\n this.mirroringShapeCharacters.setValue(10090, 10091);\n this.mirroringShapeCharacters.setValue(10091, 10090);\n this.mirroringShapeCharacters.setValue(10092, 10093);\n this.mirroringShapeCharacters.setValue(10093, 10092);\n this.mirroringShapeCharacters.setValue(10094, 10095);\n this.mirroringShapeCharacters.setValue(10095, 10094);\n this.mirroringShapeCharacters.setValue(10096, 10097);\n this.mirroringShapeCharacters.setValue(10097, 10096);\n this.mirroringShapeCharacters.setValue(10098, 10099);\n this.mirroringShapeCharacters.setValue(10099, 10098);\n this.mirroringShapeCharacters.setValue(10100, 10101);\n this.mirroringShapeCharacters.setValue(10101, 10100);\n this.mirroringShapeCharacters.setValue(10197, 10198);\n this.mirroringShapeCharacters.setValue(10198, 10197);\n this.mirroringShapeCharacters.setValue(10205, 10206);\n this.mirroringShapeCharacters.setValue(10206, 10205);\n this.mirroringShapeCharacters.setValue(10210, 10211);\n this.mirroringShapeCharacters.setValue(10211, 10210);\n this.mirroringShapeCharacters.setValue(10212, 10213);\n this.mirroringShapeCharacters.setValue(10213, 10212);\n this.mirroringShapeCharacters.setValue(10214, 10215);\n this.mirroringShapeCharacters.setValue(10215, 10214);\n this.mirroringShapeCharacters.setValue(10216, 10217);\n this.mirroringShapeCharacters.setValue(10217, 10216);\n this.mirroringShapeCharacters.setValue(10218, 10219);\n this.mirroringShapeCharacters.setValue(10219, 10218);\n this.mirroringShapeCharacters.setValue(10627, 10628);\n this.mirroringShapeCharacters.setValue(10628, 10627);\n this.mirroringShapeCharacters.setValue(10629, 10630);\n this.mirroringShapeCharacters.setValue(10630, 10629);\n this.mirroringShapeCharacters.setValue(10631, 10632);\n this.mirroringShapeCharacters.setValue(10632, 10631);\n this.mirroringShapeCharacters.setValue(10633, 10634);\n this.mirroringShapeCharacters.setValue(10634, 10633);\n this.mirroringShapeCharacters.setValue(10635, 10636);\n this.mirroringShapeCharacters.setValue(10636, 10635);\n this.mirroringShapeCharacters.setValue(10637, 10640);\n this.mirroringShapeCharacters.setValue(10638, 10639);\n this.mirroringShapeCharacters.setValue(10639, 10638);\n this.mirroringShapeCharacters.setValue(10640, 10637);\n this.mirroringShapeCharacters.setValue(10641, 10642);\n this.mirroringShapeCharacters.setValue(10642, 10641);\n this.mirroringShapeCharacters.setValue(10643, 10644);\n this.mirroringShapeCharacters.setValue(10644, 10643);\n this.mirroringShapeCharacters.setValue(10645, 10646);\n this.mirroringShapeCharacters.setValue(10646, 10645);\n this.mirroringShapeCharacters.setValue(10647, 10648);\n this.mirroringShapeCharacters.setValue(10648, 10647);\n this.mirroringShapeCharacters.setValue(10680, 8856);\n this.mirroringShapeCharacters.setValue(10688, 10689);\n this.mirroringShapeCharacters.setValue(10689, 10688);\n this.mirroringShapeCharacters.setValue(10692, 10693);\n this.mirroringShapeCharacters.setValue(10693, 10692);\n this.mirroringShapeCharacters.setValue(10703, 10704);\n this.mirroringShapeCharacters.setValue(10704, 10703);\n this.mirroringShapeCharacters.setValue(10705, 10706);\n this.mirroringShapeCharacters.setValue(10706, 10705);\n this.mirroringShapeCharacters.setValue(10708, 10709);\n this.mirroringShapeCharacters.setValue(10709, 10708);\n this.mirroringShapeCharacters.setValue(10712, 10713);\n this.mirroringShapeCharacters.setValue(10713, 10712);\n this.mirroringShapeCharacters.setValue(10714, 10715);\n this.mirroringShapeCharacters.setValue(10715, 10714);\n this.mirroringShapeCharacters.setValue(10741, 8725);\n this.mirroringShapeCharacters.setValue(10744, 10745);\n this.mirroringShapeCharacters.setValue(10745, 10744);\n this.mirroringShapeCharacters.setValue(10748, 10749);\n this.mirroringShapeCharacters.setValue(10749, 10748);\n this.mirroringShapeCharacters.setValue(10795, 10796);\n this.mirroringShapeCharacters.setValue(10796, 10795);\n this.mirroringShapeCharacters.setValue(10797, 10796);\n this.mirroringShapeCharacters.setValue(10798, 10797);\n this.mirroringShapeCharacters.setValue(10804, 10805);\n this.mirroringShapeCharacters.setValue(10805, 10804);\n this.mirroringShapeCharacters.setValue(10812, 10813);\n this.mirroringShapeCharacters.setValue(10813, 10812);\n this.mirroringShapeCharacters.setValue(10852, 10853);\n this.mirroringShapeCharacters.setValue(10853, 10852);\n this.mirroringShapeCharacters.setValue(10873, 10874);\n this.mirroringShapeCharacters.setValue(10874, 10873);\n this.mirroringShapeCharacters.setValue(10877, 10878);\n this.mirroringShapeCharacters.setValue(10878, 10877);\n this.mirroringShapeCharacters.setValue(10879, 10880);\n this.mirroringShapeCharacters.setValue(10880, 10879);\n this.mirroringShapeCharacters.setValue(10881, 10882);\n this.mirroringShapeCharacters.setValue(10882, 10881);\n this.mirroringShapeCharacters.setValue(10883, 10884);\n this.mirroringShapeCharacters.setValue(10884, 10883);\n this.mirroringShapeCharacters.setValue(10891, 10892);\n this.mirroringShapeCharacters.setValue(10892, 10891);\n this.mirroringShapeCharacters.setValue(10897, 10898);\n this.mirroringShapeCharacters.setValue(10898, 10897);\n this.mirroringShapeCharacters.setValue(10899, 10900);\n this.mirroringShapeCharacters.setValue(10900, 10899);\n this.mirroringShapeCharacters.setValue(10901, 10902);\n this.mirroringShapeCharacters.setValue(10902, 10901);\n this.mirroringShapeCharacters.setValue(10903, 10904);\n this.mirroringShapeCharacters.setValue(10904, 10903);\n this.mirroringShapeCharacters.setValue(10905, 10906);\n this.mirroringShapeCharacters.setValue(10906, 10905);\n this.mirroringShapeCharacters.setValue(10907, 10908);\n this.mirroringShapeCharacters.setValue(10908, 10907);\n this.mirroringShapeCharacters.setValue(10913, 10914);\n this.mirroringShapeCharacters.setValue(10914, 10913);\n this.mirroringShapeCharacters.setValue(10918, 10919);\n this.mirroringShapeCharacters.setValue(10919, 10918);\n this.mirroringShapeCharacters.setValue(10920, 10921);\n this.mirroringShapeCharacters.setValue(10921, 10920);\n this.mirroringShapeCharacters.setValue(10922, 10923);\n this.mirroringShapeCharacters.setValue(10923, 10922);\n this.mirroringShapeCharacters.setValue(10924, 10925);\n this.mirroringShapeCharacters.setValue(10925, 10924);\n this.mirroringShapeCharacters.setValue(10927, 10928);\n this.mirroringShapeCharacters.setValue(10928, 10927);\n this.mirroringShapeCharacters.setValue(10931, 10932);\n this.mirroringShapeCharacters.setValue(10932, 10931);\n this.mirroringShapeCharacters.setValue(10939, 10940);\n this.mirroringShapeCharacters.setValue(10940, 10939);\n this.mirroringShapeCharacters.setValue(10941, 10942);\n this.mirroringShapeCharacters.setValue(10942, 10941);\n this.mirroringShapeCharacters.setValue(10943, 10944);\n this.mirroringShapeCharacters.setValue(10944, 10943);\n this.mirroringShapeCharacters.setValue(10945, 10946);\n this.mirroringShapeCharacters.setValue(10946, 10945);\n this.mirroringShapeCharacters.setValue(10947, 10948);\n this.mirroringShapeCharacters.setValue(10948, 10947);\n this.mirroringShapeCharacters.setValue(10949, 10950);\n this.mirroringShapeCharacters.setValue(10950, 10949);\n this.mirroringShapeCharacters.setValue(10957, 10958);\n this.mirroringShapeCharacters.setValue(10958, 10957);\n this.mirroringShapeCharacters.setValue(10959, 10960);\n this.mirroringShapeCharacters.setValue(10960, 10959);\n this.mirroringShapeCharacters.setValue(10961, 10962);\n this.mirroringShapeCharacters.setValue(10962, 10961);\n this.mirroringShapeCharacters.setValue(10963, 10964);\n this.mirroringShapeCharacters.setValue(10964, 10963);\n this.mirroringShapeCharacters.setValue(10965, 10966);\n this.mirroringShapeCharacters.setValue(10966, 10965);\n this.mirroringShapeCharacters.setValue(10974, 8870);\n this.mirroringShapeCharacters.setValue(10979, 8873);\n this.mirroringShapeCharacters.setValue(10980, 8872);\n this.mirroringShapeCharacters.setValue(10981, 8875);\n this.mirroringShapeCharacters.setValue(10988, 10989);\n this.mirroringShapeCharacters.setValue(10989, 10988);\n this.mirroringShapeCharacters.setValue(10999, 11000);\n this.mirroringShapeCharacters.setValue(11000, 10999);\n this.mirroringShapeCharacters.setValue(11001, 11002);\n this.mirroringShapeCharacters.setValue(11002, 11001);\n this.mirroringShapeCharacters.setValue(12296, 12297);\n this.mirroringShapeCharacters.setValue(12297, 12296);\n this.mirroringShapeCharacters.setValue(12298, 12299);\n this.mirroringShapeCharacters.setValue(12299, 12298);\n this.mirroringShapeCharacters.setValue(12300, 12301);\n this.mirroringShapeCharacters.setValue(12301, 12300);\n this.mirroringShapeCharacters.setValue(12302, 12303);\n this.mirroringShapeCharacters.setValue(12303, 12302);\n this.mirroringShapeCharacters.setValue(12304, 12305);\n this.mirroringShapeCharacters.setValue(12305, 12304);\n this.mirroringShapeCharacters.setValue(12308, 12309);\n this.mirroringShapeCharacters.setValue(12309, 12308);\n this.mirroringShapeCharacters.setValue(12310, 12311);\n this.mirroringShapeCharacters.setValue(12311, 12310);\n this.mirroringShapeCharacters.setValue(12312, 12313);\n this.mirroringShapeCharacters.setValue(12313, 12312);\n this.mirroringShapeCharacters.setValue(12314, 12315);\n this.mirroringShapeCharacters.setValue(12315, 12314);\n this.mirroringShapeCharacters.setValue(65288, 65289);\n this.mirroringShapeCharacters.setValue(65289, 65288);\n this.mirroringShapeCharacters.setValue(65308, 65310);\n this.mirroringShapeCharacters.setValue(65310, 65308);\n this.mirroringShapeCharacters.setValue(65339, 65341);\n this.mirroringShapeCharacters.setValue(65341, 65339);\n this.mirroringShapeCharacters.setValue(65371, 65373);\n this.mirroringShapeCharacters.setValue(65373, 65371);\n this.mirroringShapeCharacters.setValue(65375, 65376);\n this.mirroringShapeCharacters.setValue(65376, 65375);\n this.mirroringShapeCharacters.setValue(65378, 65379);\n this.mirroringShapeCharacters.setValue(65379, 65378);\n };\n return Bidi;\n}());\nexport { Bidi };\nvar RtlCharacters = /** @class */ (function () {\n //#endregion\n //#region constructors\n function RtlCharacters() {\n //#region fields\n /// \n /// Specifies the character types.\n /// \n this.types = [];\n /// \n /// Specifies the text order (RTL or LTR).\n /// \n this.textOrder = -1;\n /// \n /// Specifies the RTL character types.\n /// \n /* tslint:disable-next-line:prefer-array-literal */\n this.rtlCharacterTypes = new Array(65536);\n //#endregion\n //#region constants\n /// \n /// Left-to-Right (Non-European or non-Arabic digits).\n /// \n this.L = 0;\n /// \n /// Left-to-Right Embedding\n /// \n this.LRE = 1;\n /// \n /// Left-to-Right Override\n /// \n this.LRO = 2;\n /// \n /// Right-to-Left (Hebrew alphabet, and related punctuation).\n /// \n this.R = 3;\n /// \n /// Right-to-Left Arabic \n /// \n this.AL = 4;\n /// \n /// Right-to-Left Embedding.\n /// \n this.RLE = 5;\n /// \n /// Right-to-Left Override\n /// \n this.RLO = 6;\n /// \n /// Pop Directional Format\n /// \n this.PDF = 7;\n /// \n /// European Number (European digits, Eastern Arabic-Indic digits).\n /// \n this.EN = 8;\n /// \n /// European Number Separator (Plus sign, Minus sign).\n /// \n this.ES = 9;\n /// \n /// European Number Terminator (Degree sign, currency symbols).\n /// \n this.ET = 10;\n /// \n /// Arabic Number (Arabic-Indic digits, Arabic decimal and thousands separators).\n /// \n this.AN = 11;\n /// \n /// Common Number Separator (Colon, Comma, Full Stop, No-Break Space.\n /// \n this.CS = 12;\n /// \n /// Nonspacing Mark (Characters with the General_Category values).\n /// \n this.NSM = 13;\n /// \n /// Boundary Neutral (Default ignorables, non-characters, and control characters, other than those explicitly given other types.)\n /// \n this.BN = 14;\n /// \n /// Paragraph Separator (Paragraph separator, appropriate Newline Functions, higher-level protocol paragraph determination).\n /// \n this.B = 15;\n /// \n /// \tSegment Separator (tab).\n /// \n this.S = 16;\n /// \n /// Whitespace (Space, Figure space, Line separator, Form feed, General Punctuation spaces).\n /// \n this.WS = 17;\n /// \n /// Other Neutrals (All other characters, including object replacement character).\n /// \n this.ON = 18;\n /// \n /// RTL character types.\n /// \n this.charTypes = [\n this.L, this.EN, this.BN, this.ES, this.ES, this.S, this.ET, this.ET, this.B, this.AN, this.AN, this.S, this.CS, this.CS,\n this.WS, this.NSM, this.NSM, this.B, this.BN, 27, this.BN, 28, 30, this.B, 31, 31, this.S, 32, 32, this.WS, 33, 34,\n this.ON, 35, 37, this.ET, 38, 42, this.ON, 43, 43, this.ET, 44, 44, this.CS, 45, 45, this.ET, 46, 46, this.CS,\n 47, 47, this.CS, 48, 57, this.EN, 58, 58, this.CS, 59, 64, this.ON, 65, 90, this.L, 91, 96, this.ON, 97, 122, this.L,\n 123, 126, this.ON, 127, 132, this.BN, 133, 133, this.B, 134, 159, this.BN, 160, 160, this.CS,\n 161, 161, this.ON, 162, 165, this.ET, 166, 169, this.ON, 170, 170, this.L, 171, 175, this.ON,\n 176, 177, this.ET, 178, 179, this.EN, 180, 180, this.ON, 181, 181, this.L, 182, 184, this.ON,\n 185, 185, this.EN, 186, 186, this.L, 187, 191, this.ON, 192, 214, this.L, 215, 215, this.ON,\n 216, 246, this.L, 247, 247, this.ON, 248, 696, this.L, 697, 698, this.ON, 699, 705, this.L,\n 706, 719, this.ON, 720, 721, this.L, 722, 735, this.ON, 736, 740, this.L, 741, 749, this.ON,\n 750, 750, this.L, 751, 767, this.ON, 768, 855, this.NSM, 856, 860, this.L, 861, 879, this.NSM,\n 880, 883, this.L, 884, 885, this.ON, 886, 893, this.L, 894, 894, this.ON, 895, 899, this.L,\n 900, 901, this.ON, 902, 902, this.L, 903, 903, this.ON, 904, 1013, this.L, 1014, 1014, this.ON,\n 1015, 1154, this.L, 1155, 1158, this.NSM, 1159, 1159, this.L, 1160, 1161, this.NSM,\n 1162, 1417, this.L, 1418, 1418, this.ON, 1419, 1424, this.L, 1425, 1441, this.NSM,\n 1442, 1442, this.L, 1443, 1465, this.NSM, 1466, 1466, this.L, 1467, 1469, this.NSM,\n 1470, 1470, this.R, 1471, 1471, this.NSM, 1472, 1472, this.R, 1473, 1474, this.NSM,\n 1475, 1475, this.R, 1476, 1476, this.NSM, 1477, 1487, this.L, 1488, 1514, this.R,\n 1515, 1519, this.L, 1520, 1524, this.R, 1525, 1535, this.L, 1536, 1539, this.AL,\n 1540, 1547, this.L, 1548, 1548, this.CS, 1549, 1549, this.AL, 1550, 1551, this.ON,\n 1552, 1557, this.NSM, 1558, 1562, this.L, 1563, 1563, this.AL, 1564, 1566, this.L,\n 1567, 1567, this.AL, 1568, 1568, this.L, 1569, 1594, this.AL, 1595, 1599, this.L,\n 1600, 1610, this.AL, 1611, 1624, this.NSM, 1625, 1631, this.L, 1632, 1641, this.AN,\n 1642, 1642, this.ET, 1643, 1644, this.AN, 1645, 1647, this.AL, 1648, 1648, this.NSM,\n 1649, 1749, this.AL, 1750, 1756, this.NSM, 1757, 1757, this.AL, 1758, 1764, this.NSM,\n 1765, 1766, this.AL, 1767, 1768, this.NSM, 1769, 1769, this.ON, 1770, 1773, this.NSM,\n 1774, 1775, this.AL, 1776, 1785, this.EN, 1786, 1805, this.AL, 1806, 1806, this.L,\n 1807, 1807, this.BN, 1808, 1808, this.AL, 1809, 1809, this.NSM, 1810, 1839, this.AL,\n 1840, 1866, this.NSM, 1867, 1868, this.L, 1869, 1871, this.AL, 1872, 1919, this.L,\n 1920, 1957, this.AL, 1958, 1968, this.NSM, 1969, 1969, this.AL, 1970, 2304, this.L,\n 2305, 2306, this.NSM, 2307, 2363, this.L, 2364, 2364, this.NSM, 2365, 2368, this.L,\n 2369, 2376, this.NSM, 2377, 2380, this.L, 2381, 2381, this.NSM, 2382, 2384, this.L,\n 2385, 2388, this.NSM, 2389, 2401, this.L, 2402, 2403, this.NSM, 2404, 2432, this.L,\n 2433, 2433, this.NSM, 2434, 2491, this.L, 2492, 2492, this.NSM, 2493, 2496, this.L,\n 2497, 2500, this.NSM, 2501, 2508, this.L, 2509, 2509, this.NSM, 2510, 2529, this.L,\n 2530, 2531, this.NSM, 2532, 2545, this.L, 2546, 2547, this.ET, 2548, 2560, this.L,\n 2561, 2562, this.NSM, 2563, 2619, this.L, 2620, 2620, this.NSM, 2621, 2624, this.L,\n 2625, 2626, this.NSM, 2627, 2630, this.L, 2631, 2632, this.NSM, 2633, 2634, this.L,\n 2635, 2637, this.NSM, 2638, 2671, this.L, 2672, 2673, this.NSM, 2674, 2688, this.L,\n 2689, 2690, this.NSM, 2691, 2747, this.L, 2748, 2748, this.NSM, 2749, 2752, this.L,\n 2753, 2757, this.NSM, 2758, 2758, this.L, 2759, 2760, this.NSM, 2761, 2764, this.L,\n 2765, 2765, this.NSM, 2766, 2785, this.L, 2786, 2787, this.NSM, 2788, 2800, this.L,\n 2801, 2801, this.ET, 2802, 2816, this.L, 2817, 2817, this.NSM, 2818, 2875, this.L,\n 2876, 2876, this.NSM, 2877, 2878, this.L, 2879, 2879, this.NSM, 2880, 2880, this.L,\n 2881, 2883, this.NSM, 2884, 2892, this.L, 2893, 2893, this.NSM, 2894, 2901, this.L,\n 2902, 2902, this.NSM, 2903, 2945, this.L, 2946, 2946, this.NSM, 2947, 3007, this.L,\n 3008, 3008, this.NSM, 3009, 3020, this.L, 3021, 3021, this.NSM, 3022, 3058, this.L,\n 3059, 3064, this.ON, 3065, 3065, this.ET, 3066, 3066, this.ON, 3067, 3133, this.L,\n 3134, 3136, this.NSM, 3137, 3141, this.L, 3142, 3144, this.NSM, 3145, 3145, this.L,\n 3146, 3149, this.NSM, 3150, 3156, this.L, 3157, 3158, this.NSM, 3159, 3259, this.L,\n 3260, 3260, this.NSM, 3261, 3275, this.L, 3276, 3277, this.NSM, 3278, 3392, this.L,\n 3393, 3395, this.NSM, 3396, 3404, this.L, 3405, 3405, this.NSM, 3406, 3529, this.L,\n 3530, 3530, this.NSM, 3531, 3537, this.L, 3538, 3540, this.NSM, 3541, 3541, this.L,\n 3542, 3542, this.NSM, 3543, 3632, this.L, 3633, 3633, this.NSM, 3634, 3635, this.L,\n 3636, 3642, this.NSM, 3643, 3646, this.L, 3647, 3647, this.ET, 3648, 3654, this.L,\n 3655, 3662, this.NSM, 3663, 3760, this.L, 3761, 3761, this.NSM, 3762, 3763, this.L,\n 3764, 3769, this.NSM, 3770, 3770, this.L, 3771, 3772, this.NSM, 3773, 3783, this.L,\n 3784, 3789, this.NSM, 3790, 3863, this.L, 3864, 3865, this.NSM, 3866, 3892, this.L,\n 3893, 3893, this.NSM, 3894, 3894, this.L, 3895, 3895, this.NSM, 3896, 3896, this.L,\n 3897, 3897, this.NSM, 3898, 3901, this.ON, 3902, 3952, this.L, 3953, 3966, this.NSM,\n 3967, 3967, this.L, 3968, 3972, this.NSM, 3973, 3973, this.L, 3974, 3975, this.NSM,\n 3976, 3983, this.L, 3984, 3991, this.NSM, 3992, 3992, this.L, 3993, 4028, this.NSM,\n 4029, 4037, this.L, 4038, 4038, this.NSM, 4039, 4140, this.L, 4141, 4144, this.NSM,\n 4145, 4145, this.L, 4146, 4146, this.NSM, 4147, 4149, this.L, 4150, 4151, this.NSM,\n 4152, 4152, this.L, 4153, 4153, this.NSM, 4154, 4183, this.L, 4184, 4185, this.NSM,\n 4186, 5759, this.L, 5760, 5760, this.WS, 5761, 5786, this.L, 5787, 5788, this.ON,\n 5789, 5905, this.L, 5906, 5908, this.NSM, 5909, 5937, this.L, 5938, 5940, this.NSM,\n 5941, 5969, this.L, 5970, 5971, this.NSM, 5972, 6001, this.L, 6002, 6003, this.NSM,\n 6004, 6070, this.L, 6071, 6077, this.NSM, 6078, 6085, this.L, 6086, 6086, this.NSM,\n 6087, 6088, this.L, 6089, 6099, this.NSM, 6100, 6106, this.L, 6107, 6107, this.ET,\n 6108, 6108, this.L, 6109, 6109, this.NSM, 6110, 6127, this.L, 6128, 6137, this.ON,\n 6138, 6143, this.L, 6144, 6154, this.ON, 6155, 6157, this.NSM, 6158, 6158, this.WS,\n 6159, 6312, this.L, 6313, 6313, this.NSM, 6314, 6431, this.L, 6432, 6434, this.NSM,\n 6435, 6438, this.L, 6439, 6443, this.NSM, 6444, 6449, this.L, 6450, 6450, this.NSM,\n 6451, 6456, this.L, 6457, 6459, this.NSM, 6460, 6463, this.L, 6464, 6464, this.ON,\n 6465, 6467, this.L, 6468, 6469, this.ON, 6470, 6623, this.L, 6624, 6655, this.ON,\n 6656, 8124, this.L, 8125, 8125, this.ON, 8126, 8126, this.L, 8127, 8129, this.ON,\n 8130, 8140, this.L, 8141, 8143, this.ON, 8144, 8156, this.L, 8157, 8159, this.ON,\n 8160, 8172, this.L, 8173, 8175, this.ON, 8176, 8188, this.L, 8189, 8190, this.ON,\n 8191, 8191, this.L, 8192, 8202, this.WS, 8203, 8205, this.BN, 8206, 8206, this.L,\n 8207, 8207, this.R, 8208, 8231, this.ON, 8232, 8232, this.WS, 8233, 8233, this.B,\n 8234, 8234, this.LRE, 8235, 8235, this.RLE, 8236, 8236, this.PDF, 8237, 8237, this.LRO,\n 8238, 8238, this.RLO, 8239, 8239, this.WS, 8240, 8244, this.ET, 8245, 8276, this.ON,\n 8277, 8278, this.L, 8279, 8279, this.ON, 8280, 8286, this.L, 8287, 8287, this.WS,\n 8288, 8291, this.BN, 8292, 8297, this.L, 8298, 8303, this.BN, 8304, 8304, this.EN,\n 8305, 8307, this.L, 8308, 8313, this.EN, 8314, 8315, this.ET, 8316, 8318, this.ON,\n 8319, 8319, this.L, 8320, 8329, this.EN, 8330, 8331, this.ET, 8332, 8334, this.ON,\n 8335, 8351, this.L, 8352, 8369, this.ET, 8370, 8399, this.L, 8400, 8426, this.NSM,\n 8427, 8447, this.L, 8448, 8449, this.ON, 8450, 8450, this.L, 8451, 8454, this.ON,\n 8455, 8455, this.L, 8456, 8457, this.ON, 8458, 8467, this.L, 8468, 8468, this.ON,\n 8469, 8469, this.L, 8470, 8472, this.ON, 8473, 8477, this.L, 8478, 8483, this.ON,\n 8484, 8484, this.L, 8485, 8485, this.ON, 8486, 8486, this.L, 8487, 8487, this.ON,\n 8488, 8488, this.L, 8489, 8489, this.ON, 8490, 8493, this.L, 8494, 8494, this.ET,\n 8495, 8497, this.L, 8498, 8498, this.ON, 8499, 8505, this.L, 8506, 8507, this.ON,\n 8508, 8511, this.L, 8512, 8516, this.ON, 8517, 8521, this.L, 8522, 8523, this.ON,\n 8524, 8530, this.L, 8531, 8543, this.ON, 8544, 8591, this.L, 8592, 8721, this.ON,\n 8722, 8723, this.ET, 8724, 9013, this.ON, 9014, 9082, this.L, 9083, 9108, this.ON,\n 9109, 9109, this.L, 9110, 9168, this.ON, 9169, 9215, this.L, 9216, 9254, this.ON,\n 9255, 9279, this.L, 9280, 9290, this.ON, 9291, 9311, this.L, 9312, 9371, this.EN,\n 9372, 9449, this.L, 9450, 9450, this.EN, 9451, 9751, this.ON, 9752, 9752, this.L,\n 9753, 9853, this.ON, 9854, 9855, this.L, 9856, 9873, this.ON, 9874, 9887, this.L,\n 9888, 9889, this.ON, 9890, 9984, this.L, 9985, 9988, this.ON, 9989, 9989, this.L,\n 9990, 9993, this.ON, 9994, 9995, this.L, 9996, 10023, this.ON, 10024, 10024, this.L,\n 10025, 10059, this.ON, 10060, 10060, this.L, 10061, 10061, this.ON, 10062, 10062, this.L,\n 10063, 10066, this.ON, 10067, 10069, this.L, 10070, 10070, this.ON, 10071, 10071, this.L,\n 10072, 10078, this.ON, 10079, 10080, this.L, 10081, 10132, this.ON, 10133, 10135, this.L,\n 10136, 10159, this.ON, 10160, 10160, this.L, 10161, 10174, this.ON, 10175, 10191, this.L,\n 10192, 10219, this.ON, 10220, 10223, this.L, 10224, 11021, this.ON, 11022, 11903, this.L,\n 11904, 11929, this.ON, 11930, 11930, this.L, 11931, 12019, this.ON, 12020, 12031, this.L,\n 12032, 12245, this.ON, 12246, 12271, this.L, 12272, 12283, this.ON, 12284, 12287, this.L,\n 12288, 12288, this.WS, 12289, 12292, this.ON, 12293, 12295, this.L, 12296, 12320, this.ON,\n 12321, 12329, this.L, 12330, 12335, this.NSM, 12336, 12336, this.ON, 12337, 12341, this.L,\n 12342, 12343, this.ON, 12344, 12348, this.L, 12349, 12351, this.ON, 12352, 12440, this.L,\n 12441, 12442, this.NSM, 12443, 12444, this.ON, 12445, 12447, this.L, 12448, 12448, this.ON,\n 12449, 12538, this.L, 12539, 12539, this.ON, 12540, 12828, this.L, 12829, 12830, this.ON,\n 12831, 12879, this.L, 12880, 12895, this.ON, 12896, 12923, this.L, 12924, 12925, this.ON,\n 12926, 12976, this.L, 12977, 12991, this.ON, 12992, 13003, this.L, 13004, 13007, this.ON,\n 13008, 13174, this.L, 13175, 13178, this.ON, 13179, 13277, this.L, 13278, 13279, this.ON,\n 13280, 13310, this.L, 13311, 13311, this.ON, 13312, 19903, this.L, 19904, 19967, this.ON,\n 19968, 42127, this.L, 42128, 42182, this.ON, 42183, 64284, this.L, 64285, 64285, this.R,\n 64286, 64286, this.NSM, 64287, 64296, this.R, 64297, 64297, this.ET, 64298, 64310, this.R,\n 64311, 64311, this.L, 64312, 64316, this.R, 64317, 64317, this.L, 64318, 64318, this.R,\n 64319, 64319, this.L, 64320, 64321, this.R, 64322, 64322, this.L, 64323, 64324, this.R,\n 64325, 64325, this.L, 64326, 64335, this.R, 64336, 64433, this.AL, 64434, 64466, this.L,\n 64467, 64829, this.AL, 64830, 64831, this.ON, 64832, 64847, this.L, 64848, 64911, this.AL,\n 64912, 64913, this.L, 64914, 64967, this.AL, 64968, 65007, this.L, 65008, 65020, this.AL,\n 65021, 65021, this.ON, 65022, 65023, this.L, 65024, 65039, this.NSM, 65040, 65055, this.L,\n 65056, 65059, this.NSM, 65060, 65071, this.L, 65072, 65103, this.ON, 65104, 65104, this.CS,\n 65105, 65105, this.ON, 65106, 65106, this.CS, 65107, 65107, this.L, 65108, 65108, this.ON,\n 65109, 65109, this.CS, 65110, 65118, this.ON, 65119, 65119, this.ET, 65120, 65121, this.ON,\n 65122, 65123, this.ET, 65124, 65126, this.ON, 65127, 65127, this.L, 65128, 65128, this.ON,\n 65129, 65130, this.ET, 65131, 65131, this.ON, 65132, 65135, this.L, 65136, 65140, this.AL,\n 65141, 65141, this.L, 65142, 65276, this.AL, 65277, 65278, this.L, 65279, 65279, this.BN,\n 65280, 65280, this.L, 65281, 65282, this.ON, 65283, 65285, this.ET, 65286, 65290, this.ON,\n 65291, 65291, this.ET, 65292, 65292, this.CS, 65293, 65293, this.ET, 65294, 65294, this.CS,\n 65295, 65295, this.ES, 65296, 65305, this.EN, 65306, 65306, this.CS, 65307, 65312, this.ON,\n 65313, 65338, this.L, 65339, 65344, this.ON, 65345, 65370, this.L, 65371, 65381, this.ON,\n 65382, 65503, this.L, 65504, 65505, this.ET, 65506, 65508, this.ON, 65509, 65510, this.ET,\n 65511, 65511, this.L, 65512, 65518, this.ON, 65519, 65528, this.L, 65529, 65531, this.BN,\n 65532, 65533, this.ON, 65534, 65535, this.L\n ];\n for (var i = 0; i < this.charTypes.length; ++i) {\n var start = this.charTypes[i];\n var end = this.charTypes[++i];\n var b = this.charTypes[++i];\n while (start <= end) {\n this.rtlCharacterTypes[start++] = b;\n }\n }\n }\n //#endregion\n //#region implementation\n RtlCharacters.prototype.getVisualOrder = function (inputText, isRtl) {\n this.types = this.getCharacterCode(inputText);\n this.textOrder = isRtl ? this.LRE : this.L;\n this.doVisualOrder();\n var result = [];\n for (var i = 0; i < this.levels.length; i++) {\n result[i] = this.levels[i];\n }\n return result;\n };\n RtlCharacters.prototype.getCharacterCode = function (text) {\n var characterCodes = [];\n for (var i = 0; i < text.length; i++) {\n characterCodes[i] = this.rtlCharacterTypes[text[i].charCodeAt(0)];\n }\n return characterCodes;\n };\n RtlCharacters.prototype.setDefaultLevels = function () {\n for (var i = 0; i < this.length; i++) {\n this.levels[i] = this.textOrder;\n }\n };\n RtlCharacters.prototype.setLevels = function () {\n this.setDefaultLevels();\n for (var n = 0; n < this.length; ++n) {\n var level = this.levels[n];\n if ((level & 0x80) !== 0) {\n level &= 0x7f;\n this.result[n] = ((level & 0x1) === 0) ? this.L : this.R;\n }\n this.levels[n] = level;\n }\n };\n RtlCharacters.prototype.updateLevels = function (index, level, length) {\n if ((level & 1) === 0) {\n for (var i = index; i < length; ++i) {\n if (this.result[i] === this.R) {\n this.levels[i] += 1;\n }\n else if (this.result[i] !== this.L) {\n this.levels[i] += 2;\n }\n }\n }\n else {\n for (var i = index; i < length; ++i) {\n if (this.result[i] !== this.R) {\n this.levels[i] += 1;\n }\n }\n }\n };\n RtlCharacters.prototype.doVisualOrder = function () {\n this.length = this.types.length;\n this.result = this.types;\n this.levels = [];\n this.setLevels();\n this.length = this.getEmbeddedCharactersLength();\n var preview = this.textOrder;\n var i = 0;\n while (i < this.length) {\n var level = this.levels[i];\n var preType = ((Math.max(preview, level) & 0x1) === 0) ? this.L : this.R;\n var length_1 = i + 1;\n while (length_1 < this.length && this.levels[length_1] === level) {\n ++length_1;\n }\n var success = length_1 < this.length ? this.levels[length_1] : this.textOrder;\n var type = ((Math.max(success, level) & 0x1) === 0) ? this.L : this.R;\n this.checkNSM(i, length_1, level, preType, type);\n this.updateLevels(i, level, length_1);\n preview = level;\n i = length_1;\n }\n this.checkEmbeddedCharacters(this.length);\n };\n RtlCharacters.prototype.getEmbeddedCharactersLength = function () {\n var index = 0;\n for (var i = 0; i < this.length; ++i) {\n if (!(this.types[i] === this.LRE || this.types[i] === this.RLE || this.types[i] === this.LRO ||\n this.types[i] === this.RLO || this.types[i] === this.PDF || this.types[i] === this.BN)) {\n this.result[index] = this.result[i];\n this.levels[index] = this.levels[i];\n index++;\n }\n }\n return index;\n };\n RtlCharacters.prototype.checkEmbeddedCharacters = function (length) {\n for (var i = this.types.length - 1; i >= 0; --i) {\n if (this.types[i] === this.LRE || this.types[i] === this.RLE || this.types[i] === this.LRO ||\n this.types[i] === this.RLO || this.types[i] === this.PDF || this.types[i] === this.BN) {\n this.result[i] = this.types[i];\n this.levels[i] = -1;\n }\n else {\n length -= 1;\n this.result[i] = this.result[length];\n this.levels[i] = this.levels[length];\n }\n }\n for (var i = 0; i < this.types.length; i++) {\n if (this.levels[i] === -1) {\n if (i === 0) {\n this.levels[i] = this.textOrder;\n }\n else {\n this.levels[i] = this.levels[i - 1];\n }\n }\n }\n };\n RtlCharacters.prototype.checkNSM = function (index, length, level, startType, endType) {\n var charType = startType;\n for (var i = index; i < length; ++i) {\n if (this.result[i] === this.NSM) {\n this.result[i] = charType;\n }\n else {\n charType = this.result[i];\n }\n }\n this.checkEuropeanDigits(index, length, level, startType, endType);\n };\n RtlCharacters.prototype.checkEuropeanDigits = function (index, length, level, startType, endType) {\n for (var i = index; i < length; ++i) {\n if (this.result[i] === this.EN) {\n for (var j = i - 1; j >= index; --j) {\n if (this.result[j] === this.L || this.result[j] === this.R || this.result[j] === this.AL) {\n if (this.result[j] === this.AL) {\n this.result[i] = this.AN;\n }\n break;\n }\n }\n }\n }\n this.checkArabicCharacters(index, length, level, startType, endType);\n };\n RtlCharacters.prototype.checkArabicCharacters = function (index, length, level, startType, endType) {\n for (var i = index; i < length; ++i) {\n if (this.result[i] === this.AL) {\n this.result[i] = this.R;\n }\n }\n this.checkEuropeanNumberSeparator(index, length, level, startType, endType);\n };\n RtlCharacters.prototype.checkEuropeanNumberSeparator = function (index, length, level, startType, endType) {\n for (var i = index + 1; i < length - 1; ++i) {\n if (this.result[i] === this.ES || this.result[i] === this.CS) {\n var preview = this.result[i - 1];\n var success = this.result[i + 1];\n if (preview === this.EN && success === this.EN) {\n this.result[i] = this.EN;\n }\n else if (this.result[i] === this.CS && preview === this.AN && success === this.AN) {\n this.result[i] = this.AN;\n }\n }\n }\n this.checkEuropeanNumberTerminator(index, length, level, startType, endType);\n };\n RtlCharacters.prototype.checkEuropeanNumberTerminator = function (index, length, level, startType, endType) {\n for (var i = index; i < length; ++i) {\n if (this.result[i] === this.ET) {\n var s = i;\n var b = [];\n b.push(this.ET);\n var l = this.getLength(s, length, b);\n var data = s === index ? startType : this.result[s - 1];\n if (data !== this.EN) {\n data = (l === length) ? endType : this.result[l];\n }\n if (data === this.EN) {\n for (var j = s; j < l; ++j) {\n this.result[j] = this.EN;\n }\n }\n i = l;\n }\n }\n this.checkOtherNeutrals(index, length, level, startType, endType);\n };\n RtlCharacters.prototype.checkOtherNeutrals = function (index, length, level, startType, endType) {\n for (var i = index; i < length; ++i) {\n if (this.result[i] === this.ES || this.result[i] === this.ET || this.result[i] === this.CS) {\n this.result[i] = this.ON;\n }\n }\n this.checkOtherCharacters(index, length, level, startType, endType);\n };\n RtlCharacters.prototype.checkOtherCharacters = function (index, length, level, startType, endType) {\n for (var i = index; i < length; ++i) {\n if (this.result[i] === this.EN) {\n var pst = startType;\n for (var j = i - 1; j >= index; --j) {\n if (this.result[j] === this.L || this.result[j] === this.R) {\n pst = this.result[j];\n break;\n }\n }\n if (pst === this.L) {\n this.result[i] = this.L;\n }\n }\n }\n this.checkCommanCharacters(index, length, level, startType, endType);\n };\n RtlCharacters.prototype.getLength = function (index, length, validSet) {\n --index;\n while (++index < length) {\n var t = this.result[index];\n for (var i = 0; i < validSet.length; ++i) {\n if (t === validSet[i]) {\n index = this.getLength(++index, length, validSet);\n }\n }\n return index;\n }\n return length;\n };\n RtlCharacters.prototype.checkCommanCharacters = function (index, length, level, startType, endType) {\n for (var i = index; i < length; ++i) {\n if (this.result[i] === this.WS || this.result[i] === this.ON || this.result[i] === this.B ||\n this.result[i] === this.S) {\n var s = i;\n var byte = [this.B, this.S, this.WS, this.ON];\n var l = this.getLength(s, length, byte);\n var lt = 0;\n var tt = 0;\n var rt = 0;\n if (s === index) {\n lt = startType;\n }\n else {\n lt = this.result[s - 1];\n if (lt === this.AN) {\n lt = this.R;\n }\n else if (lt === this.EN) {\n lt = this.R;\n }\n }\n if (l === length) {\n tt = endType;\n }\n else {\n tt = this.result[l];\n if (tt === this.AN) {\n tt = this.R;\n }\n else if (tt === this.EN) {\n tt = this.R;\n }\n }\n if (lt === tt) {\n rt = lt;\n }\n else {\n rt = ((level & 0x1) === 0) ? this.L : this.R;\n }\n for (var j = s; j < l; ++j) {\n this.result[j] = rt;\n }\n i = l;\n }\n }\n };\n return RtlCharacters;\n}());\nexport { RtlCharacters };\n","import { PdfString } from './../../primitives/pdf-string';\nimport { ArabicShapeRenderer } from './rtl/rtl-text-shape';\nimport { PdfTextDirection } from './../enum';\nimport { Bidi } from './rtl/rtl-bidirectional';\n/**\n * `Metrics` of the font.\n * @private\n */\nvar RtlRenderer = /** @class */ (function () {\n function RtlRenderer() {\n //region Constants\n /// Open bracket symbol.\n /// \n this.openBracket = '(';\n /// \n /// Close bracket symbol.\n /// \n this.closeBracket = ')';\n //#endregion\n }\n //#region Constructors\n /// \n /// Initializes a new instance of the class.\n /// \n // public constructor() {\n // }\n //#region Public Methods\n /// \n /// Layouts text. Changes blocks position in the RTL text.\n /// Ligates the text if needed.\n /// \n /// Line of the text.\n /// Font to be used for string printing.\n /// Font alignment.\n /// Indicates whether Word Spacing used or not.\n /// Layout string.\n RtlRenderer.prototype.layout = function (line, font, rtl, wordSpace, format) {\n if (line == null) {\n throw new Error('ArgumentNullException : line');\n }\n if (font == null) {\n throw new Error('ArgumentNullException : font');\n }\n var result = [];\n if (font.Unicode) {\n result = this.customLayout(line, rtl, format, font, wordSpace);\n }\n else {\n result = [];\n result[0] = line;\n }\n return result;\n };\n /// \n /// Layouts a string and splits it by the words and using correct lay outing.\n /// \n /// Text line.\n /// Font object.\n /// Indicates whether RTL should be applied.\n /// Indicates whether word spacing is used.\n /// Array of words if converted, null otherwise.\n RtlRenderer.prototype.splitLayout = function (line, font, rtl, wordSpace, format) {\n if (line == null) {\n throw new Error('ArgumentNullException : line');\n }\n if (font == null) {\n throw new Error('ArgumentNullException : font');\n }\n var words = [];\n var system = false;\n if (!system || words == null) {\n words = this.customSplitLayout(line, font, rtl, wordSpace, format);\n }\n return words;\n };\n //#endregion\n //#region Implementation\n // private isEnglish( word : string) : boolean\n // {\n // let c : string = (word.length > 0) ? word[0] : '';\n // return (c >= '0' && c < 'ÿ');\n // }\n // private keepOrder( words : string, startIndex : number, count: number, result : string[], resultIndex : number) : void\n // {\n // for (let i : number = 0, ri = resultIndex - count + 1; i < count; ++i, ++ri) {\n // result[ri] = words[i + startIndex];\n // }\n // }\n /// \n /// Uses system API to layout the text.\n /// \n /// Line of the text to be layouted.\n /// Font which is used for text printing.\n /// Indicates whether we use RTL or RTL lay outing of the text container.\n /// Layout string.\n /* tslint:disable-next-line:max-line-length */\n RtlRenderer.prototype.getGlyphIndex = function (line, font, rtl, /*out*/ glyphs, custom) {\n var success = true;\n var fail = false;\n if (line == null) {\n throw new Error('ArgumentNullException : line');\n }\n if (font == null) {\n throw new Error('ArgumentNullException : font');\n }\n glyphs = null;\n if (line.length === 0) {\n return { success: fail, glyphs: glyphs };\n }\n var renderer = new ArabicShapeRenderer();\n var text = renderer.shape(line, 0);\n var internalFont = font.fontInternal;\n var ttfReader = internalFont.ttfReader;\n glyphs = new Uint16Array(text.length);\n var i = 0;\n for (var k = 0, len = text.length; k < len; k++) {\n var ch = text[k];\n var glyphInfo = ttfReader.getGlyph(ch);\n if (glyphInfo !== null && typeof glyphInfo !== 'undefined') {\n glyphs[i++] = (glyphInfo).index;\n }\n }\n return { success: success, glyphs: glyphs };\n };\n /* tslint:disable-next-line:max-line-length */\n RtlRenderer.prototype.customLayout = function (line, rtl, format, font, wordSpace) {\n if (wordSpace === null || typeof wordSpace === 'undefined') {\n if (line == null) {\n throw new Error('ArgumentNullException : line');\n }\n var result = null;\n //bidirectional order.\n if (format !== null && typeof format !== 'undefined' && format.textDirection !== PdfTextDirection.None) {\n var bidi = new Bidi();\n result = bidi.getLogicalToVisualString(line, rtl);\n }\n return result;\n }\n else {\n if (line == null) {\n throw new Error('ArgumentNullException : line');\n }\n if (font == null) {\n throw new Error('ArgumentNullException : font');\n }\n var layouted = null;\n if (format !== null && typeof format !== 'undefined' && format.textDirection !== PdfTextDirection.None) {\n var renderer = new ArabicShapeRenderer();\n var txt = renderer.shape(line, 0);\n layouted = this.customLayout(txt, rtl, format);\n }\n // else {\n // layouted = this.customLayout(line, rtl, format);\n // }\n // We have unicode font, but from the file. \n var result = [];\n // Split the text by words if word spacing is not default.\n if (wordSpace) {\n var words = layouted.split('');\n var count = words.length;\n for (var i = 0; i < count; i++) {\n words[i] = this.addChars(font, words[i]);\n }\n result = words;\n }\n else {\n result = [];\n result[0] = this.addChars(font, layouted);\n }\n return result;\n }\n };\n /// \n /// Add information about used glyphs to the font.\n /// \n /// Font used for text rendering.\n /// Array of used glyphs.\n /// String in the form to be written to the file.\n RtlRenderer.prototype.addChars = function (font, glyphs) {\n var line = glyphs;\n if (font == null) {\n throw new Error('ArgumentNullException : font');\n }\n if (line == null) {\n throw new Error('ArgumentNullException : line');\n }\n var text = line;\n var internalFont = font.fontInternal;\n var ttfReader = internalFont.ttfReader;\n font.setSymbols(text);\n // Reconvert string according to unicode standard.\n text = ttfReader.convertString(text);\n var bytes = PdfString.toUnicodeArray(text, false);\n text = PdfString.byteToString(bytes);\n return text;\n // else {\n // if (font == null) {\n // throw new Error('ArgumentNullException : font');\n // }\n // if (glyphs == null) {\n // throw new Error('ArgumentNullException : glyphs');\n // }\n // // Mark the chars as used.\n // let text : string = '';\n // font.setSymbols(glyphs);\n // // Create string from the glyphs.\n // \n // let chars : string[] = [];\n // for (let i : number = 0; i < glyphs.length; i++) {\n // chars[i] = glyphs[i].toString();\n // }\n // for (let j : number = 0 ; j < chars.length; j++) {\n // text = text + chars[j];\n // }\n // let bytes : number[] = PdfString.toUnicodeArray(text, false);\n // text = PdfString.byteToString(bytes);\n // return text;\n // }\n };\n /// \n /// Layouts a string and splits it by the words by using custom lay outing.\n /// \n /// Text line.\n /// Font object.\n /// Indicates whether RTL should be applied.\n /// Indicates whether word spacing is used.\n /// Array of words if converted, null otherwise.\n /* tslint:disable-next-line:max-line-length */\n RtlRenderer.prototype.customSplitLayout = function (line, font, rtl, wordSpace, format) {\n if (line == null) {\n throw new Error('ArgumentNullException : line');\n }\n if (font == null) {\n throw new Error('ArgumentNullException : font');\n }\n var reversedLine = this.customLayout(line, rtl, format);\n var words = reversedLine.split('');\n return words;\n };\n return RtlRenderer;\n}());\nexport { RtlRenderer };\n","/**\n * `PdfBoolean` class is used to perform boolean related primitive operations.\n * @private\n */\nvar PdfBoolean = /** @class */ (function () {\n //constructor\n /**\n * Initializes a new instance of the `PdfBoolean` class.\n * @private\n */\n function PdfBoolean(value) {\n /**\n * Internal variable to store the `position`.\n * @default -1\n * @private\n */\n this.currentPosition = -1;\n this.value = value;\n }\n Object.defineProperty(PdfBoolean.prototype, \"status\", {\n //Properties\n /**\n * Gets or sets the `Status` of the specified object.\n * @private\n */\n get: function () {\n return this.objectStatus;\n },\n set: function (value) {\n this.objectStatus = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfBoolean.prototype, \"isSaving\", {\n /**\n * Gets or sets a value indicating whether this document `is saving` or not.\n * @private\n */\n get: function () {\n return this.saving;\n },\n set: function (value) {\n this.saving = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfBoolean.prototype, \"objectCollectionIndex\", {\n /**\n * Gets or sets the `index` value of the specified object.\n * @private\n */\n get: function () {\n return this.index;\n },\n set: function (value) {\n this.index = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfBoolean.prototype, \"position\", {\n /**\n * Gets or sets the `position` of the object.\n * @private\n */\n get: function () {\n return this.currentPosition;\n },\n set: function (value) {\n this.currentPosition = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfBoolean.prototype, \"clonedObject\", {\n /**\n * Returns `cloned object`.\n * @private\n */\n get: function () {\n var rValue = null;\n return rValue;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * `Saves` the object using the specified writer.\n * @private\n */\n PdfBoolean.prototype.save = function (writer) {\n writer.write(this.boolToStr(this.value));\n };\n /**\n * Creates a `copy of PdfBoolean`.\n * @private\n */\n PdfBoolean.prototype.clone = function (crossTable) {\n var newNumber = new PdfBoolean(this.value);\n return newNumber;\n };\n // Implementation\n /**\n * Converts `boolean to string` - 0/1 'true'/'false'.\n * @private\n */\n PdfBoolean.prototype.boolToStr = function (value) {\n return value ? 'true' : 'false';\n };\n return PdfBoolean;\n}());\nexport { PdfBoolean };\n","/**\n * ImageDecoder class\n */\nimport { ByteArray } from './byte-array';\nimport { PdfStream } from './../../primitives/pdf-stream';\nimport { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';\nimport { PdfName } from './../../primitives/pdf-name';\nimport { PdfNumber } from './../../primitives/pdf-number';\nimport { PdfBoolean } from './../../primitives/pdf-boolean';\nimport { PdfDictionary } from './../../primitives/pdf-dictionary';\n/**\n * Specifies the image `format`.\n * @private\n */\nexport var ImageFormat;\n(function (ImageFormat) {\n /**\n * Specifies the type of `Unknown`.\n * @hidden\n * @private\n */\n ImageFormat[ImageFormat[\"Unknown\"] = 0] = \"Unknown\";\n /**\n * Specifies the type of `Bmp`.\n * @hidden\n * @private\n */\n ImageFormat[ImageFormat[\"Bmp\"] = 1] = \"Bmp\";\n /**\n * Specifies the type of `Emf`.\n * @hidden\n * @private\n */\n ImageFormat[ImageFormat[\"Emf\"] = 2] = \"Emf\";\n /**\n * Specifies the type of `Gif`.\n * @hidden\n * @private\n */\n ImageFormat[ImageFormat[\"Gif\"] = 3] = \"Gif\";\n /**\n * Specifies the type of `Jpeg`.\n * @hidden\n * @private\n */\n ImageFormat[ImageFormat[\"Jpeg\"] = 4] = \"Jpeg\";\n /**\n * Specifies the type of `Png`.\n * @hidden\n * @private\n */\n ImageFormat[ImageFormat[\"Png\"] = 5] = \"Png\";\n /**\n * Specifies the type of `Wmf`.\n * @hidden\n * @private\n */\n ImageFormat[ImageFormat[\"Wmf\"] = 6] = \"Wmf\";\n /**\n * Specifies the type of `Icon`.\n * @hidden\n * @private\n */\n ImageFormat[ImageFormat[\"Icon\"] = 7] = \"Icon\";\n})(ImageFormat || (ImageFormat = {}));\n/**\n * `Decode the image stream`.\n * @private\n */\nvar ImageDecoder = /** @class */ (function () {\n /**\n * Initialize the new instance for `image-decoder` class.\n * @private\n */\n function ImageDecoder(stream) {\n /**\n * Start of file markers.\n * @hidden\n * @private\n */\n this.sof1Marker = 0x00C1;\n this.sof2Marker = 0x00C2;\n this.sof3Marker = 0x00C3;\n this.sof5Marker = 0x00C5;\n this.sof6Marker = 0x00C6;\n this.sof7Marker = 0x00C7;\n this.sof9Marker = 0x00C9;\n this.sof10Marker = 0x00CA;\n this.sof11Marker = 0x00CB;\n this.sof13Marker = 0x00CD;\n this.sof14Marker = 0x00CE;\n this.sof15Marker = 0x00CF;\n /**\n * Specifies `format` of image.\n * @hidden\n * @private\n */\n this.mFormat = ImageFormat.Unknown;\n /**\n * `Bits per component`.\n * @default 8\n * @hidden\n * @private\n */\n this.mbitsPerComponent = 8;\n /**\n * Internal variable for accessing fields from `DictionryProperties` class.\n * @hidden\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n this.mStream = stream;\n this.initialize();\n }\n Object.defineProperty(ImageDecoder.prototype, \"height\", {\n /**\n * Gets the `height` of image.\n * @hidden\n * @private\n */\n get: function () {\n return this.mHeight;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ImageDecoder.prototype, \"width\", {\n /**\n * Gets the `width` of image.\n * @hidden\n * @private\n */\n get: function () {\n return this.mWidth;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ImageDecoder.prototype, \"bitsPerComponent\", {\n /**\n * Gets `bits per component`.\n * @hidden\n * @private\n */\n get: function () {\n return this.mbitsPerComponent;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ImageDecoder.prototype, \"size\", {\n /**\n * Gets the `size` of an image data.\n * @hidden\n * @private\n */\n get: function () {\n return this.mImageData.count;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ImageDecoder.prototype, \"imageData\", {\n /**\n * Gets the value of an `image data`.\n * @hidden\n * @private\n */\n get: function () {\n return this.mImageData;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ImageDecoder.prototype, \"imageDataAsNumberArray\", {\n /**\n * Gets the value of an `image data as number array`.\n * @hidden\n * @private\n */\n get: function () {\n return this.mImageData.internalBuffer.buffer;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * `Initialize` image data and image stream.\n * @hidden\n * @private\n */\n ImageDecoder.prototype.initialize = function () {\n if (this.mFormat === ImageFormat.Unknown && this.checkIfJpeg()) {\n this.mFormat = ImageFormat.Jpeg;\n this.parseJpegImage();\n }\n this.reset();\n this.mImageData = new ByteArray(this.mStream.count);\n this.mStream.read(this.mImageData, 0, this.mImageData.count);\n };\n /**\n * `Reset` stream position into 0.\n * @hidden\n * @private\n */\n ImageDecoder.prototype.reset = function () {\n this.mStream.position = 0;\n };\n /**\n * `Parse` Jpeg image.\n * @hidden\n * @private\n */\n ImageDecoder.prototype.parseJpegImage = function () {\n this.reset();\n var imgData = new ByteArray(this.mStream.count);\n this.mStream.read(imgData, 0, imgData.count);\n var i = 4;\n var isLengthExceed = false;\n /* tslint:disable */\n var length = imgData.getBuffer(i) * 256 + imgData.getBuffer(i + 1);\n while (i < imgData.count) {\n i += length;\n if (i < imgData.count) {\n if (imgData.getBuffer(i + 1) === 192) {\n this.mHeight = imgData.getBuffer(i + 5) * 256 + imgData.getBuffer(i + 6);\n this.mWidth = imgData.getBuffer(i + 7) * 256 + imgData.getBuffer(i + 8);\n return;\n }\n else {\n i += 2;\n length = imgData.getBuffer(i) * 256 + imgData.getBuffer(i + 1);\n }\n }\n else {\n isLengthExceed = true;\n break;\n }\n }\n if (isLengthExceed) {\n this.mStream.position = 0;\n this.skip(this.mStream, 2);\n this.readExceededJPGImage(this.mStream);\n }\n /* tslint:enable */\n };\n Object.defineProperty(ImageDecoder.prototype, \"format\", {\n /**\n * Gets the image `format`.\n * @private\n * @hidden\n */\n get: function () {\n return this.mFormat;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * `Checks if JPG`.\n * @private\n * @hidden\n */\n ImageDecoder.prototype.checkIfJpeg = function () {\n this.reset();\n for (var i = 0; i < ImageDecoder.mJpegHeader.length; i++) {\n if (ImageDecoder.mJpegHeader[i] !== this.mStream.readByte(i)) {\n return false;\n }\n this.mStream.position++;\n }\n return true;\n };\n /**\n * Return image `dictionary`.\n * @hidden\n * @private\n */\n ImageDecoder.prototype.getImageDictionary = function () {\n if (this.mFormat === ImageFormat.Jpeg) {\n var tempArrayBuffer = this.imageData.internalBuffer.length;\n this.imageStream = new PdfStream();\n this.imageStream.isImage = true;\n var tempString = '';\n var decodedString = '';\n for (var i = 0; i < this.imageDataAsNumberArray.byteLength; i++) {\n tempString += String.fromCharCode(null, this.mStream.readByte(i));\n }\n for (var i = 0; i < tempString.length; i++) {\n if (i % 2 !== 0) {\n decodedString += tempString[i];\n }\n }\n this.imageStream.data = [decodedString];\n this.imageStream.compress = false;\n this.imageStream.items.setValue(this.dictionaryProperties.type, new PdfName(this.dictionaryProperties.xObject));\n this.imageStream.items.setValue(this.dictionaryProperties.subtype, new PdfName(this.dictionaryProperties.image));\n this.imageStream.items.setValue(this.dictionaryProperties.width, new PdfNumber(this.width));\n this.imageStream.items.setValue(this.dictionaryProperties.height, new PdfNumber(this.height));\n this.imageStream.items.setValue(this.dictionaryProperties.bitsPerComponent, new PdfNumber(this.bitsPerComponent));\n this.imageStream.items.setValue(this.dictionaryProperties.filter, new PdfName(this.dictionaryProperties.dctdecode));\n this.imageStream.items.setValue(this.dictionaryProperties.colorSpace, new PdfName(this.getColorSpace()));\n this.imageStream.items.setValue(this.dictionaryProperties.decodeParms, this.getDecodeParams());\n return this.imageStream;\n }\n else {\n return this.imageStream;\n }\n };\n /**\n * Return `colorSpace` of an image.\n * @hidden\n * @private\n */\n ImageDecoder.prototype.getColorSpace = function () {\n return this.dictionaryProperties.deviceRgb;\n };\n /**\n * Return `decode parameters` of an image.\n * @hidden\n * @private\n */\n ImageDecoder.prototype.getDecodeParams = function () {\n var decodeParams = new PdfDictionary();\n decodeParams.items.setValue(this.dictionaryProperties.columns, new PdfNumber(this.width));\n decodeParams.items.setValue(this.dictionaryProperties.blackIs1, new PdfBoolean(true));\n decodeParams.items.setValue(this.dictionaryProperties.k, new PdfNumber(-1));\n decodeParams.items.setValue(this.dictionaryProperties.predictor, new PdfNumber(15));\n decodeParams.items.setValue(this.dictionaryProperties.bitsPerComponent, new PdfNumber(this.bitsPerComponent));\n return decodeParams;\n };\n /**\n * 'readExceededJPGImage' stream\n * @hidden\n * @private\n */\n ImageDecoder.prototype.readExceededJPGImage = function (stream) {\n this.mStream = stream;\n var isContinueReading = true;\n while (isContinueReading) {\n var marker = this.getMarker(stream);\n switch (marker) {\n case this.sof1Marker:\n case this.sof2Marker:\n case this.sof3Marker:\n case this.sof5Marker:\n case this.sof6Marker:\n case this.sof7Marker:\n case this.sof9Marker:\n case this.sof10Marker:\n case this.sof11Marker:\n case this.sof13Marker:\n case this.sof14Marker:\n case this.sof15Marker:\n stream.position += 3;\n this.mHeight = this.mStream.readNextTwoBytes(stream);\n this.mWidth = this.mStream.readNextTwoBytes(stream);\n isContinueReading = false;\n break;\n default:\n this.skipStream(stream);\n break;\n }\n }\n };\n /**\n * 'skip' stream\n * @hidden\n * @private\n */\n ImageDecoder.prototype.skip = function (stream, noOfBytes) {\n this.mStream = stream;\n var temp = new ByteArray(noOfBytes);\n this.mStream.read(temp, 0, temp.count);\n };\n /**\n * 'getMarker' stream\n * @hidden\n * @private\n */\n ImageDecoder.prototype.getMarker = function (stream) {\n var skippedByte = 0;\n var marker = 32;\n marker = stream.readByte(this.mStream.position);\n stream.position++;\n while (marker !== 255) {\n skippedByte++;\n marker = stream.readByte(this.mStream.position);\n stream.position++;\n }\n do {\n marker = stream.readByte(this.mStream.position);\n stream.position++;\n } while (marker === 255);\n return marker;\n };\n /**\n * 'skipStream' stream\n * @hidden\n * @private\n */\n ImageDecoder.prototype.skipStream = function (stream) {\n var markerLength = this.mStream.readNextTwoBytes(stream) - 2;\n if (markerLength > 0) {\n stream.position += markerLength;\n }\n };\n /**\n * Number array for `png header`.\n * @hidden\n * @private\n */\n ImageDecoder.mPngHeader = [137, 80, 78, 71, 13, 10, 26, 10];\n /**\n * Number Array for `jpeg header`.\n * @hidden\n * @private\n */\n ImageDecoder.mJpegHeader = [255, 216];\n /**\n * Number array for `gif header`.\n * @hidden\n * @private\n */\n ImageDecoder.GIF_HEADER = 'G,I,F,8';\n /**\n * Number array for `bmp header.`\n * @hidden\n * @private\n */\n ImageDecoder.BMP_HEADER = 'B,M';\n return ImageDecoder;\n}());\nexport { ImageDecoder };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { PdfColorSpace } from './../enum';\nimport { PdfColor } from './../pdf-color';\nimport { PdfBrush } from './pdf-brush';\nimport { PdfDictionary } from '../../primitives/pdf-dictionary';\nimport { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';\nimport { PdfBoolean } from './../../primitives/pdf-boolean';\nimport { PdfArray } from './../../primitives/pdf-array';\nimport { PdfName } from '../../primitives/pdf-name';\nimport { PdfNumber } from '../../primitives/pdf-number';\nimport { PdfReferenceHolder } from '../../primitives/pdf-reference';\n/**\n * `PdfGradientBrush` class provides objects used to fill the interiors of graphical shapes such as rectangles,\n * ellipses, pies, polygons, and paths.\n * @private\n */\nvar PdfGradientBrush = /** @class */ (function (_super) {\n __extends(PdfGradientBrush, _super);\n //Constructor\n /**\n * Initializes a new instance of the `PdfGradientBrush` class.\n * @public\n */\n /* tslint:disable-next-line:max-line-length */\n function PdfGradientBrush(shading) {\n var _this = _super.call(this) || this;\n // Fields\n /**\n * Local variable to store the background color.\n * @private\n */\n _this.mbackground = new PdfColor(255, 255, 255);\n /**\n * Local variable to store the stroking color.\n * @private\n */\n _this.mbStroking = false;\n /**\n * Local variable to store the function.\n * @private\n */\n _this.mfunction = null;\n /**\n * Local variable to store the DictionaryProperties.\n * @private\n */\n _this.dictionaryProperties = new DictionaryProperties();\n _this.mpatternDictionary = new PdfDictionary();\n _this.mpatternDictionary.items.setValue(_this.dictionaryProperties.type, new PdfName(_this.dictionaryProperties.pattern));\n _this.mpatternDictionary.items.setValue(_this.dictionaryProperties.patternType, new PdfNumber(2));\n _this.shading = shading;\n _this.colorSpace = PdfColorSpace.Rgb;\n return _this;\n }\n Object.defineProperty(PdfGradientBrush.prototype, \"background\", {\n //Properties\n /**\n * Gets or sets the background color of the brush.\n * @public\n */\n get: function () {\n return this.mbackground;\n },\n set: function (value) {\n this.mbackground = value;\n var sh = this.shading;\n if (value.isEmpty) {\n sh.remove(this.dictionaryProperties.background);\n }\n else {\n sh.items.setValue(this.dictionaryProperties.background, value.toArray(this.colorSpace));\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGradientBrush.prototype, \"antiAlias\", {\n /**\n * Gets or sets a value indicating whether use anti aliasing algorithm.\n * @public\n */\n get: function () {\n var sh = this.shading;\n var aa = (sh.items.getValue(this.dictionaryProperties.antiAlias));\n return aa.value;\n },\n set: function (value) {\n var sh = this.shading;\n var aa = (sh.items.getValue(this.dictionaryProperties.antiAlias));\n if ((aa == null && typeof aa === 'undefined')) {\n aa = new PdfBoolean(value);\n sh.items.setValue(this.dictionaryProperties.antiAlias, aa);\n }\n else {\n aa.value = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGradientBrush.prototype, \"function\", {\n /**\n * Gets or sets the function of the brush.\n * @protected\n */\n get: function () {\n return this.mfunction;\n },\n set: function (value) {\n this.mfunction = value;\n if (value != null && typeof value !== 'undefined') {\n this.shading.items.setValue(this.dictionaryProperties.function, new PdfReferenceHolder(this.mfunction));\n }\n else {\n this.shading.remove(this.dictionaryProperties.function);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGradientBrush.prototype, \"bBox\", {\n /**\n * Gets or sets the boundary box of the brush.\n * @protected\n */\n get: function () {\n var sh = this.shading;\n var box = (sh.items.getValue(this.dictionaryProperties.bBox));\n return box;\n },\n set: function (value) {\n var sh = this.shading;\n if (value == null && typeof value === 'undefined') {\n sh.remove(this.dictionaryProperties.bBox);\n }\n else {\n sh.items.setValue(this.dictionaryProperties.bBox, value);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGradientBrush.prototype, \"colorSpace\", {\n /**\n * Gets or sets the color space of the brush.\n * @public\n */\n get: function () {\n return this.mcolorSpace;\n },\n set: function (value) {\n var colorSpace = this.shading.items.getValue(this.dictionaryProperties.colorSpace);\n if ((value !== this.mcolorSpace) || (colorSpace == null)) {\n this.mcolorSpace = value;\n var csValue = this.colorSpaceToDeviceName(value);\n this.shading.items.setValue(this.dictionaryProperties.colorSpace, new PdfName(csValue));\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGradientBrush.prototype, \"stroking\", {\n /**\n * Gets or sets a value indicating whether this PdfGradientBrush is stroking.\n * @public\n */\n get: function () {\n return this.mbStroking;\n },\n set: function (value) {\n this.mbStroking = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGradientBrush.prototype, \"patternDictionary\", {\n /**\n * Gets the pattern dictionary.\n * @protected\n */\n get: function () {\n if (this.mpatternDictionary == null) {\n this.mpatternDictionary = new PdfDictionary();\n }\n return this.mpatternDictionary;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGradientBrush.prototype, \"shading\", {\n /**\n * Gets or sets the shading dictionary.\n * @protected\n */\n get: function () {\n return this.mshading;\n },\n set: function (value) {\n if (value == null) {\n throw new Error('ArgumentNullException : Shading');\n }\n if (value !== this.mshading) {\n this.mshading = value;\n this.patternDictionary.items.setValue(this.dictionaryProperties.shading, new PdfReferenceHolder(this.mshading));\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGradientBrush.prototype, \"matrix\", {\n /**\n * Gets or sets the transformation matrix.\n * @public\n */\n get: function () {\n return this.mmatrix;\n },\n set: function (value) {\n if (value == null) {\n throw new Error('ArgumentNullException : Matrix');\n }\n if (value !== this.mmatrix) {\n this.mmatrix = value.clone();\n var m = new PdfArray(this.mmatrix.matrix.elements);\n this.mpatternDictionary.items.setValue(this.dictionaryProperties.matrix, m);\n }\n },\n enumerable: true,\n configurable: true\n });\n //Overrides\n /**\n * Monitors the changes of the brush and modify PDF state respectfully.\n * @param brush The brush.\n * @param streamWriter The stream writer.\n * @param getResources The get resources delegate.\n * @param saveChanges if set to true the changes should be saved anyway.\n * @param currentColorSpace The current color space.\n */\n /* tslint:disable-next-line:max-line-length */\n PdfGradientBrush.prototype.monitorChanges = function (brush, streamWriter, getResources, saveChanges, currentColorSpace) {\n var diff = false;\n if (brush instanceof PdfGradientBrush) {\n if ((this.colorSpace !== currentColorSpace)) {\n this.colorSpace = currentColorSpace;\n this.resetFunction();\n }\n // Set the /Pattern colour space.\n streamWriter.setColorSpace('Pattern', this.mbStroking);\n // Set the pattern for non-stroking operations.\n var resources = getResources.getResources();\n var name_1 = resources.getName(this);\n streamWriter.setColourWithPattern(null, name_1, this.mbStroking);\n diff = true;\n }\n return diff;\n };\n /**\n * Resets the changes, which were made by the brush.\n * In other words resets the state to the initial one.\n * @param streamWriter The stream writer.\n */\n PdfGradientBrush.prototype.resetChanges = function (streamWriter) {\n // Unable reset.\n };\n //Implementation\n /**\n * Converts colorspace enum to a PDF name.\n * @param colorSpace The color space enum value.\n */\n PdfGradientBrush.prototype.colorSpaceToDeviceName = function (colorSpace) {\n var result;\n switch (colorSpace) {\n case PdfColorSpace.Rgb:\n result = 'DeviceRGB';\n break;\n }\n return result;\n };\n /**\n * Resets the pattern dictionary.\n * @param dictionary A new pattern dictionary.\n */\n PdfGradientBrush.prototype.resetPatternDictionary = function (dictionary) {\n this.mpatternDictionary = dictionary;\n };\n /**\n * Clones the anti aliasing value.\n * @param brush The brush.\n */\n PdfGradientBrush.prototype.cloneAntiAliasingValue = function (brush) {\n if ((brush == null)) {\n throw new Error('ArgumentNullException : brush');\n }\n var sh = this.shading;\n var aa = (sh.items.getValue(this.dictionaryProperties.antiAlias));\n if ((aa != null)) {\n brush.shading.items.setValue(this.dictionaryProperties.antiAlias, new PdfBoolean(aa.value));\n }\n };\n /**\n * Clones the background value.\n * @param brush The brush.\n */\n PdfGradientBrush.prototype.cloneBackgroundValue = function (brush) {\n var background = this.background;\n if (!background.isEmpty) {\n brush.background = background;\n }\n };\n Object.defineProperty(PdfGradientBrush.prototype, \"element\", {\n /* tslint:enable */\n // IPdfWrapper Members\n /**\n * Gets the `element`.\n * @private\n */\n get: function () {\n return this.patternDictionary;\n },\n enumerable: true,\n configurable: true\n });\n return PdfGradientBrush;\n}(PdfBrush));\nexport { PdfGradientBrush };\n","/**\n * PdfTemplate.ts class for EJ2-PDF\n */\nimport { PdfStream } from './../../primitives/pdf-stream';\nimport { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';\nimport { PdfArray } from './../../primitives/pdf-array';\nimport { PdfGraphics } from './../pdf-graphics';\nimport { PdfResources } from './../pdf-resources';\nimport { PdfName } from './../../primitives/pdf-name';\nimport { PointF, SizeF, RectangleF } from './../../drawing/pdf-drawing';\nimport { GetResourceEventHandler } from './../pdf-graphics';\n/**\n * Represents `Pdf Template` object.\n * @private\n */\nvar PdfTemplate = /** @class */ (function () {\n function PdfTemplate(arg1, arg2) {\n /**\n * Initialize an instance for `DictionaryProperties` class.\n * @private\n * @hidden\n */\n this.dictionaryProperties = new DictionaryProperties();\n /**\n * Checks whether the transformation 'is performed'.\n * @default true\n * @private\n */\n this.writeTransformation = true;\n if (typeof arg1 === 'undefined') {\n //\n }\n else if (arg1 instanceof SizeF && typeof arg2 === 'undefined') {\n this.content = new PdfStream();\n var tempSize = new SizeF(arg1.width, arg1.height);\n this.setSize(tempSize);\n this.initialize();\n }\n else {\n this.content = new PdfStream();\n this.setSize(new SizeF(arg1, arg2));\n this.initialize();\n }\n }\n Object.defineProperty(PdfTemplate.prototype, \"size\", {\n //Properties\n /**\n * Gets the size of the 'PdfTemplate'.\n */\n get: function () {\n return this.templateSize;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfTemplate.prototype, \"width\", {\n /**\n * Gets the width of the 'PdfTemplate'.\n */\n get: function () {\n return this.size.width;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfTemplate.prototype, \"height\", {\n /**\n * Gets the height of the 'PdfTemplate'.\n */\n get: function () {\n return this.size.height;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfTemplate.prototype, \"graphics\", {\n /**\n * Gets the `graphics` of the 'PdfTemplate'.\n */\n get: function () {\n if (this.pdfGraphics == null || typeof this.pdfGraphics === 'undefined') {\n var gr = new GetResourceEventHandler(this);\n var g = new PdfGraphics(this.size, gr, this.content);\n this.pdfGraphics = g;\n // if(this.writeTransformation) {\n // Transform co-ordinates to Top/Left.\n this.pdfGraphics.initializeCoordinates();\n // }\n }\n return this.pdfGraphics;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the resources and modifies the template dictionary.\n * @private\n */\n PdfTemplate.prototype.getResources = function () {\n if (this.resources == null) {\n this.resources = new PdfResources();\n this.content.items.setValue(this.dictionaryProperties.resources, this.resources);\n }\n return this.resources;\n };\n // Public methods\n /**\n * `Initialize` the type and subtype of the template.\n * @private\n */\n PdfTemplate.prototype.initialize = function () {\n this.addType();\n this.addSubType();\n };\n /**\n * `Adds type key`.\n * @private\n */\n PdfTemplate.prototype.addType = function () {\n var value = new PdfName(this.dictionaryProperties.xObject);\n this.content.items.setValue(this.dictionaryProperties.type, value);\n };\n /**\n * `Adds SubType key`.\n * @private\n */\n PdfTemplate.prototype.addSubType = function () {\n var value = new PdfName(this.dictionaryProperties.form);\n this.content.items.setValue(this.dictionaryProperties.subtype, value);\n };\n PdfTemplate.prototype.reset = function (size) {\n if (typeof size === 'undefined') {\n if (this.resources != null) {\n this.resources = null;\n this.content.remove(this.dictionaryProperties.resources);\n }\n if (this.graphics != null) {\n this.graphics.reset(this.size);\n }\n }\n else {\n this.setSize(size);\n this.reset();\n }\n };\n /**\n * `Set the size` of the 'PdfTemplate'.\n * @private\n */\n PdfTemplate.prototype.setSize = function (size) {\n var rect = new RectangleF(new PointF(0, 0), size);\n var val = PdfArray.fromRectangle(rect);\n this.content.items.setValue(this.dictionaryProperties.bBox, val);\n this.templateSize = size;\n };\n Object.defineProperty(PdfTemplate.prototype, \"element\", {\n // /**\n // * Returns the value of current graphics.\n // * @private\n // */\n // public GetGraphics(g : PdfGraphics) : PdfGraphics {\n // if (this.graphics == null || typeof this.graphics === 'undefined') {\n // this.graphics = g;\n // this.graphics.Size = this.Size;\n // this.graphics.StreamWriter = new PdfStreamWriter(this.content)\n // this.graphics.Initialize();\n // if(this.writeTransformation) {\n // this.graphics.InitializeCoordinates();\n // }\n // }\n // return this.graphics;\n // }\n // IPdfWrapper Members\n /**\n * Gets the `content stream` of 'PdfTemplate' class.\n * @private\n */\n get: function () {\n return this.content;\n },\n enumerable: true,\n configurable: true\n });\n return PdfTemplate;\n}());\nexport { PdfTemplate };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar TrendlinesDirective = /** @class */ (function (_super) {\n __extends(TrendlinesDirective, _super);\n function TrendlinesDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TrendlinesDirective.prototype.render = function () {\n return;\n };\n TrendlinesDirective.prototype.getTag = function () {\n return 'e-trendlines';\n };\n TrendlinesDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], TrendlinesDirective);\n return TrendlinesDirective;\n}(vueImport));\nexport { TrendlinesDirective };\nexport var TrendlinesPlugin = {\n name: 'e-trendlines',\n install: function (Vue) {\n Vue.component(TrendlinesPlugin.name, TrendlinesDirective);\n }\n};\nvar TrendlineDirective = /** @class */ (function (_super) {\n __extends(TrendlineDirective, _super);\n function TrendlineDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TrendlineDirective.prototype.render = function () {\n return;\n };\n TrendlineDirective.prototype.getTag = function () {\n return 'e-trendline';\n };\n TrendlineDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], TrendlineDirective);\n return TrendlineDirective;\n}(vueImport));\nexport { TrendlineDirective };\nexport var TrendlinePlugin = {\n name: 'e-trendline',\n install: function (Vue) {\n Vue.component(TrendlinePlugin.name, TrendlineDirective);\n }\n};\n","/**\n * Used to perform `convertion between pixels and points`.\n * @private\n */\nvar PdfUnitConverter = /** @class */ (function () {\n //constructors\n /**\n * Initializes a new instance of the `UnitConvertor` class with DPI value.\n * @private\n */\n function PdfUnitConverter(dpi) {\n this.updateProportionsHelper(dpi);\n }\n /**\n * `Converts` the value, from one graphics unit to another graphics unit.\n * @private\n */\n PdfUnitConverter.prototype.convertUnits = function (value, from, to) {\n return this.convertFromPixels(this.convertToPixels(value, from), to);\n };\n /**\n * Converts the value `to pixel` from specified graphics unit.\n * @private\n */\n PdfUnitConverter.prototype.convertToPixels = function (value, from) {\n var index = from;\n var result = (value * this.proportions[index]);\n return result;\n };\n /**\n * Converts value, to specified graphics unit `from Pixel`.\n * @private\n */\n PdfUnitConverter.prototype.convertFromPixels = function (value, to) {\n var index = to;\n var result = (value / this.proportions[index]);\n return result;\n };\n /**\n * `Update proportions` matrix according to Graphics settings.\n * @private\n */\n PdfUnitConverter.prototype.updateProportionsHelper = function (pixelPerInch) {\n this.proportions = [\n pixelPerInch / 2.54,\n pixelPerInch / 6.0,\n 1,\n pixelPerInch / 72.0,\n pixelPerInch,\n pixelPerInch / 300.0,\n pixelPerInch / 25.4 // Millimeter\n ];\n };\n //Fields\n /**\n * Indicates default `horizontal resolution`.\n * @default 96\n * @private\n */\n PdfUnitConverter.horizontalResolution = 96;\n /**\n * Indicates default `vertical resolution`.\n * @default 96\n * @private\n */\n PdfUnitConverter.verticalResolution = 96;\n return PdfUnitConverter;\n}());\nexport { PdfUnitConverter };\n","import { SizeF } from './../../drawing/pdf-drawing';\nimport { PdfGraphicsUnit } from './../enum';\nimport { PdfUnitConverter } from './../unit-convertor';\n/**\n * `PdfImage` class represents the base class for images and provides functionality for the 'PdfBitmap' class.\n * @private\n */\nvar PdfImage = /** @class */ (function () {\n function PdfImage() {\n }\n Object.defineProperty(PdfImage.prototype, \"width\", {\n /**\n * Gets and Sets the `width` of an image.\n * @private\n */\n get: function () {\n return this.imageWidth;\n },\n set: function (value) {\n this.imageWidth = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfImage.prototype, \"height\", {\n /**\n * Gets and Sets the `height` of an image.\n * @private\n */\n get: function () {\n return this.imageHeight;\n },\n set: function (value) {\n this.imageHeight = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfImage.prototype, \"size\", {\n /**\n * Gets or sets the size of the image.\n * @private\n */\n set: function (value) {\n this.width = value.width;\n this.height = value.height;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfImage.prototype, \"physicalDimension\", {\n /**\n * Gets the `physical dimension` of an image.\n * @private\n */\n get: function () {\n this.imagePhysicalDimension = this.getPointSize(this.width, this.height, this.horizontalResolution, this.verticalResolution);\n return new SizeF(this.width, this.height);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfImage.prototype, \"element\", {\n // /**\n // * Gets the `image stream as string`.\n // * @private\n // */\n // public static fromString(string : string) : PdfImage {\n // let image : PdfImage = new PdfBitmap(string);\n // return image;\n // }\n /**\n * Gets the `element` image stream.\n * @private\n */\n get: function () {\n return this.imageStream;\n },\n enumerable: true,\n configurable: true\n });\n PdfImage.prototype.getPointSize = function (width, height, horizontalResolution, verticalResolution) {\n if (typeof horizontalResolution === 'undefined') {\n var dpiX = PdfUnitConverter.horizontalResolution;\n var dpiY = PdfUnitConverter.verticalResolution;\n var size = this.getPointSize(width, height, dpiX, dpiY);\n return size;\n }\n else {\n var ucX = new PdfUnitConverter(horizontalResolution);\n var ucY = new PdfUnitConverter(verticalResolution);\n var ptWidth = ucX.convertUnits(width, PdfGraphicsUnit.Pixel, PdfGraphicsUnit.Point);\n var ptHeight = ucY.convertUnits(height, PdfGraphicsUnit.Pixel, PdfGraphicsUnit.Point);\n var size = new SizeF(ptWidth, ptHeight);\n return size;\n }\n };\n return PdfImage;\n}());\nexport { PdfImage };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * PdfBitmap.ts class for EJ2-PDF\n */\nimport { ImageDecoder } from './../../graphics/images/image-decoder';\nimport { ByteArray } from './../../graphics/images/byte-array';\nimport { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';\nimport { PdfImage } from './pdf-image';\n/**\n * The 'PdfBitmap' contains methods and properties to handle the Bitmap images.\n * ```typescript\n * // create a new PDF document.\n * let document : PdfDocument = new PdfDocument();\n * // add a page to the document.\n * let page1 : PdfPage = document.pages.add();\n * // base64 string of an image\n * let imageString : string = '/9j/3+2w7em7HzY/KiijFw … 1OEYRUYrQ45yc5OUtz/9k=';\n * // load the image from the base64 string of original image.\n * let image : PdfBitmap = new PdfBitmap(imageString);\n * // draw the image\n * page1.graphics.drawImage(image, new RectangleF({x : 10, y : 10}, {width : 200, height : 200}));\n * // save the document.\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\nvar PdfBitmap = /** @class */ (function (_super) {\n __extends(PdfBitmap, _super);\n /**\n * Create an instance for `PdfBitmap` class.\n * @param encodedString Base64 string of an image.\n * ```typescript\n * // create a new PDF document.\n * let document : PdfDocument = new PdfDocument();\n * // add a page to the document.\n * let page1 : PdfPage = document.pages.add();\n * // base64 string of an image\n * let imageString : string = '/9j/3+2w7em7HzY/KiijFw … 1OEYRUYrQ45yc5OUtz/9k=';\n * //\n * // load the image from the base64 string of original image.\n * let image : PdfBitmap = new PdfBitmap(imageString);\n * //\n * // draw the image\n * page1.graphics.drawImage(image, new RectangleF({x : 10, y : 10}, {width : 200, height : 200}));\n * // save the document.\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n function PdfBitmap(encodedString) {\n var _this = _super.call(this) || this;\n //Fields\n /**\n * Specifies the `status` of an image.\n * @default true.\n * @hidden\n * @private\n */\n _this.imageStatus = true;\n /**\n * Internal variable for accessing fields from `DictionryProperties` class.\n * @hidden\n * @private\n */\n _this.dictionaryProperties = new DictionaryProperties();\n _this.loadImage(encodedString);\n return _this;\n }\n /**\n * `Load image`.\n * @hidden\n * @private\n */\n PdfBitmap.prototype.loadImage = function (encodedString) {\n var task = this.initializeAsync(encodedString);\n };\n /**\n * `Initialize` image parameters.\n * @private\n */\n PdfBitmap.prototype.initializeAsync = function (encodedString) {\n var byteArray = new ByteArray(encodedString.length);\n byteArray.writeFromBase64String(encodedString);\n this.decoder = new ImageDecoder(byteArray);\n this.height = this.decoder.height;\n this.width = this.decoder.width;\n // FrameCount = BitmapImageDecoder.FrameCount;\n this.bitsPerComponent = this.decoder.bitsPerComponent;\n };\n /**\n * `Saves` the image into stream.\n * @private\n */\n PdfBitmap.prototype.save = function () {\n this.imageStatus = true;\n this.imageStream = this.decoder.getImageDictionary();\n };\n return PdfBitmap;\n}(PdfImage));\nexport { PdfBitmap };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * PdfResources.ts class for EJ2-PDF\n */\nimport { PdfDictionary } from './../primitives/pdf-dictionary';\nimport { TemporaryDictionary } from './../collections/object-object-pair/dictionary';\nimport { PdfName } from './../primitives/pdf-name';\nimport { PdfArray } from './../primitives/pdf-array';\nimport { PdfReferenceHolder } from './../primitives/pdf-reference';\nimport { PdfCrossTable } from './../input-output/pdf-cross-table';\nimport { PdfFont } from './fonts/pdf-font';\nimport { PdfTemplate } from './figures/pdf-template';\nimport { PdfBrush } from './brushes/pdf-brush';\nimport { PdfTransparency } from './pdf-transparency';\nimport { PdfBitmap } from './../graphics/images/pdf-bitmap';\nimport { PdfImage } from './../graphics/images/pdf-image';\nimport { PdfGradientBrush } from './brushes/pdf-gradient-brush';\nimport { PdfTilingBrush } from './brushes/pdf-tiling-brush';\n/**\n * `PdfResources` class used to set resource contents like font, image.\n * @private\n */\nvar PdfResources = /** @class */ (function (_super) {\n __extends(PdfResources, _super);\n function PdfResources(baseDictionary) {\n var _this = _super.call(this, baseDictionary) || this;\n /**\n * Dictionary for the `properties names`.\n * @private\n */\n _this.properties = new PdfDictionary();\n return _this;\n }\n Object.defineProperty(PdfResources.prototype, \"names\", {\n //Properties\n /**\n * Gets the `font names`.\n * @private\n */\n get: function () {\n return this.getNames();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfResources.prototype, \"document\", {\n /**\n * Get or set the `page document`.\n * @private\n */\n get: function () {\n return this.pdfDocument;\n },\n set: function (value) {\n this.pdfDocument = value;\n },\n enumerable: true,\n configurable: true\n });\n //Public Methods\n /**\n * `Generates name` for the object and adds to the resource if the object is new.\n * @private\n */\n PdfResources.prototype.getName = function (obj) {\n var primitive = obj.element;\n var name = null;\n if (this.names.containsKey(primitive)) {\n name = this.names.getValue(primitive);\n }\n // Object is new.\n if (name == null) {\n var sName = this.generateName();\n name = new PdfName(sName);\n this.names.setValue(primitive, name);\n if (obj instanceof PdfFont) {\n this.add(obj, name);\n }\n else if (obj instanceof PdfTemplate) {\n this.add(obj, name);\n }\n else if (obj instanceof PdfGradientBrush || obj instanceof PdfTilingBrush) {\n this.add(obj, name);\n }\n else if (obj instanceof PdfTransparency) {\n this.add(obj, name);\n }\n else if (obj instanceof PdfImage || obj instanceof PdfBitmap) {\n this.add(obj, name);\n }\n }\n return name;\n };\n /**\n * Gets `resource names` to font dictionaries.\n * @private\n */\n PdfResources.prototype.getNames = function () {\n if (this.pdfNames == null) {\n this.pdfNames = new TemporaryDictionary();\n }\n var fonts = this.items.getValue(this.dictionaryProperties.font);\n if (fonts != null) {\n var reference = fonts;\n var dictionary = fonts;\n dictionary = PdfCrossTable.dereference(fonts);\n }\n return this.pdfNames;\n };\n /**\n * Add `RequireProcedureSet` into procset array.\n * @private\n */\n PdfResources.prototype.requireProcedureSet = function (procedureSetName) {\n if (procedureSetName == null) {\n throw new Error('ArgumentNullException:procedureSetName');\n }\n var procSets = this.items.getValue(this.dictionaryProperties.procset);\n if (procSets == null) {\n procSets = new PdfArray();\n this.items.setValue(this.dictionaryProperties.procset, procSets);\n }\n var name = new PdfName(procedureSetName);\n if (!procSets.contains(name)) {\n procSets.add(name);\n }\n };\n //Helper Methods\n /**\n * `Remove font` from array.\n * @private\n */\n PdfResources.prototype.removeFont = function (name) {\n var key = null;\n var keys = this.pdfNames.keys();\n for (var index = 0; index < this.pdfNames.size(); index++) {\n if (this.pdfNames.getValue(keys[index]) === new PdfName(name)) {\n key = keys[index];\n break;\n }\n }\n if (key != null) {\n this.pdfNames.remove(key);\n }\n };\n /**\n * Generates `Unique string name`.\n * @private\n */\n PdfResources.prototype.generateName = function () {\n var name = Guid.getNewGuidString();\n return name;\n };\n PdfResources.prototype.add = function (arg1, arg2) {\n if (arg1 instanceof PdfFont) {\n var dictionary = null;\n var fonts = this.items.getValue(this.dictionaryProperties.font);\n if (fonts != null) {\n var reference = fonts;\n dictionary = fonts;\n dictionary = fonts;\n }\n else {\n dictionary = new PdfDictionary();\n this.items.setValue(this.dictionaryProperties.font, dictionary);\n }\n dictionary.items.setValue(arg2.value, new PdfReferenceHolder(arg1.element));\n }\n else if (arg1 instanceof PdfTemplate) {\n var xobjects = void 0;\n xobjects = this.items.getValue(this.dictionaryProperties.xObject);\n // Create fonts dictionary.\n if (xobjects == null) {\n xobjects = new PdfDictionary();\n this.items.setValue(this.dictionaryProperties.xObject, xobjects);\n }\n xobjects.items.setValue(arg2.value, new PdfReferenceHolder(arg1.element));\n }\n else if (arg1 instanceof PdfBrush) {\n if (arg1 instanceof PdfGradientBrush || arg1 instanceof PdfTilingBrush) {\n var savable = arg1.element;\n if (savable != null) {\n var pattern = this.items.getValue(this.dictionaryProperties.pattern);\n // Create a new pattern dictionary.\n if (pattern == null) {\n pattern = new PdfDictionary();\n this.items.setValue(this.dictionaryProperties.pattern, pattern);\n }\n pattern.items.setValue(arg2.value, new PdfReferenceHolder(savable));\n }\n }\n }\n else if (arg1 instanceof PdfTransparency) {\n var savable = arg1.element;\n var transDic = null;\n transDic = this.items.getValue(this.dictionaryProperties.extGState);\n // Create a new pattern dictionary.\n if (transDic == null) {\n transDic = new PdfDictionary();\n this.items.setValue(this.dictionaryProperties.extGState, transDic);\n }\n transDic.items.setValue(arg2.value, new PdfReferenceHolder(savable));\n }\n else {\n /* tslint:disable */\n var xobjects = this.Dictionary.items.getValue(this.dictionaryProperties.xObject);\n var parentXObjects = void 0;\n if (typeof this.pdfDocument !== 'undefined') {\n parentXObjects = this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.getValue(this.dictionaryProperties.xObject);\n }\n var values = this.Dictionary.items.values();\n var hasSameImageStream = false;\n var oldReference = void 0;\n if (typeof this.pdfDocument !== 'undefined' && (typeof parentXObjects === undefined || parentXObjects == null)) {\n parentXObjects = new PdfDictionary();\n this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.setValue(this.dictionaryProperties.xObject, parentXObjects);\n }\n else if (typeof this.pdfDocument !== 'undefined') {\n var values_1 = parentXObjects.items.values();\n for (var i = 0; i < values_1.length; i++) {\n if (typeof values_1[i] !== 'undefined' && typeof values_1[i].element !== 'undefined') {\n if (values_1[i].element.data[0] === arg1.element.data[0]) {\n oldReference = values_1[i];\n hasSameImageStream = true;\n }\n }\n }\n }\n if (xobjects == null) {\n xobjects = new PdfDictionary();\n this.Dictionary.items.setValue(this.dictionaryProperties.xObject, xobjects);\n }\n if (hasSameImageStream && typeof oldReference !== 'undefined') {\n xobjects.items.setValue(arg2.value, oldReference);\n }\n else {\n var reference = new PdfReferenceHolder(arg1.element);\n xobjects.items.setValue(arg2.value, reference);\n if (typeof this.pdfDocument !== 'undefined') {\n parentXObjects.items.setValue(arg2.value, reference);\n }\n }\n /* tslint:enable */\n }\n };\n return PdfResources;\n}(PdfDictionary));\nexport { PdfResources };\n/* tslint:disable */\n/**\n * Used to create new guid for resources.\n * @private\n */\nvar Guid = /** @class */ (function () {\n function Guid() {\n }\n /**\n * Generate `new GUID`.\n * @private\n */\n Guid.getNewGuidString = function () {\n return 'aaaaaaaa-aaaa-4aaa-baaa-aaaaaaaaaaaa'.replace(/[ab]/g, function (c) {\n var random = Math.random() * 16 | 0;\n var result = c === 'a' ? random : (random & 0x3 | 0x8);\n return result.toString(16);\n });\n };\n return Guid;\n}());\nexport { Guid };\n/* tslint:enable */ \n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { GetResourceEventHandler } from './../pdf-graphics';\nimport { PdfBrush } from './pdf-brush';\nimport { PointF, SizeF, RectangleF, Rectangle } from './../../drawing/pdf-drawing';\nimport { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';\nimport { PdfArray } from './../../primitives/pdf-array';\nimport { PdfNumber } from './../../primitives/pdf-number';\nimport { PdfGraphics } from './../pdf-graphics';\nimport { PdfResources } from './../pdf-resources';\nimport { PdfStream } from './../../primitives/pdf-stream';\nimport { PdfPage } from './../../pages/pdf-page';\n/**\n * `PdfTilingBrush` Implements a colored tiling brush.\n */\nvar PdfTilingBrush = /** @class */ (function (_super) {\n __extends(PdfTilingBrush, _super);\n /**\n * Initializes a new instance of the `PdfTilingBrush` class.\n * @public\n */\n function PdfTilingBrush(arg1, arg2) {\n var _this = _super.call(this) || this;\n /**\n * Local variable to store Stroking.\n * @private\n */\n _this.mStroking = false;\n /**\n * Local variable to store the tile start location.\n * @private\n */\n _this.mLocation = new PointF(0, 0);\n /**\n * Local variable to store the dictionary properties.\n * @private\n */\n _this.mDictionaryProperties = new DictionaryProperties();\n var rect = null;\n if (arg1 instanceof Rectangle) {\n rect = arg1;\n }\n else if (arg1 instanceof SizeF) {\n rect = new Rectangle(0, 0, arg1.width, arg1.height);\n }\n if (arg2 !== null && arg2 instanceof PdfPage) {\n _this.mPage = arg2;\n }\n _this.brushStream = new PdfStream();\n _this.mResources = new PdfResources();\n _this.brushStream.items.setValue(_this.mDictionaryProperties.resources, _this.mResources);\n _this.setBox(rect);\n _this.setObligatoryFields();\n if (arg2 !== null && arg2 instanceof PdfPage) {\n _this.mPage = arg2;\n _this.graphics.colorSpace = arg2.document.colorSpace;\n }\n return _this;\n }\n /**\n * Initializes a new instance of the `PdfTilingBrush` class.\n * @private\n * @param rectangle The size of the smallest brush cell.\n * @param page The Current Page Object.\n * @param location The Tile start location.\n * @param matrix The matrix.\n */\n PdfTilingBrush.prototype.initialize = function (rectangle, page, location, matrix) {\n this.mPage = page;\n this.mLocation = location;\n this.mTransformationMatrix = matrix;\n this.tempBrushStream = this.brushStream;\n this.brushStream = new PdfStream();\n var tempResource = new PdfResources();\n this.brushStream.items.setValue(this.mDictionaryProperties.resources, tempResource);\n this.setBox(rectangle);\n this.setObligatoryFields();\n return this;\n };\n Object.defineProperty(PdfTilingBrush.prototype, \"location\", {\n //Properties\n /**\n * Location representing the start position of the tiles.\n * @public\n */\n get: function () {\n return this.mLocation;\n },\n set: function (value) {\n this.mLocation = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Sets the obligatory fields.\n * @private\n */\n PdfTilingBrush.prototype.setObligatoryFields = function () {\n this.brushStream.items.setValue(this.mDictionaryProperties.patternType, new PdfNumber(1));\n // Tiling brush.\n this.brushStream.items.setValue(this.mDictionaryProperties.paintType, new PdfNumber(1));\n // Coloured.\n this.brushStream.items.setValue(this.mDictionaryProperties.tilingType, new PdfNumber(1));\n // Constant spacing.\n this.brushStream.items.setValue(this.mDictionaryProperties.xStep, new PdfNumber((this.mBox.right - this.mBox.left)));\n this.brushStream.items.setValue(this.mDictionaryProperties.yStep, new PdfNumber((this.mBox.bottom - this.mBox.top)));\n if ((this.mPage != null) && (this.mLocation != null)) {\n if ((this.mTransformationMatrix == null && typeof this.mTransformationMatrix === 'undefined')) {\n // Transform the tile origin to fit the location\n var tileTransform = (this.mPage.size.height % this.rectangle.size.height) - (this.mLocation.y);\n /* tslint:disable-next-line:max-line-length */\n this.brushStream.items.setValue(this.mDictionaryProperties.matrix, new PdfArray([1, 0, 0, 1, this.mLocation.x, tileTransform]));\n }\n else {\n var tileTransform = 0;\n // Transform the tile origin to fit the location\n var elements = this.mTransformationMatrix.matrix.elements;\n if ((this.mPage.size.height > this.rectangle.size.height)) {\n tileTransform = (this.mTransformationMatrix.matrix.offsetY\n - (this.mPage.size.height % this.rectangle.size.height));\n }\n else {\n tileTransform = ((this.mPage.size.height % this.rectangle.size.height) + this.mTransformationMatrix.matrix.offsetY);\n }\n this.brushStream.items.setValue(this.mDictionaryProperties.matrix, new PdfArray([\n elements[0], elements[1], elements[2], elements[3], elements[4], tileTransform\n ]));\n }\n }\n };\n /**\n * Sets the BBox coordinates.\n * @private\n */\n PdfTilingBrush.prototype.setBox = function (box) {\n this.mBox = box;\n var rect = new RectangleF(this.mBox.left, this.mBox.top, this.mBox.right, this.mBox.bottom);\n this.brushStream.items.setValue(this.mDictionaryProperties.bBox, PdfArray.fromRectangle(rect));\n };\n Object.defineProperty(PdfTilingBrush.prototype, \"rectangle\", {\n //Properties\n /**\n * Gets the boundary box of the smallest brush cell.\n * @public\n */\n get: function () {\n return this.mBox;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfTilingBrush.prototype, \"size\", {\n /**\n * Gets the size of the smallest brush cell.\n * @public\n */\n get: function () {\n return this.mBox.size;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfTilingBrush.prototype, \"graphics\", {\n /**\n * Gets Graphics context of the brush.\n */\n get: function () {\n if ((this.mGraphics == null && typeof this.mGraphics === 'undefined')) {\n var gr = new GetResourceEventHandler(this);\n var g = new PdfGraphics(this.size, gr, this.brushStream);\n this.mGraphics = g;\n this.mResources = this.getResources();\n this.mGraphics.initializeCoordinates();\n }\n return this.mGraphics;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the resources and modifies the template dictionary.\n * @public\n */\n PdfTilingBrush.prototype.getResources = function () {\n return this.mResources;\n };\n Object.defineProperty(PdfTilingBrush.prototype, \"stroking\", {\n /**\n * Gets or sets a value indicating whether this PdfTilingBrush\n * is used for stroking operations.\n */\n get: function () {\n return this.mStroking;\n },\n set: function (value) {\n this.mStroking = value;\n },\n enumerable: true,\n configurable: true\n });\n //PdfBrush methods\n /**\n * Creates a new copy of a brush.\n * @public\n */\n PdfTilingBrush.prototype.clone = function () {\n var brush = this.initialize(this.rectangle, this.mPage, this.location, this.mTransformationMatrix);\n if ((this.mTransformationMatrix != null) && (this.mTransformationMatrix.matrix != null)) {\n /* tslint:disable-next-line:max-line-length */\n brush.brushStream.items.setValue(this.mDictionaryProperties.matrix, new PdfArray(this.mTransformationMatrix.matrix.elements));\n }\n brush.brushStream.data = this.tempBrushStream.data;\n brush.mResources = new PdfResources(this.mResources);\n brush.brushStream.items.setValue(this.mDictionaryProperties.resources, brush.mResources);\n return brush;\n };\n /**\n * Monitors the changes of the brush and modify PDF state respectfully.\n * @param brush The brush\n * @param streamWriter The stream writer\n * @param getResources The get resources delegate.\n * @param saveChanges if set to true the changes should be saved anyway.\n * @param currentColorSpace The current color space.\n */\n /* tslint:disable-next-line:max-line-length */\n PdfTilingBrush.prototype.monitorChanges = function (brush, streamWriter, getResources, saveChanges, currentColorSpace) {\n var diff = false;\n if (brush !== this) {\n // Set the Pattern colour space.\n streamWriter.setColorSpace('Pattern', this.mStroking);\n // Set the pattern for non-stroking operations.\n var resources1 = getResources.getResources();\n var name1 = resources1.getName(this);\n streamWriter.setColourWithPattern(null, name1, this.mStroking);\n diff = true;\n }\n else if (brush instanceof PdfTilingBrush) {\n // Set the /Pattern colour space.\n streamWriter.setColorSpace('Pattern', this.mStroking);\n // Set the pattern for non-stroking operations.\n var resources = getResources.getResources();\n var name_1 = resources.getName(this);\n streamWriter.setColourWithPattern(null, name_1, this.mStroking);\n diff = true;\n }\n return diff;\n };\n /**\n * Resets the changes, which were made by the brush.\n * In other words resets the state to the initial one.\n * @param streamWriter The stream writer.\n */\n PdfTilingBrush.prototype.resetChanges = function (streamWriter) {\n // We shouldn't do anything to reset changes.\n // All changes will be reset automatically by setting a new colour space.\n };\n Object.defineProperty(PdfTilingBrush.prototype, \"element\", {\n /* tslint:enable */\n // IPdfWrapper Members\n /**\n * Gets the `element`.\n * @public\n */\n get: function () {\n return this.brushStream;\n },\n enumerable: true,\n configurable: true\n });\n return PdfTilingBrush;\n}(PdfBrush));\nexport { PdfTilingBrush };\n","/**\n * PdfGraphics.ts class for EJ2-PDF\n */\nimport { PdfColorSpace, TextRenderingMode, PdfFillMode, PdfTextAlignment } from './enum';\nimport { PdfVerticalAlignment, PdfBlendMode } from './enum';\nimport { PdfSubSuperScript } from './fonts/enum';\nimport { PdfStreamWriter } from './../input-output/pdf-stream-writer';\nimport { PdfPen } from './pdf-pen';\nimport { PdfBrush } from './brushes/pdf-brush';\nimport { PdfSolidBrush } from './brushes/pdf-solid-brush';\nimport { PdfFont } from './fonts/pdf-font';\nimport { PdfTransformationMatrix } from './pdf-transformation-matrix';\nimport { PointF, SizeF, RectangleF } from './../drawing/pdf-drawing';\nimport { ProcedureSets } from './constants';\nimport { PdfString } from './../primitives/pdf-string';\nimport { PdfStringFormat } from './fonts/pdf-string-format';\nimport { TemporaryDictionary } from './../collections/object-object-pair/dictionary';\nimport { PdfTransparency } from './pdf-transparency';\nimport { PdfStringLayouter, LineType } from './fonts/string-layouter';\nimport { DictionaryProperties } from './../input-output/pdf-dictionary-properties';\nimport { StringTokenizer } from './fonts/string-tokenizer';\nimport { PdfAutomaticFieldInfoCollection } from './../document/automatic-fields/automatic-field-info-collection';\nimport { PdfAutomaticFieldInfo } from './../document/automatic-fields/automatic-field-info';\nimport { Operators } from './../input-output/pdf-operators';\nimport { UnicodeTrueTypeFont } from './fonts/unicode-true-type-font';\nimport { InternalEnum } from './../primitives/pdf-string';\nimport { RtlRenderer } from './fonts/rtl-renderer';\nimport { PdfTextDirection } from './enum';\nimport { PathPointType } from './figures/enum';\nimport { PdfGradientBrush } from './../../implementation/graphics/brushes/pdf-gradient-brush';\nimport { PdfTilingBrush } from './brushes/pdf-tiling-brush';\n/**\n * `PdfGraphics` class represents a graphics context of the objects.\n * It's used for performing all the graphics operations.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a new page to the document\n * let page1 : PdfPage = document.pages.add();\n * // set the font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // create black brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * //\n * //graphics of the page\n * let page1Graphics : PdfGraphics = page1.graphics;\n * // draw the text on the page1 graphics\n * page1Graphics.drawString('Hello World', font, blackBrush, new PointF(0, 0));\n * //\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\nvar PdfGraphics = /** @class */ (function () {\n function PdfGraphics(arg1, arg2, arg3) {\n /**\n * Represents the `Current color space`.\n * @private\n */\n this.currentColorSpace = PdfColorSpace.Rgb;\n /**\n * Stores `previous rendering mode`.\n * @private\n */\n this.previousTextRenderingMode = TextRenderingMode.Fill;\n /**\n * Previous `character spacing` value or 0.\n * @private\n */\n this.previousCharacterSpacing = 0.0;\n /**\n * Previous `word spacing` value or 0.\n * @private\n */\n this.previousWordSpacing = 0.0;\n /**\n * The `previously used text scaling` value.\n * @private\n */\n this.previousTextScaling = 100.0;\n /**\n * Instance of `ProcedureSets` class.\n * @private\n */\n this.procedureSets = new ProcedureSets();\n /**\n * To check wihether it is a `direct text rendering`.\n * @default true\n * @private\n */\n this.isNormalRender = true;\n /**\n * check whether to `use font size` to calculate the shift.\n * @default false\n * @private\n */\n this.isUseFontSize = false;\n /**\n * check whether the font is in `italic type`.\n * @default false\n * @private\n */\n this.isItalic = false;\n /**\n * Check whether it is an `emf Text Matrix`.\n * @default false\n * @private\n */\n this.isEmfTextScaled = false;\n /**\n * Check whether it is an `emf` call.\n * @default false\n * @private\n */\n this.isEmf = false;\n /**\n * Check whether it is an `emf plus` call.\n * @default false\n * @private\n */\n this.isEmfPlus = false;\n /**\n * Check whether it is in `base line format`.\n * @default true\n * @private\n */\n this.isBaselineFormat = true;\n /**\n * Emf Text `Scaling Factor`.\n * @private\n */\n this.emfScalingFactor = new SizeF(0, 0);\n /**\n * To check whether the `last color space` of document and garphics is saved.\n * @private\n */\n this.colorSpaceChanged = false;\n /**\n * Stores an instance of `DictionaryProperties`.\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n /**\n * Checks whether the x co-ordinate is need to set as client size or not.\n * @hidden\n * @private\n */\n this.isOverloadWithPosition = false;\n /**\n * Checks whether the x co-ordinate is need to set as client size or not.\n * @hidden\n * @private\n */\n this.isPointOverload = false;\n /**\n * Current colorspaces.\n * @hidden\n * @private\n */\n this.currentColorSpaces = ['RGB', 'CMYK', 'GrayScale', 'Indexed'];\n /**\n * Checks the current image `is optimized` or not.\n * @default false.\n * @private\n */\n this.isImageOptimized = false;\n /**\n * Stores the `graphics states`.\n * @private\n */\n this.graphicsState = [];\n /**\n * Indicates whether the object `had trasparency`.\n * @default false\n * @private\n */\n this.istransparencySet = false;\n /**\n * Stores the instance of `PdfAutomaticFieldInfoCollection` class .\n * @default null\n * @private\n */\n this.internalAutomaticFields = null;\n /**\n * Stores the index of the start line that should draw with in the next page.\n * @private\n */\n this.startCutIndex = -1;\n this.getResources = arg2;\n this.canvasSize = arg1;\n if (arg3 instanceof PdfStreamWriter) {\n this.pdfStreamWriter = arg3;\n }\n else {\n this.pdfStreamWriter = new PdfStreamWriter(arg3);\n }\n this.initialize();\n }\n Object.defineProperty(PdfGraphics.prototype, \"stringLayoutResult\", {\n // Properties\n /**\n * Returns the `result` after drawing string.\n * @private\n */\n get: function () {\n return this.pdfStringLayoutResult;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphics.prototype, \"size\", {\n /**\n * Gets the `size` of the canvas.\n * @private\n */\n get: function () {\n return this.canvasSize;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphics.prototype, \"mediaBoxUpperRightBound\", {\n /**\n * Gets and Sets the value of `MediaBox upper right bound`.\n * @private\n */\n get: function () {\n if (typeof this.internalMediaBoxUpperRightBound === 'undefined') {\n this.internalMediaBoxUpperRightBound = 0;\n }\n return this.internalMediaBoxUpperRightBound;\n },\n set: function (value) {\n this.internalMediaBoxUpperRightBound = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphics.prototype, \"clientSize\", {\n /**\n * Gets the `size` of the canvas reduced by margins and page templates.\n * @private\n */\n get: function () {\n return new SizeF(this.clipBounds.width, this.clipBounds.height);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphics.prototype, \"colorSpace\", {\n /**\n * Gets or sets the current `color space` of the document\n * @private\n */\n get: function () {\n return this.currentColorSpace;\n },\n set: function (value) {\n this.currentColorSpace = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphics.prototype, \"streamWriter\", {\n /**\n * Gets the `stream writer`.\n * @private\n */\n get: function () {\n return this.pdfStreamWriter;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphics.prototype, \"matrix\", {\n /**\n * Gets the `transformation matrix` reflecting current transformation.\n * @private\n */\n get: function () {\n if (this.transformationMatrix == null) {\n this.transformationMatrix = new PdfTransformationMatrix();\n }\n return this.transformationMatrix;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphics.prototype, \"layer\", {\n /**\n * Gets the `layer` for the graphics, if exists.\n * @private\n */\n get: function () {\n return this.pageLayer;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphics.prototype, \"page\", {\n /**\n * Gets the `page` for this graphics, if exists.\n * @private\n */\n get: function () {\n return this.pageLayer.page;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphics.prototype, \"automaticFields\", {\n get: function () {\n if (this.internalAutomaticFields == null || typeof this.internalAutomaticFields === 'undefined') {\n this.internalAutomaticFields = new PdfAutomaticFieldInfoCollection();\n }\n return this.internalAutomaticFields;\n },\n enumerable: true,\n configurable: true\n });\n //Implementation\n /**\n * `Initializes` this instance.\n * @private\n */\n PdfGraphics.prototype.initialize = function () {\n this.bStateSaved = false;\n this.currentPen = null;\n this.currentBrush = null;\n this.currentFont = null;\n this.currentColorSpace = PdfColorSpace.Rgb;\n this.bCSInitialized = false;\n this.transformationMatrix = null;\n this.previousTextRenderingMode = (-1); //.Fill;\n this.previousCharacterSpacing = -1.0;\n this.previousWordSpacing = -1.0;\n this.previousTextScaling = -100.0;\n // this.m_trasparencies = null;\n this.currentStringFormat = null;\n this.clipBounds = new RectangleF(new PointF(0, 0), this.size);\n this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf);\n };\n PdfGraphics.prototype.drawPdfTemplate = function (template, location, size) {\n if (typeof size === 'undefined') {\n if (template == null) {\n throw Error('ArgumentNullException-template');\n }\n this.drawPdfTemplate(template, location, template.size);\n }\n else {\n // let crossTable : PdfCrossTable = null;\n // if (this.pageLayer != null) {\n // crossTable = (this.page as PdfPage).section.parentDocument.crossTable;\n // }\n if (template == null) {\n throw Error('ArgumentNullException-template');\n }\n var scaleX = (template.width > 0) ? size.width / template.width : 1;\n var scaleY = (template.height > 0) ? size.height / template.height : 1;\n var bNeedScale = !(scaleX === 1 && scaleY === 1);\n // Save state.\n var state = this.save();\n // Take into consideration that rect location is bottom/left.\n var matrix = new PdfTransformationMatrix();\n if (this.pageLayer != null) {\n this.getTranslateTransform(location.x, location.y + size.height, matrix);\n }\n if (bNeedScale) {\n this.getScaleTransform(scaleX, scaleY, matrix);\n }\n this.pdfStreamWriter.modifyCtm(matrix);\n // Output template.\n var resources = this.getResources.getResources();\n var name_1 = resources.getName(template);\n this.pdfStreamWriter.executeObject(name_1);\n // Restore state.\n this.restore(state);\n //Transfer automatic fields from template.\n var g = template.graphics;\n if (g != null) {\n for (var index = 0; index < g.automaticFields.automaticFields.length; index++) {\n var fieldInfo = g.automaticFields.automaticFields[index];\n var newLocation = new PointF(fieldInfo.location.x + location.x, fieldInfo.location.y + location.y);\n var scalingX = template.size.width == 0 ? 0 : size.width / template.size.width;\n var scalingY = template.size.height == 0 ? 0 : size.height / template.size.height;\n this.automaticFields.add(new PdfAutomaticFieldInfo(fieldInfo.field, newLocation, scalingX, scalingY));\n this.page.dictionary.modify();\n }\n }\n this.getResources.getResources().requireProcedureSet(this.procedureSets.imageB);\n this.getResources.getResources().requireProcedureSet(this.procedureSets.imageC);\n this.getResources.getResources().requireProcedureSet(this.procedureSets.imageI);\n this.getResources.getResources().requireProcedureSet(this.procedureSets.text);\n }\n };\n /* tslint:disable */\n /**\n * @public\n */\n PdfGraphics.prototype.drawString = function (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {\n if (typeof arg1 === 'string' && arg2 instanceof PdfFont && (arg3 instanceof PdfPen || arg3 === null) && (arg4 instanceof PdfBrush || arg4 === null) && typeof arg5 === 'number' && typeof arg6 === 'number' && (arg7 instanceof PdfStringFormat || arg7 === null) && typeof arg8 === 'undefined') {\n this.isOverloadWithPosition = true;\n this.drawString(arg1, arg2, arg3, arg4, arg5, arg6, (this.clientSize.width - arg5), 0, arg7);\n }\n else {\n var temparg3 = arg3;\n var temparg4 = arg4;\n var temparg5 = arg5;\n var temparg6 = arg6;\n var temparg7 = arg7;\n var temparg8 = arg8;\n var temparg9 = arg9;\n var layouter = new PdfStringLayouter();\n var result = layouter.layout(arg1, arg2, temparg9, new SizeF(temparg7, temparg8), this.isOverloadWithPosition, this.clientSize);\n if (!result.empty) {\n var rect = this.checkCorrectLayoutRectangle(result.actualSize, temparg5, temparg6, temparg9);\n if (temparg7 <= 0) {\n temparg5 = rect.x;\n temparg7 = rect.width;\n }\n if (temparg8 <= 0) {\n temparg6 = rect.y;\n temparg8 = rect.height;\n }\n this.drawStringLayoutResult(result, arg2, temparg3, temparg4, new RectangleF(temparg5, temparg6, temparg7, temparg8), temparg9);\n this.isEmfTextScaled = false;\n this.emfScalingFactor = new SizeF(0, 0);\n }\n this.getResources.getResources().requireProcedureSet(this.procedureSets.text);\n this.isNormalRender = true;\n this.pdfStringLayoutResult = result;\n this.isUseFontSize = false;\n }\n }; /* tslint:enable */\n PdfGraphics.prototype.drawLine = function (arg1, arg2, arg3, arg4, arg5) {\n if (arg2 instanceof PointF) {\n var temparg2 = arg2;\n var temparg3 = arg3;\n this.drawLine(arg1, temparg2.x, temparg2.y, temparg3.x, temparg3.y);\n }\n else {\n var temparg2 = arg2;\n var temparg3 = arg3;\n var temparg4 = arg4;\n var temparg5 = arg5;\n this.stateControl(arg1, null, null);\n var sw = this.streamWriter;\n sw.beginPath(temparg2, temparg3);\n sw.appendLineSegment(temparg4, temparg5);\n sw.strokePath();\n this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf);\n }\n };\n /* tslint:disable */\n PdfGraphics.prototype.drawRectangle = function (arg1, arg2, arg3, arg4, arg5, arg6) {\n if (arg1 instanceof PdfPen && typeof arg2 === 'number') {\n var temparg3 = arg3;\n this.drawRectangle(arg1, null, arg2, temparg3, arg4, arg5);\n }\n else if (arg1 instanceof PdfBrush && typeof arg2 === 'number') {\n var temparg3 = arg3;\n this.drawRectangle(null, arg1, arg2, temparg3, arg4, arg5);\n }\n else {\n var temparg3 = arg3;\n var temparg4 = arg4;\n var temparg5 = arg5;\n var temparg6 = arg6;\n if ((arg2 instanceof PdfTilingBrush)) {\n this.bCSInitialized = false;\n var xOffset = (this.matrix.matrix.offsetX + temparg3);\n var yOffset = void 0;\n if (((this.layer != null) && (this.layer.page != null))) {\n yOffset = ((this.layer.page.size.height - this.matrix.matrix.offsetY) + temparg4);\n }\n else {\n yOffset = ((this.clientSize.height - this.matrix.matrix.offsetY) + temparg4);\n }\n (arg2).location = new PointF(xOffset, yOffset);\n (arg2).graphics.colorSpace = this.colorSpace;\n }\n else if ((arg2 instanceof PdfGradientBrush)) {\n arg2.colorSpace = this.colorSpace;\n }\n if (arg2 instanceof PdfSolidBrush && arg2.color.isEmpty) {\n arg2 = null;\n }\n var temparg1 = arg1;\n var temparg2 = arg2;\n this.stateControl(temparg1, temparg2, null);\n this.streamWriter.appendRectangle(temparg3, temparg4, temparg5, temparg6);\n this.drawPathHelper(temparg1, temparg2, false);\n }\n };\n PdfGraphics.prototype.drawPathHelper = function (arg1, arg2, arg3, arg4) {\n if (typeof arg3 === 'boolean') {\n var temparg3 = arg3;\n this.drawPathHelper(arg1, arg2, PdfFillMode.Winding, temparg3);\n }\n else {\n var temparg3 = arg3;\n var temparg4 = arg4;\n var isPen = arg1 != null;\n var isBrush = arg2 != null;\n var isEvenOdd = (temparg3 === PdfFillMode.Alternate);\n if (isPen && isBrush) {\n this.streamWriter.fillStrokePath(isEvenOdd);\n }\n else if (!isPen && !isBrush) {\n this.streamWriter.endPath();\n }\n else if (isPen) {\n this.streamWriter.strokePath();\n }\n else {\n this.streamWriter.fillPath(isEvenOdd);\n }\n }\n };\n /* tslint:disable */\n PdfGraphics.prototype.drawImage = function (arg1, arg2, arg3, arg4, arg5) {\n if (typeof arg2 === 'number' && typeof arg3 === 'number' && typeof arg4 === 'undefined') {\n var size = arg1.physicalDimension;\n this.drawImage(arg1, arg2, arg3, size.width, size.height);\n }\n else {\n var temparg2 = arg2;\n var temparg3 = arg3;\n var temparg4 = arg4;\n var temparg5 = arg5;\n arg1.save();\n var matrix = new PdfTransformationMatrix();\n this.getTranslateTransform(temparg2, (temparg3 + temparg5), matrix);\n this.getScaleTransform(arg4, arg5, matrix);\n this.pdfStreamWriter.write('q');\n this.pdfStreamWriter.modifyCtm(matrix);\n // Output template.\n var resources = this.getResources.getResources();\n if (typeof this.pageLayer !== 'undefined' && this.page != null) {\n resources.document = this.page.document;\n }\n var name_2 = resources.getName(arg1);\n if (typeof this.pageLayer !== 'undefined') {\n this.page.setResources(resources);\n }\n this.pdfStreamWriter.executeObject(name_2);\n this.pdfStreamWriter.write(Operators.restoreState);\n this.pdfStreamWriter.write(Operators.newLine);\n var resource = this.getResources.getResources();\n resource.requireProcedureSet(this.procedureSets.imageB);\n resource.requireProcedureSet(this.procedureSets.imageC);\n resource.requireProcedureSet(this.procedureSets.imageI);\n resource.requireProcedureSet(this.procedureSets.text);\n }\n };\n //Implementation\n /* tslint:disable */\n /**\n * Returns `bounds` of the line info.\n * @private\n */\n PdfGraphics.prototype.getLineBounds = function (lineIndex, result, font, layoutRectangle, format) {\n var bounds;\n if (!result.empty && lineIndex < result.lineCount && lineIndex >= 0) {\n var line = result.lines[lineIndex];\n var vShift = this.getTextVerticalAlignShift(result.actualSize.height, layoutRectangle.height, format);\n var y = vShift + layoutRectangle.y + (result.lineHeight * lineIndex);\n var lineWidth = line.width;\n var hShift = this.getHorizontalAlignShift(lineWidth, layoutRectangle.width, format);\n var lineIndent = this.getLineIndent(line, format, layoutRectangle, (lineIndex === 0));\n hShift += (!this.rightToLeft(format)) ? lineIndent : 0;\n var x = layoutRectangle.x + hShift;\n /* tslint:disable */\n var width = (!this.shouldJustify(line, layoutRectangle.width, format)) ? lineWidth - lineIndent : layoutRectangle.width - lineIndent; /* tslint:enable */\n var height = result.lineHeight;\n bounds = new RectangleF(x, y, width, height);\n }\n else {\n bounds = new RectangleF(0, 0, 0, 0);\n }\n return bounds;\n };\n /**\n * Creates `lay outed rectangle` depending on the text settings.\n * @private\n */\n PdfGraphics.prototype.checkCorrectLayoutRectangle = function (textSize, x, y, format) {\n var layoutedRectangle = new RectangleF(x, y, textSize.width, textSize.width);\n if (format != null) {\n switch (format.alignment) {\n case PdfTextAlignment.Center:\n layoutedRectangle.x -= layoutedRectangle.width / 2;\n break;\n case PdfTextAlignment.Right:\n layoutedRectangle.x -= layoutedRectangle.width;\n break;\n }\n switch (format.lineAlignment) {\n case PdfVerticalAlignment.Middle:\n layoutedRectangle.y -= layoutedRectangle.height / 2;\n break;\n case PdfVerticalAlignment.Bottom:\n layoutedRectangle.y -= layoutedRectangle.height;\n break;\n }\n }\n return layoutedRectangle;\n };\n /**\n * Sets the `layer` for the graphics.\n * @private\n */\n PdfGraphics.prototype.setLayer = function (layer) {\n this.pageLayer = layer;\n var page = layer.page;\n if (page != null && typeof page !== 'undefined') {\n page.beginSave = this.pageSave;\n }\n };\n /**\n * Adding page number field before page saving.\n * @private\n */\n /* tslint:disable */\n PdfGraphics.prototype.pageSave = function (page) {\n if (page.graphics.automaticFields != null) {\n for (var i = 0; i < page.graphics.automaticFields.automaticFields.length; i++) {\n var fieldInfo = page.graphics.automaticFields.automaticFields[i];\n fieldInfo.field.performDraw(page.graphics, fieldInfo.location, fieldInfo.scalingX, fieldInfo.scalingY);\n }\n }\n };\n /**\n * `Draws a layout result`.\n * @private\n */\n PdfGraphics.prototype.drawStringLayoutResult = function (result, font, pen, brush, layoutRectangle, format) {\n if (!result.empty) {\n this.applyStringSettings(font, pen, brush, format, layoutRectangle);\n // Set text scaling\n var textScaling = (format != null) ? format.horizontalScalingFactor : 100.0;\n if (textScaling !== this.previousTextScaling && !this.isEmfTextScaled) {\n this.pdfStreamWriter.setTextScaling(textScaling);\n this.previousTextScaling = textScaling;\n }\n var height = (format == null || format.lineSpacing === 0) ? font.height : format.lineSpacing + font.height;\n var subScript = (format != null && format.subSuperScript === PdfSubSuperScript.SubScript);\n var shift = 0;\n shift = (subScript) ? height - (font.height + font.metrics.getDescent(format)) : (height - font.metrics.getAscent(format));\n this.shift = shift;\n this.pdfStreamWriter.startNextLine(layoutRectangle.x, layoutRectangle.y - shift);\n this.pdfStreamWriter.setLeading(+height);\n var resultHeight = 0;\n var remainingString = '';\n for (var i = 0; i < result.lines.length; i++) {\n resultHeight += result.lineHeight;\n if ((layoutRectangle.y + resultHeight) > this.clientSize.height) {\n this.startCutIndex = i;\n break;\n }\n }\n for (var j = this.startCutIndex; (j < result.lines.length && j >= 0); j++) {\n remainingString += result.lines[j].text;\n }\n var bounds = new RectangleF(layoutRectangle.x, layoutRectangle.y, layoutRectangle.width, layoutRectangle.height);\n this.drawLayoutResult(result, font, format, layoutRectangle);\n this.underlineStrikeoutText(pen, brush, result, font, bounds, format);\n this.isEmfPlus = false;\n this.isUseFontSize = false;\n if (this.startCutIndex !== -1) {\n var page = this.getNextPage();\n page.graphics.drawString(remainingString, font, pen, brush, layoutRectangle.x, 0, layoutRectangle.width, 0, format);\n }\n }\n else {\n throw new Error('ArgumentNullException:result');\n }\n };\n /**\n * Gets the `next page`.\n * @private\n */\n PdfGraphics.prototype.getNextPage = function () {\n var section = this.currentPage.section;\n var nextPage = null;\n var index = section.indexOf(this.currentPage);\n if (index === section.count - 1) {\n nextPage = section.add();\n }\n else {\n nextPage = section.getPages()[index + 1];\n }\n return nextPage;\n };\n PdfGraphics.prototype.setClip = function (rectangle, mode) {\n if (typeof mode === 'undefined') {\n this.setClip(rectangle, PdfFillMode.Winding);\n }\n else {\n this.pdfStreamWriter.appendRectangle(rectangle);\n this.pdfStreamWriter.clipPath((mode === PdfFillMode.Alternate));\n }\n };\n /**\n * Applies all the `text settings`.\n * @private\n */\n PdfGraphics.prototype.applyStringSettings = function (font, pen, brush, format, bounds) {\n if (brush instanceof PdfTilingBrush) {\n this.bCSInitialized = false;\n brush.graphics.colorSpace = this.colorSpace;\n }\n else if ((brush instanceof PdfGradientBrush)) {\n this.bCSInitialized = false;\n brush.colorSpace = this.colorSpace;\n }\n var setLineWidth = false;\n var tm = this.getTextRenderingMode(pen, brush, format);\n this.stateControl(pen, brush, font, format);\n this.pdfStreamWriter.beginText();\n if ((tm) !== this.previousTextRenderingMode) {\n this.pdfStreamWriter.setTextRenderingMode(tm);\n this.previousTextRenderingMode = tm;\n }\n // Set character spacing.\n var cs = (format != null) ? format.characterSpacing : 0;\n if (cs !== this.previousCharacterSpacing && !this.isEmfTextScaled) {\n this.pdfStreamWriter.setCharacterSpacing(cs);\n this.previousCharacterSpacing = cs;\n }\n // Set word spacing.\n // NOTE: it works only if the space code is equal to 32 (0x20).\n var ws = (format != null) ? format.wordSpacing : 0;\n if (ws !== this.previousWordSpacing) {\n this.pdfStreamWriter.setWordSpacing(ws);\n this.previousWordSpacing = ws;\n }\n };\n /**\n * Calculates `shift value` if the text is vertically aligned.\n * @private\n */\n PdfGraphics.prototype.getTextVerticalAlignShift = function (textHeight, boundsHeight, format) {\n var shift = 0;\n if (boundsHeight >= 0 && format != null && format.lineAlignment !== PdfVerticalAlignment.Top) {\n switch (format.lineAlignment) {\n case PdfVerticalAlignment.Middle:\n shift = (boundsHeight - textHeight) / 2;\n break;\n case PdfVerticalAlignment.Bottom:\n shift = boundsHeight - textHeight;\n break;\n }\n }\n return shift;\n };\n /* tslint:disable */\n /**\n * `Draws layout result`.\n * @private\n */\n PdfGraphics.prototype.drawLayoutResult = function (result, font, format, layoutRectangle) {\n var vAlignShift = this.getTextVerticalAlignShift(result.actualSize.height, layoutRectangle.height, format);\n if (vAlignShift !== 0) {\n this.pdfStreamWriter.startNextLine(0, vAlignShift);\n }\n var ttfFont = font;\n var unicode = (ttfFont != null && ttfFont.isUnicode);\n var embed = (ttfFont != null && ttfFont.isEmbedFont);\n var lines = result.lines;\n for (var i = 0, len = lines.length; (i < len && i !== this.startCutIndex); i++) {\n var lineInfo = lines[i];\n var line = lineInfo.text;\n var lineWidth = lineInfo.width;\n var hAlignShift = this.getHorizontalAlignShift(lineWidth, layoutRectangle.width, format);\n var lineIndent = this.getLineIndent(lineInfo, format, layoutRectangle, (i === 0));\n hAlignShift += (!this.rightToLeft(format)) ? lineIndent : 0;\n if (hAlignShift !== 0 && !this.isEmfTextScaled) {\n this.pdfStreamWriter.startNextLine(hAlignShift, 0);\n }\n if (unicode) {\n this.drawUnicodeLine(lineInfo, layoutRectangle, font, format);\n }\n else {\n this.drawAsciiLine(lineInfo, layoutRectangle, font, format);\n }\n if (hAlignShift !== 0 && !this.isEmfTextScaled) {\n this.pdfStreamWriter.startNextLine(-hAlignShift, 0);\n }\n if (this.isOverloadWithPosition && lines.length > 1) {\n this.pdfStreamWriter.startNextLine(-(layoutRectangle.x), 0);\n layoutRectangle.x = 0;\n layoutRectangle.width = this.clientSize.width;\n this.isOverloadWithPosition = false;\n this.isPointOverload = true;\n }\n }\n this.getResources.getResources().requireProcedureSet(this.procedureSets.text);\n if (vAlignShift !== 0) {\n this.pdfStreamWriter.startNextLine(0, -(vAlignShift - result.lineHeight));\n }\n this.pdfStreamWriter.endText();\n };\n /**\n * `Draws Ascii line`.\n * @private\n */\n PdfGraphics.prototype.drawAsciiLine = function (lineInfo, layoutRectangle, font, format) {\n this.justifyLine(lineInfo, layoutRectangle.width, format);\n var value = '';\n if (lineInfo.text.indexOf('(') !== -1 || lineInfo.text.indexOf(')') !== -1) {\n for (var i = 0; i < lineInfo.text.length; i++) {\n if (lineInfo.text[i] === '(') {\n value += '\\\\\\(';\n }\n else if (lineInfo.text[i] === ')') {\n value += '\\\\\\)';\n }\n else {\n value += lineInfo.text[i];\n }\n }\n }\n if (value === '') {\n value = lineInfo.text;\n }\n var line = '(' + value + ')';\n this.pdfStreamWriter.showNextLineText(new PdfString(line));\n };\n /**\n * Draws unicode line.\n * @private\n */\n PdfGraphics.prototype.drawUnicodeLine = function (lineInfo, layoutRectangle, font, format) {\n var line = lineInfo.text;\n var lineWidth = lineInfo.width;\n var rtl = (format !== null && typeof format !== 'undefined' && format.rightToLeft);\n var useWordSpace = (format !== null && typeof format !== 'undefined' && (format.wordSpacing !== 0 || format.alignment === PdfTextAlignment.Justify));\n var ttfFont = font;\n var wordSpacing = this.justifyLine(lineInfo, layoutRectangle.width, format);\n var rtlRender = new RtlRenderer();\n if (rtl || (format !== null && typeof format !== 'undefined' && format.textDirection !== PdfTextDirection.None)) {\n var blocks = null;\n var rightAlign = (format !== null && typeof format !== 'undefined' && format.alignment === PdfTextAlignment.Right);\n if (format !== null && typeof format !== 'undefined' && format.textDirection !== PdfTextDirection.None) {\n /* tslint:disable-next-line:max-line-length */\n blocks = rtlRender.layout(line, ttfFont, (format.textDirection === PdfTextDirection.RightToLeft) ? true : false, useWordSpace, format);\n }\n else {\n blocks = rtlRender.layout(line, ttfFont, rightAlign, useWordSpace, format);\n }\n var words = null;\n if (blocks.length > 1) {\n if (format !== null && typeof format !== 'undefined' && format.textDirection !== PdfTextDirection.None) {\n /* tslint:disable-next-line:max-line-length */\n words = rtlRender.splitLayout(line, ttfFont, (format.textDirection === PdfTextDirection.RightToLeft) ? true : false, useWordSpace, format);\n }\n else {\n words = rtlRender.splitLayout(line, ttfFont, rightAlign, useWordSpace, format);\n }\n }\n else {\n words = [line];\n }\n this.drawUnicodeBlocks(blocks, words, ttfFont, format, wordSpacing);\n }\n else {\n if (useWordSpace) {\n var result = this.breakUnicodeLine(line, ttfFont, null);\n var blocks = result.tokens;\n var words = result.words;\n this.drawUnicodeBlocks(blocks, words, ttfFont, format, wordSpacing);\n }\n else {\n var token = this.convertToUnicode(line, ttfFont);\n var value = this.getUnicodeString(token);\n this.streamWriter.showNextLineText(value);\n }\n }\n };\n /**\n * Draws array of unicode tokens.\n */\n /* tslint:disable */\n PdfGraphics.prototype.drawUnicodeBlocks = function (blocks, words, font, format, wordSpacing) {\n /* tslint:enable */\n if (blocks == null) {\n throw new Error('Argument Null Exception : blocks');\n }\n if (words == null) {\n throw new Error('Argument Null Exception : words');\n }\n if (font == null) {\n throw new Error('Argument Null Exception : font');\n }\n this.streamWriter.startNextLine();\n var x = 0;\n var xShift = 0;\n var firstLineIndent = 0;\n var paragraphIndent = 0;\n try {\n if (format !== null && typeof format !== 'undefined') {\n firstLineIndent = format.firstLineIndent;\n paragraphIndent = format.paragraphIndent;\n format.firstLineIndent = 0;\n format.paragraphIndent = 0;\n }\n var spaceWidth = font.getCharWidth(StringTokenizer.whiteSpace, format) + wordSpacing;\n var characterSpacing = (format != null) ? format.characterSpacing : 0;\n var wordSpace = (format !== null && typeof format !== 'undefined' && wordSpacing === 0) ? format.wordSpacing : 0;\n spaceWidth += characterSpacing + wordSpace;\n for (var i = 0; i < blocks.length; i++) {\n var token = blocks[i];\n var word = words[i];\n var tokenWidth = 0;\n if (x !== 0) {\n this.streamWriter.startNextLine(x, 0);\n }\n if (word.length > 0) {\n tokenWidth += /*Utils.Round(*/ font.measureString(word, format).width /*)*/;\n tokenWidth += characterSpacing;\n var val = this.getUnicodeString(token);\n this.streamWriter.showText(val);\n }\n if (i !== blocks.length - 1) {\n x = tokenWidth + spaceWidth;\n xShift += x;\n }\n }\n // Rolback current line position.\n if (xShift > 0) {\n this.streamWriter.startNextLine(-xShift, 0);\n }\n }\n finally {\n if (format !== null && typeof format !== 'undefined') {\n format.firstLineIndent = firstLineIndent;\n format.paragraphIndent = paragraphIndent;\n }\n }\n };\n /**\n * Breakes the unicode line to the words and converts symbols to glyphs.\n */\n PdfGraphics.prototype.breakUnicodeLine = function (line, ttfFont, words) {\n if (line === null) {\n throw new Error('Argument Null Exception : line');\n }\n words = line.split(null);\n var tokens = [];\n for (var i = 0; i < words.length; i++) {\n // Reconvert string according to unicode standard.\n var word = words[i];\n var token = this.convertToUnicode(word, ttfFont);\n tokens[i] = token;\n }\n return { tokens: tokens, words: words };\n };\n /**\n * Creates PdfString from the unicode text.\n */\n PdfGraphics.prototype.getUnicodeString = function (token) {\n if (token === null) {\n throw new Error('Argument Null Exception : token');\n }\n var val = new PdfString(token);\n val.converted = true;\n val.encode = InternalEnum.ForceEncoding.Ascii;\n return val;\n };\n /**\n * Converts to unicode format.\n */\n PdfGraphics.prototype.convertToUnicode = function (text, ttfFont) {\n var token = null;\n if (text == null) {\n throw new Error('Argument Null Exception : text');\n }\n if (ttfFont == null) {\n throw new Error('Argument Null Exception : ttfFont');\n }\n if (ttfFont.fontInternal instanceof UnicodeTrueTypeFont) {\n var ttfReader = ttfFont.fontInternal.ttfReader;\n ttfFont.setSymbols(text);\n token = ttfReader.convertString(text);\n var bytes = PdfString.toUnicodeArray(token, false);\n token = PdfString.byteToString(bytes);\n }\n return token;\n };\n /**\n * `Justifies` the line if needed.\n * @private\n */\n PdfGraphics.prototype.justifyLine = function (lineInfo, boundsWidth, format) {\n var line = lineInfo.text;\n var lineWidth = lineInfo.width;\n var shouldJustify = this.shouldJustify(lineInfo, boundsWidth, format);\n var hasWordSpacing = (format != null && format.wordSpacing !== 0);\n var symbols = StringTokenizer.spaces;\n var whitespacesCount = StringTokenizer.getCharsCount(line, symbols);\n var wordSpace = 0;\n if (shouldJustify) {\n // Correct line width.\n if (hasWordSpacing) {\n lineWidth -= (whitespacesCount * format.wordSpacing);\n }\n var difference = boundsWidth - lineWidth;\n wordSpace = difference / whitespacesCount;\n this.pdfStreamWriter.setWordSpacing(wordSpace);\n }\n else {\n // If there is justifying, but the line shouldn't be justified, restore default word spacing.\n if (hasWordSpacing) {\n this.pdfStreamWriter.setWordSpacing(format.wordSpacing);\n }\n else {\n this.pdfStreamWriter.setWordSpacing(0);\n }\n }\n return wordSpace;\n };\n /**\n * `Reset` or reinitialize the current graphic value.\n * @private\n */\n PdfGraphics.prototype.reset = function (size) {\n this.canvasSize = size;\n this.streamWriter.clear();\n this.initialize();\n this.initializeCoordinates();\n };\n /**\n * Checks whether the line should be `justified`.\n * @private\n */\n PdfGraphics.prototype.shouldJustify = function (lineInfo, boundsWidth, format) {\n var line = lineInfo.text;\n var lineWidth = lineInfo.width;\n var justifyStyle = (format != null && format.alignment === PdfTextAlignment.Justify);\n var goodWidth = (boundsWidth >= 0 && lineWidth < boundsWidth);\n var symbols = StringTokenizer.spaces;\n var whitespacesCount = StringTokenizer.getCharsCount(line, symbols);\n var hasSpaces = (whitespacesCount > 0 && line[0] !== StringTokenizer.whiteSpace);\n var goodLineBreakStyle = ((lineInfo.lineType & LineType.LayoutBreak) > 0);\n /* tslint:disable */\n var shouldJustify = (justifyStyle && goodWidth && hasSpaces && (goodLineBreakStyle || format.alignment === PdfTextAlignment.Justify)); /* tslint:enable */\n return shouldJustify;\n };\n /* tslint:disable */\n /**\n * Emulates `Underline, Strikeout` of the text if needed.\n * @private\n */\n PdfGraphics.prototype.underlineStrikeoutText = function (pen, brush, result, font, layoutRectangle, format) {\n if (font.underline || font.strikeout) {\n // Calculate line width.\n var linePen = this.createUnderlineStikeoutPen(pen, brush, font, format);\n if (linePen != null) {\n // Approximate line positions.\n var vShift = this.getTextVerticalAlignShift(result.actualSize.height, layoutRectangle.height, format);\n var underlineYOffset = 0;\n underlineYOffset = layoutRectangle.y + vShift + font.metrics.getAscent(format) + 1.5 * linePen.width;\n var strikeoutYOffset = layoutRectangle.y + vShift + font.metrics.getHeight(format) / 2 + 1.5 * linePen.width;\n var lines = result.lines;\n // Run through the text and draw lines.\n for (var i = 0, len = result.lineCount; i < len; i++) {\n var lineInfo = lines[i];\n var line = lineInfo.text;\n var lineWidth = lineInfo.width;\n var hShift = this.getHorizontalAlignShift(lineWidth, layoutRectangle.width, format);\n var lineIndent = this.getLineIndent(lineInfo, format, layoutRectangle, (i === 0));\n hShift += (!this.rightToLeft(format)) ? lineIndent : 0;\n var x1 = layoutRectangle.x + hShift;\n /* tslint:disable */\n var x2 = (!this.shouldJustify(lineInfo, layoutRectangle.width, format)) ? x1 + lineWidth - lineIndent : x1 + layoutRectangle.width - lineIndent;\n /* tslint:enable */\n if (font.underline) {\n var y = underlineYOffset;\n this.drawLine(linePen, x1, y, x2, y);\n underlineYOffset += result.lineHeight;\n }\n if (font.strikeout) {\n var y = strikeoutYOffset;\n this.drawLine(linePen, x1, y, x2, y);\n strikeoutYOffset += result.lineHeight;\n }\n if (this.isPointOverload && lines.length > 1) {\n layoutRectangle.x = 0;\n layoutRectangle.width = this.clientSize.width;\n }\n }\n this.isPointOverload = false;\n }\n }\n };\n /**\n * `Creates a pen` for drawing lines in the text.\n * @private\n */\n PdfGraphics.prototype.createUnderlineStikeoutPen = function (pen, brush, font, format) {\n // Calculate line width.\n var lineWidth = font.metrics.getSize(format) / 20;\n var linePen = null;\n // Create a pen fo the lines.\n if (pen != null) {\n linePen = new PdfPen(pen.color, lineWidth);\n }\n else if (brush != null) {\n linePen = new PdfPen(brush, lineWidth);\n }\n return linePen;\n };\n /**\n * Return `text rendering mode`.\n * @private\n */\n PdfGraphics.prototype.getTextRenderingMode = function (pen, brush, format) {\n var tm = TextRenderingMode.None;\n if (pen != null && brush != null) {\n tm = TextRenderingMode.FillStroke;\n }\n else if (pen != null) {\n tm = TextRenderingMode.Stroke;\n }\n else {\n tm = TextRenderingMode.Fill;\n }\n if (format != null && format.clipPath) {\n tm |= TextRenderingMode.ClipFlag;\n }\n return tm;\n };\n /**\n * Returns `line indent` for the line.\n * @private\n */\n PdfGraphics.prototype.getLineIndent = function (lineInfo, format, layoutBounds, firstLine) {\n var lineIndent = 0;\n var firstParagraphLine = ((lineInfo.lineType & LineType.FirstParagraphLine) > 0);\n if (format != null && firstParagraphLine) {\n lineIndent = (firstLine) ? format.firstLineIndent : format.paragraphIndent;\n lineIndent = (layoutBounds.width > 0) ? Math.min(layoutBounds.width, lineIndent) : lineIndent;\n }\n return lineIndent;\n };\n /**\n * Calculates shift value if the line is `horizontaly aligned`.\n * @private\n */\n PdfGraphics.prototype.getHorizontalAlignShift = function (lineWidth, boundsWidth, format) {\n var shift = 0;\n if (boundsWidth >= 0 && format != null && format.alignment !== PdfTextAlignment.Left) {\n switch (format.alignment) {\n case PdfTextAlignment.Center:\n shift = (boundsWidth - lineWidth) / 2;\n break;\n case PdfTextAlignment.Right:\n shift = boundsWidth - lineWidth;\n break;\n }\n }\n return shift;\n };\n /**\n * Gets or sets the value that indicates `text direction` mode.\n * @private\n */\n PdfGraphics.prototype.rightToLeft = function (format) {\n var rtl = (format !== null && typeof format !== 'undefined' && format.rightToLeft);\n if (format !== null && typeof format !== 'undefined') {\n if (format.textDirection !== PdfTextDirection.None && typeof format.textDirection !== 'undefined') {\n rtl = true;\n }\n }\n return rtl;\n };\n PdfGraphics.prototype.stateControl = function (pen, brush, font, format) {\n if (typeof format === 'undefined') {\n this.stateControl(pen, brush, font, null);\n }\n else {\n if (brush instanceof PdfGradientBrush) {\n this.bCSInitialized = false;\n brush.colorSpace = this.colorSpace;\n }\n if (brush instanceof PdfTilingBrush) {\n this.bCSInitialized = false;\n brush.graphics.colorSpace = this.colorSpace;\n }\n var saveState = false;\n if (brush !== null) {\n var solidBrush = brush;\n if (typeof this.pageLayer !== 'undefined' && this.pageLayer != null) {\n if (this.colorSpaceChanged === false) {\n this.lastDocumentCS = this.pageLayer.page.document.colorSpace;\n this.lastGraphicsCS = this.pageLayer.page.graphics.colorSpace;\n this.colorSpace = this.pageLayer.page.document.colorSpace;\n this.currentColorSpace = this.pageLayer.page.document.colorSpace;\n this.colorSpaceChanged = true;\n }\n }\n this.initCurrentColorSpace(this.currentColorSpace);\n }\n else if (pen != null) {\n var pdfPen = pen;\n if (typeof this.pageLayer !== 'undefined' && this.pageLayer != null) {\n /* tslint:disable */\n this.colorSpace = this.pageLayer.page.document.colorSpace;\n this.currentColorSpace = this.pageLayer.page.document.colorSpace;\n }\n this.initCurrentColorSpace(this.currentColorSpace);\n }\n this.penControl(pen, saveState);\n this.brushControl(brush, saveState);\n this.fontControl(font, format, saveState);\n }\n };\n /**\n * Initializes the `current color space`.\n * @private\n */\n PdfGraphics.prototype.initCurrentColorSpace = function (colorspace) {\n var re = this.getResources.getResources();\n if (!this.bCSInitialized) {\n if (this.currentColorSpace != PdfColorSpace.GrayScale) {\n this.pdfStreamWriter.setColorSpace('Device' + this.currentColorSpaces[this.currentColorSpace], true);\n this.pdfStreamWriter.setColorSpace('Device' + this.currentColorSpaces[this.currentColorSpace], false);\n this.bCSInitialized = true;\n }\n else {\n this.pdfStreamWriter.setColorSpace('DeviceGray', true);\n this.pdfStreamWriter.setColorSpace('DeviceGray', false);\n this.bCSInitialized = true;\n }\n }\n };\n /**\n * Controls the `pen state`.\n * @private\n */\n PdfGraphics.prototype.penControl = function (pen, saveState) {\n if (pen != null) {\n this.currentPen = pen;\n /* tslint:disable */\n pen.monitorChanges(this.currentPen, this.pdfStreamWriter, this.getResources, saveState, this.colorSpace, this.matrix.clone());\n /* tslint:enable */\n this.currentPen = pen.clone();\n }\n };\n /**\n * Controls the `brush state`.\n * @private\n */\n PdfGraphics.prototype.brushControl = function (brush, saveState) {\n if (brush != null && typeof brush !== 'undefined') {\n var b = brush.clone();\n var lgb = b;\n if (lgb !== null && typeof lgb !== 'undefined' && !(brush instanceof PdfSolidBrush) && !(brush instanceof PdfTilingBrush)) {\n var m = lgb.matrix;\n var matrix = this.matrix.clone();\n if ((m != null)) {\n m.multiply(matrix);\n matrix = m;\n }\n lgb.matrix = matrix;\n }\n this.currentBrush = lgb;\n var br = (brush);\n /* tslint:disable */\n b.monitorChanges(this.currentBrush, this.pdfStreamWriter, this.getResources, saveState, this.colorSpace);\n /* tslint:enable */\n this.currentBrush = brush;\n brush = null;\n }\n };\n /**\n * Saves the font and other `font settings`.\n * @private\n */\n PdfGraphics.prototype.fontControl = function (font, format, saveState) {\n if (font != null) {\n var curSubSuper = (format != null) ? format.subSuperScript : PdfSubSuperScript.None;\n /* tslint:disable */\n var prevSubSuper = (this.currentStringFormat != null) ? this.currentStringFormat.subSuperScript : PdfSubSuperScript.None; /* tslint:enable */\n if (saveState || font !== this.currentFont || curSubSuper !== prevSubSuper) {\n var resources = this.getResources.getResources();\n this.currentFont = font;\n this.currentStringFormat = format;\n var size = font.metrics.getSize(format);\n /* tslint:disable */\n this.isEmfTextScaled = false;\n var fontName = resources.getName(font);\n this.pdfStreamWriter.setFont(font, fontName, size);\n }\n }\n };\n PdfGraphics.prototype.setTransparency = function (arg1, arg2, arg3) {\n if (typeof arg2 === 'undefined') {\n this.istransparencySet = true;\n this.setTransparency(arg1, arg1, PdfBlendMode.Normal);\n }\n else if (typeof arg2 === 'number' && typeof arg3 === 'undefined') {\n this.setTransparency(arg1, arg2, PdfBlendMode.Normal);\n }\n else {\n if (this.trasparencies == null) {\n this.trasparencies = new TemporaryDictionary();\n }\n var transp = null;\n var td = new TransparencyData(arg1, arg2, arg3);\n if (this.trasparencies.containsKey(td)) {\n transp = this.trasparencies.getValue(td);\n }\n if (transp == null) {\n transp = new PdfTransparency(arg1, arg2, arg3);\n this.trasparencies.setValue(td, transp);\n }\n var resources = this.getResources.getResources();\n var name_3 = resources.getName(transp);\n var sw = this.streamWriter;\n sw.setGraphicsState(name_3);\n }\n };\n PdfGraphics.prototype.clipTranslateMargins = function (x, y, left, top, right, bottom) {\n if (x instanceof RectangleF && typeof y === 'undefined') {\n this.clipBounds = x;\n this.pdfStreamWriter.writeComment('Clip margins.');\n this.pdfStreamWriter.appendRectangle(x);\n this.pdfStreamWriter.closePath();\n this.pdfStreamWriter.clipPath(false);\n this.pdfStreamWriter.writeComment('Translate co-ordinate system.');\n this.translateTransform(x.x, x.y);\n }\n else if (typeof x === 'number') {\n var clipArea = new RectangleF(left, top, this.size.width - left - right, this.size.height - top - bottom);\n this.clipBounds = clipArea;\n this.pdfStreamWriter.writeComment(\"Clip margins.\");\n this.pdfStreamWriter.appendRectangle(clipArea);\n this.pdfStreamWriter.closePath();\n this.pdfStreamWriter.clipPath(false);\n this.pdfStreamWriter.writeComment(\"Translate co-ordinate system.\");\n this.translateTransform(x, y);\n }\n };\n /**\n * `Updates y` co-ordinate.\n * @private\n */\n PdfGraphics.prototype.updateY = function (y) {\n return -y;\n };\n /**\n * Used to `translate the transformation`.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // create a new page\n * let page1 : PdfPage = document.pages.add();\n * // set pen\n * let pen : PdfPen = new PdfPen(new PdfColor(0, 0, 0));\n * //\n * // set translate transform\n * page1.graphics.translateTransform(100, 100);\n * //\n * // draw the rectangle after applying translate transform\n * page1.graphics.drawRectangle(pen, new RectangleF({x : 0, y : 0}, {width : 100, height : 50}));\n * // save the document.\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n * @param offsetX The x-coordinate of the translation.\n * @param offsetY The y-coordinate of the translation.\n */\n PdfGraphics.prototype.translateTransform = function (offsetX, offsetY) {\n var matrix = new PdfTransformationMatrix();\n this.getTranslateTransform(offsetX, offsetY, matrix);\n this.pdfStreamWriter.modifyCtm(matrix);\n this.matrix.multiply(matrix);\n };\n /**\n * `Translates` coordinates of the input matrix.\n * @private\n */\n PdfGraphics.prototype.getTranslateTransform = function (x, y, input) {\n input.translate(x, this.updateY(y));\n return input;\n };\n /* tslint:disable */\n /**\n * Applies the specified `scaling operation` to the transformation matrix of this Graphics by prepending it to the object's transformation matrix.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // create a new page\n * let page1 : PdfPage = document.pages.add();\n * // create pen\n * let pen : PdfPen = new PdfPen(new PdfColor(0, 0, 0));\n * //\n * // apply scaling trasformation\n * page1.graphics.scaleTransform(1.5, 2);\n * //\n * // draw the rectangle after applying scaling transform\n * page1.graphics.drawRectangle(pen, new RectangleF({x : 100, y : 100}, {width : 100, height : 50}));\n * // save the document.\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n * @param scaleX Scale factor in the x direction.\n * @param scaleY Scale factor in the y direction.\n */\n /* tslint:enable */\n PdfGraphics.prototype.scaleTransform = function (scaleX, scaleY) {\n var matrix = new PdfTransformationMatrix();\n this.getScaleTransform(scaleX, scaleY, matrix);\n this.pdfStreamWriter.modifyCtm(matrix);\n this.matrix.multiply(matrix);\n };\n /**\n * `Scales` coordinates of the input matrix.\n * @private\n */\n PdfGraphics.prototype.getScaleTransform = function (x, y, input) {\n if (input == null) {\n input = new PdfTransformationMatrix();\n }\n input.scale(x, y);\n return input;\n };\n /**\n * Applies the specified `rotation` to the transformation matrix of this Graphics.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // create a new page\n * let page1 : PdfPage = document.pages.add();\n * // create pen\n * let pen : PdfPen = new PdfPen(new PdfColor(0, 0, 0));\n * //\n * // set RotateTransform with 25 degree of angle\n * page1.graphics.rotateTransform(25);\n * //\n * // draw the rectangle after RotateTransformation\n * page1.graphics.drawRectangle(pen, new RectangleF({x : 100, y : 100}, {width : 100, height : 50}));\n * // save the document.\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n * @param angle Angle of rotation in degrees.\n */\n PdfGraphics.prototype.rotateTransform = function (angle) {\n var matrix = new PdfTransformationMatrix();\n this.getRotateTransform(angle, matrix);\n this.pdfStreamWriter.modifyCtm(matrix);\n this.matrix.multiply(matrix);\n };\n /**\n * `Initializes coordinate system`.\n * @private\n */\n PdfGraphics.prototype.initializeCoordinates = function () {\n // Matrix equation: TM(T-1)=M', where T=[1 0 0 -1 0 h]\n this.pdfStreamWriter.writeComment('Change co-ordinate system to left/top.');\n // Translate co-ordinates only, don't flip.\n if (this.mediaBoxUpperRightBound !== -(this.size.height)) {\n if (this.cropBox == null) {\n if (this.mediaBoxUpperRightBound === this.size.height || this.mediaBoxUpperRightBound === 0) {\n this.translateTransform(0, this.updateY(this.size.height));\n }\n else {\n this.translateTransform(0, this.updateY(this.mediaBoxUpperRightBound));\n }\n }\n }\n };\n /**\n * `Rotates` coordinates of the input matrix.\n * @private\n */\n PdfGraphics.prototype.getRotateTransform = function (angle, input) {\n if (input == null || typeof input === 'undefined') {\n input = new PdfTransformationMatrix();\n }\n input.rotate(this.updateY(angle));\n return input;\n };\n /**\n * `Saves` the current state of this Graphics and identifies the saved state with a GraphicsState.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // create a new page\n * let page1 : PdfPage = document.pages.add();\n * // create pen\n * let pen : PdfPen = new PdfPen(new PdfColor(0, 0, 0));\n * //\n * // save the graphics state\n * let state1 : PdfGraphicsState = page1.graphics.save();\n * //\n * page1.graphics.scaleTransform(1.5, 2);\n * // draw the rectangle\n * page1.graphics.drawRectangle(pen, new RectangleF({x : 100, y : 100}, {width : 100, height : 50}));\n * // restore the graphics state\n * page1.graphics.restore(state1);\n * // save the document.\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n PdfGraphics.prototype.save = function () {\n var state = new PdfGraphicsState(this, this.matrix.clone());\n state.brush = this.currentBrush;\n state.pen = this.currentPen;\n state.font = this.currentFont;\n state.colorSpace = this.currentColorSpace;\n state.characterSpacing = this.previousCharacterSpacing;\n state.wordSpacing = this.previousWordSpacing;\n state.textScaling = this.previousTextScaling;\n state.textRenderingMode = this.previousTextRenderingMode;\n this.graphicsState.push(state);\n this.pdfStreamWriter.saveGraphicsState();\n return state;\n };\n PdfGraphics.prototype.restore = function (state) {\n if (typeof state === 'undefined') {\n if (this.graphicsState.length > 0) {\n this.doRestoreState();\n }\n }\n else {\n if (this.graphicsState.indexOf(state) !== -1) {\n for (;;) {\n if (this.graphicsState.length === 0) {\n break;\n }\n var popState = this.doRestoreState();\n if (popState === state) {\n break;\n }\n }\n }\n }\n };\n /**\n * `Restores graphics state`.\n * @private\n */\n PdfGraphics.prototype.doRestoreState = function () {\n var state = this.graphicsState.pop();\n this.transformationMatrix = state.matrix;\n this.currentBrush = state.brush;\n this.currentPen = state.pen;\n this.currentFont = state.font;\n this.currentColorSpace = state.colorSpace;\n this.previousCharacterSpacing = state.characterSpacing;\n this.previousWordSpacing = state.wordSpacing;\n this.previousTextScaling = state.textScaling;\n this.previousTextRenderingMode = state.textRenderingMode;\n this.pdfStreamWriter.restoreGraphicsState();\n return state;\n };\n /* tslint:enable */\n /**\n * `Draws the specified path`, using its original physical size, at the location specified by a coordinate pair.\n * ```typescript\n * // create a new PDF document.\n * let document : PdfDocument = new PdfDocument();\n * // add a page to the document.\n * let page1 : PdfPage = document.pages.add();\n * //Create new PDF path.\n * let path : PdfPath = new PdfPath();\n * //Add line path points.\n * path.addLine(new PointF(10, 100), new PointF(10, 200));\n * path.addLine(new PointF(100, 100), new PointF(100, 200));\n * path.addLine(new PointF(100, 200), new PointF(55, 150));\n * // set pen\n * let pen : PdfPen = new PdfPen(new PdfColor(255, 0, 0));\n * // set brush\n * let brush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // draw the path\n * page1.graphics.drawPath(pen, brush, path);\n * //\n * // save the document.\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n * @param pen Color of the text.\n * @param brush Color of the text.\n * @param path Draw path.\n */\n PdfGraphics.prototype.drawPath = function (pen, brush, path) {\n if (brush instanceof PdfTilingBrush) {\n this.bCSInitialized = false;\n brush.graphics.colorSpace = this.colorSpace;\n }\n else if (brush instanceof PdfGradientBrush) {\n this.bCSInitialized = false;\n brush.colorSpace = this.colorSpace;\n }\n this.stateControl(pen, brush, null);\n this.buildUpPath(path.pathPoints, path.pathTypes);\n this.drawPathHelper(pen, brush, path.fillMode, false);\n };\n /* tslint:disable-next-line:max-line-length */\n PdfGraphics.prototype.drawArc = function (arg1, arg2, arg3, arg4, arg5, arg6, arg7) {\n if (arg2 instanceof RectangleF) {\n this.drawArc(arg1, arg2.x, arg2.y, arg2.width, arg2.height, arg3, arg4);\n }\n else {\n if ((arg7 !== 0)) {\n this.stateControl(arg1, null, null);\n this.constructArcPath(arg2, arg3, (arg2 + arg4), (arg3 + arg5), arg6, arg7);\n this.drawPathHelper(arg1, null, false);\n }\n }\n };\n /**\n * Builds up the path.\n * @private\n */\n PdfGraphics.prototype.buildUpPath = function (arg1, arg2) {\n var cnt = arg1.length;\n for (var i = 0; i < cnt; ++i) {\n var typeValue = 0;\n var point = arg1[i];\n switch (((arg2[i] & (PdfGraphics.pathTypesValuesMask)))) {\n case PathPointType.Start:\n this.pdfStreamWriter.beginPath(point.x, point.y);\n break;\n case PathPointType.Bezier3:\n var p2 = new PointF(0, 0);\n var p3 = new PointF(0, 0);\n var result1 = this.getBezierPoints(arg1, arg2, i, p2, p3);\n this.pdfStreamWriter.appendBezierSegment(point, result1.p2, result1.p3);\n i = result1.i;\n break;\n case PathPointType.Line:\n this.pdfStreamWriter.appendLineSegment(point);\n break;\n default:\n throw new Error('ArithmeticException - Incorrect path formation.');\n }\n typeValue = arg2[i];\n this.checkFlags(typeValue);\n }\n };\n /**\n * Gets the bezier points from respective arrays.\n * @private\n */\n /* tslint:disable-next-line:max-line-length */\n PdfGraphics.prototype.getBezierPoints = function (points, types, i, p2, p3) {\n var errorMsg = 'Malforming path.';\n ++i;\n if ((((types[i] & PdfGraphics.pathTypesValuesMask)) === PathPointType.Bezier3)) {\n p2 = points[i];\n ++i;\n if ((((types[i] & PdfGraphics.pathTypesValuesMask)) === PathPointType.Bezier3)) {\n p3 = points[i];\n }\n else {\n throw new Error('ArgumentException : errorMsg');\n }\n }\n else {\n throw new Error('ArgumentException : errorMsg');\n }\n return { i: i, p2: p2, p3: p3 };\n };\n /**\n * Checks path point type flags.\n * @private\n */\n PdfGraphics.prototype.checkFlags = function (type) {\n if ((((type & (PathPointType.CloseSubpath))) === PathPointType.CloseSubpath)) {\n this.pdfStreamWriter.closePath();\n }\n };\n /**\n * Constructs the arc path using Bezier curves.\n * @private\n */\n PdfGraphics.prototype.constructArcPath = function (x1, y1, x2, y2, startAng, sweepAngle) {\n var points = this.getBezierArc(x1, y1, x2, y2, startAng, sweepAngle);\n if ((points.length === 0)) {\n return;\n }\n var pt = [points[0], points[1], points[2], points[3], points[4], points[5], points[6], points[7]];\n this.pdfStreamWriter.beginPath(pt[0], pt[1]);\n var i = 0;\n for (i = 0; i < points.length; i = i + 8) {\n pt = [points[i], points[i + 1], points[i + 2], points[i + 3], points[i + 4], points[i + 5], points[i + 6], points[i + 7]];\n this.pdfStreamWriter.appendBezierSegment(pt[2], pt[3], pt[4], pt[5], pt[6], pt[7]);\n }\n };\n /**\n * Gets the bezier points for arc constructing.\n * @private\n */\n PdfGraphics.prototype.getBezierArc = function (numX1, numY1, numX2, numY2, s1, e1) {\n if ((numX1 > numX2)) {\n var tmp = void 0;\n tmp = numX1;\n numX1 = numX2;\n numX2 = tmp;\n }\n if ((numY2 > numY1)) {\n var tmp = void 0;\n tmp = numY1;\n numY1 = numY2;\n numY2 = tmp;\n }\n var fragAngle1;\n var numFragments;\n if ((Math.abs(e1) <= 90)) {\n fragAngle1 = e1;\n numFragments = 1;\n }\n else {\n numFragments = (Math.ceil((Math.abs(e1) / 90)));\n fragAngle1 = (e1 / numFragments);\n }\n var xcen = ((numX1 + numX2) / 2);\n var ycen = ((numY1 + numY2) / 2);\n var rx = ((numX2 - numX1) / 2);\n var ry = ((numY2 - numY1) / 2);\n var halfAng = ((fragAngle1 * (Math.PI / 360)));\n var kappa = (Math.abs(4.0 / 3.0 * (1.0 - Math.cos(halfAng)) / Math.sin(halfAng)));\n var pointsList = [];\n for (var i = 0; (i < numFragments); i++) {\n var thetaValue0 = (((s1 + (i * fragAngle1)) * (Math.PI / 180)));\n var thetaValue1 = (((s1 + ((i + 1) * fragAngle1)) * (Math.PI / 180)));\n var cos0 = (Math.cos(thetaValue0));\n var cos1 = (Math.cos(thetaValue1));\n var sin0 = (Math.sin(thetaValue0));\n var sin1 = (Math.sin(thetaValue1));\n if ((fragAngle1 > 0)) {\n /* tslint:disable-next-line:max-line-length */\n pointsList.push((xcen + (rx * cos0)), (ycen - (ry * sin0)), (xcen + (rx * (cos0 - (kappa * sin0)))), (ycen - (ry * (sin0 + (kappa * cos0)))), (xcen + (rx * (cos1 + (kappa * sin1)))), (ycen - (ry * (sin1 - (kappa * cos1)))), (xcen + (rx * cos1)), (ycen - (ry * sin1)));\n }\n else {\n /* tslint:disable-next-line:max-line-length */\n pointsList.push((xcen + (rx * cos0)), (ycen - (ry * sin0)), (xcen + (rx * (cos0 + (kappa * sin0)))), (ycen - (ry * (sin0 - (kappa * cos0)))), (xcen + (rx * (cos1 - (kappa * sin1)))), (ycen - (ry * (sin1 + (kappa * cos1)))), (xcen + (rx * cos1)), (ycen - (ry * sin1)));\n }\n }\n return pointsList;\n };\n // Constants\n /**\n * Specifies the mask of `path type values`.\n * @private\n */\n PdfGraphics.pathTypesValuesMask = 0xf;\n /**\n * Checks whether the object is `transparencyObject`.\n * @hidden\n * @private\n */\n PdfGraphics.transparencyObject = false;\n return PdfGraphics;\n}());\nexport { PdfGraphics };\n/**\n * `GetResourceEventHandler` class is alternate for event handlers and delegates.\n * @private\n * @hidden\n */\nvar GetResourceEventHandler = /** @class */ (function () {\n /**\n * Initialize instance of `GetResourceEventHandler` class.\n * Alternate for event handlers and delegates.\n * @private\n */\n function GetResourceEventHandler(sender) {\n this.sender = sender;\n }\n /**\n * Return the instance of `PdfResources` class.\n * @private\n */\n GetResourceEventHandler.prototype.getResources = function () {\n return this.sender.getResources();\n };\n return GetResourceEventHandler;\n}());\nexport { GetResourceEventHandler };\nvar PdfGraphicsState = /** @class */ (function () {\n function PdfGraphicsState(graphics, matrix) {\n /**\n * Stores `previous rendering mode`.\n * @default TextRenderingMode.Fill\n * @private\n */\n this.internalTextRenderingMode = TextRenderingMode.Fill;\n /**\n * `Previous character spacing` value or 0.\n * @default 0.0\n * @private\n */\n this.internalCharacterSpacing = 0.0;\n /**\n * `Previous word spacing` value or 0.\n * @default 0.0\n * @private\n */\n this.internalWordSpacing = 0.0;\n /**\n * The previously used `text scaling value`.\n * @default 100.0\n * @private\n */\n this.internalTextScaling = 100.0;\n /**\n * `Current color space`.\n * @default PdfColorSpace.Rgb\n * @private\n */\n this.pdfColorSpace = PdfColorSpace.Rgb;\n if (typeof graphics !== 'undefined') {\n this.pdfGraphics = graphics;\n this.transformationMatrix = matrix;\n }\n }\n Object.defineProperty(PdfGraphicsState.prototype, \"graphics\", {\n // Properties\n /**\n * Gets the parent `graphics object`.\n * @private\n */\n get: function () {\n return this.pdfGraphics;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphicsState.prototype, \"matrix\", {\n /**\n * Gets the `current matrix`.\n * @private\n */\n get: function () {\n return this.transformationMatrix;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphicsState.prototype, \"characterSpacing\", {\n /**\n * Gets or sets the `current character spacing`.\n * @private\n */\n get: function () {\n return this.internalCharacterSpacing;\n },\n set: function (value) {\n this.internalCharacterSpacing = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphicsState.prototype, \"wordSpacing\", {\n /**\n * Gets or sets the `word spacing` value.\n * @private\n */\n get: function () {\n return this.internalWordSpacing;\n },\n set: function (value) {\n this.internalWordSpacing = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphicsState.prototype, \"textScaling\", {\n /**\n * Gets or sets the `text scaling` value.\n * @private\n */\n get: function () {\n return this.internalTextScaling;\n },\n set: function (value) {\n this.internalTextScaling = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphicsState.prototype, \"pen\", {\n /**\n * Gets or sets the `current pen` object.\n * @private\n */\n get: function () {\n return this.pdfPen;\n },\n set: function (value) {\n this.pdfPen = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphicsState.prototype, \"brush\", {\n /**\n * Gets or sets the `brush`.\n * @private\n */\n get: function () {\n return this.pdfBrush;\n },\n set: function (value) {\n this.pdfBrush = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphicsState.prototype, \"font\", {\n /**\n * Gets or sets the `current font` object.\n * @private\n */\n get: function () {\n return this.pdfFont;\n },\n set: function (value) {\n this.pdfFont = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphicsState.prototype, \"colorSpace\", {\n /**\n * Gets or sets the `current color space` value.\n * @private\n */\n get: function () {\n return this.pdfColorSpace;\n },\n set: function (value) {\n this.pdfColorSpace = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfGraphicsState.prototype, \"textRenderingMode\", {\n /**\n * Gets or sets the `text rendering mode`.\n * @private\n */\n get: function () {\n return this.internalTextRenderingMode;\n },\n set: function (value) {\n this.internalTextRenderingMode = value;\n },\n enumerable: true,\n configurable: true\n });\n return PdfGraphicsState;\n}());\nexport { PdfGraphicsState };\nvar TransparencyData = /** @class */ (function () {\n // Constructors\n /**\n * Initializes a new instance of the `TransparencyData` class.\n * @private\n */\n function TransparencyData(alphaPen, alphaBrush, blendMode) {\n this.alphaPen = alphaPen;\n this.alphaBrush = alphaBrush;\n this.blendMode = blendMode;\n }\n return TransparencyData;\n}());\n","import { PdfStream } from './../primitives/pdf-stream';\nimport { PdfGraphics, GetResourceEventHandler } from './../graphics/pdf-graphics';\nimport { PdfPageLayerCollection } from './pdf-page-layer-collection';\nimport { DictionaryProperties } from './../input-output/pdf-dictionary-properties';\nimport { PdfColorSpace } from './../graphics/enum';\n/**\n * The `PdfPageLayer` used to create layers in PDF document.\n * @private\n */\nvar PdfPageLayer = /** @class */ (function () {\n function PdfPageLayer(page, streamClipPageTemplates) {\n // private bSaved : boolean;\n /**\n * Local Variable to store the `color space` of the document.\n * @private\n */\n this.pdfColorSpace = PdfColorSpace.Rgb;\n /**\n * Local Variable to set `visibility`.\n * @default true\n * @private\n */\n this.isVisible = true;\n /**\n * Indicates if `Sublayer` is present.\n * @default false\n * @private\n */\n this.sublayer = false;\n /**\n * Local variable to store `length` of the graphics.\n * @default 0\n * @private\n */\n this.contentLength = 0;\n /**\n * Instance for `PdfDictionaryProperties` Class.\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n if (page === null) {\n throw new Error('ArgumentNullException:page');\n }\n this.pdfPage = page;\n this.clipPageTemplates = true;\n if (typeof streamClipPageTemplates === 'undefined') {\n this.content = new PdfStream();\n }\n else if (streamClipPageTemplates instanceof PdfStream || streamClipPageTemplates === null) {\n if (streamClipPageTemplates === null) {\n throw new Error('ArgumentNullException:stream');\n }\n this.content = streamClipPageTemplates;\n }\n else {\n this.content = new PdfStream();\n this.clipPageTemplates = streamClipPageTemplates;\n }\n }\n Object.defineProperty(PdfPageLayer.prototype, \"colorSpace\", {\n // Properties\n /**\n * Get or set the `color space`.\n * @private\n */\n get: function () {\n return this.pdfColorSpace;\n },\n set: function (value) {\n this.pdfColorSpace = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageLayer.prototype, \"page\", {\n /**\n * Gets parent `page` of the layer.\n * @private\n */\n get: function () {\n return this.pdfPage;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageLayer.prototype, \"layerId\", {\n /**\n * Gets and Sets the `id of the layer`.\n * @private\n */\n get: function () {\n return this.layerid;\n },\n set: function (value) {\n this.layerid = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageLayer.prototype, \"name\", {\n /**\n * Gets or sets the `name` of the layer.\n * @private\n */\n get: function () {\n return this.layerName;\n },\n set: function (value) {\n this.layerName = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageLayer.prototype, \"visible\", {\n /**\n * Gets or sets the `visibility` of the layer.\n * @private\n */\n get: function () {\n return this.isVisible;\n },\n set: function (value) {\n this.isVisible = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageLayer.prototype, \"graphics\", {\n /**\n * Gets `Graphics` context of the layer, used to draw various graphical content on layer.\n * @private\n */\n get: function () {\n if ((this.pdfGraphics == null)) {\n this.initializeGraphics(this.page);\n }\n return this.pdfGraphics;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageLayer.prototype, \"layers\", {\n /**\n * Gets the collection of `PdfPageLayer`, this collection handle by the class 'PdfPageLayerCollection'.\n * @private\n */\n get: function () {\n if (this.layer == null) {\n this.layer = new PdfPageLayerCollection(this.page);\n this.layer.sublayer = true;\n return this.layer;\n }\n else {\n return this.layer;\n }\n },\n enumerable: true,\n configurable: true\n });\n // Implementation\n /**\n * `Adds` a new PDF Page layer.\n * @private\n */\n PdfPageLayer.prototype.add = function () {\n var layer = new PdfPageLayer(this.pdfPage);\n layer.name = '';\n return layer;\n };\n /**\n * Returns a value indicating the `sign` of a single-precision floating-point number.\n * @private\n */\n PdfPageLayer.prototype.sign = function (number) {\n if (number === 0) {\n return 0;\n }\n else if (number > 0) {\n return 1;\n }\n else {\n return -1;\n }\n };\n /**\n * `Initializes Graphics context` of the layer.\n * @private\n */\n PdfPageLayer.prototype.initializeGraphics = function (page) {\n var oPage = page;\n var gr = new GetResourceEventHandler(this.page);\n var cropBox = null;\n this.pdfGraphics = new PdfGraphics(page.size, gr, this.content);\n this.pdfGraphics.mediaBoxUpperRightBound = 0;\n if (oPage != null) {\n var sc = oPage.section.parent;\n if (sc != null) {\n this.pdfGraphics.colorSpace = sc.document.colorSpace;\n this.colorSpace = sc.document.colorSpace;\n }\n }\n // Transform coordinates to the left/top and activate margins.\n var isSame = (this.sign(page.origin.y) === this.sign(page.origin.x));\n // if (page != null) {\n if (page.origin.x >= 0 && page.origin.y >= 0 || !(isSame)) {\n this.pdfGraphics.initializeCoordinates();\n }\n else {\n // this.m_graphics.InitializeCoordinates(page);\n }\n var clipRect = oPage.section.getActualBounds(oPage, true);\n var margins = oPage.section.pageSettings.margins;\n if (this.clipPageTemplates) {\n if (page.origin.x >= 0 && page.origin.y >= 0) {\n this.pdfGraphics.clipTranslateMargins(clipRect);\n }\n }\n else {\n this.graphics.clipTranslateMargins(clipRect.x, clipRect.y, margins.left, margins.top, margins.right, margins.bottom);\n }\n this.pdfGraphics.setLayer(this);\n // this.bSaved = false;\n };\n Object.defineProperty(PdfPageLayer.prototype, \"element\", {\n // IPdfWrapper Members\n /**\n * Gets the wrapped `element`.\n * @private\n */\n get: function () {\n return this.content;\n },\n enumerable: true,\n configurable: true\n });\n return PdfPageLayer;\n}());\nexport { PdfPageLayer };\n","/**\n * PdfCollection.ts class for EJ2-PDF\n * The class used to handle the collection of PdF objects.\n */\nvar PdfCollection = /** @class */ (function () {\n // Constructors\n /**\n * Initializes a new instance of the `Collection` class.\n * @private\n */\n function PdfCollection() {\n //\n }\n Object.defineProperty(PdfCollection.prototype, \"count\", {\n // Properties\n /**\n * Gets the `Count` of stored objects.\n * @private\n */\n get: function () {\n if (typeof this.collection === 'undefined') {\n this.collection = [];\n }\n return this.collection.length;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfCollection.prototype, \"list\", {\n /**\n * Gets the `list` of stored objects.\n * @private\n */\n get: function () {\n if (typeof this.collection === 'undefined') {\n this.collection = [];\n }\n return this.collection;\n },\n enumerable: true,\n configurable: true\n });\n return PdfCollection;\n}());\nexport { PdfCollection };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * PdfPageLayerCollection.ts class for EJ2-PDF\n */\nimport { PdfPageBase } from './pdf-page-base';\nimport { PdfDictionary } from './../primitives/pdf-dictionary';\nimport { PdfPageLayer } from './pdf-page-layer';\nimport { PdfCollection } from './../general/pdf-collection';\nimport { PdfReferenceHolder } from './../primitives/pdf-reference';\nimport { PdfStream } from './../primitives/pdf-stream';\n/**\n * The class provides methods and properties to handle the collections of `PdfPageLayer`.\n */\nvar PdfPageLayerCollection = /** @class */ (function (_super) {\n __extends(PdfPageLayerCollection, _super);\n function PdfPageLayerCollection(page) {\n var _this = _super.call(this) || this;\n /**\n * Stores the `number of first level layers` in the document.\n * @default 0\n * @private\n */\n _this.parentLayerCount = 0;\n /**\n * Indicates if `Sublayer` is present.\n * @default false\n * @private\n */\n _this.sublayer = false;\n /**\n * Stores the `optional content dictionary`.\n * @private\n */\n _this.optionalContent = new PdfDictionary();\n if (page instanceof PdfPageBase) {\n // if (page == null) {\n // throw new Error('ArgumentNullException:page');\n // }\n _this.page = page;\n var lPage = page;\n // if (lPage != null) {\n _this.parseLayers(lPage);\n // }\n }\n return _this;\n }\n PdfPageLayerCollection.prototype.items = function (index, value) {\n if (typeof index === 'number' && typeof value === 'undefined') {\n var obj = this.list[index];\n return obj;\n }\n else {\n if (value == null) {\n throw new Error('ArgumentNullException: layer');\n }\n if (value.page !== this.page) {\n throw new Error('ArgumentException: The layer belongs to another page');\n }\n // // Add/remove the layer.\n // let layer : PdfPageLayer = this.items(index);\n // if (layer != null) {\n // this.RemoveLayer(layer);\n // }\n // this.List[index] = value;\n // this.InsertLayer(index, value);\n }\n };\n PdfPageLayerCollection.prototype.add = function (firstArgument, secondArgument) {\n if (typeof firstArgument === 'undefined') {\n var layer = new PdfPageLayer(this.page);\n layer.name = '';\n this.add(layer);\n return layer;\n }\n else if (firstArgument instanceof PdfPageLayer) {\n // if (layer == null)\n // throw new ArgumentNullException(\"layer\");\n // if (layer.Page != m_page)\n // throw new ArgumentException(\"The layer belongs to another page\");\n var index = this.list.push(firstArgument);\n // Register layer.\n this.addLayer(index, firstArgument);\n return index;\n }\n else {\n return 0;\n }\n };\n /**\n * Registers `layer` at the page.\n * @private\n */\n PdfPageLayerCollection.prototype.addLayer = function (index, layer) {\n var reference = new PdfReferenceHolder(layer);\n this.page.contents.add(reference);\n };\n // private RemoveLayer(layer : PdfPageLayer) : void {\n // if (layer == null) {\n // throw new Error('ArgumentNullException:layer');\n // }\n // let reference : PdfReferenceHolder = new PdfReferenceHolder(layer);\n // if (this.page != null) {\n // this.page.Contents.Remove(reference);\n // }\n // }\n /**\n * Inserts `PdfPageLayer` into the collection at specified index.\n * @private\n */\n PdfPageLayerCollection.prototype.insert = function (index, layer) {\n // if (index < 0)\n // throw new ArgumentOutOfRangeException(\"index\", \"Value can not be less 0\");\n // if (layer == null)\n // throw new ArgumentNullException(\"layer\");\n // if (layer.Page != m_page)\n // throw new ArgumentException(\"The layer belongs to another page\");\n var list = [];\n var length = this.list.length;\n for (var i = index; i < length; i++) {\n list.push(this.list.pop());\n }\n this.list.push(layer);\n for (var i = 0; i < list.length; i++) {\n this.list.push(list[i]);\n }\n // Register layer.\n this.insertLayer(index, layer);\n };\n /**\n * Registers layer at the page.\n * @private\n */\n PdfPageLayerCollection.prototype.insertLayer = function (index, layer) {\n if (layer == null) {\n throw new Error('ArgumentNullException:layer');\n }\n var reference = new PdfReferenceHolder(layer);\n this.page.contents.insert(index, reference);\n };\n // tslint:disable\n /**\n * `Parses the layers`.\n * @private\n */\n PdfPageLayerCollection.prototype.parseLayers = function (loadedPage) {\n // if (loadedPage == null) {\n // throw new Error('ArgumentNullException:loadedPage');\n // }\n var contents = this.page.contents;\n var resource = this.page.getResources();\n var crossTable = null;\n var ocproperties = null;\n var propertie = null;\n var isLayerAdded = false;\n // if (loadedPage instanceof PdfPage) {\n crossTable = loadedPage.crossTable;\n // } else {\n // crossTable = (loadedPage as PdfLoadedPage).CrossTable;\n // Propertie = PdfCrossTable.Dereference(Resource[DictionaryProperties.Properties]) as PdfDictionary;\n // ocproperties = PdfCrossTable.Dereference((loadedPage as PdfLoadedPage).\n // Document.Catalog[DictionaryProperties.OCProperties]) as PdfDictionary;\n // }\n var saveStream = new PdfStream();\n var restoreStream = new PdfStream();\n var saveState = 'q';\n var newLine = '\\n';\n var restoreState = 'Q';\n // for (let index : number = 0; index < contents.Items.length; index++) {\n // let obj : IPdfPrimitive = contents[index];\n // let stream : PdfStream = crossTable.GetObject(obj) as PdfStream;\n // if (stream == null)\n // throw new PdfDocumentException(\"Invalid contents array.\");\n // // if (stream.Compress)\n // {\n // if (!loadedPage.Imported)\n // stream.Decompress();\n // }\n // byte[] contentId = stream.Data;\n // string str = PdfString.ByteToString(contentId);\n // if (!loadedPage.Imported && (contents.Count == 1) && ((stream.Data[stream.Data.Length - 2] ==\n // RestoreState) || (stream.Data[stream.Data.Length - 1] == RestoreState)))\n // {\n // byte[] content = stream.Data;\n // byte[] data = new byte[content.Length + 4];\n // data[0] = SaveState;\n // data[1] = NewLine;\n // content.CopyTo(data, 2);\n // data[data.Length - 2] = NewLine;\n // data[data.Length - 1] = RestoreState;\n // stream.Data = data;\n // }\n // if (ocproperties != null)\n // {\n // if (Propertie != null)\n // {\n // foreach (KeyValuePair prop in Propertie.Items)\n // {\n // String Key = prop.Key.ToString();\n // PdfReferenceHolder refh = prop.Value as PdfReferenceHolder;\n // PdfDictionary Dict = null;\n // if (refh != null)\n // {\n // Dict = refh.Object as PdfDictionary;\n // }\n // else\n // {\n // Dict = prop.Value as PdfDictionary;\n // }\n // PdfDictionary m_usage = PdfCrossTable.Dereference(Dict[DictionaryProperties.Usage]) as PdfDictionary;\n // if (m_usage != null)\n // {\n // if (str.Contains(Key))\n // {\n // PdfPageLayer layer = new PdfPageLayer(loadedPage, stream);\n // PdfDictionary printoption = PdfCrossTable.Dereference(m_usage[DictionaryProperties.Print])\n // as PdfDictionary;\n // if (printoption != null)\n // {\n // layer.m_printOption = printoption;\n // foreach (KeyValuePair value in printoption.Items)\n // {\n // if (value.Key.Value.Equals(DictionaryProperties.PrintState))\n // {\n // string printState = (value.Value as PdfName).Value;\n // if (printState.Equals(DictionaryProperties.OCGON))\n // {\n // layer.PrintState = PdfPrintState.AlwaysPrint;\n // break;\n // }\n // else\n // {\n // layer.PrintState = PdfPrintState.NeverPrint;\n // break;\n // }\n // }\n // }\n // }\n // PdfString layerName = PdfCrossTable.Dereference(Dict[DictionaryProperties.Name]) as PdfString;\n // layer.Name = layerName.Value;\n // List.add(layer);\n // isLayerAdded = true;\n // if(!str.Contains(\"EMC\"))\n // break;\n // }\n // }\n // else\n // {\n // if (str.Contains(Key))\n // {\n // PdfPageLayer layer = new PdfPageLayer(loadedPage, stream);\n // List.add(layer);\n // if(Dict.ContainsKey(DictionaryProperties.Name))\n // {\n // PdfString layerName = PdfCrossTable.Dereference(Dict[DictionaryProperties.Name]) as PdfString;\n // layer.Name = layerName.Value;\n // }\n // isLayerAdded = true;\n // break;\n // }\n // }\n // }\n // }\n // }\n // if (!isLayerAdded)\n // {\n // PdfPageLayer layer = new PdfPageLayer(loadedPage, stream);\n // List.add(layer);\n // }\n // else\n // isLayerAdded = false;\n // }\n var saveData = [];\n saveData.push(saveState);\n saveStream.data = saveData;\n contents.insert(0, new PdfReferenceHolder(saveStream));\n saveData = [];\n saveData.push(restoreState);\n restoreStream.data = saveData;\n contents.insert(contents.count, new PdfReferenceHolder(restoreStream));\n };\n /**\n * Returns `index of` the `PdfPageLayer` in the collection if exists, -1 otherwise.\n * @private\n */\n PdfPageLayerCollection.prototype.indexOf = function (layer) {\n if (layer == null) {\n throw new Error('ArgumentNullException: layer');\n }\n var index = this.list.indexOf(layer);\n return index;\n };\n return PdfPageLayerCollection;\n}(PdfCollection));\nexport { PdfPageLayerCollection };\n","import { PdfArray } from './../primitives/pdf-array';\nimport { PdfPageLayerCollection } from './pdf-page-layer-collection';\nimport { DictionaryProperties } from './../input-output/pdf-dictionary-properties';\nimport { PdfResources } from './../graphics/pdf-resources';\n/**\n * The abstract base class for all pages,\n * `PdfPageBase` class provides methods and properties to create PDF pages and its elements.\n * @private\n */\nvar PdfPageBase = /** @class */ (function () {\n //constructors\n /**\n * Initializes a new instance of the `PdfPageBase` class.\n * @private\n */\n function PdfPageBase(dictionary) {\n /**\n * `Index` of the default layer.\n * @default -1.\n * @private\n */\n this.defLayerIndex = -1;\n /**\n * Local variable to store if page `updated`.\n * @default false.\n * @private\n */\n this.modified = false;\n /**\n * Instance of `DictionaryProperties` class.\n * @hidden\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n this.pageDictionary = dictionary;\n }\n Object.defineProperty(PdfPageBase.prototype, \"section\", {\n //Properties\n /**\n * Gets the `section` of a page.\n * @private\n */\n get: function () {\n // if (this.pdfSection === null) {\n // throw new Error('PdfException : Page must be added to some section before using.');\n // }\n return this.pdfSection;\n },\n set: function (value) {\n this.pdfSection = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageBase.prototype, \"dictionary\", {\n /**\n * Gets the page `dictionary`.\n * @private\n */\n get: function () {\n return this.pageDictionary;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageBase.prototype, \"element\", {\n /**\n * Gets the wrapped `element`.\n * @private\n */\n get: function () {\n return this.pageDictionary;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageBase.prototype, \"defaultLayer\", {\n /**\n * Gets the `default layer` of the page (Read only).\n * @private\n */\n get: function () {\n var layer = this.layers;\n var index = this.defaultLayerIndex;\n var returnlayer = layer.items(index);\n return returnlayer;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageBase.prototype, \"defaultLayerIndex\", {\n /**\n * Gets or sets `index of the default layer`.\n * @private\n */\n get: function () {\n if (this.layerCollection.count === 0 || this.defLayerIndex === -1) {\n var layer = this.layerCollection.add();\n this.defLayerIndex = this.layerCollection.indexOf(layer);\n }\n return this.defLayerIndex;\n },\n /**\n * Gets or sets` index of the default layer`.\n * @private\n */\n set: function (value) {\n if (value < 0 || value > this.layers.count - 1) {\n throw new Error('ArgumentOutOfRangeException : value, Index can not be less 0 and greater Layers.Count - 1');\n }\n else {\n this.defLayerIndex = value;\n this.modified = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageBase.prototype, \"layers\", {\n /**\n * Gets the collection of the page's `layers` (Read only).\n * @private\n */\n get: function () {\n if (this.layerCollection == null || typeof this.layerCollection === 'undefined') {\n this.layerCollection = new PdfPageLayerCollection(this);\n }\n return this.layerCollection;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Return an instance of `PdfResources` class.\n * @private\n */\n PdfPageBase.prototype.getResources = function () {\n if (this.resources == null) {\n this.resources = new PdfResources();\n this.dictionary.items.setValue(this.dictionaryProperties.resources, this.resources);\n }\n return this.resources;\n };\n Object.defineProperty(PdfPageBase.prototype, \"contents\", {\n /**\n * Gets `array of page's content`.\n * @private\n */\n get: function () {\n var obj = this.pageDictionary.items.getValue(this.dictionaryProperties.contents);\n var contents = obj;\n var rh = obj;\n if (contents == null) {\n contents = new PdfArray();\n this.pageDictionary.items.setValue(this.dictionaryProperties.contents, contents);\n }\n return contents;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Sets the `resources`.\n * @private\n */\n PdfPageBase.prototype.setResources = function (res) {\n this.resources = res;\n this.dictionary.items.setValue(this.dictionaryProperties.resources, this.resources);\n this.modified = true;\n };\n return PdfPageBase;\n}());\nexport { PdfPageBase };\n","import { PdfArray } from './../primitives/pdf-array';\nimport { PdfReferenceHolder } from './../primitives/pdf-reference';\nimport { DictionaryProperties } from './../input-output/pdf-dictionary-properties';\nimport { SizeF, RectangleF, PointF } from './../drawing/pdf-drawing';\nimport { PdfStringLayouter } from './../graphics/fonts/string-layouter';\nimport { PdfColorSpace } from './../graphics/enum';\n/**\n * `PdfAnnotationCollection` class represents the collection of 'PdfAnnotation' objects.\n * @private\n */\nvar PdfAnnotationCollection = /** @class */ (function () {\n function PdfAnnotationCollection(page) {\n // Constants\n /**\n * `Error` constant message.\n * @private\n */\n this.alreadyExistsAnnotationError = 'This annotatation had been already added to page';\n /**\n * `Error` constant message.\n * @private\n */\n this.missingAnnotationException = 'Annotation is not contained in collection.';\n /**\n * Specifies the Internal variable to store fields of `PdfDictionaryProperties`.\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n /**\n * Array of the `annotations`.\n * @private\n */\n this.internalAnnotations = new PdfArray();\n /**\n * privte `list` for the annotations.\n * @private\n */\n this.lists = [];\n if (typeof page !== 'undefined') {\n this.page = page;\n }\n }\n Object.defineProperty(PdfAnnotationCollection.prototype, \"annotations\", {\n /**\n * Gets the `PdfAnnotation` object at the specified index. Read-Only.\n * @private\n */\n get: function () {\n return this.internalAnnotations;\n },\n set: function (value) {\n this.internalAnnotations = value;\n },\n enumerable: true,\n configurable: true\n });\n // Public methods\n /**\n * `Adds` a new annotation to the collection.\n * @private\n */\n PdfAnnotationCollection.prototype.add = function (annotation) {\n // this.SetPrint(annotation);\n this.doAdd(annotation);\n };\n /**\n * `Adds` a Annotation to collection.\n * @private\n */\n /* tslint:disable */\n PdfAnnotationCollection.prototype.doAdd = function (annotation) {\n if (typeof annotation.destination !== 'undefined') {\n var layout = new PdfStringLayouter();\n var layoutResult = layout.layout(annotation.text, annotation.font, annotation.stringFormat, new SizeF((annotation.bounds.width), 0), false, new SizeF(0, 0));\n var lastPosition = annotation.bounds.y;\n if (layoutResult.lines.length === 1) {\n var size = annotation.font.measureString(layoutResult.lines[0].text);\n annotation.bounds = new RectangleF(new PointF(annotation.bounds.x, lastPosition), size);\n annotation.text = layoutResult.lines[0].text;\n //Draw Annotation Text.\n this.page.graphics.drawString(annotation.text, annotation.font, null, annotation.brush, annotation.bounds.x, annotation.bounds.y, annotation.bounds.width, annotation.bounds.height, null);\n //Add annotation to dictionary.\n annotation.setPage(this.page);\n this.setColor(annotation);\n this.internalAnnotations.add(new PdfReferenceHolder(annotation));\n this.lists.push(annotation);\n }\n else {\n for (var i = 0; i < layoutResult.lines.length; i++) {\n var size = annotation.font.measureString(layoutResult.lines[i].text);\n if (i === 0) {\n annotation.bounds = new RectangleF(annotation.bounds.x, lastPosition, size.width, size.height);\n annotation.text = layoutResult.lines[i].text;\n //Draw Annotation Text.\n this.page.graphics.drawString(annotation.text, annotation.font, null, annotation.brush, annotation.bounds.x, lastPosition, size.width, size.height, null);\n //Add annotation to dictionary.\n annotation.setPage(this.page);\n this.setColor(annotation);\n this.internalAnnotations.add(new PdfReferenceHolder(annotation));\n this.lists.push(annotation);\n //Update y for drawing next line of the text.\n lastPosition += annotation.bounds.height;\n }\n else {\n var annot = annotation.clone();\n annot.bounds = new RectangleF(new PointF(annotation.bounds.x, lastPosition), size);\n annot.text = layoutResult.lines[i].text;\n //Draw Annotation Text.\n this.page.graphics.drawString(annot.text, annot.font, null, annot.brush, annot.bounds.x, annot.bounds.y, annot.bounds.width, annot.bounds.height, null);\n //Add annotation to dictionary.\n annot.setPage(this.page);\n this.setColor(annot);\n this.internalAnnotations.add(new PdfReferenceHolder(annot));\n this.lists.push(annot);\n //Update y for drawing next line of the text.\n lastPosition += annot.bounds.height;\n }\n }\n }\n }\n else {\n annotation.setPage(this.page);\n this.internalAnnotations.add(new PdfReferenceHolder(annotation));\n return this.lists.push(annotation);\n }\n };\n /* tslint:enable */\n /**\n * `Set a color of an annotation`.\n * @private\n */\n PdfAnnotationCollection.prototype.setColor = function (annotation) {\n var cs = PdfColorSpace.Rgb;\n var colours = annotation.color.toArray(cs);\n annotation.dictionary.items.setValue(this.dictionaryProperties.c, colours);\n };\n Object.defineProperty(PdfAnnotationCollection.prototype, \"element\", {\n // IPdfWrapper Members\n /**\n * Gets the `Element` representing this object.\n * @private\n */\n get: function () {\n return this.internalAnnotations;\n },\n enumerable: true,\n configurable: true\n });\n return PdfAnnotationCollection;\n}());\nexport { PdfAnnotationCollection };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { PdfPageBase } from './pdf-page-base';\nimport { PdfDictionary, SaveTemplateEventHandler } from './../primitives/pdf-dictionary';\nimport { PdfName } from './../primitives/pdf-name';\nimport { PdfReferenceHolder } from './../primitives/pdf-reference';\nimport { SizeF } from './../drawing/pdf-drawing';\nimport { PdfAnnotationCollection } from './../annotations/annotation-collection';\nimport { PdfPageLayer } from './pdf-page-layer';\n/**\n * Provides methods and properties to create pages and its elements.\n * `PdfPage` class inherited from the `PdfPageBase` class.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * //\n * // add a new page to the document\n * let page1 : PdfPage = document.pages.add();\n * //\n * // set the font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // create black brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(0, 0));\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\nvar PdfPage = /** @class */ (function (_super) {\n __extends(PdfPage, _super);\n //constructors\n /**\n * Initialize the new instance for `PdfPage` class.\n * @private\n */\n function PdfPage() {\n var _this = _super.call(this, new PdfDictionary()) || this;\n /**\n * Stores the instance of `PdfAnnotationCollection` class.\n * @hidden\n * @default null\n * @private\n */\n _this.annotationCollection = null;\n /**\n * Stores the instance of `PageBeginSave` event for Page Number Field.\n * @default null\n * @private\n */\n _this.beginSave = null;\n _this.initialize();\n return _this;\n }\n Object.defineProperty(PdfPage.prototype, \"document\", {\n //Properties\n /**\n * Gets current `document`.\n * @private\n */\n get: function () {\n if (this.section !== null && this.section.parent !== null) {\n return this.section.parent.document;\n }\n else {\n return null;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPage.prototype, \"graphics\", {\n /**\n * Get the current `graphics`.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a new page to the document\n * let page1 : PdfPage = document.pages.add();\n * //\n * // get graphics\n * let graphics : PdfGraphics = page1.graphics;\n * //\n * // set the font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // create black brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // draw the text\n * graphics.drawString('Hello World', font, blackBrush, new PointF(0, 0));\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n get: function () {\n var result = this.defaultLayer.graphics;\n result.currentPage = this;\n return result;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPage.prototype, \"crossTable\", {\n /**\n * Gets the `cross table`.\n * @private\n */\n get: function () {\n if (this.section === null) {\n throw new Error('PdfDocumentException : Page is not created');\n }\n return this.section.parent === null ? this.section.parentDocument.crossTable : this.section.parent.document.crossTable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPage.prototype, \"size\", {\n /**\n * Gets the size of the PDF page- Read only.\n * @public\n */\n get: function () {\n return this.section.pageSettings.size;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPage.prototype, \"origin\", {\n /**\n * Gets the `origin` of the page.\n * @private\n */\n get: function () {\n return this.section.pageSettings.origin;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPage.prototype, \"annotations\", {\n /**\n * Gets a collection of the `annotations` of the page- Read only.\n * @private\n */\n get: function () {\n if (this.annotationCollection == null) {\n this.annotationCollection = new PdfAnnotationCollection(this);\n // if (!this.Dictionary.ContainsKey(this.dictionaryProperties.annots)) {\n this.dictionary.items.setValue(this.dictionaryProperties.annots, this.annotationCollection.element);\n // }\n this.annotationCollection.annotations = this.dictionary.items.getValue(this.dictionaryProperties.annots);\n }\n return this.annotationCollection;\n },\n enumerable: true,\n configurable: true\n });\n //Implementation\n /**\n * `Initializes` a page.\n * @private\n */\n PdfPage.prototype.initialize = function () {\n this.dictionary.items.setValue(this.dictionaryProperties.type, new PdfName('Page'));\n this.dictionary.pageBeginDrawTemplate = new SaveTemplateEventHandler(this);\n };\n /**\n * Sets parent `section` to the page.\n * @private\n */\n PdfPage.prototype.setSection = function (section) {\n this.section = section;\n this.dictionary.items.setValue(this.dictionaryProperties.parent, new PdfReferenceHolder(section));\n };\n /**\n * `Resets the progress`.\n * @private\n */\n PdfPage.prototype.resetProgress = function () {\n this.isProgressOn = false;\n };\n /**\n * Get the page size reduced by page margins and page template dimensions.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a pages to the document\n * let page1 : PdfPage = document.pages.add();\n * // create new standard font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // set brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * //\n * // set the specified point using `getClientSize` method\n * let point : PointF = new PointF(page1.getClientSize().width - 200, page1.getClientSize().height - 200);\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, point);\n * //\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n PdfPage.prototype.getClientSize = function () {\n var returnValue = this.section.getActualBounds(this, true);\n return new SizeF(returnValue.width, returnValue.height);\n };\n /**\n * Helper method to retrive the instance of `PageBeginSave` event for header and footer elements.\n * @private\n */\n PdfPage.prototype.pageBeginSave = function () {\n var doc = this.document;\n if (typeof doc !== undefined && doc != null) {\n this.drawPageTemplates(doc);\n }\n if (this.beginSave != null && typeof this.beginSave !== 'undefined') {\n this.beginSave(this);\n }\n };\n /**\n * Helper method to draw template elements.\n * @private\n */\n PdfPage.prototype.drawPageTemplates = function (document) {\n // Draw Background templates.\n var hasBackTemplates = this.section.containsTemplates(document, this, false);\n if (hasBackTemplates) {\n var backLayer = new PdfPageLayer(this, false);\n this.layers.insert(0, backLayer);\n this.section.drawTemplates(this, backLayer, document, false);\n if (backLayer.graphics !== null && typeof backLayer.graphics !== 'undefined') {\n for (var i = 0; i < backLayer.graphics.automaticFields.automaticFields.length; i++) {\n var fieldInfo = backLayer.graphics.automaticFields.automaticFields[i];\n fieldInfo.field.performDraw(backLayer.graphics, fieldInfo.location, fieldInfo.scalingX, fieldInfo.scalingY);\n }\n }\n }\n // Draw Foreground templates.\n var hasFrontTemplates = this.section.containsTemplates(document, this, true);\n if (hasFrontTemplates) {\n var frontLayer = new PdfPageLayer(this, false);\n this.layers.add(frontLayer);\n this.section.drawTemplates(this, frontLayer, document, true);\n }\n };\n return PdfPage;\n}(PdfPageBase));\nexport { PdfPage };\n","/**\n * Provides data for `PageAddedEventHandler` event.\n * This event raises when adding the new PDF page to the PDF document.\n */\nvar PageAddedEventArgs = /** @class */ (function () {\n function PageAddedEventArgs(page) {\n if (typeof page !== 'undefined') {\n this.pdfPage = page;\n }\n else {\n this.pdfPage = null;\n }\n }\n Object.defineProperty(PageAddedEventArgs.prototype, \"page\", {\n /**\n * Gets the `newly added page`.\n * @private\n */\n get: function () {\n return this.pdfPage;\n },\n enumerable: true,\n configurable: true\n });\n return PageAddedEventArgs;\n}());\nexport { PageAddedEventArgs };\n","/**\n * Represents the `collection of pages in a section`.\n * @private\n */\nvar PdfSectionPageCollection = /** @class */ (function () {\n // Constructors\n /**\n * Initializes a new instance of the `PdfSectionPageCollection` class.\n * @private\n */\n function PdfSectionPageCollection(section) {\n // Fields\n /**\n * @hidden\n * @private\n */\n this.pdfSection = null;\n if (section == null) {\n throw Error('ArgumentNullException(\"section\")');\n }\n this.section = section;\n }\n Object.defineProperty(PdfSectionPageCollection.prototype, \"section\", {\n // Properties\n /**\n * Gets the `PdfPage` at the specified index.\n * @private\n */\n get: function () {\n return this.pdfSection;\n },\n set: function (value) {\n this.pdfSection = value;\n },\n enumerable: true,\n configurable: true\n });\n // Public Methods\n /**\n * `Determines` whether the specified page is within the collection.\n * @private\n */\n PdfSectionPageCollection.prototype.contains = function (page) {\n return this.section.contains(page);\n };\n /**\n * `Removes` the specified page from collection.\n * @private\n */\n PdfSectionPageCollection.prototype.remove = function (page) {\n this.section.remove(page);\n };\n /**\n * `Adds` a new page from collection.\n * @private\n */\n PdfSectionPageCollection.prototype.add = function () {\n return this.section.add();\n };\n return PdfSectionPageCollection;\n}());\nexport { PdfSectionPageCollection };\n","import { TemplateType } from './../pages/enum';\n// import { PdfStampCollection } from `./../Pages/PdfStampCollection`;\n/**\n * `PdfDocumentTemplate` class encapsulates a page template for all the pages in the document.\n * @private\n */\nvar PdfDocumentTemplate = /** @class */ (function () {\n // Constructors\n /**\n * Initializes a new instance of the `PdfDocumentTemplate` class.\n * @public\n */\n function PdfDocumentTemplate() {\n //\n }\n Object.defineProperty(PdfDocumentTemplate.prototype, \"left\", {\n // private m_stamps : PdfStampCollection;\n // Properties\n /**\n * `Left` page template object.\n * @public\n */\n get: function () {\n return this.leftTemplate;\n },\n set: function (value) {\n this.leftTemplate = this.checkElement(value, TemplateType.Left);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"top\", {\n /**\n * `Top` page template object.\n * @public\n */\n get: function () {\n return this.topTemplate;\n },\n set: function (value) {\n this.topTemplate = this.checkElement(value, TemplateType.Top);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"right\", {\n /**\n * `Right` page template object.\n * @public\n */\n get: function () {\n return this.rightTemplate;\n },\n set: function (value) {\n this.rightTemplate = this.checkElement(value, TemplateType.Right);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"bottom\", {\n /**\n * `Bottom` page template object.\n * @public\n */\n get: function () {\n return this.bottomTemplate;\n },\n set: function (value) {\n this.bottomTemplate = this.checkElement(value, TemplateType.Bottom);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"EvenLeft\", {\n /**\n * `EvenLeft` page template object.\n * @public\n */\n get: function () {\n return this.evenLeft;\n },\n set: function (value) {\n this.evenLeft = this.checkElement(value, TemplateType.Left);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"EvenTop\", {\n /**\n * `EvenTop` page template object.\n * @public\n */\n get: function () {\n return this.evenTop;\n },\n set: function (value) {\n this.evenTop = this.checkElement(value, TemplateType.Top);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"EvenRight\", {\n /**\n * `EvenRight` page template object.\n * @public\n */\n get: function () {\n return this.evenRight;\n },\n set: function (value) {\n this.evenRight = this.checkElement(value, TemplateType.Right);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"EvenBottom\", {\n /**\n * `EvenBottom` page template object.\n * @public\n */\n get: function () {\n return this.evenBottom;\n },\n set: function (value) {\n this.evenBottom = this.checkElement(value, TemplateType.Bottom);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"OddLeft\", {\n /**\n * `OddLeft` page template object.\n * @public\n */\n get: function () {\n return this.oddLeft;\n },\n set: function (value) {\n this.oddLeft = this.checkElement(value, TemplateType.Left);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"OddTop\", {\n /**\n * `OddTop` page template object.\n * @public\n */\n get: function () {\n return this.oddTop;\n },\n set: function (value) {\n this.oddTop = this.checkElement(value, TemplateType.Top);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"OddRight\", {\n /**\n * `OddRight` page template object.\n * @public\n */\n get: function () {\n return this.oddRight;\n },\n set: function (value) {\n this.oddRight = this.checkElement(value, TemplateType.Right);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentTemplate.prototype, \"OddBottom\", {\n /**\n * `OddBottom` page template object.\n * @public\n */\n get: function () {\n return this.oddBottom;\n },\n set: function (value) {\n this.oddBottom = this.checkElement(value, TemplateType.Bottom);\n },\n enumerable: true,\n configurable: true\n });\n // Implementation\n /**\n * Returns `left` template.\n * @public\n */\n PdfDocumentTemplate.prototype.getLeft = function (page) {\n if (page == null) {\n throw new Error('ArgumentNullException:page');\n }\n var template = null;\n // if (page.Document.Pages != null) {\n var even = this.isEven(page);\n if (even) {\n template = (this.EvenLeft != null) ? this.EvenLeft : this.left;\n }\n else {\n template = (this.OddLeft != null) ? this.OddLeft : this.left;\n }\n // }\n return template;\n };\n /**\n * Returns `top` template.\n * @public\n */\n PdfDocumentTemplate.prototype.getTop = function (page) {\n if (page == null) {\n throw new Error('ArgumentNullException:page');\n }\n var template = null;\n // if (page.Document.Pages != null) {\n var even = this.isEven(page);\n if (even) {\n template = (this.EvenTop != null) ? this.EvenTop : this.top;\n }\n else {\n template = (this.OddTop != null) ? this.OddTop : this.top;\n }\n // }\n return template;\n };\n /**\n * Returns `right` template.\n * @public\n */\n PdfDocumentTemplate.prototype.getRight = function (page) {\n if (page == null) {\n throw new Error('ArgumentNullException:page');\n }\n var template = null;\n // if (page.Document.Pages != null) {\n var even = this.isEven(page);\n if (even) {\n template = (this.EvenRight != null) ? this.EvenRight : this.right;\n }\n else {\n template = (this.OddRight != null) ? this.OddRight : this.right;\n }\n // }\n return template;\n };\n /**\n * Returns `bottom` template.\n * @public\n */\n PdfDocumentTemplate.prototype.getBottom = function (page) {\n if (page == null) {\n throw new Error('ArgumentNullException:page');\n }\n var template = null;\n // if (page.Document.Pages != null) {\n var even = this.isEven(page);\n if (even) {\n template = (this.EvenBottom != null) ? this.EvenBottom : this.bottom;\n }\n else {\n template = (this.OddBottom != null) ? this.OddBottom : this.bottom;\n }\n // }\n return template;\n };\n /**\n * Checks whether the page `is even`.\n * @private\n */\n PdfDocumentTemplate.prototype.isEven = function (page) {\n var pages = page.section.document.pages;\n var index = 0;\n if (pages.pageCollectionIndex.containsKey(page)) {\n index = pages.pageCollectionIndex.getValue(page) + 1;\n }\n else {\n index = pages.indexOf(page) + 1;\n }\n var even = ((index % 2) === 0);\n return even;\n };\n /**\n * Checks a `template element`.\n * @private\n */\n PdfDocumentTemplate.prototype.checkElement = function (templateElement, type) {\n if (templateElement != null) {\n if ((typeof templateElement.type !== 'undefined') && (templateElement.type !== TemplateType.None)) {\n throw new Error('NotSupportedException:Can not reassign the template element. Please, create new one.');\n }\n templateElement.type = type;\n }\n return templateElement;\n };\n return PdfDocumentTemplate;\n}());\nexport { PdfDocumentTemplate };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * PdfSectionTemplate.ts class for EJ2-PDF\n */\nimport { PdfDocumentTemplate } from './../document/pdf-document-template';\n/**\n * Represents a `page template` for all the pages in the section.\n */\nvar PdfSectionTemplate = /** @class */ (function (_super) {\n __extends(PdfSectionTemplate, _super);\n // Constructors\n /**\n * `Creates a new object`.\n * @private\n */\n function PdfSectionTemplate() {\n var _this = _super.call(this) || this;\n _this.leftValue = _this.topValue = _this.rightValue = _this.bottomValue = _this.stampValue = true;\n return _this;\n }\n Object.defineProperty(PdfSectionTemplate.prototype, \"applyDocumentLeftTemplate\", {\n // Properties\n /**\n * Gets or sets value indicating whether parent `Left page template should be used or not`.\n * @private\n */\n get: function () {\n return this.leftValue;\n },\n set: function (value) {\n this.leftValue = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSectionTemplate.prototype, \"applyDocumentTopTemplate\", {\n /**\n * Gets or sets value indicating whether parent `Top page template should be used or not`.\n * @private\n */\n get: function () {\n return this.topValue;\n },\n set: function (value) {\n this.topValue = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSectionTemplate.prototype, \"applyDocumentRightTemplate\", {\n /**\n * Gets or sets value indicating whether parent `Right page template should be used or not`.\n * @private\n */\n get: function () {\n return this.rightValue;\n },\n set: function (value) {\n this.rightValue = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSectionTemplate.prototype, \"applyDocumentBottomTemplate\", {\n /**\n * Gets or sets value indicating whether parent `Bottom page template should be used or not`.\n * @private\n */\n get: function () {\n return this.bottomValue;\n },\n set: function (value) {\n this.bottomValue = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSectionTemplate.prototype, \"applyDocumentStamps\", {\n /**\n * Gets or sets value indicating whether the `stamp value` is true or not.\n * @private\n */\n get: function () {\n return this.stampValue;\n },\n set: function (value) {\n this.stampValue = value;\n },\n enumerable: true,\n configurable: true\n });\n return PdfSectionTemplate;\n}(PdfDocumentTemplate));\nexport { PdfSectionTemplate };\n","import { PdfPage } from './pdf-page';\nimport { PageAddedEventArgs } from './page-added-event-arguments';\nimport { PdfReferenceHolder } from './../primitives/pdf-reference';\nimport { PdfArray } from './../primitives/pdf-array';\nimport { PdfNumber } from './../primitives/pdf-number';\nimport { PdfName } from './../primitives/pdf-name';\nimport { PdfDictionary } from './../primitives/pdf-dictionary';\nimport { SaveSectionEventHandler } from './../primitives/pdf-dictionary';\nimport { DictionaryProperties } from './../input-output/pdf-dictionary-properties';\nimport { PdfSectionCollection } from './pdf-section-collection';\nimport { PdfSectionPageCollection } from './pdf-section-page-collection';\nimport { RectangleF } from './../drawing/pdf-drawing';\nimport { PdfSectionTemplate } from './pdf-section-templates';\n/**\n * Represents a `section` entity. A section it's a set of the pages with similar page settings.\n */\nvar PdfSection = /** @class */ (function () {\n function PdfSection(document, pageSettings) {\n //Fields\n //public PageAdded() : PageAddedEventArgs.PageAddedEventHandler = new PageAddedEventArgs.PageAddedEventHandler(Object,args)\n /**\n * @hidden\n * @private\n */\n this.pageAdded = new PageAddedEventArgs();\n /**\n * @hidden\n * @private\n */\n this.pdfPages = [];\n /**\n * @hidden\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n this.pdfDocument = document;\n if (typeof pageSettings === 'undefined') {\n this.settings = document.pageSettings.clone();\n this.initialSettings = this.settings.clone();\n }\n else {\n this.settings = pageSettings.clone();\n this.initialSettings = this.settings.clone();\n }\n this.initialize();\n }\n Object.defineProperty(PdfSection.prototype, \"parent\", {\n //Property\n /**\n * Gets or sets the `parent`.\n * @private\n */\n get: function () {\n return this.sectionCollection;\n },\n set: function (value) {\n this.sectionCollection = value;\n this.section.items.setValue(this.dictionaryProperties.parent, new PdfReferenceHolder(value));\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSection.prototype, \"parentDocument\", {\n /**\n * Gets the `parent document`.\n * @private\n */\n get: function () {\n return this.pdfDocument;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSection.prototype, \"pageSettings\", {\n /**\n * Gets or sets the `page settings` of the section.\n * @private\n */\n get: function () {\n return this.settings;\n },\n set: function (value) {\n if (value != null) {\n this.settings = value;\n }\n else {\n throw Error('Value can not be null.');\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSection.prototype, \"element\", {\n /**\n * Gets the wrapped `element`.\n * @private\n */\n get: function () {\n return this.section;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSection.prototype, \"count\", {\n /**\n * Gets the `count` of the pages in the section.\n * @private\n */\n get: function () {\n return this.pagesReferences.count;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSection.prototype, \"template\", {\n /**\n * Gets or sets a `template` for the pages in the section.\n * @private\n */\n get: function () {\n if (this.pageTemplate == null) {\n this.pageTemplate = new PdfSectionTemplate();\n }\n return this.pageTemplate;\n },\n set: function (value) {\n this.pageTemplate = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSection.prototype, \"document\", {\n /**\n * Gets the `document`.\n * @private\n */\n get: function () {\n return this.sectionCollection.document;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSection.prototype, \"pages\", {\n /**\n * Gets the collection of `pages` in a section (Read only)\n * @private\n */\n get: function () {\n if (this.pagesCollection == null || typeof this.pagesCollection === 'undefined') {\n this.pagesCollection = new PdfSectionPageCollection(this);\n }\n return this.pagesCollection;\n },\n enumerable: true,\n configurable: true\n });\n //methods\n /**\n * `Return the page collection` of current section.\n * @private\n */\n PdfSection.prototype.getPages = function () {\n return this.pdfPages;\n };\n /**\n * `Translates` point into native coordinates of the page.\n * @private\n */\n PdfSection.prototype.pointToNativePdf = function (page, point) {\n var bounds = this.getActualBounds(page, true);\n point.x += bounds.x;\n point.y = this.pageSettings.height - (point.y);\n return point;\n };\n /**\n * Sets the page setting of the current section.\n * @public\n * @param settings Instance of `PdfPageSettings`\n */\n PdfSection.prototype.setPageSettings = function (settings) {\n this.settings = settings;\n this.state.orientation = settings.orientation;\n this.state.rotate = settings.rotate;\n this.state.size = settings.size;\n this.state.origin = settings.origin;\n };\n /**\n * `Initializes` the object.\n * @private\n */\n PdfSection.prototype.initialize = function () {\n this.pagesReferences = new PdfArray();\n this.section = new PdfDictionary();\n this.state = new PageSettingsState(this.pdfDocument);\n this.section.sectionBeginSave = new SaveSectionEventHandler(this, this.state);\n this.pageCount = new PdfNumber(0);\n this.section.items.setValue(this.dictionaryProperties.count, this.pageCount);\n this.section.items.setValue(this.dictionaryProperties.type, new PdfName(this.dictionaryProperties.pages));\n this.section.items.setValue(this.dictionaryProperties.kids, this.pagesReferences);\n };\n /**\n * Checks whether any template should be printed on this layer.\n * @private\n * @param document The parent document.\n * @param page The parent page.\n * @param foreground Layer z-order.\n * @returns True - if some content should be printed on the layer, False otherwise.\n */\n PdfSection.prototype.containsTemplates = function (document, page, foreground) {\n var documentHeaders = this.getDocumentTemplates(document, page, foreground);\n var sectionTemplates = this.getSectionTemplates(page, foreground);\n return (documentHeaders.length > 0 || sectionTemplates.length > 0);\n };\n /**\n * Returns array of the document templates.\n * @private\n * @param document The parent document.\n * @param page The parent page.\n * @param foreground If true - return foreground templates, if false - return background templates.\n * @returns Returns array of the document templates.\n */\n /* tslint:disable */\n PdfSection.prototype.getDocumentTemplates = function (document, page, foreground) {\n var templates = [];\n if (this.template.applyDocumentTopTemplate && document.template.getTop(page) != null) {\n if ((!(document.template.getTop(page).foreground || foreground)) || (document.template.getTop(page).foreground && foreground)) {\n templates.push(document.template.getTop(page));\n }\n }\n if (this.template.applyDocumentBottomTemplate && document.template.getBottom(page) != null) {\n if ((!(document.template.getBottom(page).foreground || foreground)) || (document.template.getBottom(page).foreground && foreground)) {\n templates.push(document.template.getBottom(page));\n }\n }\n if (this.template.applyDocumentLeftTemplate && document.template.getLeft(page) != null) {\n if ((!(document.template.getLeft(page).foreground || foreground)) || (document.template.getLeft(page).foreground && foreground)) {\n templates.push(document.template.getLeft(page));\n }\n }\n if (this.template.applyDocumentRightTemplate && document.template.getRight(page) != null) {\n if ((!(document.template.getRight(page).foreground || foreground)) || (document.template.getRight(page).foreground && foreground)) {\n templates.push(document.template.getRight(page));\n }\n }\n return templates;\n };\n /**\n * Returns array of the section templates.\n * @private\n * @param page The parent page.\n * @param foreground If true - return foreground templates, if false - return background templates.\n * @returns Returns array of the section templates.\n */\n /* tslint:disable */\n PdfSection.prototype.getSectionTemplates = function (page, foreground) {\n var templates = [];\n if (this.template.getTop(page) != null) {\n var pageTemplate = this.template.getTop(page);\n if ((!(pageTemplate.foreground || foreground)) || (pageTemplate.foreground && foreground)) {\n templates.push(pageTemplate);\n }\n }\n if (this.template.getBottom(page) != null) {\n var pageTemplate = this.template.getBottom(page);\n if ((!(pageTemplate.foreground || foreground)) || (pageTemplate.foreground && foreground)) {\n templates.push(pageTemplate);\n }\n }\n if (this.template.getLeft(page) != null) {\n var pageTemplate = this.template.getLeft(page);\n if ((!(pageTemplate.foreground || foreground)) || (pageTemplate.foreground && foreground)) {\n templates.push(pageTemplate);\n }\n }\n if (this.template.getRight(page) != null) {\n var pageTemplate = this.template.getRight(page);\n if ((!(pageTemplate.foreground || foreground)) || (pageTemplate.foreground && foreground)) {\n templates.push(pageTemplate);\n }\n }\n return templates;\n };\n /* tslint:enable */\n /**\n * `Adds` the specified page.\n * @private\n */\n PdfSection.prototype.add = function (page) {\n if (typeof page === 'undefined') {\n var page_1 = new PdfPage();\n this.add(page_1);\n return page_1;\n }\n else {\n var r = this.checkPresence(page);\n this.pdfPages.push(page);\n this.pagesReferences.add(r);\n page.setSection(this);\n page.resetProgress();\n this.pageAddedMethod(page);\n }\n };\n /**\n * `Checks the presence`.\n * @private\n */\n PdfSection.prototype.checkPresence = function (page) {\n var rh = new PdfReferenceHolder(page);\n var contains = false;\n var sc = this.parent;\n for (var index = 0; index < sc.section.length; index++) {\n var section = sc.section[index];\n contains = contains || section.contains(page);\n }\n return rh;\n };\n /**\n * `Determines` whether the page in within the section.\n * @private\n */\n PdfSection.prototype.contains = function (page) {\n var index = this.indexOf(page);\n return (0 <= index);\n };\n /**\n * Get the `index of` the page.\n * @private\n */\n PdfSection.prototype.indexOf = function (page) {\n for (var index = 0; index < this.pdfPages.length; index++) {\n if (this.pdfPages[index] === page) {\n return this.pdfPages.indexOf(page);\n }\n }\n var r = new PdfReferenceHolder(page);\n return this.pagesReferences.indexOf(r);\n };\n /**\n * Call two event's methods.\n * @hidden\n * @private\n */\n PdfSection.prototype.pageAddedMethod = function (page) {\n //Create event's arguments\n var args = new PageAddedEventArgs(page);\n this.onPageAdded(args);\n var parent = this.parent;\n parent.document.pages.onPageAdded(args);\n this.pageCount.intValue = this.count;\n };\n /**\n * Called when the page has been added.\n * @hidden\n * @private\n */\n PdfSection.prototype.onPageAdded = function (args) {\n //\n };\n PdfSection.prototype.getActualBounds = function (arg1, arg2, arg3) {\n if (arg1 instanceof PdfPage && typeof arg2 === 'boolean') {\n var result = void 0;\n var document_1 = this.parent.document;\n result = this.getActualBounds(document_1, arg1, arg2);\n return result;\n }\n else {\n arg1 = arg1;\n arg2 = arg2;\n arg3 = arg3;\n var bounds = new RectangleF(0, 0, 0, 0);\n bounds.height = (arg3) ? this.pageSettings.size.height : this.pageSettings.getActualSize().height;\n bounds.width = (arg3) ? this.pageSettings.size.width : this.pageSettings.getActualSize().width;\n var left = this.getLeftIndentWidth(arg1, arg2, arg3);\n var top_1 = this.getTopIndentHeight(arg1, arg2, arg3);\n var right = this.getRightIndentWidth(arg1, arg2, arg3);\n var bottom = this.getBottomIndentHeight(arg1, arg2, arg3);\n bounds.x += left;\n bounds.y += top_1;\n bounds.width -= (left + right);\n bounds.height -= (top_1 + bottom);\n return bounds;\n }\n };\n /**\n * Calculates width of the `left indent`.\n * @private\n */\n PdfSection.prototype.getLeftIndentWidth = function (document, page, includeMargins) {\n if (document == null) {\n throw new Error('ArgumentNullException:document');\n }\n if (page == null) {\n throw new Error('ArgumentNullException:page');\n }\n var value = (includeMargins) ? this.pageSettings.margins.left : 0;\n var templateWidth = (this.template.getLeft(page) != null) ? this.template.getLeft(page).width : 0;\n var docTemplateWidth = (document.template.getLeft(page) != null) ? document.template.getLeft(page).width : 0;\n value += (this.template.applyDocumentLeftTemplate) ? Math.max(templateWidth, docTemplateWidth) : templateWidth;\n return value;\n };\n /**\n * Calculates `Height` of the top indent.\n * @private\n */\n PdfSection.prototype.getTopIndentHeight = function (document, page, includeMargins) {\n if (document == null) {\n throw new Error('ArgumentNullException:document');\n }\n if (page == null) {\n throw new Error('ArgumentNullException:page');\n }\n var value = (includeMargins) ? this.pageSettings.margins.top : 0;\n var templateHeight = (this.template.getTop(page) != null) ? this.template.getTop(page).height : 0;\n var docTemplateHeight = (document.template.getTop(page) != null) ? document.template.getTop(page).height : 0;\n value += (this.template.applyDocumentTopTemplate) ? Math.max(templateHeight, docTemplateHeight) : templateHeight;\n return value;\n };\n /**\n * Calculates `width` of the right indent.\n * @private\n */\n PdfSection.prototype.getRightIndentWidth = function (document, page, includeMargins) {\n if (document == null) {\n throw new Error('ArgumentNullException:document');\n }\n if (page == null) {\n throw new Error('ArgumentNullException:page');\n }\n var value = (includeMargins) ? this.pageSettings.margins.right : 0;\n var templateWidth = (this.template.getRight(page) != null) ? this.template.getRight(page).width : 0;\n var docTemplateWidth = (document.template.getRight(page) != null) ? document.template.getRight(page).width : 0;\n value += (this.template.applyDocumentRightTemplate) ? Math.max(templateWidth, docTemplateWidth) : templateWidth;\n return value;\n };\n /**\n * Calculates `Height` of the bottom indent.\n * @private\n */\n PdfSection.prototype.getBottomIndentHeight = function (document, page, includeMargins) {\n if (document == null) {\n throw new Error('ArgumentNullException:document');\n }\n if (page == null) {\n throw new Error('ArgumentNullException:page');\n }\n var value = (includeMargins) ? this.pageSettings.margins.bottom : 0;\n var templateHeight = (this.template.getBottom(page) != null) ? this.template.getBottom(page).height : 0;\n var docTemplateHeight = (document.template.getBottom(page) != null) ? document.template.getBottom(page).height : 0;\n value += (this.template.applyDocumentBottomTemplate) ? Math.max(templateHeight, docTemplateHeight) : templateHeight;\n return value;\n };\n /**\n * `Removes` the page from the section.\n * @private\n */\n PdfSection.prototype.remove = function (page) {\n if (page == null) {\n throw Error('ArgumentNullException(\"page\")');\n }\n var index = this.pdfPages.indexOf(page);\n this.pagesReferences.removeAt(index);\n var temproaryPages = [];\n for (var j = 0; j < index; j++) {\n temproaryPages.push(this.pdfPages[j]);\n }\n for (var j = index + 1; j < this.pdfPages.length; j++) {\n temproaryPages.push(this.pdfPages[j]);\n }\n this.pdfPages = temproaryPages;\n };\n /**\n * In fills dictionary by the data from `Page settings`.\n * @private\n */\n PdfSection.prototype.applyPageSettings = function (container, parentSettings, state) {\n var bounds = new RectangleF(state.origin, state.size);\n container.items.setValue(this.dictionaryProperties.mediaBox, PdfArray.fromRectangle(bounds));\n var rotate = 0;\n rotate = PdfSectionCollection.rotateFactor * state.rotate;\n var angle = new PdfNumber(rotate);\n container.items.setValue(this.dictionaryProperties.rotate, angle);\n };\n /**\n * Catches the Save event of the dictionary.\n * @hidden\n * @private\n */\n PdfSection.prototype.beginSave = function (state, writer) {\n var doc = writer.document;\n this.applyPageSettings(this.section, doc.pageSettings, state);\n };\n /**\n * Draws page templates on the page.\n * @private\n */\n PdfSection.prototype.drawTemplates = function (page, layer, document, foreground) {\n var documentHeaders = this.getDocumentTemplates(document, page, foreground);\n var sectionHeaders = this.getSectionTemplates(page, foreground);\n this.drawTemplatesHelper(layer, document, documentHeaders);\n this.drawTemplatesHelper(layer, document, sectionHeaders);\n };\n /**\n * Draws page templates on the page.\n * @private\n */\n PdfSection.prototype.drawTemplatesHelper = function (layer, document, templates) {\n if (templates != null && templates.length > 0) {\n var len = templates.length;\n for (var i = 0; i < len; i++) {\n var template = templates[i];\n template.draw(layer, document);\n }\n }\n };\n return PdfSection;\n}());\nexport { PdfSection };\nvar PageSettingsState = /** @class */ (function () {\n //Public Constructor\n /**\n * New instance to store the `PageSettings`.\n * @private\n */\n function PageSettingsState(document) {\n this.pageOrientation = document.pageSettings.orientation;\n this.pageRotate = document.pageSettings.rotate;\n this.pageSize = document.pageSettings.size;\n this.pageOrigin = document.pageSettings.origin;\n }\n Object.defineProperty(PageSettingsState.prototype, \"orientation\", {\n //public Properties\n /**\n * @hidden\n * @private\n */\n get: function () {\n return this.pageOrientation;\n },\n set: function (value) {\n this.pageOrientation = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PageSettingsState.prototype, \"rotate\", {\n /**\n * @hidden\n * @private\n */\n get: function () {\n return this.pageRotate;\n },\n set: function (value) {\n this.pageRotate = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PageSettingsState.prototype, \"size\", {\n /**\n * @hidden\n * @private\n */\n get: function () {\n return this.pageSize;\n },\n set: function (value) {\n this.pageSize = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PageSettingsState.prototype, \"origin\", {\n /**\n * @hidden\n * @private\n */\n get: function () {\n return this.pageOrigin;\n },\n set: function (value) {\n this.pageOrigin = value;\n },\n enumerable: true,\n configurable: true\n });\n return PageSettingsState;\n}());\nexport { PageSettingsState };\n","import { PdfNumber } from './../primitives/pdf-number';\nimport { PdfName } from './../primitives/pdf-name';\nimport { PdfArray } from './../primitives/pdf-array';\nimport { PdfDictionary, SaveSectionCollectionEventHandler } from './../primitives/pdf-dictionary';\nimport { PdfReferenceHolder } from './../primitives/pdf-reference';\nimport { RectangleF, PointF } from './../drawing/pdf-drawing';\nimport { PdfSection } from './pdf-section';\nimport { DictionaryProperties } from './../input-output/pdf-dictionary-properties';\n/**\n * Represents the `collection of the sections`.\n * @private\n */\nvar PdfSectionCollection = /** @class */ (function () {\n //constructor\n /**\n * Initializes a new instance of the `PdfSectionCollection` class.\n * @private\n */\n function PdfSectionCollection(document) {\n /**\n * @hidden\n * @private\n */\n this.sections = [];\n /**\n * @hidden\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n // if (document === null) {\n // throw new Error('ArgumentNullException : document');\n // }\n this.pdfDocument = document.clone();\n this.initialize();\n }\n Object.defineProperty(PdfSectionCollection.prototype, \"section\", {\n //Properties\n /**\n * Gets the `Section` collection.\n */\n get: function () {\n return this.sections;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSectionCollection.prototype, \"document\", {\n /**\n * Gets a parent `document`.\n * @private\n */\n get: function () {\n return this.pdfDocument;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSectionCollection.prototype, \"count\", {\n /**\n * Gets the `number of sections` in a document.\n * @private\n */\n get: function () {\n return this.sections.length;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfSectionCollection.prototype, \"element\", {\n /**\n * Gets the wrapped `element`.\n * @private\n */\n get: function () {\n return this.pages;\n },\n enumerable: true,\n configurable: true\n });\n //Methods\n /**\n * `Initializes the object`.\n * @private\n */\n PdfSectionCollection.prototype.initialize = function () {\n this.sectionCount = new PdfNumber(0);\n this.sectionCollection = new PdfArray();\n this.pages = new PdfDictionary();\n this.pages.beginSave = new SaveSectionCollectionEventHandler(this);\n this.pages.items.setValue(this.dictionaryProperties.type, new PdfName('Pages'));\n this.pages.items.setValue(this.dictionaryProperties.kids, this.sectionCollection);\n this.pages.items.setValue(this.dictionaryProperties.count, this.sectionCount);\n this.pages.items.setValue(this.dictionaryProperties.resources, new PdfDictionary());\n this.setPageSettings(this.pages, this.pdfDocument.pageSettings);\n };\n /**\n * Initializes a new instance of the `PdfSectionCollection` class.\n * @private\n */\n PdfSectionCollection.prototype.pdfSectionCollection = function (index) {\n if (index < 0 || index >= this.count) {\n throw new Error('IndexOutOfRangeException()');\n }\n return this.sections[index];\n };\n /**\n * In fills dictionary by the data from `Page settings`.\n * @private\n */\n PdfSectionCollection.prototype.setPageSettings = function (container, pageSettings) {\n // if (container === null) {\n // throw new Error('ArgumentNullException : container');\n // }\n // if (pageSettings === null) {\n // throw new Error('ArgumentNullException : pageSettings');\n // }\n var bounds = new RectangleF(new PointF(), pageSettings.size);\n container.items.setValue(this.dictionaryProperties.mediaBox, PdfArray.fromRectangle(bounds));\n };\n /**\n * `Adds` the specified section.\n * @private\n */\n PdfSectionCollection.prototype.add = function (section) {\n if (typeof section === 'undefined') {\n var section_1 = new PdfSection(this.pdfDocument);\n this.add(section_1);\n return section_1;\n }\n else {\n // if (section === null) {\n // throw new Error('ArgumentNullException : section');\n // }\n var r = this.checkSection(section);\n this.sections.push(section);\n section.parent = this;\n this.sectionCollection.add(r);\n return this.sections.indexOf(section);\n }\n };\n /**\n * `Checks` if the section is within the collection.\n * @private\n */\n PdfSectionCollection.prototype.checkSection = function (section) {\n var r = new PdfReferenceHolder(section);\n var contains = this.sectionCollection.contains(r);\n // if (contains) {\n // throw new Error('ArgumentException : The object can not be added twice to the collection,section');\n // }\n return r;\n };\n /**\n * Catches the Save event of the dictionary to `count the pages`.\n * @private\n */\n PdfSectionCollection.prototype.countPages = function () {\n var count = 0;\n this.sections.forEach(function (n) { return (count += n.count); });\n return count;\n };\n /**\n * Catches the Save event of the dictionary to `count the pages`.\n * @hidden\n * @private\n */\n PdfSectionCollection.prototype.beginSave = function () {\n this.sectionCount.intValue = this.countPages();\n };\n //Fields\n /**\n * Rotate factor for page `rotation`.\n * @default 90\n * @private\n */\n PdfSectionCollection.rotateFactor = 90;\n return PdfSectionCollection;\n}());\nexport { PdfSectionCollection };\n","import { PdfPage } from './pdf-page';\nimport { Dictionary } from './../collections/dictionary';\n/**\n * Represents a virtual collection of all the pages in the document.\n * @private\n */\nvar PdfDocumentPageCollection = /** @class */ (function () {\n //constructor\n /**\n * Initializes a new instance of the `PdfPageCollection` class.\n * @private\n */\n function PdfDocumentPageCollection(document) {\n /**\n * It holds the page collection with the `index`.\n * @private\n */\n this.pdfPageCollectionIndex = new Dictionary();\n this.document = document;\n }\n Object.defineProperty(PdfDocumentPageCollection.prototype, \"count\", {\n //Property\n /**\n * Gets the total `number of the pages`.\n * @private\n */\n get: function () {\n return this.countPages();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocumentPageCollection.prototype, \"pageCollectionIndex\", {\n /**\n * Gets a `page index` from the document.\n * @private\n */\n get: function () {\n return this.pdfPageCollectionIndex;\n },\n enumerable: true,\n configurable: true\n });\n PdfDocumentPageCollection.prototype.add = function (page) {\n if (typeof page === 'undefined') {\n var page_1 = new PdfPage();\n this.add(page_1);\n return page_1;\n }\n else {\n var section = this.getLastSection();\n section.add(page);\n }\n };\n /**\n * Returns `last section` in the document.\n * @private\n */\n PdfDocumentPageCollection.prototype.getLastSection = function () {\n var sc = this.document.sections;\n if (sc.section.length === 0) {\n sc.add();\n }\n var section = sc.section[sc.section.length - 1];\n return section;\n };\n /**\n * Called when `new page has been added`.\n * @private\n */\n PdfDocumentPageCollection.prototype.onPageAdded = function (args) {\n // if (PageAdded !== null)\n // {\n // PageAdded(this, args);\n // }\n };\n /**\n * Gets the `total number of pages`.\n * @private\n */\n PdfDocumentPageCollection.prototype.countPages = function () {\n var sc = this.document.sections;\n var count = 0;\n for (var index = 0; index < sc.section.length; index++) {\n count += sc.section[index].count;\n }\n return count;\n };\n /**\n * Gets the `page object` from page index.\n * @private\n */\n PdfDocumentPageCollection.prototype.getPageByIndex = function (index) {\n return this.getPage(index);\n };\n /**\n * Gets a page by its `index` in the document.\n * @private\n */\n PdfDocumentPageCollection.prototype.getPage = function (index) {\n if ((index < 0) || (index >= this.count)) {\n throw Error('ArgumentOutOfRangeException(\"index\", \"Value can not be less 0\")');\n }\n var page = null;\n var sectionStartIndex = 0;\n var sectionCount = 0;\n var pageIndex = 0;\n var length = this.document.sections.count;\n for (var i = 0; i < length; i++) {\n var section = this.document.sections.section[i];\n sectionCount = section.count;\n pageIndex = index - sectionStartIndex;\n // We found a section containing the page.\n if ((index >= sectionStartIndex && pageIndex < sectionCount)) {\n page = section.getPages()[pageIndex];\n break;\n }\n sectionStartIndex += sectionCount;\n }\n return page;\n };\n /**\n * Gets the `index of` the page in the document.\n * @private\n */\n PdfDocumentPageCollection.prototype.indexOf = function (page) {\n var index = -1;\n if (page == null) {\n throw new Error('ArgumentNullException: page');\n }\n else {\n var numPages = 0;\n for (var i = 0, len = this.document.sections.count; i < len; i++) {\n var section = this.document.sections.pdfSectionCollection(i);\n index = section.indexOf(page);\n if (index >= 0) {\n index += numPages;\n break;\n }\n else {\n index = -1;\n }\n numPages += section.count;\n }\n }\n return index;\n };\n /**\n * `Removes` the specified page.\n * @private\n */\n PdfDocumentPageCollection.prototype.remove = function (page) {\n if (page == null) {\n throw Error('ArgumentNullException(\"page\")');\n }\n var section = null;\n var len;\n for (var i = 0, len_1 = this.document.sections.count; i < len_1; i++) {\n section = this.document.sections.pdfSectionCollection(i);\n if (section.pages.contains(page)) {\n section.pages.remove(page);\n break;\n }\n }\n return section;\n };\n return PdfDocumentPageCollection;\n}());\nexport { PdfDocumentPageCollection };\n","/**\n * PdfCacheCollection.ts class for EJ2-PDF\n */\nimport { Dictionary } from './../collections/dictionary';\n/**\n * `Collection of the cached objects`.\n * @private\n */\nvar PdfCacheCollection = /** @class */ (function () {\n // Constructors\n /**\n * Initializes a new instance of the `PdfCacheCollection` class.\n * @private\n */\n function PdfCacheCollection() {\n this.referenceObjects = [];\n this.pdfFontCollection = new Dictionary();\n }\n // Public methods\n /**\n * `Searches` for the similar cached object. If is not found - adds the object to the cache.\n * @private\n */\n PdfCacheCollection.prototype.search = function (obj) {\n var result = null;\n var group = this.getGroup(obj);\n if (group == null) {\n group = this.createNewGroup();\n }\n else if (group.length > 0) {\n result = group[0];\n }\n group.push(obj);\n return result;\n };\n // Implementation\n /**\n * `Creates` a new group.\n * @private\n */\n PdfCacheCollection.prototype.createNewGroup = function () {\n var group = [];\n this.referenceObjects.push(group);\n return group;\n };\n /**\n * `Find and Return` a group.\n * @private\n */\n PdfCacheCollection.prototype.getGroup = function (result) {\n var group = null;\n if (result !== null) {\n var len = this.referenceObjects.length;\n for (var i = 0; i < len; i++) {\n if (this.referenceObjects.length > 0) {\n var tGroup = this.referenceObjects[i];\n if (tGroup.length > 0) {\n var representative = tGroup[0];\n if (result.equalsTo(representative)) {\n group = tGroup;\n break;\n }\n }\n else {\n this.removeGroup(tGroup);\n }\n }\n len = this.referenceObjects.length;\n }\n }\n return group;\n };\n /**\n * Remove a group from the storage.\n */\n PdfCacheCollection.prototype.removeGroup = function (group) {\n if (group !== null) {\n var index = this.referenceObjects.indexOf(group);\n this.referenceObjects.slice(index, index + 1);\n }\n };\n PdfCacheCollection.prototype.destroy = function () {\n this.pdfFontCollection = undefined;\n this.referenceObjects = undefined;\n };\n return PdfCacheCollection;\n}());\nexport { PdfCacheCollection };\n","/**\n * PdfStandardFontMetricsFactory.ts class for EJ2-PDF\n */\nimport { PdfFontStyle, PdfFontFamily } from './enum';\nimport { PdfFontMetrics, StandardWidthTable } from './pdf-font-metrics';\n/**\n * @private\n * `Factory of the standard fonts metrics`.\n */\nvar PdfStandardFontMetricsFactory = /** @class */ (function () {\n function PdfStandardFontMetricsFactory() {\n }\n /**\n * Returns `metrics` of the font.\n * @private\n */\n PdfStandardFontMetricsFactory.getMetrics = function (fontFamily, fontStyle, size) {\n var metrics = null;\n switch (fontFamily) {\n case PdfFontFamily.Helvetica:\n metrics = this.getHelveticaMetrics(fontFamily, fontStyle, size);\n break;\n case PdfFontFamily.Courier:\n metrics = this.getCourierMetrics(fontFamily, fontStyle, size);\n break;\n case PdfFontFamily.TimesRoman:\n metrics = this.getTimesMetrics(fontFamily, fontStyle, size);\n break;\n case PdfFontFamily.Symbol:\n metrics = this.getSymbolMetrics(fontFamily, fontStyle, size);\n break;\n case PdfFontFamily.ZapfDingbats:\n metrics = this.getZapfDingbatsMetrics(fontFamily, fontStyle, size);\n break;\n default:\n metrics = this.getHelveticaMetrics(PdfFontFamily.Helvetica, fontStyle, size);\n break;\n }\n metrics.name = fontFamily.toString();\n metrics.subScriptSizeFactor = this.subSuperScriptFactor;\n metrics.superscriptSizeFactor = this.subSuperScriptFactor;\n return metrics;\n };\n // Implementation\n /**\n * Creates `Helvetica font metrics`.\n * @private\n */\n PdfStandardFontMetricsFactory.getHelveticaMetrics = function (fontFamily, fontStyle, size) {\n var metrics = new PdfFontMetrics();\n if ((fontStyle & PdfFontStyle.Bold) > 0 && (fontStyle & PdfFontStyle.Italic) > 0) {\n metrics.ascent = this.helveticaBoldItalicAscent;\n metrics.descent = this.helveticaBoldItalicDescent;\n metrics.postScriptName = this.helveticaBoldItalicName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.arialBoldWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n else if ((fontStyle & PdfFontStyle.Bold) > 0) {\n metrics.ascent = this.helveticaBoldAscent;\n metrics.descent = this.helveticaBoldDescent;\n metrics.postScriptName = this.helveticaBoldName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.arialBoldWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n else if ((fontStyle & PdfFontStyle.Italic) > 0) {\n metrics.ascent = this.helveticaItalicAscent;\n metrics.descent = this.helveticaItalicDescent;\n metrics.postScriptName = this.helveticaItalicName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.arialWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n else {\n metrics.ascent = this.helveticaAscent;\n metrics.descent = this.helveticaDescent;\n metrics.postScriptName = this.helveticaName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.arialWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n return metrics;\n };\n /**\n * Creates `Courier font metrics`.\n * @private\n */\n PdfStandardFontMetricsFactory.getCourierMetrics = function (fontFamily, fontStyle, size) {\n var metrics = new PdfFontMetrics();\n if ((fontStyle & PdfFontStyle.Bold) > 0 && (fontStyle & PdfFontStyle.Italic) > 0) {\n metrics.ascent = this.courierBoldItalicAscent;\n metrics.descent = this.courierBoldItalicDescent;\n metrics.postScriptName = this.courierBoldItalicName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.fixedWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n else if ((fontStyle & PdfFontStyle.Bold) > 0) {\n metrics.ascent = this.courierBoldAscent;\n metrics.descent = this.courierBoldDescent;\n metrics.postScriptName = this.courierBoldName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.fixedWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n else if ((fontStyle & PdfFontStyle.Italic) > 0) {\n metrics.ascent = this.courierItalicAscent;\n metrics.descent = this.courierItalicDescent;\n metrics.postScriptName = this.courierItalicName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.fixedWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n else {\n metrics.ascent = this.courierAscent;\n metrics.descent = this.courierDescent;\n metrics.postScriptName = this.courierName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.fixedWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n return metrics;\n };\n /**\n * Creates `Times font metrics`.\n * @private\n */\n PdfStandardFontMetricsFactory.getTimesMetrics = function (fontFamily, fontStyle, size) {\n var metrics = new PdfFontMetrics();\n if ((fontStyle & PdfFontStyle.Bold) > 0 && (fontStyle & PdfFontStyle.Italic) > 0) {\n metrics.ascent = this.timesBoldItalicAscent;\n metrics.descent = this.timesBoldItalicDescent;\n metrics.postScriptName = this.timesBoldItalicName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.timesRomanBoldItalicWidths);\n metrics.height = metrics.ascent - metrics.descent;\n }\n else if ((fontStyle & PdfFontStyle.Bold) > 0) {\n metrics.ascent = this.timesBoldAscent;\n metrics.descent = this.timesBoldDescent;\n metrics.postScriptName = this.timesBoldName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.timesRomanBoldWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n else if ((fontStyle & PdfFontStyle.Italic) > 0) {\n metrics.ascent = this.timesItalicAscent;\n metrics.descent = this.timesItalicDescent;\n metrics.postScriptName = this.timesItalicName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.timesRomanItalicWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n else {\n metrics.ascent = this.timesAscent;\n metrics.descent = this.timesDescent;\n metrics.postScriptName = this.timesName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.timesRomanWidth);\n metrics.height = metrics.ascent - metrics.descent;\n }\n return metrics;\n };\n /**\n * Creates `Symbol font metrics`.\n * @private\n */\n PdfStandardFontMetricsFactory.getSymbolMetrics = function (fontFamily, fontStyle, size) {\n var metrics = new PdfFontMetrics();\n metrics.ascent = this.symbolAscent;\n metrics.descent = this.symbolDescent;\n metrics.postScriptName = this.symbolName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.symbolWidth);\n metrics.height = metrics.ascent - metrics.descent;\n return metrics;\n };\n /**\n * Creates `ZapfDingbats font metrics`.\n * @private\n */\n PdfStandardFontMetricsFactory.getZapfDingbatsMetrics = function (fontFamily, fontStyle, size) {\n var metrics = new PdfFontMetrics();\n metrics.ascent = this.zapfDingbatsAscent;\n metrics.descent = this.zapfDingbatsDescent;\n metrics.postScriptName = this.zapfDingbatsName;\n metrics.size = size;\n metrics.widthTable = new StandardWidthTable(this.zapfDingbatsWidth);\n metrics.height = metrics.ascent - metrics.descent;\n return metrics;\n };\n /**\n * `Multiplier` os subscript superscript.\n * @private\n */\n PdfStandardFontMetricsFactory.subSuperScriptFactor = 1.52;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaAscent = 931;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaDescent = -225;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaName = 'Helvetica';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaBoldAscent = 962;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaBoldDescent = -228;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaBoldName = 'Helvetica-Bold';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaItalicAscent = 931;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaItalicDescent = -225;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaItalicName = 'Helvetica-Oblique';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaBoldItalicAscent = 962;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaBoldItalicDescent = -228;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.helveticaBoldItalicName = 'Helvetica-BoldOblique';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.courierAscent = 805;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.courierDescent = -250;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.courierName = 'Courier';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.courierBoldAscent = 801;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.courierBoldDescent = -250;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.courierBoldName = 'Courier-Bold';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.courierItalicAscent = 805;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.courierItalicDescent = -250;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.courierItalicName = 'Courier-Oblique';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.courierBoldItalicAscent = 801;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.courierBoldItalicDescent = -250;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.courierBoldItalicName = 'Courier-BoldOblique';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.timesAscent = 898;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.timesDescent = -218;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.timesName = 'Times-Roman';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.timesBoldAscent = 935;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.timesBoldDescent = -218;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.timesBoldName = 'Times-Bold';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.timesItalicAscent = 883;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.timesItalicDescent = -217;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.timesItalicName = 'Times-Italic';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.timesBoldItalicAscent = 921;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.timesBoldItalicDescent = -218;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.timesBoldItalicName = 'Times-BoldItalic';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.symbolAscent = 1010;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.symbolDescent = -293;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.symbolName = 'Symbol';\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.zapfDingbatsAscent = 820;\n /**\n * `Ascender` value for the font.\n * @private\n */\n PdfStandardFontMetricsFactory.zapfDingbatsDescent = -143;\n /**\n * `Font type`.\n * @private\n */\n PdfStandardFontMetricsFactory.zapfDingbatsName = 'ZapfDingbats';\n /**\n * `Arial` widths table.\n * @private\n */\n PdfStandardFontMetricsFactory.arialWidth = [\n 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333,\n 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584,\n 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833,\n 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278,\n 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833,\n 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334,\n 584, 0, 556, 0, 222, 556, 333, 1000, 556, 556, 333, 1000, 667, 333, 1000, 0,\n 611, 0, 0, 222, 222, 333, 333, 350, 556, 1000, 333, 1000, 500, 333, 944, 0,\n 500, 667, 0, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 0,\n 737, 333, 400, 584, 333, 333, 333, 556, 537, 278, 333, 333, 365, 556, 834, 834,\n 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278,\n 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667,\n 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278,\n 278, 278, 556, 556, 556, 556, 556, 556, 556, 584, 611, 556, 556, 556, 556, 500,\n 556, 500\n ];\n /**\n * `Arial bold` widths table.\n * @private\n */\n PdfStandardFontMetricsFactory.arialBoldWidth = [\n 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333,\n 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584,\n 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833,\n 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333,\n 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889,\n 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389,\n 584, 0, 556, 0, 278, 556, 500, 1000, 556, 556, 333, 1000, 667, 333, 1000, 0,\n 611, 0, 0, 278, 278, 500, 500, 350, 556, 1000, 333, 1000, 556, 333, 944, 0,\n 500, 667, 0, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 0,\n 737, 333, 400, 584, 333, 333, 333, 611, 556, 278, 333, 333, 365, 556, 834, 834,\n 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278,\n 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667,\n 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278,\n 278, 278, 611, 611, 611, 611, 611, 611, 611, 584, 611, 611, 611, 611, 611, 556,\n 611, 556\n ];\n /**\n * `Fixed` widths table.\n * @private\n */\n PdfStandardFontMetricsFactory.fixedWidth = [\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,\n 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600\n ];\n /**\n * `Times` widths table.\n * @private\n */\n PdfStandardFontMetricsFactory.timesRomanWidth = [\n 250, 333, 408, 500, 500, 833, 778, 180, 333, 333, 500, 564, 250, 333,\n 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278, 564, 564,\n 564, 444, 921, 722, 667, 667, 722, 611, 556, 722, 722, 333, 389, 722, 611, 889,\n 722, 722, 556, 722, 667, 556, 611, 722, 722, 944, 722, 722, 611, 333, 278, 333,\n 469, 500, 333, 444, 500, 444, 500, 444, 333, 500, 500, 278, 278, 500, 278, 778,\n 500, 500, 500, 500, 333, 389, 278, 500, 500, 722, 500, 500, 444, 480, 200, 480,\n 541, 0, 500, 0, 333, 500, 444, 1000, 500, 500, 333, 1000, 556, 333, 889, 0,\n 611, 0, 0, 333, 333, 444, 444, 350, 500, 1000, 333, 980, 389, 333, 722, 0,\n 444, 722, 0, 333, 500, 500, 500, 500, 200, 500, 333, 760, 276, 500, 564, 0,\n 760, 333, 400, 564, 300, 300, 333, 500, 453, 250, 333, 300, 310, 500, 750, 750,\n 750, 444, 722, 722, 722, 722, 722, 722, 889, 667, 611, 611, 611, 611, 333, 333,\n 333, 333, 722, 722, 722, 722, 722, 722, 722, 564, 722, 722, 722, 722, 722, 722,\n 556, 500, 444, 444, 444, 444, 444, 444, 667, 444, 444, 444, 444, 444, 278, 278,\n 278, 278, 500, 500, 500, 500, 500, 500, 500, 564, 500, 500, 500, 500, 500, 500,\n 500, 500\n ];\n /**\n * `Times bold` widths table.\n * @private\n */\n PdfStandardFontMetricsFactory.timesRomanBoldWidth = [\n 250, 333, 555, 500, 500, 1000, 833, 278, 333, 333, 500, 570, 250, 333,\n 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 570, 570,\n 570, 500, 930, 722, 667, 722, 722, 667, 611, 778, 778, 389, 500, 778, 667, 944,\n 722, 778, 611, 778, 722, 556, 667, 722, 722, 1000, 722, 722, 667, 333, 278, 333,\n 581, 500, 333, 500, 556, 444, 556, 444, 333, 500, 556, 278, 333, 556, 278, 833,\n 556, 500, 556, 556, 444, 389, 333, 556, 500, 722, 500, 500, 444, 394, 220, 394,\n 520, 0, 500, 0, 333, 500, 500, 1000, 500, 500, 333, 1000, 556, 333, 1000, 0,\n 667, 0, 0, 333, 333, 500, 500, 350, 500, 1000, 333, 1000, 389, 333, 722, 0,\n 444, 722, 0, 333, 500, 500, 500, 500, 220, 500, 333, 747, 300, 500, 570, 0,\n 747, 333, 400, 570, 300, 300, 333, 556, 540, 250, 333, 300, 330, 500, 750, 750,\n 750, 500, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 389, 389,\n 389, 389, 722, 722, 778, 778, 778, 778, 778, 570, 778, 722, 722, 722, 722, 722,\n 611, 556, 500, 500, 500, 500, 500, 500, 722, 444, 444, 444, 444, 444, 278, 278,\n 278, 278, 500, 556, 500, 500, 500, 500, 500, 570, 500, 556, 556, 556, 556, 500,\n 556, 500\n ];\n /**\n * `Times italic` widths table.\n * @private\n */\n PdfStandardFontMetricsFactory.timesRomanItalicWidth = [\n 250, 333, 420, 500, 500, 833, 778, 214, 333, 333, 500, 675, 250, 333,\n 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 675, 675,\n 675, 500, 920, 611, 611, 667, 722, 611, 611, 722, 722, 333, 444, 667, 556, 833,\n 667, 722, 611, 722, 611, 500, 556, 722, 611, 833, 611, 556, 556, 389, 278, 389,\n 422, 500, 333, 500, 500, 444, 500, 444, 278, 500, 500, 278, 278, 444, 278, 722,\n 500, 500, 500, 500, 389, 389, 278, 500, 444, 667, 444, 444, 389, 400, 275, 400,\n 541, 0, 500, 0, 333, 500, 556, 889, 500, 500, 333, 1000, 500, 333, 944, 0,\n 556, 0, 0, 333, 333, 556, 556, 350, 500, 889, 333, 980, 389, 333, 667, 0,\n 389, 556, 0, 389, 500, 500, 500, 500, 275, 500, 333, 760, 276, 500, 675, 0,\n 760, 333, 400, 675, 300, 300, 333, 500, 523, 250, 333, 300, 310, 500, 750, 750,\n 750, 500, 611, 611, 611, 611, 611, 611, 889, 667, 611, 611, 611, 611, 333, 333,\n 333, 333, 722, 667, 722, 722, 722, 722, 722, 675, 722, 722, 722, 722, 722, 556,\n 611, 500, 500, 500, 500, 500, 500, 500, 667, 444, 444, 444, 444, 444, 278, 278,\n 278, 278, 500, 500, 500, 500, 500, 500, 500, 675, 500, 500, 500, 500, 500, 444,\n 500, 444\n ];\n /**\n * `Times bold italic` widths table.\n * @private\n */\n PdfStandardFontMetricsFactory.timesRomanBoldItalicWidths = [\n 250, 389, 555, 500, 500, 833, 778, 278, 333, 333, 500, 570, 250, 333,\n 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 570, 570,\n 570, 500, 832, 667, 667, 667, 722, 667, 667, 722, 778, 389, 500, 667, 611, 889,\n 722, 722, 611, 722, 667, 556, 611, 722, 667, 889, 667, 611, 611, 333, 278, 333,\n 570, 500, 333, 500, 500, 444, 500, 444, 333, 500, 556, 278, 278, 500, 278, 778,\n 556, 500, 500, 500, 389, 389, 278, 556, 444, 667, 500, 444, 389, 348, 220, 348,\n 570, 0, 500, 0, 333, 500, 500, 1000, 500, 500, 333, 1000, 556, 333, 944, 0,\n 611, 0, 0, 333, 333, 500, 500, 350, 500, 1000, 333, 1000, 389, 333, 722, 0,\n 389, 611, 0, 389, 500, 500, 500, 500, 220, 500, 333, 747, 266, 500, 606, 0,\n 747, 333, 400, 570, 300, 300, 333, 576, 500, 250, 333, 300, 300, 500, 750, 750,\n 750, 500, 667, 667, 667, 667, 667, 667, 944, 667, 667, 667, 667, 667, 389, 389,\n 389, 389, 722, 722, 722, 722, 722, 722, 722, 570, 722, 722, 722, 722, 722, 611,\n 611, 500, 500, 500, 500, 500, 500, 500, 722, 444, 444, 444, 444, 444, 278, 278,\n 278, 278, 500, 556, 500, 500, 500, 500, 500, 570, 500, 556, 556, 556, 556, 444,\n 500, 444\n ];\n /**\n * `Symbol` widths table.\n * @private\n */\n PdfStandardFontMetricsFactory.symbolWidth = [\n 250, 333, 713, 500, 549, 833, 778, 439, 333, 333, 500, 549, 250, 549,\n 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278,\n 549, 549, 549, 444, 549, 722, 667, 722, 612, 611, 763, 603, 722, 333,\n 631, 722, 686, 889, 722, 722, 768, 741, 556, 592, 611, 690, 439, 768,\n 645, 795, 611, 333, 863, 333, 658, 500, 500, 631, 549, 549, 494, 439,\n 521, 411, 603, 329, 603, 549, 549, 576, 521, 549, 549, 521, 549, 603,\n 439, 576, 713, 686, 493, 686, 494, 480, 200, 480, 549, 750, 620, 247,\n 549, 167, 713, 500, 753, 753, 753, 753, 1042, 987, 603, 987, 603, 400,\n 549, 411, 549, 549, 713, 494, 460, 549, 549, 549, 549, 1000, 603, 1000,\n 658, 823, 686, 795, 987, 768, 768, 823, 768, 768, 713, 713, 713, 713,\n 713, 713, 713, 768, 713, 790, 790, 890, 823, 549, 250, 713, 603, 603,\n 1042, 987, 603, 987, 603, 494, 329, 790, 790, 786, 713, 384, 384, 384,\n 384, 384, 384, 494, 494, 494, 494, 329, 274, 686, 686, 686, 384, 384,\n 384, 384, 384, 384, 494, 494, 494, -1\n ];\n /**\n * `Zip dingbats` widths table.\n * @private\n */\n PdfStandardFontMetricsFactory.zapfDingbatsWidth = [\n 278, 974, 961, 974, 980, 719, 789, 790, 791, 690, 960, 939, 549, 855,\n 911, 933, 911, 945, 974, 755, 846, 762, 761, 571, 677, 763, 760, 759,\n 754, 494, 552, 537, 577, 692, 786, 788, 788, 790, 793, 794, 816, 823,\n 789, 841, 823, 833, 816, 831, 923, 744, 723, 749, 790, 792, 695, 776,\n 768, 792, 759, 707, 708, 682, 701, 826, 815, 789, 789, 707, 687, 696,\n 689, 786, 787, 713, 791, 785, 791, 873, 761, 762, 762, 759, 759, 892,\n 892, 788, 784, 438, 138, 277, 415, 392, 392, 668, 668, 390, 390, 317,\n 317, 276, 276, 509, 509, 410, 410, 234, 234, 334, 334, 732, 544, 544,\n 910, 667, 760, 760, 776, 595, 694, 626, 788, 788, 788, 788, 788, 788,\n 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788,\n 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788,\n 788, 788, 788, 788, 788, 788, 894, 838, 1016, 458, 748, 924, 748, 918,\n 927, 928, 928, 834, 873, 828, 924, 924, 917, 930, 931, 463, 883, 836,\n 836, 867, 867, 696, 696, 874, 874, 760, 946, 771, 865, 771, 888, 967,\n 888, 831, 873, 927, 970, 918\n ];\n return PdfStandardFontMetricsFactory;\n}());\nexport { PdfStandardFontMetricsFactory };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { PdfFontFamily, PdfFontStyle, FontEncoding } from './enum';\nimport { PdfFont } from './pdf-font';\nimport { PdfDocument } from './../../document/pdf-document';\nimport { PdfStandardFontMetricsFactory } from './pdf-standard-font-metrics-factory';\nimport { PdfDictionary } from './../../primitives/pdf-dictionary';\nimport { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';\nimport { PdfName } from './../../primitives/pdf-name';\n/**\n * Represents one of the 14 standard fonts.\n * It's used to create a standard PDF font to draw the text in to the PDF.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a new page to the document\n * let page1 : PdfPage = document.pages.add();\n * //\n * // create new standard font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * //\n * // create black brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(0, 0));\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\nvar PdfStandardFont = /** @class */ (function (_super) {\n __extends(PdfStandardFont, _super);\n function PdfStandardFont(fontFamilyPrototype, size, style) {\n var _this = _super.call(this, size, (typeof style === 'undefined') ? ((fontFamilyPrototype instanceof PdfStandardFont) ? fontFamilyPrototype.style : PdfFontStyle.Regular) : style) || this;\n /**\n * Gets `ascent` of the font.\n * @private\n */\n _this.dictionaryProperties = new DictionaryProperties();\n /**\n * Gets `encodings` for internal class use.\n * @hidden\n * @private\n */\n _this.encodings = ['Unknown', 'StandardEncoding', 'MacRomanEncoding', 'MacExpertEncoding',\n 'WinAnsiEncoding', 'PDFDocEncoding', 'IdentityH'];\n if (typeof fontFamilyPrototype === 'undefined') {\n _this.pdfFontFamily = PdfFontFamily.Helvetica;\n }\n else if ((fontFamilyPrototype instanceof PdfStandardFont)) {\n _this.pdfFontFamily = fontFamilyPrototype.fontFamily;\n }\n else {\n _this.pdfFontFamily = fontFamilyPrototype;\n }\n _this.checkStyle();\n _this.initializeInternals();\n return _this;\n }\n Object.defineProperty(PdfStandardFont.prototype, \"fontFamily\", {\n /* tslint:enable */\n //Properties\n /**\n * Gets the `FontFamily`.\n * @private\n */\n get: function () {\n return this.pdfFontFamily;\n },\n enumerable: true,\n configurable: true\n });\n //methods\n /**\n * Checks font `style` of the font.\n * @private\n */\n PdfStandardFont.prototype.checkStyle = function () {\n if (this.fontFamily === PdfFontFamily.Symbol || this.fontFamily === PdfFontFamily.ZapfDingbats) {\n var style = this.style;\n style &= ~(PdfFontStyle.Bold | PdfFontStyle.Italic);\n this.setStyle(style);\n }\n };\n /**\n * Returns `width` of the line.\n * @public\n */\n PdfStandardFont.prototype.getLineWidth = function (line, format) {\n if (line == null) {\n throw new Error('ArgumentNullException:line');\n }\n var width = 0;\n var name = this.name;\n line = PdfStandardFont.convert(line);\n for (var i = 0, len = line.length; i < len; i++) {\n var ch = line[i];\n var charWidth = this.getCharWidthInternal(ch, format);\n width += charWidth;\n }\n var size = this.metrics.getSize(format);\n width *= (PdfFont.charSizeMultiplier * size);\n width = this.applyFormatSettings(line, format, width);\n return width;\n };\n /**\n * Checks whether fonts are `equals`.\n * @private\n */\n PdfStandardFont.prototype.equalsToFont = function (font) {\n var equal = false;\n var stFont = font;\n if (stFont != null) {\n var fontFamilyEqual = (this.fontFamily === stFont.fontFamily);\n var lineReducer = (~(PdfFontStyle.Underline | PdfFontStyle.Strikeout));\n var styleEqual = (this.style & lineReducer) === (stFont.style & lineReducer);\n equal = (fontFamilyEqual && styleEqual);\n }\n return equal;\n };\n /**\n * `Initializes` font internals..\n * @private\n */\n PdfStandardFont.prototype.initializeInternals = function () {\n var equalFont = null;\n // if (PdfDocument.EnableCache) {\n equalFont = PdfDocument.cache.search(this);\n // }\n var internals = null;\n // if (equalFont == null) {\n // Create font metrics.\n var metrics = PdfStandardFontMetricsFactory.getMetrics(this.pdfFontFamily, this.style, this.size);\n this.metrics = metrics;\n internals = this.createInternals();\n this.setInternals(internals);\n };\n /**\n * `Creates` font`s dictionary.\n * @private\n */\n PdfStandardFont.prototype.createInternals = function () {\n var dictionary = new PdfDictionary();\n dictionary.items.setValue(this.dictionaryProperties.type, new PdfName(this.dictionaryProperties.font));\n dictionary.items.setValue(this.dictionaryProperties.subtype, new PdfName(this.dictionaryProperties.type1));\n dictionary.items.setValue(this.dictionaryProperties.baseFont, new PdfName(this.metrics.postScriptName));\n if (this.fontFamily !== PdfFontFamily.Symbol && this.fontFamily !== PdfFontFamily.ZapfDingbats) {\n var encoding = this.encodings[FontEncoding.WinAnsiEncoding];\n dictionary.items.setValue(this.dictionaryProperties.encoding, new PdfName(encoding));\n }\n return dictionary;\n };\n /**\n * Returns `width` of the char. This methods doesn`t takes into consideration font`s size.\n * @private\n */\n PdfStandardFont.prototype.getCharWidthInternal = function (charCode, format) {\n var width = 0;\n var code = 0;\n code = charCode.charCodeAt(0);\n if (this.name === '0' || this.name === '1' || this.name === '2' ||\n this.name === '3' || this.name === '4') {\n code = code - PdfStandardFont.charOffset;\n }\n code = (code >= 0 && code !== 128) ? code : 0;\n var metrics = this.metrics;\n var widthTable = metrics.widthTable;\n width = widthTable.items(code);\n return width;\n };\n /**\n * `Converts` the specified text.\n * @private\n */\n PdfStandardFont.convert = function (text) {\n return text;\n };\n //Constants\n /**\n * First character `position`.\n * @private\n */\n PdfStandardFont.charOffset = 32;\n return PdfStandardFont;\n}(PdfFont));\nexport { PdfStandardFont };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { PdfWriter } from './../input-output/pdf-writer';\nimport { PdfMainObjectCollection } from './../input-output/pdf-main-object-collection';\nimport { PdfDocumentBase } from './pdf-document-base';\nimport { PdfCrossTable } from './../input-output/pdf-cross-table';\nimport { PdfCatalog } from './pdf-catalog';\nimport { PdfPageSettings } from './../pages/pdf-page-settings';\nimport { PdfSectionCollection } from './../pages/pdf-section-collection';\nimport { PdfDocumentPageCollection } from './../pages/pdf-document-page-collection';\nimport { PdfCacheCollection } from './../general/pdf-cache-collection';\nimport { PdfColorSpace } from './../graphics/enum';\nimport { PdfDocumentTemplate } from './pdf-document-template';\nimport { PdfFontFamily } from './../graphics/fonts/enum';\nimport { PdfStandardFont } from './../graphics/fonts/pdf-standard-font';\n/**\n * Represents a PDF document and can be used to create a new PDF document from the scratch.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a new page to the document\n * let page1 : PdfPage = document.pages.add();\n * // set the font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // create black brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(0, 0));\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\nvar PdfDocument = /** @class */ (function (_super) {\n __extends(PdfDocument, _super);\n function PdfDocument(isMerging) {\n var _this = _super.call(this) || this;\n /**\n * Default `margin` value.\n * @default 40.0\n * @private\n */\n _this.defaultMargin = 40.0;\n /**\n * Internal variable to store instance of `StreamWriter` classes..\n * @default null\n * @private\n */\n _this.streamWriter = null;\n _this.document = _this;\n var isMerge = false;\n if (typeof isMerging === 'undefined') {\n PdfDocument.cacheCollection = new PdfCacheCollection();\n isMerge = false;\n }\n else {\n isMerge = isMerging;\n }\n var objects = new PdfMainObjectCollection();\n _this.setMainObjectCollection(objects);\n var crossTable = new PdfCrossTable();\n crossTable.isMerging = isMerge;\n crossTable.document = _this;\n _this.setCrossTable(crossTable);\n var catalog = new PdfCatalog();\n _this.setCatalog(catalog);\n objects.add(catalog);\n catalog.position = -1;\n _this.sectionCollection = new PdfSectionCollection(_this);\n _this.documentPageCollection = new PdfDocumentPageCollection(_this);\n catalog.pages = _this.sectionCollection;\n return _this;\n }\n Object.defineProperty(PdfDocument, \"defaultFont\", {\n //Properties\n /**\n * Gets the `default font`. It is used for complex objects when font is not explicitly defined.\n * @private\n */\n get: function () {\n if (this.defaultStandardFont == null) {\n this.defaultStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 8);\n }\n return this.defaultStandardFont;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocument.prototype, \"sections\", {\n /**\n * Gets the collection of the `sections` in the document.\n * @private\n */\n get: function () {\n return this.sectionCollection;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocument.prototype, \"pageSettings\", {\n /**\n * Gets the document's page setting.\n * @public\n */\n get: function () {\n if (this.settings == null) {\n this.settings = new PdfPageSettings(this.defaultMargin);\n }\n return this.settings;\n },\n /**\n * Sets the document's page setting.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n *\n * // sets the right margin of the page\n * document.pageSettings.margins.right = 0;\n * // set the page size.\n * document.pageSettings.size = new SizeF(500, 500);\n * // change the page orientation to landscape\n * document.pageSettings.orientation = PdfPageOrientation.Landscape;\n * // apply 90 degree rotation on the page\n * document.pageSettings.rotate = PdfPageRotateAngle.RotateAngle90;\n *\n * // add a pages to the document\n * let page1 : PdfPage = document.pages.add();\n * // set font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // set brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // set the specified Point\n * let point : PointF = new PointF(page1.getClientSize().width - 200, page1.getClientSize().height - 200);\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, point);\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n set: function (value) {\n this.settings = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocument.prototype, \"pages\", {\n /**\n * Represents the collection of pages in the PDF document.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * //\n * // get the collection of pages in the document\n * let pageCollection : PdfDocumentPageCollection = document.pages;\n * //\n * // add pages\n * let page1 : PdfPage = pageCollection.add();\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n get: function () {\n return this.documentPageCollection;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocument, \"cache\", {\n /**\n * Gets collection of the `cached objects`.\n * @private\n */\n get: function () {\n if (typeof PdfDocument.cacheCollection === 'undefined' || PdfDocument.cacheCollection == null) {\n return new PdfCacheCollection();\n }\n return PdfDocument.cacheCollection;\n },\n /**\n * Sets collection of the `cached objects`.\n * @private\n */\n set: function (value) {\n this.cacheCollection = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocument, \"enableCache\", {\n /**\n * Gets the value of enable cache.\n * @private\n */\n get: function () {\n return this.isCacheEnabled;\n },\n /**\n * Sets thie value of enable cache.\n * @private\n */\n set: function (value) {\n this.isCacheEnabled = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocument.prototype, \"colorSpace\", {\n /* tslint:disable */\n /**\n * Gets or sets the `color space` of the document. This property can be used to create PDF document in RGB, Gray scale or CMYK color spaces.\n * @private\n */\n get: function () {\n if ((this.pdfColorSpace === PdfColorSpace.Rgb) || ((this.pdfColorSpace === PdfColorSpace.Cmyk)\n || (this.pdfColorSpace === PdfColorSpace.GrayScale))) {\n return this.pdfColorSpace;\n }\n else {\n return PdfColorSpace.Rgb;\n }\n },\n set: function (value) {\n if ((value === PdfColorSpace.Rgb) || ((value === PdfColorSpace.Cmyk) ||\n (value === PdfColorSpace.GrayScale))) {\n this.pdfColorSpace = value;\n }\n else {\n this.pdfColorSpace = PdfColorSpace.Rgb;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfDocument.prototype, \"template\", {\n /* tslint:enable */\n /**\n * Gets or sets a `template` to all pages in the document.\n * @private\n */\n get: function () {\n if (this.pageTemplate == null) {\n this.pageTemplate = new PdfDocumentTemplate();\n }\n return this.pageTemplate;\n },\n set: function (value) {\n this.pageTemplate = value;\n },\n enumerable: true,\n configurable: true\n });\n PdfDocument.prototype.docSave = function (stream, arg2, arg3) {\n this.checkPagesPresence();\n if (stream === null) {\n throw new Error('ArgumentNullException : stream');\n }\n this.streamWriter = stream;\n var writer = new PdfWriter(stream);\n writer.document = this;\n if (typeof arg2 === 'boolean' && typeof arg3 === 'undefined') {\n return this.crossTable.save(writer);\n }\n else {\n this.crossTable.save(writer, arg2);\n }\n };\n /**\n * Checks the pages `presence`.\n * @private\n */\n PdfDocument.prototype.checkPagesPresence = function () {\n if (this.pages.count === 0) {\n this.pages.add();\n }\n };\n /**\n * disposes the current instance of `PdfDocument` class.\n * ```typescript\n * // create a new PDF document\n * let document : PdfDocument = new PdfDocument();\n * // add a new page to the document\n * let page1 : PdfPage = document.pages.add();\n * // set the font\n * let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);\n * // create black brush\n * let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));\n * // draw the text\n * page1.graphics.drawString('Hello World', font, blackBrush, new PointF(0, 0));\n * // save the document\n * document.save('output.pdf');\n * // destroy the document\n * document.destroy();\n * ```\n */\n PdfDocument.prototype.destroy = function () {\n this.catalog = undefined;\n this.colorSpace = undefined;\n this.currentSavingObj = undefined;\n this.documentPageCollection = undefined;\n this.isStreamCopied = undefined;\n this.pageSettings = undefined;\n this.pageTemplate = undefined;\n this.pdfColorSpace = undefined;\n this.sectionCollection = undefined;\n PdfDocument.cache.destroy();\n this.crossTable.pdfObjects.destroy();\n PdfDocument.cache = undefined;\n this.streamWriter.destroy();\n };\n /**\n * `Font` used in complex objects to draw strings and text when it is not defined explicitly.\n * @default null\n * @private\n */\n PdfDocument.defaultStandardFont = null;\n /**\n * Indicates whether enable cache or not\n * @default true\n * @private\n */\n PdfDocument.isCacheEnabled = true;\n return PdfDocument;\n}(PdfDocumentBase));\nexport { PdfDocument };\n","/**\n * PdfPageTemplateElement.ts class for EJ2-Pdf\n */\nimport { PdfDockStyle, PdfAlignmentStyle, TemplateType } from './enum';\nimport { PointF, SizeF } from './../drawing/pdf-drawing';\nimport { PdfTemplate } from './../graphics/figures/pdf-template';\nimport { PdfPage } from './pdf-page';\nimport { RectangleF } from './../drawing/pdf-drawing';\n/**\n * Describes a `page template` object that can be used as header/footer, watermark or stamp.\n */\nvar PdfPageTemplateElement = /** @class */ (function () {\n /* tslint:disable */\n function PdfPageTemplateElement(arg1, arg2, arg3, arg4, arg5) {\n if (arg1 instanceof RectangleF && typeof arg2 === 'undefined') {\n this.InitiateBounds(arg1.x, arg1.y, arg1.width, arg1.height, null);\n }\n else if (arg1 instanceof RectangleF && arg2 instanceof PdfPage && typeof arg3 === 'undefined') {\n this.InitiateBounds(arg1.x, arg1.y, arg1.width, arg1.height, arg2);\n }\n else if (arg1 instanceof PointF && arg2 instanceof SizeF && typeof arg3 === 'undefined') {\n this.InitiateBounds(arg1.x, arg1.y, arg2.width, arg2.height, null);\n }\n else if (arg1 instanceof PointF && arg2 instanceof SizeF && arg3 instanceof PdfPage && typeof arg4 === 'undefined') {\n this.InitiateBounds(arg1.x, arg1.y, arg2.width, arg2.height, arg3);\n }\n else if (arg1 instanceof SizeF && typeof arg2 === 'undefined') {\n this.InitiateBounds(0, 0, arg1.width, arg1.height, null);\n }\n else if (typeof arg1 === 'number' && typeof arg2 === 'number' && typeof arg3 === 'undefined') {\n this.InitiateBounds(0, 0, arg1, arg2, null);\n }\n else if (typeof arg1 === 'number' && typeof arg2 === 'number' && arg3 instanceof PdfPage && typeof arg4 === 'undefined') {\n this.InitiateBounds(0, 0, arg1, arg2, arg3);\n }\n else if (typeof arg1 === 'number' && typeof arg2 === 'number' && typeof arg3 === 'number' && typeof arg4 === 'number' && typeof arg5 === 'undefined') {\n this.InitiateBounds(arg1, arg2, arg3, arg4, null);\n }\n else {\n this.InitiateBounds(arg1, arg2, arg3, arg4, null);\n // this.graphics.colorSpace = this.page.document.colorSpace;\n }\n /* tslint:enable */\n }\n Object.defineProperty(PdfPageTemplateElement.prototype, \"dock\", {\n // Properties\n /**\n * Gets or sets the `dock style` of the page template element.\n * @private\n */\n get: function () {\n return this.dockStyle;\n },\n set: function (value) {\n // if (this.dockStyle !== value && this.Type === TemplateType.None) {\n this.dockStyle = value;\n // Reset alignment.\n this.resetAlignment();\n // }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"alignment\", {\n /**\n * Gets or sets `alignment` of the page template element.\n * @private\n */\n get: function () {\n return this.alignmentStyle;\n },\n set: function (value) {\n // if (this.alignmentStyle !== value) {\n this.setAlignment(value);\n // }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"foreground\", {\n /**\n * Indicates whether the page template is located `in front of the page layers or behind of it`.\n * @private\n */\n get: function () {\n return this.isForeground;\n },\n set: function (value) {\n // if (this.foreground !== value) {\n this.isForeground = value;\n // }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"background\", {\n /**\n * Indicates whether the page template is located `behind of the page layers or in front of it`.\n * @private\n */\n get: function () {\n return !this.isForeground;\n },\n set: function (value) {\n this.isForeground = !value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"location\", {\n /**\n * Gets or sets `location` of the page template element.\n * @private\n */\n get: function () {\n return this.currentLocation;\n },\n set: function (value) {\n if (this.type === TemplateType.None) {\n this.currentLocation = value;\n }\n else {\n //\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"x\", {\n /**\n * Gets or sets `X` co-ordinate of the template element on the page.\n * @private\n */\n get: function () {\n var value = (typeof this.currentLocation !== 'undefined') ? this.currentLocation.x : 0;\n return value;\n },\n set: function (value) {\n if (this.type === TemplateType.None) {\n this.currentLocation.x = value;\n }\n else {\n //\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"y\", {\n /**\n * Gets or sets `Y` co-ordinate of the template element on the page.\n * @private\n */\n get: function () {\n var value = (typeof this.currentLocation !== 'undefined') ? this.currentLocation.y : 0;\n return value;\n },\n set: function (value) {\n if (this.type === TemplateType.None) {\n this.currentLocation.y = value;\n }\n else {\n //\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"size\", {\n /**\n * Gets or sets `size` of the page template element.\n * @private\n */\n get: function () {\n return this.template.size;\n },\n set: function (value) {\n if (this.type === TemplateType.None) {\n this.template.reset(value);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"width\", {\n /**\n * Gets or sets `width` of the page template element.\n * @private\n */\n get: function () {\n return this.template.width;\n },\n set: function (value) {\n if (this.template.width !== value && this.type === TemplateType.None) {\n var size = this.template.size;\n size.width = value;\n this.template.reset(size);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"height\", {\n /**\n * Gets or sets `height` of the page template element.\n * @private\n */\n get: function () {\n return this.template.height;\n },\n set: function (value) {\n if (this.template.height !== value && this.type === TemplateType.None) {\n var size = this.template.size;\n size.height = value;\n this.template.reset(size);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"graphics\", {\n /**\n * Gets `graphics` context of the page template element.\n * @private\n */\n get: function () {\n return this.template.graphics;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"template\", {\n /**\n * Gets Pdf `template` object.\n * @private\n */\n get: function () {\n // if (typeof this.pdfTemplate === 'undefined' || this.pdfTemplate == null) {\n // this.pdfTemplate = new PdfTemplate(this.size);\n // }\n return this.pdfTemplate;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"type\", {\n /**\n * Gets or sets `type` of the usage of this page template.\n * @private\n */\n get: function () {\n return this.templateType;\n },\n set: function (value) {\n this.updateDocking(value);\n this.templateType = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfPageTemplateElement.prototype, \"bounds\", {\n /**\n * Gets or sets `bounds` of the page template.\n * @public\n */\n get: function () {\n return new RectangleF(new PointF(this.x, this.y), this.size);\n },\n set: function (value) {\n if (this.type === TemplateType.None) {\n this.location = new PointF(value.x, value.y);\n this.size = new SizeF(value.width, value.height);\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * `Initialize Bounds` Initialize the bounds value of the template.\n * @private\n */\n PdfPageTemplateElement.prototype.InitiateBounds = function (arg1, arg2, arg3, arg4, arg5) {\n this.x = arg1;\n this.y = arg2;\n this.pdfTemplate = new PdfTemplate(arg3, arg4);\n // this.graphics.colorSpace = this.page.document.colorSpace;\n };\n /**\n * `Updates Dock` property if template is used as header/footer.\n * @private\n */\n PdfPageTemplateElement.prototype.updateDocking = function (type) {\n if (type !== TemplateType.None) {\n switch (type) {\n case TemplateType.Top:\n this.dock = PdfDockStyle.Top;\n break;\n case TemplateType.Bottom:\n this.dock = PdfDockStyle.Bottom;\n break;\n case TemplateType.Left:\n this.dock = PdfDockStyle.Left;\n break;\n case TemplateType.Right:\n this.dock = PdfDockStyle.Right;\n break;\n }\n this.resetAlignment();\n }\n };\n /**\n * `Resets alignment` of the template.\n * @private\n */\n PdfPageTemplateElement.prototype.resetAlignment = function () {\n this.alignment = PdfAlignmentStyle.None;\n };\n /**\n * `Sets alignment` of the template.\n * @private\n */\n PdfPageTemplateElement.prototype.setAlignment = function (alignment) {\n if (this.dock === PdfDockStyle.None) {\n this.alignmentStyle = alignment;\n }\n else {\n // Template is docked and alignment has been changed.\n var canBeSet = false;\n switch (this.dock) {\n case PdfDockStyle.Left:\n canBeSet = (alignment === PdfAlignmentStyle.TopLeft || alignment === PdfAlignmentStyle.MiddleLeft ||\n alignment === PdfAlignmentStyle.BottomLeft || alignment === PdfAlignmentStyle.None);\n break;\n case PdfDockStyle.Top:\n canBeSet = (alignment === PdfAlignmentStyle.TopLeft || alignment === PdfAlignmentStyle.TopCenter ||\n alignment === PdfAlignmentStyle.TopRight || alignment === PdfAlignmentStyle.None);\n break;\n case PdfDockStyle.Right:\n canBeSet = (alignment === PdfAlignmentStyle.TopRight || alignment === PdfAlignmentStyle.MiddleRight ||\n alignment === PdfAlignmentStyle.BottomRight || alignment === PdfAlignmentStyle.None);\n break;\n case PdfDockStyle.Bottom:\n canBeSet = (alignment === PdfAlignmentStyle.BottomLeft || alignment === PdfAlignmentStyle.BottomCenter\n || alignment === PdfAlignmentStyle.BottomRight || alignment === PdfAlignmentStyle.None);\n break;\n case PdfDockStyle.Fill:\n canBeSet = (alignment === PdfAlignmentStyle.MiddleCenter || alignment === PdfAlignmentStyle.None);\n break;\n }\n if (canBeSet) {\n this.alignmentStyle = alignment;\n }\n }\n };\n /**\n * Draws the template.\n * @private\n */\n PdfPageTemplateElement.prototype.draw = function (layer, document) {\n var page = layer.page;\n var bounds = this.calculateBounds(page, document);\n if (bounds.x === -0) {\n bounds.x = 0;\n }\n layer.graphics.drawPdfTemplate(this.template, new PointF(bounds.x, bounds.y), new SizeF(bounds.width, bounds.height));\n };\n /**\n * Calculates bounds of the page template.\n * @private\n */\n PdfPageTemplateElement.prototype.calculateBounds = function (page, document) {\n var result = this.bounds;\n if (this.alignmentStyle !== PdfAlignmentStyle.None) {\n result = this.getAlignmentBounds(page, document);\n }\n else if (this.dockStyle !== PdfDockStyle.None) {\n result = this.getDockBounds(page, document);\n }\n return result;\n };\n /**\n * Calculates bounds according to the alignment.\n * @private\n */\n PdfPageTemplateElement.prototype.getAlignmentBounds = function (page, document) {\n var result = this.bounds;\n if (this.type === TemplateType.None) {\n result = this.getSimpleAlignmentBounds(page, document);\n }\n else {\n result = this.getTemplateAlignmentBounds(page, document);\n }\n return result;\n };\n /**\n * Calculates bounds according to the alignment.\n * @private\n */\n PdfPageTemplateElement.prototype.getSimpleAlignmentBounds = function (page, document) {\n var bounds = this.bounds;\n var pdfSection = page.section;\n var actualBounds = pdfSection.getActualBounds(document, page, false);\n var x = this.x;\n var y = this.y;\n switch (this.alignmentStyle) {\n case PdfAlignmentStyle.TopLeft:\n x = 0;\n y = 0;\n break;\n case PdfAlignmentStyle.TopCenter:\n x = (actualBounds.width - this.width) / 2;\n y = 0;\n break;\n case PdfAlignmentStyle.TopRight:\n x = actualBounds.width - this.width;\n y = 0;\n break;\n case PdfAlignmentStyle.MiddleLeft:\n x = 0;\n y = (actualBounds.height - this.height) / 2;\n break;\n case PdfAlignmentStyle.MiddleCenter:\n x = (actualBounds.width - this.width) / 2;\n y = (actualBounds.height - this.height) / 2;\n break;\n case PdfAlignmentStyle.MiddleRight:\n x = actualBounds.width - this.width;\n y = (actualBounds.height - this.height) / 2;\n break;\n case PdfAlignmentStyle.BottomLeft:\n x = 0;\n y = actualBounds.height - this.height;\n break;\n case PdfAlignmentStyle.BottomCenter:\n x = (actualBounds.width - this.width) / 2;\n y = actualBounds.height - this.height;\n break;\n case PdfAlignmentStyle.BottomRight:\n x = actualBounds.width - this.width;\n y = actualBounds.height - this.height;\n break;\n }\n bounds.x = x;\n bounds.y = y;\n return bounds;\n };\n /**\n * Calculates bounds according to the alignment.\n * @private\n */\n PdfPageTemplateElement.prototype.getTemplateAlignmentBounds = function (page, document) {\n var result = this.bounds;\n var section = page.section;\n var actualBounds = section.getActualBounds(document, page, false);\n var x = this.x;\n var y = this.y;\n switch (this.alignmentStyle) {\n case PdfAlignmentStyle.TopLeft:\n if (this.type === TemplateType.Left) {\n x = -actualBounds.x;\n y = 0;\n }\n else if (this.type === TemplateType.Top) {\n x = -actualBounds.x;\n y = -actualBounds.y;\n }\n break;\n case PdfAlignmentStyle.TopCenter:\n x = (actualBounds.width - this.width) / 2;\n y = -actualBounds.y;\n break;\n case PdfAlignmentStyle.TopRight:\n if (this.type === TemplateType.Right) {\n x = actualBounds.width + section.getRightIndentWidth(document, page, false) - this.width;\n y = 0;\n }\n else if (this.type === TemplateType.Top) {\n x = actualBounds.width + section.getRightIndentWidth(document, page, false) - this.width;\n y = -actualBounds.y;\n }\n break;\n case PdfAlignmentStyle.MiddleLeft:\n x = -actualBounds.x;\n y = (actualBounds.height - this.height) / 2;\n break;\n case PdfAlignmentStyle.MiddleCenter:\n x = (actualBounds.width - this.width) / 2;\n y = (actualBounds.height - this.height) / 2;\n break;\n case PdfAlignmentStyle.MiddleRight:\n x = actualBounds.width + section.getRightIndentWidth(document, page, false) - this.width;\n y = (actualBounds.height - this.height) / 2;\n break;\n case PdfAlignmentStyle.BottomLeft:\n if (this.type === TemplateType.Left) {\n x = -actualBounds.x;\n y = actualBounds.height - this.height;\n }\n else if (this.type === TemplateType.Bottom) {\n x = -actualBounds.x;\n y = actualBounds.height + section.getBottomIndentHeight(document, page, false) - this.height;\n }\n break;\n case PdfAlignmentStyle.BottomCenter:\n x = (actualBounds.width - this.width) / 2;\n y = actualBounds.height + section.getBottomIndentHeight(document, page, false) - this.height;\n break;\n case PdfAlignmentStyle.BottomRight:\n if (this.type === TemplateType.Right) {\n x = actualBounds.width + section.getRightIndentWidth(document, page, false) - this.width;\n y = actualBounds.height - this.height;\n }\n else if (this.type === TemplateType.Bottom) {\n x = actualBounds.width + section.getRightIndentWidth(document, page, false) - this.width;\n y = actualBounds.height + section.getBottomIndentHeight(document, page, false) - this.height;\n }\n break;\n }\n result.x = x;\n result.y = y;\n return result;\n };\n /**\n * Calculates bounds according to the docking.\n * @private\n */\n PdfPageTemplateElement.prototype.getDockBounds = function (page, document) {\n var result = this.bounds;\n if (this.type === TemplateType.None) {\n result = this.getSimpleDockBounds(page, document);\n }\n else {\n result = this.getTemplateDockBounds(page, document);\n }\n return result;\n };\n /**\n * Calculates bounds according to the docking.\n * @private\n */\n PdfPageTemplateElement.prototype.getSimpleDockBounds = function (page, document) {\n var result = this.bounds;\n var section = page.section;\n var actualBounds = section.getActualBounds(document, page, false);\n var x = this.x;\n var y = this.y;\n var width = this.width;\n var height = this.height;\n switch (this.dockStyle) {\n case PdfDockStyle.Left:\n x = 0;\n y = 0;\n width = this.width;\n height = actualBounds.height;\n break;\n case PdfDockStyle.Top:\n x = 0;\n y = 0;\n width = actualBounds.width;\n height = this.height;\n break;\n case PdfDockStyle.Right:\n x = actualBounds.width - this.width;\n y = 0;\n width = this.width;\n height = actualBounds.height;\n break;\n case PdfDockStyle.Bottom:\n x = 0;\n y = actualBounds.height - this.height;\n width = actualBounds.width;\n height = this.height;\n break;\n case PdfDockStyle.Fill:\n x = 0;\n x = 0;\n width = actualBounds.width;\n height = actualBounds.height;\n break;\n }\n result = new RectangleF(x, y, width, height);\n return result;\n };\n /**\n * Calculates template bounds basing on docking if template is a page template.\n * @private\n */\n PdfPageTemplateElement.prototype.getTemplateDockBounds = function (page, document) {\n var result = this.bounds;\n var section = page.section;\n var actualBounds = section.getActualBounds(document, page, false);\n var actualSize = section.pageSettings.getActualSize();\n var x = this.x;\n var y = this.y;\n var width = this.width;\n var height = this.height;\n switch (this.dockStyle) {\n case PdfDockStyle.Left:\n x = -actualBounds.x;\n y = 0;\n width = this.width;\n height = actualBounds.height;\n break;\n case PdfDockStyle.Top:\n x = -actualBounds.x;\n y = -actualBounds.y;\n width = actualSize.width;\n height = this.height;\n if (actualBounds.height < 0) {\n y = -actualBounds.y + actualSize.height;\n }\n break;\n case PdfDockStyle.Right:\n x = actualBounds.width + section.getRightIndentWidth(document, page, false) - this.width;\n y = 0;\n width = this.width;\n height = actualBounds.height;\n break;\n case PdfDockStyle.Bottom:\n x = -actualBounds.x;\n y = actualBounds.height + section.getBottomIndentHeight(document, page, false) - this.height;\n width = actualSize.width;\n height = this.height;\n if (actualBounds.height < 0) {\n y -= actualSize.height;\n }\n break;\n case PdfDockStyle.Fill:\n x = 0;\n x = 0;\n width = actualBounds.width;\n height = actualBounds.height;\n break;\n }\n result = new RectangleF(x, y, width, height);\n return result;\n };\n return PdfPageTemplateElement;\n}());\nexport { PdfPageTemplateElement };\n","/* eslint-disable @typescript-eslint/no-inferrable-types */\nimport { print as printWindow, createElement, isNullOrUndefined, Browser } from '@syncfusion/ej2-base';\nimport { SvgRenderer } from '@syncfusion/ej2-svg-base';\nimport { getElement, removeElement } from '../utils/helper';\nimport { beforePrint, afterExport } from '../model/constants';\nimport { PdfPageOrientation, PdfDocument, PdfBitmap, SizeF, PdfStandardFont, PdfPageTemplateElement, PdfSolidBrush, PdfColor } from '@syncfusion/ej2-pdf-export';\nvar ExportUtils = /** @class */ (function () {\n /**\n * Constructor for chart and accumulation annotation\n *\n * @param control\n */\n function ExportUtils(control) {\n this.control = control;\n }\n /**\n * To print the accumulation and chart elements\n *\n * @param elements\n */\n ExportUtils.prototype.print = function (elements) {\n this.printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');\n this.printWindow.moveTo(0, 0);\n this.printWindow.resizeTo(screen.availWidth, screen.availHeight);\n var argsData = {\n cancel: false, htmlContent: this.getHTMLContent(elements), name: beforePrint\n };\n this.control.trigger(beforePrint, argsData);\n if (!argsData.cancel) {\n printWindow(argsData.htmlContent, this.printWindow);\n }\n };\n /**\n * To get the html string of the chart and accumulation\n *\n * @param elements\n * @private\n */\n ExportUtils.prototype.getHTMLContent = function (elements) {\n var div = createElement('div');\n if (elements) {\n if (elements instanceof Array) {\n for (var j = 0; j < elements.length; j++) {\n var value = elements[j];\n div.appendChild(getElement(value).cloneNode(true));\n }\n }\n else if (elements instanceof Element) {\n div.appendChild(elements.cloneNode(true));\n }\n else {\n div.appendChild(getElement(elements).cloneNode(true));\n }\n }\n else {\n div.appendChild(this.control.element.cloneNode(true));\n }\n return div;\n };\n /**\n * To export the file as image/svg format\n *\n * @param type\n * @param fileName\n */\n ExportUtils.prototype.export = function (type, fileName, orientation, controls, width, height, isVertical, header, footer) {\n var _this = this;\n var controlValue = this.getControlsValue(controls, isVertical);\n width = width ? width : controlValue.width;\n height = height ? height : controlValue.height;\n var element = this.control.svgObject;\n var isCanvas = this.control.enableCanvas;\n var image;\n if (!isCanvas) {\n element = createElement('canvas', {\n id: 'ej2-canvas',\n attrs: {\n 'width': width.toString(),\n 'height': height.toString()\n }\n });\n }\n var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);\n orientation = isNullOrUndefined(orientation) ? PdfPageOrientation.Landscape : orientation;\n var svgData = '';\n var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :\n [(new XMLSerializer()).serializeToString(controlValue.svg)], { type: 'image/svg+xml' }));\n if (type === 'SVG') {\n if (Browser.info.name === 'msie') {\n var svg = new Blob([(new XMLSerializer()).serializeToString(controlValue.svg)], { type: 'application/octet-stream' });\n window.navigator.msSaveOrOpenBlob(svg, fileName + '.' + type.toLocaleLowerCase());\n }\n else {\n this.triggerDownload(fileName, type, url, isDownload);\n }\n }\n else if (Browser.info.name === 'msie') {\n var canvas = element;\n if (!isCanvas) {\n canvas = this.createCanvas();\n }\n image = canvas.toDataURL();\n if (type === 'PDF') {\n this.exportPdf(canvas, orientation, width, height, isDownload, fileName, header, footer);\n }\n else {\n this.doexport(type, image, fileName);\n }\n }\n else {\n var image_1 = new Image();\n var ctx_1 = element.getContext('2d');\n image_1.onload = (function () {\n ctx_1.drawImage(image_1, 0, 0);\n window.URL.revokeObjectURL(url);\n if (type === 'PDF') {\n _this.exportPdf(element, orientation, width, height, isDownload, fileName, header, footer);\n }\n else {\n if (window.navigator.msSaveOrOpenBlob) {\n window.navigator.msSaveOrOpenBlob(element.toBlob(null), fileName + '.' + type.toLocaleLowerCase());\n }\n else {\n _this.triggerDownload(fileName, type, element.toDataURL('image/' + type.toLowerCase()), isDownload);\n }\n }\n });\n image_1.src = url;\n }\n if (!isCanvas) {\n removeElement(document.getElementById(this.control.element.id + '_canvas'));\n }\n };\n /**\n * To get data url for charts.\n *\n * @param chart\n */\n ExportUtils.prototype.getDataUrl = function (chart) {\n var controlValue = this.getControlsValue([chart]);\n var element = this.control.svgObject;\n var isCanvas = this.control.enableCanvas;\n if (!isCanvas) {\n element = createElement('canvas', {\n id: 'ej2-canvas',\n attrs: {\n 'width': controlValue.width.toString(),\n 'height': controlValue.height.toString()\n }\n });\n }\n var url = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(controlValue.svg)], { type: 'image/svg+xml' }));\n if (Browser.info.name === 'msie') {\n var canvas = element;\n if (!isCanvas) {\n canvas = this.createCanvas();\n }\n var argsData = {\n name: afterExport, cancel: false, dataUrl: element.toDataURL('image/png')\n };\n chart.trigger(afterExport, argsData);\n return { element: canvas, dataUrl: canvas.toDataURL() };\n }\n else {\n var image_2 = new Image();\n var ctx_2 = element.getContext('2d');\n image_2.onload = (function () {\n ctx_2.drawImage(image_2, 0, 0);\n window.URL.revokeObjectURL(url);\n var argsData = {\n name: afterExport, cancel: false, dataUrl: element.toDataURL('image/png')\n };\n chart.trigger(afterExport, argsData);\n return argsData.dataUrl;\n });\n image_2.src = url;\n return { element: element, blobUrl: url };\n }\n };\n /**\n * To trigger the download element\n *\n * @param fileName\n * @param type\n * @param url\n */\n ExportUtils.prototype.triggerDownload = function (fileName, type, url, isDownload) {\n createElement('a', {\n attrs: {\n 'download': fileName + '.' + type.toLocaleLowerCase(),\n 'href': url\n }\n }).dispatchEvent(new MouseEvent(isDownload ? 'click' : 'move', {\n view: window,\n bubbles: false,\n cancelable: true\n }));\n };\n /**\n * To get the maximum size value\n *\n * @param controls\n * @param name\n */\n // eslint-disable-next-line max-len\n ExportUtils.prototype.getControlsValue = function (controls, isVertical) {\n var width = 0;\n var height = 0;\n var isCanvas = this.control.enableCanvas;\n var svgObject = new SvgRenderer('').createSvg({\n id: 'Svg_Export_Element',\n width: 200, height: 200\n });\n controls.map(function (control) {\n var svg = control.svgObject.cloneNode(true);\n var groupEle = control.renderer.createGroup({\n style: (isNullOrUndefined(isVertical) || isVertical) ? 'transform: translateY(' + height + 'px)' :\n 'transform: translateX(' + width + 'px)'\n });\n var backgroundColor = svg.childNodes[0].getAttribute('fill');\n if ((control.theme === 'Tailwind' || control.theme === 'TailwindDark')\n && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {\n svg.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');\n }\n if (!isCanvas) {\n groupEle.appendChild(svg);\n }\n var top = 0;\n var left = 0;\n if (control.stockLegendModule && control.legendSettings.visible) {\n if (control.legendSettings.position === \"Bottom\" || control.legendSettings.position === \"Top\"\n || control.legendSettings.position === \"Auto\") {\n top += control.stockLegendModule.legendBounds.height;\n }\n else if (control.legendSettings.position === \"Left\" || control.legendSettings.position === \"Right\") {\n left += control.stockLegendModule.legendBounds.width;\n }\n }\n width = (isNullOrUndefined(isVertical) || isVertical) ? Math.max(control.availableSize.width + left, width) :\n width + control.availableSize.width + left;\n height = (isNullOrUndefined(isVertical) || isVertical) ? height + control.availableSize.height + top :\n Math.max(control.availableSize.height + top, height);\n if (!isCanvas) {\n svgObject.appendChild(groupEle);\n }\n });\n if (!isCanvas) {\n svgObject.setAttribute('width', width + '');\n svgObject.setAttribute('height', height + '');\n }\n return {\n 'width': width,\n 'height': height,\n 'svg': svgObject\n };\n };\n ExportUtils.prototype.createCanvas = function () {\n var chart = this.control;\n this.canvasRender(true, chart);\n var canvas = chart.svgObject;\n this.canvasRender(false, chart);\n return canvas;\n };\n /**\n * To convert svg chart into canvas chart to fix export issue in IE\n * We cant export svg to other formats in IE\n *\n * @param enableCanvas\n * @param chart\n * @param enableCanvas\n * @param chart\n */\n ExportUtils.prototype.canvasRender = function (enableCanvas, chart) {\n chart.enableCanvas = enableCanvas;\n chart['preRender']();\n chart['render']();\n };\n // eslint-disable-next-line max-len\n ExportUtils.prototype.exportPdf = function (element, orientation, width, height, isDownload, fileName, header, footer) {\n var document = new PdfDocument();\n var margin = document.pageSettings.margins;\n var pdfDefaultWidth = document.pageSettings.width;\n var pdfDefaultHeight = document.pageSettings.height;\n var imageString = element.toDataURL('image/jpeg').replace('image/jpeg', 'image/octet-stream');\n document.pageSettings.orientation = orientation;\n var exactWidth = (pdfDefaultWidth < width) ? (width + margin.left + margin.right) : pdfDefaultWidth;\n var exactHeight = (pdfDefaultHeight < height) ? (height + margin.top + margin.bottom) : pdfDefaultHeight;\n if (header !== undefined) {\n var font = new PdfStandardFont(1, header.fontSize || 15);\n var pdfHeader = new PdfPageTemplateElement(exactWidth, 40);\n pdfHeader.graphics.drawString(header.content + '', font, null, new PdfSolidBrush(new PdfColor(0, 0, 0)), header.x, header.y, null);\n document.template.top = pdfHeader;\n }\n if (footer !== undefined) {\n var font = new PdfStandardFont(1, footer.fontSize || 15);\n var pdfFooter = new PdfPageTemplateElement(exactWidth, 40);\n pdfFooter.graphics.drawString(footer.content + '', font, null, new PdfSolidBrush(new PdfColor(0, 0, 0)), footer.x, footer.y, null);\n document.template.bottom = pdfFooter;\n }\n document.pageSettings.size = new SizeF(exactWidth, exactHeight);\n imageString = imageString.slice(imageString.indexOf(',') + 1);\n document.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, width, height);\n if (isDownload) {\n document.save(fileName + '.pdf');\n document.destroy();\n }\n };\n ExportUtils.prototype.doexport = function (type, image, fileName) {\n var images = [];\n var fileType = type || 'JPG';\n images = [image];\n this.exportImage(images, fileName, fileType, image);\n };\n ExportUtils.prototype.exportImage = function (images, fileName, fileType, image) {\n var buffers = [];\n var length = (!(images instanceof HTMLElement)) ? images.length : 0;\n for (var g = 0; g < length; g++) {\n image = images[g];\n image = image.replace(/^data:[a-z]*;,/, '');\n var image1 = image.split(',');\n var byteString = atob(image1[1]);\n var buffer = new ArrayBuffer(byteString.length);\n var intArray = new Uint8Array(buffer);\n for (var i = 0; i < byteString.length; i++) {\n intArray[i] = byteString.charCodeAt(i);\n }\n buffers.push(buffer);\n }\n for (var j = 0; j < buffers.length; j++) {\n var b = new Blob([buffers[j]], { type: 'application/octet-stream' });\n if (Browser.info.name === 'msie') {\n window.navigator.msSaveOrOpenBlob(b, fileName + '.' + fileType.toLocaleLowerCase());\n }\n }\n };\n return ExportUtils;\n}());\nexport { ExportUtils };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/* eslint-disable jsdoc/require-returns */\n/* eslint-disable jsdoc/require-param */\n/* eslint-disable valid-jsdoc */\n/* eslint-disable @typescript-eslint/ban-types */\nimport { Component, Property, NotifyPropertyChanges, Internationalization } from '@syncfusion/ej2-base';\nimport { L10n, setValue, isNullOrUndefined, updateBlazorTemplate } from '@syncfusion/ej2-base';\nimport { ChildProperty } from '@syncfusion/ej2-base';\nimport { remove, extend } from '@syncfusion/ej2-base';\nimport { Browser, Touch } from '@syncfusion/ej2-base';\nimport { Event, EventHandler, Complex, Collection } from '@syncfusion/ej2-base';\nimport { findClipRect, showTooltip, ImageOption, removeElement, appendChildElement, blazorTemplatesReset } from '../common/utils/helper';\nimport { textElement, RectOption, createSvg, firstToLowerCase, titlePositionX, redrawElement } from '../common/utils/helper';\nimport { appendClipElement, ChartLocation } from '../common/utils/helper';\nimport { getSeriesColor, Theme, getThemeColor } from '../common/model/theme';\nimport { Margin, Border, ChartArea, Font, Indexes, TooltipSettings } from '../common/model/base';\nimport { Row, Column, Axis } from './axis/axis';\nimport { CartesianAxisLayoutPanel } from './axis/cartesian-panel';\nimport { Rect, measureText, TextOption, Size, SvgRenderer } from '@syncfusion/ej2-svg-base';\nimport { ChartData } from './utils/get-data';\nimport { Series } from './series/chart-series';\nimport { Data } from '../common/model/data';\nimport { Marker } from './series/marker';\nimport { LegendSettings } from '../common/legend/legend';\nimport { TechnicalIndicator } from './technical-indicators/technical-indicator';\nimport { chartMouseClick, pointClick, pointDoubleClick, axisLabelClick, beforeResize } from '../common/model/constants';\nimport { chartMouseDown, chartMouseMove, chartMouseUp, load, pointMove, chartMouseLeave, resized } from '../common/model/constants';\nimport { ChartAnnotationSettings } from './model/chart-base';\nimport { getElement, getTitle } from '../common/utils/helper';\nimport { ExportUtils } from '../common/utils/export';\n/**\n * Configures the RangeColorSetting in the chart.\n */\nvar RangeColorSetting = /** @class */ (function (_super) {\n __extends(RangeColorSetting, _super);\n function RangeColorSetting() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], RangeColorSetting.prototype, \"start\", void 0);\n __decorate([\n Property()\n ], RangeColorSetting.prototype, \"end\", void 0);\n __decorate([\n Property([])\n ], RangeColorSetting.prototype, \"colors\", void 0);\n __decorate([\n Property('')\n ], RangeColorSetting.prototype, \"label\", void 0);\n return RangeColorSetting;\n}(ChildProperty));\nexport { RangeColorSetting };\n/**\n * Configures the crosshair in the chart.\n */\nvar CrosshairSettings = /** @class */ (function (_super) {\n __extends(CrosshairSettings, _super);\n function CrosshairSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(false)\n ], CrosshairSettings.prototype, \"enable\", void 0);\n __decorate([\n Property('')\n ], CrosshairSettings.prototype, \"dashArray\", void 0);\n __decorate([\n Complex({ color: null, width: 1 }, Border)\n ], CrosshairSettings.prototype, \"line\", void 0);\n __decorate([\n Property('Both')\n ], CrosshairSettings.prototype, \"lineType\", void 0);\n __decorate([\n Property('')\n ], CrosshairSettings.prototype, \"verticalLineColor\", void 0);\n __decorate([\n Property('')\n ], CrosshairSettings.prototype, \"horizontalLineColor\", void 0);\n __decorate([\n Property(1)\n ], CrosshairSettings.prototype, \"opacity\", void 0);\n return CrosshairSettings;\n}(ChildProperty));\nexport { CrosshairSettings };\n/**\n * Configures the zooming behavior for the chart.\n */\nvar ZoomSettings = /** @class */ (function (_super) {\n __extends(ZoomSettings, _super);\n function ZoomSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(false)\n ], ZoomSettings.prototype, \"enableSelectionZooming\", void 0);\n __decorate([\n Property(false)\n ], ZoomSettings.prototype, \"enablePinchZooming\", void 0);\n __decorate([\n Property(false)\n ], ZoomSettings.prototype, \"enableMouseWheelZooming\", void 0);\n __decorate([\n Property(true)\n ], ZoomSettings.prototype, \"enableDeferredZooming\", void 0);\n __decorate([\n Property('XY')\n ], ZoomSettings.prototype, \"mode\", void 0);\n __decorate([\n Property(['Zoom', 'ZoomIn', 'ZoomOut', 'Pan', 'Reset'])\n ], ZoomSettings.prototype, \"toolbarItems\", void 0);\n __decorate([\n Property(false)\n ], ZoomSettings.prototype, \"enablePan\", void 0);\n __decorate([\n Property(false)\n ], ZoomSettings.prototype, \"enableScrollbar\", void 0);\n return ZoomSettings;\n}(ChildProperty));\nexport { ZoomSettings };\n/**\n * Represents the Chart control.\n * ```html\n * \n * \n * ```\n *\n * @public\n */\nvar Chart = /** @class */ (function (_super) {\n __extends(Chart, _super);\n /**\n * Constructor for creating the widget\n *\n * @hidden\n */\n function Chart(options, element) {\n var _this = _super.call(this, options, element) || this;\n /** @private */\n _this.rotatedDataLabelCollections = [];\n /** @public */\n _this.animated = false;\n /** @private */\n _this.isPointMouseDown = false;\n /** @private */\n _this.isScrolling = false;\n /** @private */\n _this.checkResize = 0;\n /** @private */\n _this.visible = 0;\n /** @private */\n _this.clickCount = 0;\n /** @private */\n _this.singleClickTimer = 0;\n /** @private */\n _this.chartAreaType = 'Cartesian';\n /** @private */\n _this.isRtlEnabled = false;\n _this.chartid = 57723;\n setValue('mergePersistData', _this.mergePersistChartData, _this);\n return _this;\n }\n /**\n * To manage persist chart data\n */\n Chart.prototype.mergePersistChartData = function () {\n var data = window.localStorage.getItem(this.getModuleName() + this.element.id);\n if (!(isNullOrUndefined(data) || (data === ''))) {\n var dataObj = JSON.parse(data);\n var keys = Object.keys(dataObj);\n this.isProtectedOnChange = true;\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if ((typeof this[key] === 'object') && !isNullOrUndefined(this[key])) {\n extend(this[key], dataObj[key]);\n }\n else {\n this[key] = dataObj[key];\n }\n }\n this.isProtectedOnChange = false;\n }\n };\n /**\n *\n * @param elementId\n * Return the proper ID when the special character exist in the ID\n */\n Chart.prototype.isIdHasSpecialCharacter = function (elementId) {\n var regex = /^[A-Za-z ]+$/;\n var numberRegex = /^[0-9 ]+$/;\n var childElementId = '';\n if (!regex.test(elementId)) {\n var start = 0;\n if (numberRegex.test(elementId[0])) {\n childElementId += ('\\\\3' + elementId[0]);\n start = 1;\n }\n for (var i = start; i < elementId.length; i++) {\n if (!regex.test(elementId[i]) && elementId.indexOf('-') === -1 &&\n elementId.indexOf('_') === -1 && elementId.indexOf('\\\\') === -1 && !numberRegex.test(elementId[i])) {\n childElementId += ('\\\\' + elementId[i]);\n }\n else {\n childElementId += elementId[i];\n }\n }\n return childElementId;\n }\n else {\n return elementId;\n }\n };\n /**\n * Initialize the event handler.\n */\n Chart.prototype.preRender = function () {\n this.element.id = this.isIdHasSpecialCharacter(this.element.id);\n // It is used for checking blazor framework or not.\n var blazor = 'Blazor';\n this.isBlazor = window[blazor];\n this.allowServerDataBinding = false;\n this.unWireEvents();\n this.initPrivateVariable();\n this.setCulture();\n this.wireEvents();\n if (this.stockChart) {\n if (this.stockChart.tooltip.header === null) {\n this.tooltip.header = '
${point.x}';\n }\n if (this.stockChart.tooltip.format === null) {\n this.tooltip.format = 'High :
${point.high}Low :' +\n '
${point.low}Open :
${point.open}Close :
${point.close}';\n if (this.stockChart.series[0].volume !== '') {\n this.tooltip.format += '
Volume :
${point.volume}';\n }\n }\n this.animateSeries = false;\n }\n };\n Chart.prototype.initPrivateVariable = function () {\n this.animateSeries = true;\n this.delayRedraw = false;\n this.horizontalAxes = [];\n this.verticalAxes = [];\n this.refreshAxis();\n this.refreshDefinition(this.rows);\n this.refreshDefinition(this.columns);\n if (this.tooltipModule) {\n this.tooltipModule.previousPoints = [];\n }\n if (this.element.id === '') {\n var collection = document.getElementsByClassName('e-chart').length;\n this.element.id = 'chart_' + this.chartid + '_' + collection;\n }\n //seperate ID to differentiate chart and stock chart\n this.svgId = this.stockChart ? this.stockChart.element.id + '_stockChart_chart' :\n this.element.id + (this.enableCanvas ? '_canvas' : '_svg');\n };\n /**\n * To Initialize the control rendering.\n */\n Chart.prototype.render = function () {\n var _this = this;\n this.svgRenderer = new SvgRenderer(this.element.id);\n var loadEventData = {\n chart: this.isBlazor ? {} : this, theme: this.theme, name: load, cancel: false\n };\n if (!this.stockChart) {\n /**\n * Load event for the chart will be triggered only chart componet, if this is stock chart, load event did not triggered.\n */\n this.trigger(load, loadEventData, function () {\n if (!loadEventData.cancel) {\n _this.cartesianChartRendering(loadEventData);\n }\n });\n }\n else {\n // The fix is specific for nextjs app, as window is set as not defined for server side application like nextjs.\n this.isRtlEnabled = (window.getComputedStyle(document.querySelector('body')).direction === 'rtl');\n this.cartesianChartRendering(loadEventData);\n }\n };\n Chart.prototype.cartesianChartRendering = function (beforeRenderData) {\n this.theme = this.isBlazor ? beforeRenderData.theme : this.theme;\n this.createChartSvg();\n this.setTheme();\n this.markerRender = new Marker(this);\n this.calculateAreaType();\n this.calculateVisibleSeries();\n this.initTechnicalIndicators();\n this.initTrendLines();\n this.calculateVisibleAxis();\n this.processData();\n this.renderComplete();\n this.allowServerDataBinding = true;\n };\n /**\n * Gets the localized label by locale keyword.\n *\n * @param {string} key key\n * @returns {string} localized label\n */\n Chart.prototype.getLocalizedLabel = function (key) {\n return this.localeObject.getConstant(key);\n };\n /**\n * Animate the series bounds.\n *\n * @private\n */\n Chart.prototype.animate = function (duration) {\n this.redraw = true;\n this.animated = true; //used to set duration as 1000 for animation at default 300\n this.duration = duration ? duration : 1000;\n };\n /**\n * Refresh the chart bounds.\n *\n * @private\n */\n Chart.prototype.refreshBound = function () {\n this.rotatedDataLabelCollections = [];\n if (this.legendModule && this.legendSettings.visible) {\n this.legendModule.getLegendOptions(this.visibleSeries, this);\n }\n /**\n * I264230, EJ2-36761\n * Issue: Tooltip doesnot appears after zooming and hovering on same point\n * Root cause: While performing zoom, previous points in tooltip restore.\n * Fix: previous points set to empty array\n */\n if (this.tooltip.enable && this.tooltipModule) {\n this.tooltipModule.previousPoints = [];\n }\n this.calculateStackValues();\n this.calculateBounds();\n //this prevents the initial rendering of stock chart\n if (this.stockChart && !this.stockChart.rangeFound) {\n if (this.stockChart.enablePeriodSelector || this.stockChart.enableSelector) {\n return null;\n }\n }\n this.renderElements();\n removeElement('chartmeasuretext');\n this.removeSelection();\n };\n /**\n * To calcualte the stack values\n */\n Chart.prototype.calculateStackValues = function () {\n var series;\n var isCalculateStacking = false;\n for (var i = 0, len = this.visibleSeries.length; i < len; i++) {\n series = this.visibleSeries[i];\n series.position = series.rectCount = undefined;\n if (((series.type.indexOf('Stacking') !== -1) || (series.drawType.indexOf('Stacking') !== -1\n && this.chartAreaType === 'PolarRadar')) && !isCalculateStacking) {\n series.calculateStackedValue(series.type.indexOf('100') > -1, this);\n isCalculateStacking = true;\n }\n }\n };\n Chart.prototype.removeSelection = function () {\n for (var _i = 0, _a = this.visibleSeries; _i < _a.length; _i++) {\n var series = _a[_i];\n if (series.visible) {\n for (var _b = 0, _c = series.points; _b < _c.length; _b++) {\n var point = _c[_b];\n point.isSelect = false;\n }\n }\n }\n if (getElement(this.element.id + '_ej2_drag_multi_group')) {\n if (this.selectionMode.indexOf('Drag') > -1) {\n this.selectionModule.filterArray = [];\n }\n removeElement(this.element.id + '_ej2_drag_multi_group');\n this.selectionModule.calculateDragSelectedElements(this, new Rect(0, 0, 0, 0), true);\n }\n else if (getElement(this.element.id + '_ej2_drag_group')) {\n if (this.selectionMode !== 'Lasso') {\n this.selectionModule.filterArray = [];\n }\n removeElement(this.element.id + '_ej2_drag_group');\n this.selectionModule.calculateDragSelectedElements(this, new Rect(0, 0, 0, 0), true);\n }\n };\n Chart.prototype.renderElements = function () {\n this.renderBorder();\n this.renderTitle();\n this.renderAreaBorder();\n this.renderSeriesElements(this.renderAxes());\n this.renderLegend();\n this.applyZoomkit();\n this.performSelection();\n this.setSecondaryElementPosition();\n for (var _i = 0, _a = this.visibleSeries; _i < _a.length; _i++) {\n var value = _a[_i];\n updateBlazorTemplate(this.element.id + '_DataLabel', 'Template', value.marker.dataLabel);\n }\n this.renderAnnotation();\n };\n /**\n * To render the legend\n *\n * @private\n */\n Chart.prototype.renderAxes = function () {\n this.yAxisElements = this.renderer.createGroup({ id: this.element.id + 'yAxisCollection' });\n var axisElement;\n if (this.rows.length > 0 && this.columns.length > 0) {\n axisElement = this.chartAxisLayoutPanel.renderAxes();\n }\n if (this.stripLineModule) {\n this.stripLineModule.renderStripLine(this, 'Behind', this.axisCollections);\n }\n return axisElement;\n };\n /**\n * To render the legend\n */\n Chart.prototype.renderLegend = function () {\n if (this.legendModule && this.legendModule.legendCollections.length && this.legendSettings.visible) {\n this.legendModule.calTotalPage = true;\n var borderWidth = this.legendSettings.border.width;\n var bounds = this.legendModule.legendBounds;\n var rect = new Rect(bounds.x, bounds.y, bounds.width, bounds.height);\n if (this.enableCanvas) {\n rect = new Rect(rect.x - borderWidth / 2, rect.y - borderWidth / 2, rect.width + borderWidth, rect.height + borderWidth);\n this.renderer.canvasClip(rect);\n }\n this.legendModule.renderLegend(this, this.legendSettings, bounds);\n if (this.enableCanvas) {\n this.renderer.canvasRestore();\n }\n }\n if (!this.redraw) {\n if (!this.stockChart) {\n this.element.appendChild(this.svgObject);\n }\n else {\n if (!getElement(this.stockChart.chartObject.id)) {\n this.stockChart.mainObject.appendChild(this.svgObject);\n }\n }\n }\n };\n /**\n * To set the left and top position for data label template for center aligned chart\n */\n Chart.prototype.setSecondaryElementPosition = function () {\n var element = getElement(this.element.id + '_Secondary_Element');\n if (!element) {\n return;\n }\n var rect = this.element.getBoundingClientRect();\n var svgRect = getElement(this.svgId).getBoundingClientRect();\n element.style.left = Math.max(svgRect.left - rect.left, 0) + 'px';\n element.style.top = Math.max(svgRect.top - rect.top, 0) + 'px';\n };\n Chart.prototype.initializeModuleElements = function () {\n this.dataLabelCollections = [];\n var elementId = this.element.id;\n if (this.series.length) {\n this.seriesElements = (this.series[0].type === 'Scatter' || this.series[0].type === 'Bubble') ?\n this.svgRenderer.createGroup({ id: elementId + 'SeriesCollection' }) :\n this.renderer.createGroup({ id: elementId + 'SeriesCollection' });\n }\n if (this.indicators.length) {\n this.indicatorElements = this.renderer.createGroup({ id: elementId + 'IndicatorCollection' });\n }\n if (this.hasTrendlines()) {\n this.trendLineElements = this.renderer.createGroup({ id: elementId + 'TrendLineCollection' });\n }\n this.dataLabelElements = this.renderer.createGroup({ id: elementId + 'DataLabelCollection' });\n };\n Chart.prototype.hasTrendlines = function () {\n var isTrendline;\n for (var _i = 0, _a = this.series; _i < _a.length; _i++) {\n var series = _a[_i];\n isTrendline = series.trendlines.length ? true : false;\n if (isTrendline) {\n break;\n }\n }\n return isTrendline;\n };\n Chart.prototype.renderSeriesElements = function (axisElement) {\n // Initialize the series elements values\n this.initializeModuleElements();\n var elementId = this.element.id;\n if (this.element.tagName !== 'g') {\n var tooltipDiv = redrawElement(this.redraw, elementId + '_Secondary_Element') ||\n this.createElement('div');\n tooltipDiv.id = elementId + '_Secondary_Element';\n tooltipDiv['style'] = 'position: relative';\n appendChildElement(false, this.element, tooltipDiv, this.redraw);\n }\n // For canvas\n if (this.enableCanvas) {\n var tooltipdiv = document.getElementById(elementId + '_Secondary_Element');\n tooltipdiv = !tooltipdiv ? this.createElement('div', { id: elementId + '_Secondary_Element',\n attrs: { 'style': 'position: relative; left:0px; top:0px' } }) : tooltipdiv;\n var svg = this.svgRenderer.createSvg({\n id: elementId + '_tooltip_svg',\n width: this.availableSize.width,\n height: this.availableSize.height\n });\n svg['style'] = 'position: absolute; pointer-events: none';\n tooltipdiv.appendChild(svg);\n }\n // For userInteraction\n if (this.tooltip.enable) {\n appendChildElement(this.enableCanvas, this.svgObject, this.renderer.createGroup({ id: elementId + '_UserInteraction', style: 'pointer-events:none;' }), this.redraw);\n }\n if (this.rows.length > 0 && this.columns.length > 0) {\n this.initializeIndicator();\n this.initializeTrendLine();\n this.renderSeries();\n // Trendline is append to DOM after the series\n if (this.trendLineElements) {\n appendChildElement(this.enableCanvas, this.svgObject, this.trendLineElements, this.redraw);\n }\n this.appendElementsAfterSeries(axisElement);\n }\n };\n /**\n * @private\n */\n Chart.prototype.renderSeries = function () {\n var visibility;\n if (this.enableCanvas) {\n // To clip the series rect for canvas\n this.renderer.canvasClip(this.chartAxisLayoutPanel.seriesClipRect);\n }\n for (var _i = 0, _a = this.visibleSeries; _i < _a.length; _i++) {\n var item = _a[_i];\n if (item.category === 'TrendLine') {\n visibility = this.series[item.sourceIndex].trendlines[item.index].visible;\n }\n else {\n visibility = item.visible;\n }\n if (visibility) {\n this.visible++;\n findClipRect(item);\n if (this.enableCanvas) {\n // To render scatter and bubble series in canvas\n this.renderCanvasSeries(item);\n }\n item.renderSeries(this);\n }\n }\n if (this.enableCanvas) {\n this.renderer.canvasRestore();\n }\n this.visible = 0;\n var options = {\n 'id': this.element.id + '_ChartAreaClipRect_',\n 'x': this.chartAxisLayoutPanel.seriesClipRect.x,\n 'y': this.chartAxisLayoutPanel.seriesClipRect.y,\n 'width': this.chartAxisLayoutPanel.seriesClipRect.width,\n 'height': this.chartAxisLayoutPanel.seriesClipRect.height,\n 'fill': 'transparent',\n 'stroke-width': 1,\n 'stroke': 'Gray'\n };\n if (!this.seriesElements) {\n return;\n }\n if (!this.enableCanvas) {\n this.seriesElements.appendChild(appendClipElement(this.redraw, options, this.renderer));\n }\n var seriesSvg = document.getElementById(this.element.id + '_series_svg');\n if (seriesSvg) {\n appendChildElement(false, seriesSvg, this.seriesElements, this.redraw);\n }\n else {\n appendChildElement(this.enableCanvas, this.svgObject, this.seriesElements, this.redraw);\n }\n };\n Chart.prototype.renderCanvasSeries = function (item) {\n var svgElement;\n var divElement;\n if ((item.type === 'Bubble' || item.type === 'Scatter')) {\n svgElement = !svgElement ? this.svgRenderer.createSvg({ id: this.element.id + '_series_svg',\n width: this.availableSize.width, height: this.availableSize.height }) : svgElement;\n divElement = !divElement ? this.createElement('div', { id: this.element.id + '_series' }) : divElement;\n divElement['style'] = 'position: absolute';\n var mainElement = document.getElementById(this.element.id + '_Secondary_Element');\n divElement.appendChild(svgElement);\n mainElement.appendChild(divElement);\n }\n svgElement = (this.enableCanvas && (item.type === 'Bubble' || item.type === 'Scatter')) ?\n svgElement : this.svgObject;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var canvas = (this.enableCanvas && (item.type === 'Bubble' || item.type === 'Scatter')) ?\n false : this.enableCanvas;\n };\n Chart.prototype.initializeIndicator = function () {\n for (var _i = 0, _a = this.indicators; _i < _a.length; _i++) {\n var indicator = _a[_i];\n if (this[firstToLowerCase(indicator.type) + 'IndicatorModule']) {\n this[firstToLowerCase(indicator.type) + 'IndicatorModule'].createIndicatorElements(this, indicator, indicator.index);\n }\n }\n if (this.indicatorElements) {\n appendChildElement(this.enableCanvas, this.svgObject, this.indicatorElements, this.redraw);\n }\n };\n Chart.prototype.initializeTrendLine = function () {\n for (var _i = 0, _a = this.visibleSeries; _i < _a.length; _i++) {\n var series = _a[_i];\n if (series.trendlines.length) {\n this.trendLineModule.getTrendLineElements(series, this);\n }\n }\n };\n Chart.prototype.appendElementsAfterSeries = function (axisElement) {\n if (this.chartAreaType === 'PolarRadar') {\n appendChildElement(this.enableCanvas, this.svgObject, this.yAxisElements, this.redraw);\n }\n appendChildElement(this.enableCanvas, this.svgObject, axisElement, this.redraw);\n if ((this.zoomModule && this.zoomSettings.enableScrollbar && this.scrollElement.childElementCount) ||\n (this.scrollElement && this.scrollElement.childElementCount)) {\n appendChildElement(false, getElement(this.element.id + '_Secondary_Element'), this.scrollElement, this.redraw);\n }\n if (this.stripLineModule) {\n this.stripLineModule.renderStripLine(this, 'Over', this.axisCollections);\n }\n if (!this.tooltip.enable) {\n appendChildElement(this.enableCanvas, this.svgObject, this.renderer.createGroup({ id: this.element.id + '_UserInteraction', style: 'pointer-events:none;' }), this.redraw);\n }\n if (this.stockChart) {\n this.stockChart.calculateStockEvents();\n }\n };\n Chart.prototype.applyZoomkit = function () {\n /**\n * Issue: Zoomkit not visible after performing refresh()\n * Fix: this method called without checking `zoomModule.isZoomed`\n */\n if (this.chartAreaType === 'PolarRadar') {\n return;\n }\n if (!this.redraw && this.zoomModule && (!this.zoomSettings.enablePan || this.zoomModule.performedUI)) {\n this.zoomModule.applyZoomToolkit(this, this.axisCollections);\n }\n };\n /**\n * Render annotation perform here\n *\n * @private\n */\n Chart.prototype.renderAnnotation = function () {\n if (this.annotationModule) {\n //for stock chart, stock chart's id is added to render the annotations\n this.annotationModule.renderAnnotations(getElement((this.stockChart ? this.stockChart.element.id : this.element.id) + '_Secondary_Element'));\n }\n };\n Chart.prototype.performSelection = function () {\n var selectedDataIndexes = [];\n if (this.selectionModule) {\n selectedDataIndexes = extend([], this.selectionModule.selectedDataIndexes, null, true);\n this.selectionModule.invokeSelection(this);\n }\n if (this.highlightModule) {\n this.highlightModule.invokeHighlight(this);\n }\n if (selectedDataIndexes.length > 0) {\n this.selectionModule.selectedDataIndexes = selectedDataIndexes;\n this.selectionModule.redrawSelection(this, this.selectionMode);\n }\n };\n Chart.prototype.processData = function (render) {\n if (render === void 0) { render = true; }\n this.visibleSeriesCount = 0;\n var check = true;\n for (var _i = 0, _a = this.visibleSeries; _i < _a.length; _i++) {\n var series = _a[_i];\n if (!series.visible && !this.legendSettings.visible) {\n this.visibleSeriesCount++;\n continue;\n }\n if (series.category !== 'Indicator' && series.category !== 'TrendLine') {\n this.initializeDataModule(series);\n }\n }\n for (var _b = 0, _c = this.indicators; _b < _c.length; _b++) {\n var indicator = _c[_b];\n if (indicator.dataSource) {\n var techIndicator = indicator;\n this.initializeDataModule(techIndicator);\n check = false;\n }\n }\n if (render && (!this.visibleSeries.length || this.visibleSeriesCount === this.visibleSeries.length && check)) {\n this.refreshBound();\n this.trigger('loaded', { chart: this.isBlazor ? {} : this });\n }\n };\n Chart.prototype.initializeDataModule = function (series) {\n series.xData = [];\n series.yData = [];\n var dataSource;\n var isAngular = 'isAngular';\n if (this[isAngular]) {\n dataSource = Object.keys(series.dataSource).length ? series.dataSource : this.dataSource;\n }\n else {\n dataSource = series.dataSource || this.dataSource;\n }\n series.dataModule = new Data(dataSource, series.query);\n series.points = [];\n series.refreshDataManager(this);\n };\n Chart.prototype.calculateBounds = function () {\n var margin = this.margin;\n // Title Height;\n var titleHeight = 0;\n var subTitleHeight = 0;\n var titleWidth = 0;\n var padding = 15;\n var left = margin.left;\n var width = this.availableSize.width - left - margin.right - this.border.width;\n this.titleCollection = [];\n this.subTitleCollection = [];\n if (this.title) {\n this.titleCollection = getTitle(this.title, this.titleStyle, width);\n titleHeight = (measureText(this.title, this.titleStyle).height * this.titleCollection.length) + padding;\n if (this.subTitle) {\n var maxWidth = 0;\n for (var _i = 0, _a = this.titleCollection; _i < _a.length; _i++) {\n var titleText = _a[_i];\n titleWidth = measureText(titleText, this.titleStyle).width;\n maxWidth = titleWidth > maxWidth ? titleWidth : maxWidth;\n }\n this.subTitleCollection = getTitle(this.subTitle, this.subTitleStyle, maxWidth);\n subTitleHeight = (measureText(this.subTitle, this.subTitleStyle).height * this.subTitleCollection.length) +\n padding;\n }\n }\n var top = margin.top + subTitleHeight + titleHeight + this.chartArea.border.width * 0.5;\n var height = this.availableSize.height - top - this.border.width - margin.bottom;\n if (this.stockChart && this.stockChart.legendSettings.visible && this.stockChart.stockLegendModule) {\n if (this.stockChart.legendSettings.position === \"Top\") {\n top += this.stockChart.stockLegendModule.legendBounds.height;\n }\n else if (this.stockChart.legendSettings.position === \"Left\") {\n left += this.stockChart.stockLegendModule.legendBounds.width;\n }\n }\n this.initialClipRect = new Rect(left, top, width, height);\n if (this.legendModule && this.legendSettings.visible) {\n this.legendModule.calculateLegendBounds(this.initialClipRect, this.availableSize, null);\n }\n this.chartAxisLayoutPanel.measureAxis(this.initialClipRect);\n };\n /**\n * Handles the print method for chart control.\n */\n Chart.prototype.print = function (id) {\n var exportChart = new ExportUtils(this);\n exportChart.print(id);\n };\n /**\n * Defines the trendline initialization\n */\n Chart.prototype.initTrendLines = function () {\n this.isProtectedOnChange = true;\n for (var _i = 0, _a = this.visibleSeries; _i < _a.length; _i++) {\n var series = _a[_i];\n var trendIndex = 0;\n for (var _b = 0, _c = series.trendlines; _b < _c.length; _b++) {\n var trendline = _c[_b];\n var trendLine = trendline;\n if (this.trendLineModule) {\n trendLine.index = trendIndex;\n trendLine.sourceIndex = series.index;\n this.trendLineModule.initSeriesCollection(trendLine, this);\n if (trendLine.targetSeries) {\n trendLine.targetSeries.xAxisName = series.xAxisName;\n trendLine.targetSeries.yAxisName = series.yAxisName;\n this.visibleSeries.push(trendLine.targetSeries);\n }\n }\n trendIndex++;\n }\n }\n this.isProtectedOnChange = false;\n };\n Chart.prototype.calculateAreaType = function () {\n var series = this.series[0];\n this.chartArea.border.width = this.stockChart ? 0 : this.chartArea.border.width;\n if (series) {\n this.requireInvertedAxis = ((series.type.indexOf('Bar') !== -1) && !this.isTransposed) ||\n ((series.type.indexOf('Bar') === -1) && this.isTransposed && this.chartAreaType !== 'PolarRadar');\n }\n this.chartAxisLayoutPanel = this.chartAreaType === 'PolarRadar' ? (this.polarSeriesModule || this.radarSeriesModule)\n : new CartesianAxisLayoutPanel(this);\n };\n /**\n * Calculate the visible axis\n *\n * @private\n */\n Chart.prototype.calculateVisibleAxis = function () {\n var axis;\n var axes = [this.primaryXAxis, this.primaryYAxis];\n axes = this.chartAreaType === 'Cartesian' ? axes.concat(this.axes) : axes;\n if (this.paretoSeriesModule && this.series[0].type === 'Pareto') {\n axes = axes.concat(this.paretoSeriesModule.paretoAxes);\n }\n this.axisCollections = [];\n if (this.zoomModule) {\n this.zoomModule.isPanning = this.zoomModule.isAxisZoomed(axes) && this.zoomSettings.enablePan;\n this.svgObject.setAttribute('cursor', this.zoomModule.isPanning ? 'pointer' : 'auto');\n if (this.scrollBarModule) {\n this.scrollBarModule.axes = axes;\n }\n }\n if (this.scrollSettingEnabled) {\n if (this.scrollBarModule) {\n this.scrollBarModule.axes = axes;\n }\n }\n for (var i = 0, len = axes.length; i < len; i++) {\n axis = axes[i];\n axis.series = [];\n axis.labels = [];\n for (var _i = 0, _a = this.visibleSeries; _i < _a.length; _i++) {\n var series = _a[_i];\n this.initAxis(series, axis, true);\n }\n for (var _b = 0, _c = this.indicators; _b < _c.length; _b++) {\n var indicator = _c[_b];\n this.initAxis(indicator, axis, false);\n }\n if (this.scrollBarModule && !axis.zoomingScrollBar) {\n this.scrollBarModule.injectTo(axis, this);\n }\n if (axis.orientation != null) {\n this.axisCollections.push(axis);\n }\n }\n if (this.rows.length > 0 && this.columns.length > 0) {\n this.chartAxisLayoutPanel.measure();\n }\n };\n Chart.prototype.initAxis = function (series, axis, isSeries) {\n if (series.xAxisName === axis.name || (series.xAxisName == null && axis.name === 'primaryXAxis')) {\n axis.orientation = this.requireInvertedAxis ? 'Vertical' : 'Horizontal';\n series.xAxis = axis;\n if (isSeries) {\n axis.series.push(series);\n }\n }\n else if (series.yAxisName === axis.name || (series.yAxisName == null && axis.name === 'primaryYAxis')) {\n axis.orientation = this.requireInvertedAxis ? 'Horizontal' : 'Vertical';\n series.yAxis = axis;\n if (isSeries) {\n axis.series.push(series);\n }\n }\n };\n Chart.prototype.initTechnicalIndicators = function () {\n var i = 0;\n for (var _i = 0, _a = this.indicators; _i < _a.length; _i++) {\n var indicator = _a[_i];\n var techIndicator = indicator;\n var type = firstToLowerCase(techIndicator.type);\n if (this[type + 'IndicatorModule']) {\n techIndicator.index = i;\n this[type + 'IndicatorModule'].initSeriesCollection(techIndicator, this);\n for (var _b = 0, _c = techIndicator.targetSeries; _b < _c.length; _b++) {\n var targetSeries = _c[_b];\n if (indicator.seriesName || indicator.dataSource) {\n this.visibleSeries.push(targetSeries);\n }\n }\n }\n i++;\n }\n };\n /** @private */\n Chart.prototype.refreshTechnicalIndicator = function (series) {\n if (this.indicators.length) {\n var targetIndicator = null;\n if (series instanceof Series && series.category !== 'Indicator') {\n for (var _i = 0, _a = this.indicators; _i < _a.length; _i++) {\n var indicator = _a[_i];\n if (indicator.seriesName === series.name && !indicator.dataSource) {\n targetIndicator = indicator;\n targetIndicator.setDataSource(series, this);\n }\n }\n }\n else if (series instanceof TechnicalIndicator) {\n targetIndicator = series;\n targetIndicator.setDataSource(series instanceof Series ? series : null, this);\n }\n }\n };\n Chart.prototype.calculateVisibleSeries = function () {\n var series;\n this.visibleSeries = [];\n var colors = this.palettes.length ? this.palettes : getSeriesColor(this.theme);\n var count = colors.length;\n var seriesCollection = this.series.sort(function (a, b) { return a.zOrder - b.zOrder; });\n for (var i = 0, len = seriesCollection.length; i < len; i++) {\n series = seriesCollection[i];\n // for y axis label issue during chart navigation\n series.category = seriesCollection[0].type === 'Pareto' ? 'Pareto' : 'Series';\n series.index = i;\n series.interior = series.fill || colors[i % count];\n switch (series.type) {\n case 'Bar':\n case 'StackingBar':\n case 'StackingBar100':\n if (seriesCollection[0].type.indexOf('Bar') === -1) {\n continue;\n }\n break;\n case 'Polar':\n case 'Radar':\n if (this.chartAreaType !== 'PolarRadar') {\n continue;\n }\n if (this.chartAreaType === 'PolarRadar' && ((series.xAxisName === null && series.yAxisName !== null) ||\n (series.xAxisName !== null && series.yAxisName === null) ||\n (series.xAxisName !== null && series.yAxisName !== null))) {\n continue;\n }\n break;\n case 'Pareto':\n this.visibleSeries.push(series);\n this.paretoSeriesModule.initSeries(series, this);\n continue;\n default:\n if (this.chartAreaType === 'PolarRadar' || seriesCollection[0].type.indexOf('Bar') > -1) {\n continue;\n }\n break;\n }\n this.visibleSeries.push(series);\n seriesCollection[i] = series;\n }\n };\n Chart.prototype.renderTitle = function () {\n var rect;\n var margin = this.margin;\n if (this.title) {\n var alignment = this.titleStyle.textAlignment;\n var getAnchor = alignment === 'Near' ? 'start' : alignment === 'Far' ? 'end' : 'middle';\n var elementSize = measureText(this.title, this.titleStyle);\n rect = new Rect(margin.left, 0, this.availableSize.width - margin.left - margin.right, 0);\n var options = new TextOption(this.element.id + '_ChartTitle', titlePositionX(rect, this.titleStyle), this.margin.top + ((elementSize.height) * 3 / 4), getAnchor, this.titleCollection, '', 'auto');\n var element = redrawElement(this.redraw, this.element.id + '_ChartTitle', options, this.renderer) ||\n textElement(this.renderer, options, this.titleStyle, this.titleStyle.color || this.themeStyle.chartTitle, this.svgObject, null, null, null, null, null, null, null, null, this.enableCanvas);\n if (element) {\n element.setAttribute('aria-label', this.description || this.title);\n element.setAttribute('tabindex', this.tabIndex.toString());\n }\n if (this.subTitle) {\n this.renderSubTitle(options);\n }\n }\n };\n Chart.prototype.renderSubTitle = function (options) {\n var maxWidth = 0;\n var titleWidth = 0;\n var padding = 10;\n var anchor = function (alignment) {\n return alignment === 'Near' ? 'start' : alignment === 'Far' ? 'end' : 'middle';\n };\n var alignment = this.titleStyle.textAlignment;\n for (var _i = 0, _a = this.titleCollection; _i < _a.length; _i++) {\n var titleText = _a[_i];\n titleWidth = measureText(titleText, this.titleStyle).width;\n maxWidth = titleWidth > maxWidth ? titleWidth : maxWidth;\n }\n var subTitleElementSize = measureText(this.subTitle, this.subTitleStyle);\n var rect = new Rect(alignment === 'Center' ? (options.x - maxWidth * 0.5) : alignment === 'Far' ? options.x - maxWidth : options.x, 0, maxWidth, 0);\n var subTitleOptions = new TextOption(this.element.id + '_ChartSubTitle', titlePositionX(rect, this.subTitleStyle), options.y * options.text.length + ((subTitleElementSize.height) * 3 / 4) + padding, anchor(this.subTitleStyle.textAlignment), this.subTitleCollection, '', 'auto');\n var element = redrawElement(this.redraw, this.element.id + '_ChartSubTitle', subTitleOptions, this.renderer) ||\n textElement(this.renderer, subTitleOptions, this.subTitleStyle, this.subTitleStyle.color || this.themeStyle.chartTitle, this.svgObject, null, null, null, null, null, null, null, null, this.enableCanvas);\n if (element) {\n element.setAttribute('aria-label', this.description || this.subTitle);\n element.setAttribute('tabindex', this.tabIndex.toString());\n }\n };\n Chart.prototype.renderBorder = function () {\n var x = 0;\n var y = 0;\n var width = this.border.width;\n var backGroundImage = this.backgroundImage;\n var fillColor = backGroundImage ? 'transparent' : (this.background || this.themeStyle.background);\n if (this.stockChart && this.stockChart.legendSettings.visible && this.stockChart.stockLegendModule) {\n if (this.stockChart.legendSettings.position === \"Top\") {\n y += this.stockChart.stockLegendModule.legendBounds.height;\n }\n else if (this.stockChart.legendSettings.position === \"Left\") {\n x += this.stockChart.stockLegendModule.legendBounds.width;\n }\n }\n var rect = new RectOption(this.element.id + '_ChartBorder', fillColor, this.border, 1, new Rect(width * 0.5 + x, width * 0.5 + y, this.availableSize.width - width, this.availableSize.height - width));\n this.htmlObject = redrawElement(this.redraw, this.element.id + '_ChartBorder', rect, this.renderer)\n || this.renderer.drawRectangle(rect);\n appendChildElement(this.enableCanvas, this.svgObject, this.htmlObject, this.redraw);\n // to draw back ground image for chart\n if (backGroundImage) {\n var image = new ImageOption(this.availableSize.height - width, this.availableSize.width - width, backGroundImage, 0, 0, this.element.id + '_ChartBackground', 'visible', 'none');\n this.htmlObject = redrawElement(this.redraw, this.element.id + '_ChartBackground', image, this.renderer)\n || this.renderer.drawImage(image);\n appendChildElement(this.enableCanvas, this.svgObject, this.htmlObject, this.redraw);\n }\n };\n /**\n * @private\n */\n Chart.prototype.renderAreaBorder = function () {\n if (this.chartAreaType === 'PolarRadar') {\n return null;\n }\n else {\n var element = getElement(this.element.id + '_ChartAreaBorder');\n var previousRect = element ?\n new Rect(+element.getAttribute('x'), +element.getAttribute('y'), +element.getAttribute('width'), +element.getAttribute('height')) : null;\n var rect = new RectOption(this.element.id + '_ChartAreaBorder', this.chartArea.background, { width: this.chartArea.border.width, color: this.chartArea.border.color || this.themeStyle.areaBorder }, this.chartArea.opacity, this.chartAxisLayoutPanel.seriesClipRect);\n this.htmlObject = this.renderer.drawRectangle(rect);\n appendChildElement(this.enableCanvas, this.svgObject, this.htmlObject, this.redraw, true, 'x', 'y', null, null, true, true, previousRect);\n this.htmlObject = null;\n }\n // to draw back ground image for chart area\n var backGroundImage = this.chartArea.backgroundImage;\n if (backGroundImage) {\n var width = this.chartArea.border.width;\n var image = new ImageOption(this.initialClipRect.height - width, this.initialClipRect.width - width, backGroundImage, this.initialClipRect.x, this.initialClipRect.y, this.element.id + '_ChartAreaBackground', 'visible', 'none');\n this.htmlObject = this.renderer.drawImage(image);\n appendChildElement(this.enableCanvas, this.svgObject, this.htmlObject, this.redraw, true, 'x', 'y', null, null, true, true);\n }\n };\n /**\n * To add series for the chart\n *\n * @param {SeriesModel[]} seriesCollection - Defines the series collection to be added in chart.\n * @returns {void}.\n */\n Chart.prototype.addSeries = function (seriesCollection) {\n for (var _i = 0, seriesCollection_1 = seriesCollection; _i < seriesCollection_1.length; _i++) {\n var series = seriesCollection_1[_i];\n series = new Series(this, 'series', series);\n this.series.push(series);\n }\n this.refresh();\n };\n /**\n * To Remove series for the chart\n *\n * @param {number} index - Defines the series index to be remove in chart series\n * @returns {void}\n */\n Chart.prototype.removeSeries = function (index) {\n this.redraw = false; //fix for remove svg not working when use animatemethod.\n this.series.splice(index, 1);\n this.refresh();\n };\n /**\n * To Clear all series for the chart\n *\n * @returns {void}.\n */\n Chart.prototype.clearSeries = function () {\n this.series = [];\n this.refresh();\n };\n /**\n * To add secondary axis for the chart\n *\n * @param {AxisModel[]} axisCollection - Defines the axis collection to be added in chart.\n * @returns {void}.\n */\n Chart.prototype.addAxes = function (axisCollection) {\n for (var _i = 0, axisCollection_1 = axisCollection; _i < axisCollection_1.length; _i++) {\n var axis = axisCollection_1[_i];\n axis = new Axis(this, 'axes', axis);\n if (this.isBlazor) {\n axis.interval = isNaN(axis.interval) ? null : axis.interval;\n axis.desiredIntervals = isNaN(axis.desiredIntervals) ? null : axis.desiredIntervals;\n }\n this.axes.push(axis);\n }\n this.refresh();\n };\n /**\n * To remove secondary axis for the chart\n *\n * @param {number} index - Defines the axis collection to be removed in chart.\n * @returns {void}\n */\n Chart.prototype.removeAxis = function (index) {\n this.redraw = false;\n this.axes.splice(index, 1);\n this.refresh();\n };\n /**\n * To destroy the widget\n *\n * @function destroy\n * @returns {void}.\n * @member of Chart\n */\n Chart.prototype.destroy = function () {\n if (this.scrollBarModule) {\n this.scrollBarModule.destroy();\n }\n if (this.markerRender) {\n this.markerRender.removeEventListener();\n this.markerRender = null;\n }\n this.horizontalAxes = [];\n this.verticalAxes = [];\n this.visibleSeries = [];\n this.axisCollections = [];\n this.rotatedDataLabelCollections = [];\n this.seriesElements = null;\n this.chartAxisLayoutPanel = null;\n this.dataLabelCollections = null;\n this.dataLabelElements = null;\n this.yAxisElements = null;\n /**\n * To fix react timeout destroy issue.\n */\n if (this.element) {\n this.unWireEvents();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (this.isReact) {\n this.clearTemplate();\n }\n _super.prototype.destroy.call(this);\n if (!this.enableCanvas) {\n this.removeSvg();\n this.svgObject = null;\n }\n }\n };\n /**\n * Get component name\n */\n Chart.prototype.getModuleName = function () {\n return 'chart';\n };\n /**\n * Get the properties to be maintained in the persisted state.\n *\n * @private\n */\n Chart.prototype.getPersistData = function () {\n var keyEntity = ['loaded', 'animationComplete', 'primaryXAxis', 'primaryYAxis'];\n return this.addOnPersist(keyEntity);\n };\n /**\n * Method to create SVG element.\n */\n Chart.prototype.createChartSvg = function () {\n this.removeSvg();\n createSvg(this);\n };\n /**\n * Method to bind events for chart\n */\n Chart.prototype.unWireEvents = function () {\n var startEvent = Browser.touchStartEvent;\n var moveEvent = Browser.touchMoveEvent;\n var stopEvent = Browser.touchEndEvent;\n var cancelEvent = Browser.isPointer ? 'pointerleave' : 'mouseleave';\n /*! UnBind the Event handler */\n EventHandler.remove(this.element, startEvent, this.chartOnMouseDown);\n EventHandler.remove(this.element, moveEvent, this.mouseMove);\n EventHandler.remove(this.element, stopEvent, this.mouseEnd);\n EventHandler.remove(this.element, 'click', this.chartOnMouseClick);\n EventHandler.remove(this.element, 'contextmenu', this.chartRightClick);\n EventHandler.remove(this.element, cancelEvent, this.mouseLeave);\n window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.resizeBound);\n /**\n * To fix memory issue\n */\n if (this.touchObject) {\n this.touchObject.destroy();\n this.touchObject = null;\n }\n };\n Chart.prototype.wireEvents = function () {\n /**\n * To fix react timeout destroy issue.\n */\n if (!this.element) {\n return;\n }\n /*! Find the Events type */\n var cancelEvent = Browser.isPointer ? 'pointerleave' : 'mouseleave';\n /*! Bind the Event handler */\n EventHandler.add(this.element, Browser.touchStartEvent, this.chartOnMouseDown, this);\n EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMove, this);\n EventHandler.add(this.element, Browser.touchEndEvent, this.mouseEnd, this);\n EventHandler.add(this.element, 'click', this.chartOnMouseClick, this);\n EventHandler.add(this.element, 'contextmenu', this.chartRightClick, this);\n EventHandler.add(this.element, cancelEvent, this.mouseLeave, this);\n this.resizeBound = this.chartResize.bind(this);\n window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.resizeBound);\n this.longPressBound = this.longPress.bind(this);\n this.touchObject = new Touch(this.element, { tapHold: this.longPressBound, tapHoldThreshold: 500 });\n /*! Apply the style for chart */\n this.setStyle(this.element);\n };\n Chart.prototype.chartRightClick = function (event) {\n if (this.crosshair.enable && this.crosshairModule &&\n (event.buttons === 2 || event.which === 0 || event.pointerType === 'touch')) {\n event.preventDefault();\n event.stopPropagation();\n return false;\n }\n return true;\n };\n Chart.prototype.setStyle = function (element) {\n var zooming = this.zoomSettings;\n var disableScroll = zooming.enableSelectionZooming || zooming.enablePinchZooming ||\n this.selectionMode !== 'None' || this.crosshair.enable || this.highlightMode !== 'None';\n element.style.touchAction = disableScroll ? 'none' : 'element';\n element.style.msTouchAction = disableScroll ? 'none' : 'element';\n element.style.msContentZooming = 'none';\n element.style.msUserSelect = 'none';\n element.style.webkitUserSelect = 'none';\n element.style.position = 'relative';\n element.style.display = 'block';\n // To fix angular and react tooltip div scrollbar issue\n element.style.overflow = 'hidden';\n };\n /**\n * Finds the orientation.\n *\n * @returns {boolean}\n * @private\n */\n Chart.prototype.isOrientation = function () {\n return ('orientation' in window && 'onorientationchange' in window);\n };\n /**\n * Handles the long press on chart.\n *\n * @returns {boolean} false\n * @private\n */\n Chart.prototype.longPress = function (e) {\n this.mouseX = (e && e.originalEvent.changedTouches) ? (e.originalEvent.changedTouches[0].clientX) : 0;\n this.mouseY = (e && e.originalEvent.changedTouches) ? (e.originalEvent.changedTouches[0].clientY) : 0;\n this.startMove = true;\n this.setMouseXY(this.mouseX, this.mouseY);\n this.notify('tapHold', e);\n return false;\n };\n /**\n * To find mouse x, y for aligned chart element svg position\n */\n Chart.prototype.setMouseXY = function (pageX, pageY) {\n if (getElement(this.svgId)) {\n var svgRect = getElement(this.svgId).getBoundingClientRect();\n var rect = this.element.getBoundingClientRect();\n this.mouseY = (pageY - rect.top) - Math.max(svgRect.top - rect.top, 0);\n this.mouseX = (pageX - rect.left) - Math.max(svgRect.left - rect.left, 0);\n }\n };\n /**\n * Export method for the chart.\n */\n Chart.prototype.export = function (type, fileName) {\n if (this.exportModule) {\n this.exportModule.export(type, fileName);\n if (this.afterExport) {\n this.exportModule.getDataUrl(this);\n }\n }\n };\n /**\n * Handles the chart resize.\n *\n * @returns {boolean} false\n * @private\n */\n Chart.prototype.chartResize = function () {\n var _this = this;\n this.animateSeries = false;\n var arg = {\n chart: this.isBlazor ? {} : this,\n name: resized,\n currentSize: new Size(0, 0),\n previousSize: new Size(this.availableSize.width, this.availableSize.height)\n };\n var beforeResizeArgs = { name: 'beforeResize', cancelResizedEvent: false };\n if (this.resizeTo) {\n clearTimeout(this.resizeTo);\n }\n this.trigger(beforeResize, beforeResizeArgs);\n if (!beforeResizeArgs.cancelResizedEvent) {\n this.resizeTo = +setTimeout(function () {\n if (_this.isDestroyed || _this.stockChart) {\n clearTimeout(_this.resizeTo);\n return;\n }\n _this.createChartSvg();\n arg.currentSize = _this.availableSize;\n _this.trigger(resized, arg);\n _this.refreshAxis();\n _this.refreshBound();\n _this.trigger('loaded', { chart: _this.isBlazor ? {} : _this });\n }, 500);\n }\n return false;\n };\n /**\n * Handles the mouse move.\n *\n * @returns {boolean} false\n * @private\n */\n Chart.prototype.mouseMove = function (e) {\n var pageX;\n var pageY;\n var touchArg;\n if (e.type === 'touchmove') {\n this.isTouch = true;\n touchArg = e;\n pageX = touchArg.changedTouches[0].clientX;\n pageY = touchArg.changedTouches[0].clientY;\n }\n else {\n this.isTouch = e.pointerType === 'touch' || e.pointerType === '2' || this.isTouch;\n pageX = e.clientX;\n pageY = e.clientY;\n }\n if (getElement(this.svgId)) {\n this.setMouseXY(pageX, pageY);\n this.chartOnMouseMove(e);\n }\n return false;\n };\n /**\n * Handles the mouse leave.\n *\n * @returns {boolean} false\n * @private\n */\n Chart.prototype.mouseLeave = function (e) {\n var pageX;\n var pageY;\n var touchArg;\n if (e.type === 'touchleave') {\n this.isTouch = true;\n touchArg = e;\n pageX = touchArg.changedTouches[0].clientX;\n pageY = touchArg.changedTouches[0].clientY;\n }\n else {\n this.isTouch = e.pointerType === 'touch' || e.pointerType === '2';\n pageX = e.clientX;\n pageY = e.clientY;\n }\n this.setMouseXY(pageX, pageY);\n this.chartOnMouseLeave(e);\n return false;\n };\n /**\n * Handles the mouse leave on chart.\n *\n * @returns {boolean} false\n * @private\n */\n Chart.prototype.chartOnMouseLeave = function (e) {\n var element = e.target;\n var cancelEvent = Browser.isPointer ? 'pointerleave' : 'mouseleave';\n this.trigger(chartMouseLeave, { target: element.id, x: this.mouseX, y: this.mouseY });\n removeElement(this.element.id + '_EJ2_AxisLabel_Tooltip');\n this.isChartDrag = this.isPointMouseDown = false;\n this.notify(cancelEvent, e);\n return false;\n };\n /**\n * Handles the mouse click on chart.\n *\n * @returns {boolean} false\n * @private\n */\n Chart.prototype.chartOnMouseClick = function (e) {\n var _this = this;\n var element = e.target;\n this.trigger(chartMouseClick, { target: element.id, x: this.mouseX, y: this.mouseY });\n this.clickCount++;\n var timeInterval = 0;\n var isAngular = 'isAngular';\n if (this[isAngular]) {\n var observers = 'observers';\n timeInterval = this.pointDoubleClick[observers].length > 0 ? 400 : 0;\n }\n else {\n timeInterval = this.pointDoubleClick ? 400 : 0;\n }\n if (this.clickCount === 1 && this.pointClick) {\n this.singleClickTimer = +setTimeout(function () {\n _this.clickCount = 0;\n _this.triggerPointEvent(pointClick, e);\n }, timeInterval);\n }\n else if (this.clickCount === 2 && this.pointDoubleClick) {\n clearTimeout(this.singleClickTimer);\n this.clickCount = 0;\n this.triggerPointEvent(pointDoubleClick, e);\n }\n if (this.axisLabelClick) {\n this.triggerAxisLabelClickEvent(axisLabelClick, e);\n }\n this.notify('click', e);\n return false;\n };\n Chart.prototype.triggerPointEvent = function (event, e) {\n var evt = e;\n var data = new ChartData(this);\n var pointData = data.getData();\n if (pointData.series && pointData.point) {\n this.trigger(event, {\n series: this.isBlazor ? {} : pointData.series,\n point: pointData.point,\n seriesIndex: pointData.series.index, pointIndex: pointData.point.index,\n x: this.mouseX, y: this.mouseY, pageX: evt.pageX, pageY: evt.pageY\n });\n }\n };\n Chart.prototype.triggerAxisLabelClickEvent = function (event, e) {\n var targetElement = e.target;\n var clickEvt = e;\n if (targetElement.id.indexOf('_AxisLabel_') !== -1) {\n var index = targetElement.id.split('_AxisLabel_');\n var axisIndex = +index[0].slice(-1);\n var labelIndex = +index[1];\n var currentAxis = this.axisCollections[axisIndex];\n if (currentAxis.visible && (axisIndex === 0 || axisIndex === 1)) {\n this.trigger(event, {\n chart: this,\n axis: currentAxis,\n text: currentAxis.visibleLabels[labelIndex].text,\n labelID: targetElement.id,\n index: labelIndex,\n location: new ChartLocation(clickEvt.pageX, clickEvt.pageY),\n value: currentAxis.visibleLabels[labelIndex].value\n });\n }\n }\n };\n /**\n * Handles the mouse move on chart.\n *\n * @returns {boolean} false\n * @private\n */\n Chart.prototype.chartOnMouseMove = function (e) {\n var element = e.target;\n this.trigger(chartMouseMove, { target: element.id, x: this.mouseX, y: this.mouseY });\n if (this.pointMove) {\n this.triggerPointEvent(pointMove, e);\n }\n // Tooltip for chart series.\n if (!this.isTouch) {\n this.titleTooltip(e, this.mouseX, this.mouseY);\n this.axisTooltip(e, this.mouseX, this.mouseY);\n }\n if (this.dataEditingModule) {\n this.dataEditingModule.pointMouseMove(e);\n }\n this.notify(Browser.touchMoveEvent, e);\n this.isTouch = false;\n return false;\n };\n Chart.prototype.titleTooltip = function (event, x, y, isTouch) {\n var targetId = event.target.id;\n var id = (targetId === (this.element.id + '_ChartTitle') || targetId === (this.element.id + '_ChartSubTitle') ||\n targetId.indexOf('_AxisTitle') > -1 || targetId.indexOf('_legend_title') > -1);\n var index = 0;\n if (targetId.indexOf('_AxisTitle') > -1) {\n index = parseInt(((targetId.replace(this.element.id, '')).replace('AxisLabel_', '')).split('_')[2], 10);\n }\n if (id && (event.target.textContent.indexOf('...') > -1)) {\n var title = (targetId === (this.element.id + '_ChartTitle')) ? this.title :\n targetId.indexOf('_AxisTitle') > -1 ? this.axisCollections[index].title :\n targetId.indexOf('_ChartSubTitle') > -1 ? this.subTitle : this.legendSettings.title;\n showTooltip(title, x, y, this.element.offsetWidth, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);\n }\n else {\n removeElement(this.element.id + '_EJ2_Title_Tooltip');\n }\n };\n Chart.prototype.axisTooltip = function (event, x, y, isTouch) {\n var targetId = event.target.id;\n if (((targetId.indexOf('AxisLabel') > -1) || targetId.indexOf('Axis_MultiLevelLabel') > -1) &&\n (event.target.textContent.indexOf('...') > -1)) {\n var isTitleOrLegendEnabled = (this.legendSettings.visible || this.primaryXAxis.title === '');\n showTooltip(this.findAxisLabel(targetId), x, y, this.element.offsetWidth, this.element.id + '_EJ2_AxisLabel_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch, isTitleOrLegendEnabled);\n }\n else {\n removeElement(this.element.id + '_EJ2_AxisLabel_Tooltip');\n }\n };\n Chart.prototype.findAxisLabel = function (text) {\n var texts;\n if (text.indexOf('AxisLabel') > -1) {\n texts = ((text.replace(this.element.id, '')).replace('AxisLabel_', '')).split('_');\n return this.axisCollections[parseInt(texts[0], 10)].visibleLabels[parseInt(texts[1], 10)].originalText;\n }\n else {\n texts = ((text.replace(this.element.id, '')).replace('Axis_MultiLevelLabel_Level_', '').replace('Text_', '')).split('_');\n return (this.axisCollections[parseInt(texts[0], 10)].multiLevelLabels[parseInt(texts[1], 10)]\n .categories[parseInt(texts[2], 10)].text);\n }\n };\n /**\n * Handles the mouse down on chart.\n *\n * @returns {boolean} false\n * @private\n */\n Chart.prototype.chartOnMouseDown = function (e) {\n var pageX;\n var pageY;\n var target;\n var touchArg;\n var offset = Browser.isDevice ? 20 : 30;\n var rect = this.element.getBoundingClientRect();\n var element = e.target;\n this.trigger(chartMouseDown, { target: element.id, x: this.mouseX, y: this.mouseY });\n if (e.type === 'touchstart') {\n this.isTouch = true;\n touchArg = e;\n pageX = touchArg.changedTouches[0].clientX;\n pageY = touchArg.changedTouches[0].clientY;\n target = touchArg.target;\n }\n else {\n this.isTouch = e.pointerType === 'touch';\n pageX = e.clientX;\n pageY = e.clientY;\n target = e.target;\n }\n var svgRect = getElement(this.svgId).getBoundingClientRect();\n this.mouseDownX = this.previousMouseMoveX = (pageX - rect.left) - Math.max(svgRect.left - rect.left, 0);\n this.mouseDownY = this.previousMouseMoveY = (pageY - rect.top) - Math.max(svgRect.top - rect.top, 0);\n if (this.isTouch) {\n this.isDoubleTap = (new Date().getTime() < this.threshold && target.id.indexOf(this.element.id + '_Zooming_') === -1 &&\n (this.mouseDownX - offset >= this.mouseX || this.mouseDownX + offset >= this.mouseX) &&\n (this.mouseDownY - offset >= this.mouseY || this.mouseDownY + offset >= this.mouseY) &&\n (this.mouseX - offset >= this.mouseDownX || this.mouseX + offset >= this.mouseDownX) &&\n (this.mouseY - offset >= this.mouseDownY || this.mouseY + offset >= this.mouseDownY));\n }\n if (this.dataEditingModule) {\n this.dataEditingModule.pointMouseDown();\n }\n this.notify(Browser.touchStartEvent, e);\n return false;\n };\n /**\n * Handles the mouse up.\n *\n * @returns {boolean} false\n * @private\n */\n Chart.prototype.mouseEnd = function (e) {\n var pageY;\n var pageX;\n var touchArg;\n if (e.type === 'touchend') {\n touchArg = e;\n pageX = touchArg.changedTouches[0].clientX;\n this.isTouch = true;\n pageY = touchArg.changedTouches[0].clientY;\n }\n else {\n pageY = e.clientY;\n pageX = e.clientX;\n this.isTouch = e.pointerType === 'touch' || e.pointerType === '2';\n }\n this.setMouseXY(pageX, pageY);\n this.chartOnMouseUp(e);\n return false;\n };\n /**\n * Handles the mouse up.\n *\n * @returns {boolean}\n * @private\n */\n Chart.prototype.chartOnMouseUp = function (e) {\n var element = e.target;\n this.trigger(chartMouseUp, { target: element.id, x: this.mouseX, y: this.mouseY });\n this.isChartDrag = false;\n if (this.isTouch) {\n this.titleTooltip(e, this.mouseX, this.mouseY, this.isTouch);\n this.axisTooltip(e, this.mouseX, this.mouseY, this.isTouch);\n this.threshold = new Date().getTime() + 300;\n }\n if (this.dataEditingModule) {\n this.dataEditingModule.pointMouseUp();\n }\n if (!this.enableCanvas && this.seriesElements) {\n this.seriesElements.removeAttribute('clip-path');\n }\n this.notify(Browser.touchEndEvent, e);\n return false;\n };\n /**\n * Method to set culture for chart\n */\n Chart.prototype.setCulture = function () {\n this.intl = new Internationalization();\n this.setLocaleConstants();\n this.localeObject = new L10n(this.getModuleName(), this.defaultLocalConstants, this.locale);\n };\n /**\n * Method to set the annotation content dynamically for chart.\n */\n Chart.prototype.setAnnotationValue = function (annotationIndex, content) {\n var parentNode = getElement(this.element.id + '_Annotation_Collections');\n var annotation = this.annotations[annotationIndex];\n var element;\n if (content !== null) {\n annotation.content = content;\n if (parentNode) {\n removeElement(this.element.id + '_Annotation_' + annotationIndex);\n element = this.createElement('div');\n this.annotationModule.processAnnotation(annotation, annotationIndex, element);\n parentNode.appendChild(element.children[0]);\n }\n else {\n this.annotationModule.renderAnnotations(getElement(this.element.id + '_Secondary_Element'));\n }\n }\n };\n /**\n * Method to set locale constants\n */\n Chart.prototype.setLocaleConstants = function () {\n this.defaultLocalConstants = {\n ZoomIn: 'Zoom in',\n Zoom: 'Zoom',\n ZoomOut: 'Zoom out',\n Pan: 'Pan',\n Reset: 'Reset',\n ResetZoom: 'Reset Zoom'\n };\n };\n /**\n * Theming for chart\n */\n Chart.prototype.setTheme = function () {\n /*! Set theme */\n this.themeStyle = getThemeColor(this.theme);\n };\n /**\n * To provide the array of modules needed for control rendering\n *\n * @returns {ModuleDeclaration[]}\n * @private\n */\n /* eslint-disable */\n Chart.prototype.requiredModules = function () {\n var _this = this;\n var modules = [];\n var series = this.series;\n var enableAnnotation = false;\n var moduleName;\n var errorBarVisible = false;\n var isPointDrag = false;\n var dataLabelEnable = false;\n var zooming = this.zoomSettings;\n this.chartAreaType = (series.length > 0 && (series[0].type === 'Polar' || series[0].type === 'Radar')) ? 'PolarRadar' : 'Cartesian';\n if (this.tooltip.enable) {\n modules.push({\n member: 'Tooltip',\n args: [this]\n });\n }\n series.map(function (value) {\n _this.isLegend = (_this.legendSettings.visible && ((value.name !== '') || !!_this.isLegend));\n moduleName = value.type.indexOf('100') !== -1 ? value.type.replace('100', '') + 'Series' : value.type + 'Series';\n errorBarVisible = value.errorBar.visible || errorBarVisible;\n dataLabelEnable = value.marker.dataLabel.visible || dataLabelEnable;\n isPointDrag = value.dragSettings.enable || isPointDrag;\n if (!modules.some(function (currentModule) {\n return currentModule.member === moduleName;\n })) {\n modules.push({\n member: moduleName,\n args: [_this, series]\n });\n }\n if (_this.chartAreaType === 'PolarRadar') {\n modules.push({\n member: value.drawType + 'Series',\n args: [_this, series]\n });\n }\n if (value.type === 'Pareto') {\n modules.push({\n member: 'ColumnSeries',\n args: [_this, series]\n });\n modules.push({\n member: 'LineSeries',\n args: [_this, series]\n });\n }\n });\n this.findIndicatorModules(modules);\n this.findTrendLineModules(modules);\n modules = this.findAxisModule(modules);\n enableAnnotation = this.annotations.some(function (value) {\n return (value.content !== null);\n });\n if (errorBarVisible) {\n modules.push({\n member: 'ErrorBar',\n args: [this, series]\n });\n }\n if (this.isLegend) {\n modules.push({\n member: 'Legend',\n args: [this]\n });\n }\n if (this.enableExport || this.allowExport) {\n modules.push({\n member: 'Export',\n args: [this]\n });\n }\n if (this.chartAreaType !== 'PolarRadar' && !this.scrollSettingEnabled && (zooming.enableSelectionZooming\n || zooming.enableMouseWheelZooming || zooming.enablePinchZooming || zooming.enablePan || zooming.enableScrollbar)) {\n modules.push({\n member: 'Zoom',\n args: [this, this.zoomSettings]\n });\n if (zooming.enableScrollbar) {\n modules.push({\n member: 'ScrollBar',\n args: [this]\n });\n }\n }\n if (this.selectionMode !== 'None' && !(this.chartAreaType === 'PolarRadar' &&\n this.selectionMode.indexOf('Drag') > -1)) {\n modules.push({\n member: 'Selection',\n args: [this]\n });\n }\n if (this.highlightMode !== 'None') {\n modules.push({\n member: 'Highlight',\n args: [this]\n });\n }\n if (dataLabelEnable) {\n modules.push({\n member: 'DataLabel',\n args: [this, series]\n });\n }\n if (isPointDrag) {\n modules.push({\n member: 'DataEditing',\n args: [this]\n });\n }\n if (enableAnnotation) {\n modules.push({\n member: 'Annotation',\n args: [this]\n });\n }\n if (this.chartAreaType !== 'PolarRadar' && this.crosshair.enable) {\n modules.push({\n member: 'Crosshair',\n args: [this]\n });\n }\n return modules;\n };\n Chart.prototype.findAxisModule = function (modules) {\n var axisCollections = [];\n axisCollections.push(this.primaryXAxis);\n axisCollections.push(this.primaryYAxis);\n axisCollections = axisCollections.concat(this.axes);\n var datetimeEnabled = false;\n var categoryEnabled = false;\n var logarithmicEnabled = false;\n var striplineEnabled = false;\n var dateTimeCategoryEnabled = false;\n var multiLevelEnabled = false;\n for (var _i = 0, axisCollections_1 = axisCollections; _i < axisCollections_1.length; _i++) {\n var axis = axisCollections_1[_i];\n datetimeEnabled = axis.valueType === 'DateTime' || datetimeEnabled;\n categoryEnabled = axis.valueType === 'Category' || categoryEnabled;\n logarithmicEnabled = axis.valueType === 'Logarithmic' || logarithmicEnabled;\n dateTimeCategoryEnabled = axis.valueType === 'DateTimeCategory' || dateTimeCategoryEnabled;\n striplineEnabled = this.findStriplineVisibility(axis.stripLines) || striplineEnabled;\n multiLevelEnabled = axis.multiLevelLabels.length > 0 || multiLevelEnabled;\n this.scrollSettingEnabled = axis.scrollbarSettings.enable ? true : this.scrollSettingEnabled;\n }\n if (datetimeEnabled) {\n modules.push({\n member: 'DateTime',\n args: [this]\n });\n }\n if (categoryEnabled) {\n modules.push({\n member: 'Category',\n args: [this]\n });\n }\n if (logarithmicEnabled) {\n modules.push({\n member: 'Logarithmic',\n args: [this]\n });\n }\n if (striplineEnabled) {\n modules.push({\n member: 'StripLine',\n args: [this]\n });\n }\n if (multiLevelEnabled) {\n modules.push({\n member: 'MultiLevelLabel',\n args: [this]\n });\n }\n if (dateTimeCategoryEnabled) {\n modules.push({\n member: 'DateTimeCategory',\n args: [this]\n });\n }\n if (this.scrollSettingEnabled) {\n modules.push({\n member: 'ScrollBar',\n args: [this]\n });\n }\n return modules;\n };\n Chart.prototype.findIndicatorModules = function (modules) {\n var macdEnable;\n var bandEnable;\n var indicators = this.indicators;\n if (this.indicators.length) {\n modules.push({\n member: 'LineSeries',\n args: [this]\n });\n indicators.map(function (indicator) {\n macdEnable = macdEnable || indicator.type === 'Macd';\n bandEnable = bandEnable || indicator.type === 'BollingerBands';\n });\n if (macdEnable) {\n modules.push({\n member: 'ColumnSeries',\n args: [this]\n });\n }\n if (bandEnable) {\n modules.push({\n member: 'RangeAreaSeries',\n args: [this]\n });\n }\n if (bandEnable) {\n modules.push({\n member: 'SplineRangeAreaSeries',\n args: [this]\n });\n }\n for (var _i = 0, _a = this.indicators; _i < _a.length; _i++) {\n var indicator = _a[_i];\n modules.push({\n member: indicator.type + 'Indicator',\n args: [this]\n });\n }\n }\n };\n Chart.prototype.findTrendLineModules = function (modules) {\n var isLine;\n var isSpline;\n var _loop_1 = function (series) {\n var markerEnable;\n series.trendlines.map(function (trendline) {\n markerEnable = markerEnable || trendline.marker.visible;\n isLine = isLine || (trendline.type === 'Linear' || trendline.type === 'MovingAverage') ? true : false;\n isSpline = isSpline || !isLine ? true : false;\n });\n if (markerEnable) {\n modules.push({\n member: 'Marker',\n args: [this_1, series]\n });\n }\n };\n var this_1 = this;\n for (var _i = 0, _a = this.series; _i < _a.length; _i++) {\n var series = _a[_i];\n _loop_1(series);\n }\n if (isLine || isSpline) {\n modules.push({\n member: 'TrendLine',\n args: [this]\n });\n }\n if (isLine) {\n modules.push({\n member: 'LineSeries',\n args: [this]\n });\n }\n if (isSpline) {\n modules.push({\n member: 'SplineSeries',\n args: [this]\n });\n }\n };\n Chart.prototype.findStriplineVisibility = function (striplines) {\n var visible = false;\n for (var _i = 0, striplines_1 = striplines; _i < striplines_1.length; _i++) {\n var stripline = striplines_1[_i];\n if (stripline.visible) {\n visible = true;\n break;\n }\n }\n return visible;\n };\n /**\n * To Remove the SVG.\n * @return {boolean}\n * @private\n */\n Chart.prototype.removeSvg = function () {\n if (this.redraw) {\n return null;\n }\n blazorTemplatesReset(this);\n if (this.enableCanvas && this.svgObject && this.svgObject.tagName === 'CANVAS') {\n this.renderer.clearRect(new Rect(0, 0, this.availableSize.width, this.availableSize.height));\n if (this.svgObject.parentNode) {\n remove(this.svgObject);\n }\n return null;\n }\n removeElement(this.element.id + '_Secondary_Element');\n if (this.isReact) {\n this.clearTemplate();\n }\n var removeLength = 0;\n if (this.zoomModule && this.zoomModule.pinchTarget) {\n this.zoomModule.pinchTarget.id = '';\n this.zoomModule.pinchTarget.setAttribute('opacity', '0');\n this.svgObject.appendChild(this.zoomModule.pinchTarget);\n removeLength = 1;\n }\n // Fix for blazor resize issue\n if (!isNullOrUndefined(this.resizeTo)) {\n if (this.resizeTo !== this.checkResize && this.isBlazor && this.element.childElementCount) {\n var containerCollection = document.querySelectorAll('.e-chart');\n for (var index = 0; index < containerCollection.length; index++) {\n var container = containerCollection[index];\n while (container.firstChild) {\n remove(container.firstChild);\n }\n }\n }\n this.checkResize = this.resizeTo;\n }\n if (this.svgObject) {\n while (this.svgObject.childNodes.length > removeLength) {\n this.svgObject.removeChild(this.svgObject.firstChild);\n }\n if (!this.svgObject.hasChildNodes() && this.svgObject.parentNode && !(this.stockChart)) {\n remove(this.svgObject);\n }\n }\n };\n Chart.prototype.refreshDefinition = function (definitions) {\n for (var _i = 0, definitions_1 = definitions; _i < definitions_1.length; _i++) {\n var item = definitions_1[_i];\n item.axes = [];\n }\n };\n /**\n * Refresh the axis default value.\n *\n * @returns {boolean}\n * @private\n */\n Chart.prototype.refreshAxis = function () {\n var axis = this.primaryXAxis;\n axis.rect = new Rect(undefined, undefined, 0, 0);\n axis = this.primaryYAxis;\n axis.isStack100 = false;\n axis.rect = new Rect(undefined, undefined, 0, 0);\n for (var _i = 0, _a = this.axes; _i < _a.length; _i++) {\n var item = _a[_i];\n axis = item;\n axis.rect = new Rect(undefined, undefined, 0, 0);\n axis.isStack100 = false;\n }\n if (this.paretoSeriesModule && this.series[0].type === 'Pareto') {\n for (var _b = 0, _c = this.paretoSeriesModule.paretoAxes; _b < _c.length; _b++) {\n var item = _c[_b];\n axis = item;\n axis.rect = new Rect(undefined, undefined, 0, 0);\n axis.isStack100 = false;\n }\n }\n };\n Chart.prototype.axisChange = function (axis) {\n if (!axis.name && !axis.valueType) {\n return false;\n }\n this.refreshDefinition(this.columns);\n this.refreshDefinition(this.rows);\n this.calculateVisibleAxis();\n this.processData();\n return true;\n };\n /**\n * Get visible series by index\n */\n Chart.prototype.getVisibleSeries = function (visibleSeries, index) {\n for (var _i = 0, visibleSeries_1 = visibleSeries; _i < visibleSeries_1.length; _i++) {\n var series = visibleSeries_1[_i];\n if (index === series.index) {\n return series;\n }\n }\n return null;\n };\n /**\n * Fix for live data update flicker issue\n */\n Chart.prototype.refreshLiveData = function () {\n this.calculateVisibleSeries();\n this.initTechnicalIndicators();\n this.initTrendLines();\n this.refreshDefinition(this.columns);\n this.refreshDefinition(this.rows);\n this.calculateVisibleAxis();\n this.processData(false);\n if (!this.isBlazor) {\n this.enableCanvas ? this.createChartSvg() : this.removeSvg();\n this.refreshAxis();\n this.refreshBound();\n this.trigger('loaded', { chart: this.isBlazor ? {} : this });\n }\n };\n /**\n * To remove style element\n */\n Chart.prototype.removeStyles = function () {\n removeElement(this.element.id + '_ej2_chart_selection');\n removeElement(this.element.id + '_ej2_chart_highlight');\n };\n /**\n * Called internally if any of the property value changed.\n * @private\n */\n // tslint:disable-next-line:max-func-body-length\n Chart.prototype.onPropertyChanged = function (newProp, oldProp) {\n var renderer = false;\n var refreshBounds = false;\n this.animateSeries = false;\n if (!this.delayRedraw) {\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'primaryXAxis':\n refreshBounds = this.axisChange(newProp.primaryXAxis);\n if (newProp.primaryXAxis.edgeLabelPlacement) {\n renderer = true;\n }\n if (!newProp.primaryXAxis.crosshairTooltip) {\n refreshBounds = true;\n }\n break;\n case 'primaryYAxis':\n refreshBounds = this.axisChange(newProp.primaryYAxis);\n if (newProp.primaryYAxis.edgeLabelPlacement) {\n renderer = true;\n }\n if (!newProp.primaryYAxis.crosshairTooltip) {\n refreshBounds = true;\n }\n break;\n case 'axes':\n for (var _b = 0, _c = Object.keys(newProp.axes); _b < _c.length; _b++) {\n var index = _c[_b];\n refreshBounds = refreshBounds || this.axisChange(newProp.axes[index]);\n if (!newProp.axes[index].crosshairTooltip) {\n refreshBounds = true;\n }\n }\n break;\n case 'height':\n case 'width':\n this.createChartSvg();\n refreshBounds = true;\n break;\n case 'subTitle':\n case 'title':\n refreshBounds = true;\n break;\n case 'titleStyle':\n if (newProp.titleStyle && (newProp.titleStyle.size || newProp.titleStyle.textOverflow)) {\n refreshBounds = true;\n }\n else {\n renderer = true;\n }\n break;\n case 'subTitleStyle':\n if (newProp.subTitleStyle && (newProp.subTitleStyle.size || newProp.subTitleStyle.textOverflow)) {\n refreshBounds = true;\n }\n else {\n renderer = true;\n }\n break;\n case 'border':\n renderer = true;\n break;\n case 'dataSource':\n this.processData(false);\n refreshBounds = true;\n break;\n case 'enableCanvas':\n this.refresh();\n break;\n case 'series':\n var len = this.series.length;\n var seriesRefresh = false;\n var series = void 0;\n var blazorProp = void 0;\n for (var i = 0; i < len; i++) {\n series = newProp.series[i];\n // I264774 blazor series visible property binding not working issue fixed.\n if (this.isBlazor && series && ((series.visible !== oldProp.series[i].visible) || series.isClosed ||\n series.marker || series.emptyPointSettings || series.type || series.boxPlotMode || series.showMean)) {\n blazorProp = true;\n }\n if (series && (series.dataSource || series.query || series.errorBar || series.xName ||\n series.yName || series.size || series.high || series.low || series.open || series.close ||\n series.fill || series.name || series.marker || blazorProp)) {\n extend(this.getVisibleSeries(this.visibleSeries, i), series, null, true);\n seriesRefresh = true;\n }\n }\n if (seriesRefresh) {\n this.calculateVisibleSeries();\n this.initTechnicalIndicators();\n this.initTrendLines();\n this.refreshDefinition(this.columns);\n this.refreshDefinition(this.rows);\n this.calculateVisibleAxis();\n this.processData(false);\n refreshBounds = true;\n }\n break;\n case 'indicators':\n refreshBounds = true;\n break;\n case 'zoomSettings':\n if (newProp.zoomSettings.enableScrollbar || oldProp.zoomSettings.enableScrollbar) {\n refreshBounds = true;\n }\n renderer = true;\n break;\n case 'background':\n renderer = true;\n break;\n case 'chartArea':\n if (newProp.chartArea.border && newProp.chartArea.border.width) {\n refreshBounds = true;\n }\n renderer = true;\n break;\n case 'legendSettings':\n if (!newProp.legendSettings.background || !newProp.legendSettings.opacity) {\n refreshBounds = true;\n }\n renderer = true;\n break;\n case 'palettes':\n this.calculateVisibleSeries();\n renderer = true;\n break;\n case 'selectedDataIndexes':\n if (this.selectionModule) {\n this.selectionModule.currentMode = this.selectionMode;\n this.selectionModule.selectedDataIndexes = this.selectedDataIndexes;\n this.selectionModule.styleId = this.element.id + '_ej2_chart_selection';\n this.selectionModule.redrawSelection(this, oldProp.selectionMode, true);\n }\n break;\n case 'selectionMode':\n if (this.selectionModule && newProp.selectionMode && newProp.selectionMode.indexOf('Drag') === -1) {\n this.selectionModule.currentMode = this.selectionMode;\n this.selectionModule.styleId = this.element.id + '_ej2_chart_selection';\n this.selectionModule.redrawSelection(this, oldProp.selectionMode, true);\n }\n break;\n case 'isMultiSelect':\n if (this.selectionModule && !newProp.isMultiSelect && this.selectionModule.selectedDataIndexes.length > 1) {\n this.selectionModule.currentMode = this.selectionMode;\n this.selectionModule.styleId = this.element.id + '_ej2_chart_selection';\n this.selectionModule.redrawSelection(this, oldProp.selectionMode);\n }\n break;\n case 'highlightMode':\n case 'selectionPattern':\n case 'highlightPattern':\n this.removeStyles();\n renderer = true;\n break;\n case 'theme':\n this.animateSeries = true;\n break;\n case 'locale':\n case 'currencyCode':\n if (this.isBlazor) {\n this.setCulture();\n renderer = true;\n }\n else {\n this.refresh();\n }\n break;\n case 'tooltip':\n if (this.tooltipModule) { // To check the tooltip enable is true.\n this.tooltipModule.previousPoints = [];\n if (this.tooltip.template) {\n this.tooltipModule.template = this.tooltip.template;\n }\n }\n break;\n }\n }\n if (!refreshBounds && renderer) {\n this.rotatedDataLabelCollections = [];\n this.removeSvg();\n this.renderElements();\n this.trigger('loaded', { chart: this.isBlazor ? {} : this });\n }\n if (refreshBounds) {\n this.enableCanvas ? this.createChartSvg() : this.removeSvg();\n if (this.isReact) {\n this.clearTemplate();\n }\n this.refreshAxis();\n this.refreshBound();\n this.trigger('loaded', { chart: this.isBlazor ? {} : this });\n this.redraw = false;\n this.animated = false;\n }\n }\n };\n __decorate([\n Property(null)\n ], Chart.prototype, \"width\", void 0);\n __decorate([\n Property(null)\n ], Chart.prototype, \"height\", void 0);\n __decorate([\n Property('')\n ], Chart.prototype, \"title\", void 0);\n __decorate([\n Property('')\n ], Chart.prototype, \"dataSource\", void 0);\n __decorate([\n Complex(Theme.chartTitleFont, Font)\n ], Chart.prototype, \"titleStyle\", void 0);\n __decorate([\n Property('')\n ], Chart.prototype, \"subTitle\", void 0);\n __decorate([\n Complex(Theme.chartSubTitleFont, Font)\n ], Chart.prototype, \"subTitleStyle\", void 0);\n __decorate([\n Complex({}, Margin)\n ], Chart.prototype, \"margin\", void 0);\n __decorate([\n Complex({ color: '#DDDDDD', width: 0 }, Border)\n ], Chart.prototype, \"border\", void 0);\n __decorate([\n Property(null)\n ], Chart.prototype, \"background\", void 0);\n __decorate([\n Complex({ border: { color: null, width: 0.5 }, background: 'transparent' }, ChartArea)\n ], Chart.prototype, \"chartArea\", void 0);\n __decorate([\n Complex({ name: 'primaryXAxis' }, Axis)\n ], Chart.prototype, \"primaryXAxis\", void 0);\n __decorate([\n Complex({ name: 'primaryYAxis' }, Axis)\n ], Chart.prototype, \"primaryYAxis\", void 0);\n __decorate([\n Collection([{}], Row)\n ], Chart.prototype, \"rows\", void 0);\n __decorate([\n Collection([{}], Column)\n ], Chart.prototype, \"columns\", void 0);\n __decorate([\n Collection([{}], Axis)\n ], Chart.prototype, \"axes\", void 0);\n __decorate([\n Collection([{}], Series)\n ], Chart.prototype, \"series\", void 0);\n __decorate([\n Collection([{}], ChartAnnotationSettings)\n ], Chart.prototype, \"annotations\", void 0);\n __decorate([\n Property([])\n ], Chart.prototype, \"palettes\", void 0);\n __decorate([\n Property('Material')\n ], Chart.prototype, \"theme\", void 0);\n __decorate([\n Complex({}, TooltipSettings)\n ], Chart.prototype, \"tooltip\", void 0);\n __decorate([\n Complex({}, CrosshairSettings)\n ], Chart.prototype, \"crosshair\", void 0);\n __decorate([\n Complex({}, LegendSettings)\n ], Chart.prototype, \"legendSettings\", void 0);\n __decorate([\n Collection([{}], RangeColorSetting)\n ], Chart.prototype, \"rangeColorSettings\", void 0);\n __decorate([\n Complex({}, ZoomSettings)\n ], Chart.prototype, \"zoomSettings\", void 0);\n __decorate([\n Property('None')\n ], Chart.prototype, \"selectionMode\", void 0);\n __decorate([\n Property('None')\n ], Chart.prototype, \"highlightMode\", void 0);\n __decorate([\n Property('None')\n ], Chart.prototype, \"selectionPattern\", void 0);\n __decorate([\n Property('None')\n ], Chart.prototype, \"highlightPattern\", void 0);\n __decorate([\n Property(false)\n ], Chart.prototype, \"isMultiSelect\", void 0);\n __decorate([\n Property(false)\n ], Chart.prototype, \"allowMultiSelection\", void 0);\n __decorate([\n Property(true)\n ], Chart.prototype, \"enableExport\", void 0);\n __decorate([\n Property(false)\n ], Chart.prototype, \"allowExport\", void 0);\n __decorate([\n Collection([], Indexes)\n ], Chart.prototype, \"selectedDataIndexes\", void 0);\n __decorate([\n Property(false)\n ], Chart.prototype, \"useGroupingSeparator\", void 0);\n __decorate([\n Property(false)\n ], Chart.prototype, \"enableAutoIntervalOnBothAxis\", void 0);\n __decorate([\n Property(false)\n ], Chart.prototype, \"isTransposed\", void 0);\n __decorate([\n Property(false)\n ], Chart.prototype, \"enableCanvas\", void 0);\n __decorate([\n Property(null)\n ], Chart.prototype, \"backgroundImage\", void 0);\n __decorate([\n Collection([], TechnicalIndicator)\n ], Chart.prototype, \"indicators\", void 0);\n __decorate([\n Property(true)\n ], Chart.prototype, \"enableAnimation\", void 0);\n __decorate([\n Property(null)\n ], Chart.prototype, \"description\", void 0);\n __decorate([\n Property(1)\n ], Chart.prototype, \"tabIndex\", void 0);\n __decorate([\n Property(true)\n ], Chart.prototype, \"enableSideBySidePlacement\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"resized\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"beforeResize\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"annotationRender\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"beforePrint\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"loaded\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"beforeExport\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"afterExport\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"load\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"animationComplete\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"legendRender\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"textRender\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"pointRender\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"seriesRender\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"axisLabelRender\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"axisLabelClick\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"axisRangeCalculated\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"axisMultiLabelRender\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"legendClick\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"multiLevelLabelClick\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"tooltipRender\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"sharedTooltipRender\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"chartMouseMove\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"chartMouseClick\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"pointClick\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"pointDoubleClick\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"pointMove\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"chartMouseLeave\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"chartMouseDown\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"chartMouseUp\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"dragComplete\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"selectionComplete\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"zoomComplete\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"onZooming\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"scrollStart\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"scrollEnd\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"scrollChanged\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"dragStart\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"drag\", void 0);\n __decorate([\n Event()\n ], Chart.prototype, \"dragEnd\", void 0);\n __decorate([\n Property('USD')\n ], Chart.prototype, \"currencyCode\", void 0);\n Chart = __decorate([\n NotifyPropertyChanges\n ], Chart);\n return Chart;\n}(Component));\nexport { Chart };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar SegmentsDirective = /** @class */ (function (_super) {\n __extends(SegmentsDirective, _super);\n function SegmentsDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SegmentsDirective.prototype.render = function () {\n return;\n };\n SegmentsDirective.prototype.getTag = function () {\n return 'e-segments';\n };\n SegmentsDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], SegmentsDirective);\n return SegmentsDirective;\n}(vueImport));\nexport { SegmentsDirective };\nexport var SegmentsPlugin = {\n name: 'e-segments',\n install: function (Vue) {\n Vue.component(SegmentsPlugin.name, SegmentsDirective);\n }\n};\nvar SegmentDirective = /** @class */ (function (_super) {\n __extends(SegmentDirective, _super);\n function SegmentDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SegmentDirective.prototype.render = function () {\n return;\n };\n SegmentDirective.prototype.getTag = function () {\n return 'e-segment';\n };\n SegmentDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], SegmentDirective);\n return SegmentDirective;\n}(vueImport));\nexport { SegmentDirective };\nexport var SegmentPlugin = {\n name: 'e-segment',\n install: function (Vue) {\n Vue.component(SegmentPlugin.name, SegmentDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar SeriesCollectionDirective = /** @class */ (function (_super) {\n __extends(SeriesCollectionDirective, _super);\n function SeriesCollectionDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SeriesCollectionDirective.prototype.render = function () {\n return;\n };\n SeriesCollectionDirective.prototype.getTag = function () {\n return 'e-series-collection';\n };\n SeriesCollectionDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], SeriesCollectionDirective);\n return SeriesCollectionDirective;\n}(vueImport));\nexport { SeriesCollectionDirective };\nexport var SeriesCollectionPlugin = {\n name: 'e-series-collection',\n install: function (Vue) {\n Vue.component(SeriesCollectionPlugin.name, SeriesCollectionDirective);\n }\n};\nvar SeriesDirective = /** @class */ (function (_super) {\n __extends(SeriesDirective, _super);\n function SeriesDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SeriesDirective.prototype.render = function () {\n return;\n };\n SeriesDirective.prototype.getTag = function () {\n return 'e-series';\n };\n SeriesDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], SeriesDirective);\n return SeriesDirective;\n}(vueImport));\nexport { SeriesDirective };\nexport var SeriesPlugin = {\n name: 'e-series',\n install: function (Vue) {\n Vue.component(SeriesPlugin.name, SeriesDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar StripLinesDirective = /** @class */ (function (_super) {\n __extends(StripLinesDirective, _super);\n function StripLinesDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StripLinesDirective.prototype.render = function () {\n return;\n };\n StripLinesDirective.prototype.getTag = function () {\n return 'e-striplines';\n };\n StripLinesDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], StripLinesDirective);\n return StripLinesDirective;\n}(vueImport));\nexport { StripLinesDirective };\nexport var StripLinesPlugin = {\n name: 'e-striplines',\n install: function (Vue) {\n Vue.component(StripLinesPlugin.name, StripLinesDirective);\n }\n};\nvar StripLineDirective = /** @class */ (function (_super) {\n __extends(StripLineDirective, _super);\n function StripLineDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StripLineDirective.prototype.render = function () {\n return;\n };\n StripLineDirective.prototype.getTag = function () {\n return 'e-stripline';\n };\n StripLineDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], StripLineDirective);\n return StripLineDirective;\n}(vueImport));\nexport { StripLineDirective };\nexport var StripLinePlugin = {\n name: 'e-stripline',\n install: function (Vue) {\n Vue.component(StripLinePlugin.name, StripLineDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar CategoriesDirective = /** @class */ (function (_super) {\n __extends(CategoriesDirective, _super);\n function CategoriesDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n CategoriesDirective.prototype.render = function () {\n return;\n };\n CategoriesDirective.prototype.getTag = function () {\n return 'e-categories';\n };\n CategoriesDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], CategoriesDirective);\n return CategoriesDirective;\n}(vueImport));\nexport { CategoriesDirective };\nexport var CategoriesPlugin = {\n name: 'e-categories',\n install: function (Vue) {\n Vue.component(CategoriesPlugin.name, CategoriesDirective);\n }\n};\nvar CategoryDirective = /** @class */ (function (_super) {\n __extends(CategoryDirective, _super);\n function CategoryDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n CategoryDirective.prototype.render = function () {\n return;\n };\n CategoryDirective.prototype.getTag = function () {\n return 'e-category';\n };\n CategoryDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], CategoryDirective);\n return CategoryDirective;\n}(vueImport));\nexport { CategoryDirective };\nexport var CategoryPlugin = {\n name: 'e-category',\n install: function (Vue) {\n Vue.component(CategoryPlugin.name, CategoryDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar MultiLevelLabelsDirective = /** @class */ (function (_super) {\n __extends(MultiLevelLabelsDirective, _super);\n function MultiLevelLabelsDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MultiLevelLabelsDirective.prototype.render = function () {\n return;\n };\n MultiLevelLabelsDirective.prototype.getTag = function () {\n return 'e-multilevellabels';\n };\n MultiLevelLabelsDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], MultiLevelLabelsDirective);\n return MultiLevelLabelsDirective;\n}(vueImport));\nexport { MultiLevelLabelsDirective };\nexport var MultiLevelLabelsPlugin = {\n name: 'e-multilevellabels',\n install: function (Vue) {\n Vue.component(MultiLevelLabelsPlugin.name, MultiLevelLabelsDirective);\n }\n};\nvar MultiLevelLabelDirective = /** @class */ (function (_super) {\n __extends(MultiLevelLabelDirective, _super);\n function MultiLevelLabelDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MultiLevelLabelDirective.prototype.render = function () {\n return;\n };\n MultiLevelLabelDirective.prototype.getTag = function () {\n return 'e-multilevellabel';\n };\n MultiLevelLabelDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], MultiLevelLabelDirective);\n return MultiLevelLabelDirective;\n}(vueImport));\nexport { MultiLevelLabelDirective };\nexport var MultiLevelLabelPlugin = {\n name: 'e-multilevellabel',\n install: function (Vue) {\n Vue.component(MultiLevelLabelPlugin.name, MultiLevelLabelDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar AxesDirective = /** @class */ (function (_super) {\n __extends(AxesDirective, _super);\n function AxesDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AxesDirective.prototype.render = function () {\n return;\n };\n AxesDirective.prototype.getTag = function () {\n return 'e-axes';\n };\n AxesDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], AxesDirective);\n return AxesDirective;\n}(vueImport));\nexport { AxesDirective };\nexport var AxesPlugin = {\n name: 'e-axes',\n install: function (Vue) {\n Vue.component(AxesPlugin.name, AxesDirective);\n }\n};\nvar AxisDirective = /** @class */ (function (_super) {\n __extends(AxisDirective, _super);\n function AxisDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AxisDirective.prototype.render = function () {\n return;\n };\n AxisDirective.prototype.getTag = function () {\n return 'e-axis';\n };\n AxisDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], AxisDirective);\n return AxisDirective;\n}(vueImport));\nexport { AxisDirective };\nexport var AxisPlugin = {\n name: 'e-axis',\n install: function (Vue) {\n Vue.component(AxisPlugin.name, AxisDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar RowsDirective = /** @class */ (function (_super) {\n __extends(RowsDirective, _super);\n function RowsDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n RowsDirective.prototype.render = function () {\n return;\n };\n RowsDirective.prototype.getTag = function () {\n return 'e-rows';\n };\n RowsDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], RowsDirective);\n return RowsDirective;\n}(vueImport));\nexport { RowsDirective };\nexport var RowsPlugin = {\n name: 'e-rows',\n install: function (Vue) {\n Vue.component(RowsPlugin.name, RowsDirective);\n }\n};\nvar RowDirective = /** @class */ (function (_super) {\n __extends(RowDirective, _super);\n function RowDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n RowDirective.prototype.render = function () {\n return;\n };\n RowDirective.prototype.getTag = function () {\n return 'e-row';\n };\n RowDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], RowDirective);\n return RowDirective;\n}(vueImport));\nexport { RowDirective };\nexport var RowPlugin = {\n name: 'e-row',\n install: function (Vue) {\n Vue.component(RowPlugin.name, RowDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar ColumnsDirective = /** @class */ (function (_super) {\n __extends(ColumnsDirective, _super);\n function ColumnsDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ColumnsDirective.prototype.render = function () {\n return;\n };\n ColumnsDirective.prototype.getTag = function () {\n return 'e-columns';\n };\n ColumnsDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], ColumnsDirective);\n return ColumnsDirective;\n}(vueImport));\nexport { ColumnsDirective };\nexport var ColumnsPlugin = {\n name: 'e-columns',\n install: function (Vue) {\n Vue.component(ColumnsPlugin.name, ColumnsDirective);\n }\n};\nvar ColumnDirective = /** @class */ (function (_super) {\n __extends(ColumnDirective, _super);\n function ColumnDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ColumnDirective.prototype.render = function () {\n return;\n };\n ColumnDirective.prototype.getTag = function () {\n return 'e-column';\n };\n ColumnDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], ColumnDirective);\n return ColumnDirective;\n}(vueImport));\nexport { ColumnDirective };\nexport var ColumnPlugin = {\n name: 'e-column',\n install: function (Vue) {\n Vue.component(ColumnPlugin.name, ColumnDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar RangeColorSettingsDirective = /** @class */ (function (_super) {\n __extends(RangeColorSettingsDirective, _super);\n function RangeColorSettingsDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n RangeColorSettingsDirective.prototype.render = function () {\n return;\n };\n RangeColorSettingsDirective.prototype.getTag = function () {\n return 'e-rangecolorsettings';\n };\n RangeColorSettingsDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], RangeColorSettingsDirective);\n return RangeColorSettingsDirective;\n}(vueImport));\nexport { RangeColorSettingsDirective };\nexport var RangeColorSettingsPlugin = {\n name: 'e-rangecolorsettings',\n install: function (Vue) {\n Vue.component(RangeColorSettingsPlugin.name, RangeColorSettingsDirective);\n }\n};\nvar RangeColorSettingDirective = /** @class */ (function (_super) {\n __extends(RangeColorSettingDirective, _super);\n function RangeColorSettingDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n RangeColorSettingDirective.prototype.render = function () {\n return;\n };\n RangeColorSettingDirective.prototype.getTag = function () {\n return 'e-rangecolorsetting';\n };\n RangeColorSettingDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], RangeColorSettingDirective);\n return RangeColorSettingDirective;\n}(vueImport));\nexport { RangeColorSettingDirective };\nexport var RangeColorSettingPlugin = {\n name: 'e-rangecolorsetting',\n install: function (Vue) {\n Vue.component(RangeColorSettingPlugin.name, RangeColorSettingDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar AnnotationsDirective = /** @class */ (function (_super) {\n __extends(AnnotationsDirective, _super);\n function AnnotationsDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AnnotationsDirective.prototype.render = function () {\n return;\n };\n AnnotationsDirective.prototype.getTag = function () {\n return 'e-annotations';\n };\n AnnotationsDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], AnnotationsDirective);\n return AnnotationsDirective;\n}(vueImport));\nexport { AnnotationsDirective };\nexport var AnnotationsPlugin = {\n name: 'e-annotations',\n install: function (Vue) {\n Vue.component(AnnotationsPlugin.name, AnnotationsDirective);\n }\n};\n/**\n * `e-annotation` directive represent a annotation of the VueJS Chart.\n * It must be contained in a Chart component(`ejs-chart`).\n * ```vue\n *
\n * \n * \n * \n * \n * \n * ```\n */\nvar AnnotationDirective = /** @class */ (function (_super) {\n __extends(AnnotationDirective, _super);\n function AnnotationDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AnnotationDirective.prototype.render = function () {\n return;\n };\n AnnotationDirective.prototype.getTag = function () {\n return 'e-annotation';\n };\n AnnotationDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], AnnotationDirective);\n return AnnotationDirective;\n}(vueImport));\nexport { AnnotationDirective };\nexport var AnnotationPlugin = {\n name: 'e-annotation',\n install: function (Vue) {\n Vue.component(AnnotationPlugin.name, AnnotationDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar SelectedDataIndexesDirective = /** @class */ (function (_super) {\n __extends(SelectedDataIndexesDirective, _super);\n function SelectedDataIndexesDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SelectedDataIndexesDirective.prototype.render = function () {\n return;\n };\n SelectedDataIndexesDirective.prototype.getTag = function () {\n return 'e-selecteddataindexes';\n };\n SelectedDataIndexesDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], SelectedDataIndexesDirective);\n return SelectedDataIndexesDirective;\n}(vueImport));\nexport { SelectedDataIndexesDirective };\nexport var SelectedDataIndexesPlugin = {\n name: 'e-selecteddataindexes',\n install: function (Vue) {\n Vue.component(SelectedDataIndexesPlugin.name, SelectedDataIndexesDirective);\n }\n};\nvar SelectedDataIndexDirective = /** @class */ (function (_super) {\n __extends(SelectedDataIndexDirective, _super);\n function SelectedDataIndexDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SelectedDataIndexDirective.prototype.render = function () {\n return;\n };\n SelectedDataIndexDirective.prototype.getTag = function () {\n return 'e-selecteddataindex';\n };\n SelectedDataIndexDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], SelectedDataIndexDirective);\n return SelectedDataIndexDirective;\n}(vueImport));\nexport { SelectedDataIndexDirective };\nexport var SelectedDataIndexPlugin = {\n name: 'e-selecteddataindex',\n install: function (Vue) {\n Vue.component(SelectedDataIndexPlugin.name, SelectedDataIndexDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EJComponentDecorator, allVue, gh } from '@syncfusion/ej2-vue-base';\n\nimport Vue from 'vue';\nexport var isExecute = gh ? false : true;\nvar vueImport;\nif (!isExecute || parseInt(allVue.version) < 3) {\n vueImport = Vue;\n}\nelse {\n vueImport = Vue;\n}\nvar IndicatorsDirective = /** @class */ (function (_super) {\n __extends(IndicatorsDirective, _super);\n function IndicatorsDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n IndicatorsDirective.prototype.render = function () {\n return;\n };\n IndicatorsDirective.prototype.getTag = function () {\n return 'e-indicators';\n };\n IndicatorsDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], IndicatorsDirective);\n return IndicatorsDirective;\n}(vueImport));\nexport { IndicatorsDirective };\nexport var IndicatorsPlugin = {\n name: 'e-indicators',\n install: function (Vue) {\n Vue.component(IndicatorsPlugin.name, IndicatorsDirective);\n }\n};\nvar IndicatorDirective = /** @class */ (function (_super) {\n __extends(IndicatorDirective, _super);\n function IndicatorDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n IndicatorDirective.prototype.render = function () {\n return;\n };\n IndicatorDirective.prototype.getTag = function () {\n return 'e-indicator';\n };\n IndicatorDirective = __decorate([\n EJComponentDecorator({}, isExecute)\n ], IndicatorDirective);\n return IndicatorDirective;\n}(vueImport));\nexport { IndicatorDirective };\nexport var IndicatorPlugin = {\n name: 'e-indicator',\n install: function (Vue) {\n Vue.component(IndicatorPlugin.name, IndicatorDirective);\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { isUndefined } from '@syncfusion/ej2-base';\nimport { ComponentBase, EJComponentDecorator, getProps, gh } from '@syncfusion/ej2-vue-base';\nimport { isNullOrUndefined, getValue } from '@syncfusion/ej2-base';\nimport { Chart } from '@syncfusion/ej2-charts';\nimport { TrendlinesDirective, TrendlineDirective, TrendlinesPlugin, TrendlinePlugin } from './trendlines.directive';\nimport { SegmentsDirective, SegmentDirective, SegmentsPlugin, SegmentPlugin } from './segments.directive';\nimport { SeriesCollectionDirective, SeriesDirective, SeriesCollectionPlugin, SeriesPlugin } from './series.directive';\nimport { StripLinesDirective, StripLineDirective, StripLinesPlugin, StripLinePlugin } from './striplines.directive';\nimport { CategoriesDirective, CategoryDirective, CategoriesPlugin, CategoryPlugin } from './categories.directive';\nimport { MultiLevelLabelsDirective, MultiLevelLabelDirective, MultiLevelLabelsPlugin, MultiLevelLabelPlugin } from './multilevellabels.directive';\nimport { AxesDirective, AxisDirective, AxesPlugin, AxisPlugin } from './axes.directive';\nimport { RowsDirective, RowDirective, RowsPlugin, RowPlugin } from './rows.directive';\nimport { ColumnsDirective, ColumnDirective, ColumnsPlugin, ColumnPlugin } from './columns.directive';\nimport { RangeColorSettingsDirective, RangeColorSettingDirective, RangeColorSettingsPlugin, RangeColorSettingPlugin } from './rangecolorsettings.directive';\nimport { AnnotationsDirective, AnnotationDirective, AnnotationsPlugin, AnnotationPlugin } from './annotations.directive';\nimport { SelectedDataIndexesDirective, SelectedDataIndexDirective, SelectedDataIndexesPlugin, SelectedDataIndexPlugin } from './selecteddataindexes.directive';\nimport { IndicatorsDirective, IndicatorDirective, IndicatorsPlugin, IndicatorPlugin } from './indicators.directive';\n\nexport var properties = ['islazyUpdate', 'allowExport', 'allowMultiSelection', 'annotations', 'axes', 'background', 'backgroundImage', 'border', 'chartArea', 'columns', 'crosshair', 'currencyCode', 'dataSource', 'description', 'enableAnimation', 'enableAutoIntervalOnBothAxis', 'enableCanvas', 'enableExport', 'enablePersistence', 'enableRtl', 'enableSideBySidePlacement', 'height', 'highlightMode', 'highlightPattern', 'indicators', 'isMultiSelect', 'isTransposed', 'legendSettings', 'locale', 'margin', 'palettes', 'primaryXAxis', 'primaryYAxis', 'rangeColorSettings', 'rows', 'selectedDataIndexes', 'selectionMode', 'selectionPattern', 'series', 'subTitle', 'subTitleStyle', 'tabIndex', 'theme', 'title', 'titleStyle', 'tooltip', 'useGroupingSeparator', 'width', 'zoomSettings', 'afterExport', 'animationComplete', 'annotationRender', 'axisLabelClick', 'axisLabelRender', 'axisMultiLabelRender', 'axisRangeCalculated', 'beforeExport', 'beforePrint', 'beforeResize', 'chartMouseClick', 'chartMouseDown', 'chartMouseLeave', 'chartMouseMove', 'chartMouseUp', 'drag', 'dragComplete', 'dragEnd', 'dragStart', 'legendClick', 'legendRender', 'load', 'loaded', 'multiLevelLabelClick', 'onZooming', 'pointClick', 'pointDoubleClick', 'pointMove', 'pointRender', 'resized', 'scrollChanged', 'scrollEnd', 'scrollStart', 'selectionComplete', 'seriesRender', 'sharedTooltipRender', 'textRender', 'tooltipRender', 'zoomComplete'];\nexport var modelProps = ['dataSource'];\nexport var testProp = getProps({ props: properties });\nexport var props = testProp[0];\nexport var watch = testProp[1];\nexport var emitProbs = Object.keys(watch);\nemitProbs.push('modelchanged');\nfor (var _i = 0, modelProps_1 = modelProps; _i < modelProps_1.length; _i++) {\n var props_1 = modelProps_1[_i];\n emitProbs.push('update:' + props_1);\n}\nexport var isExecute = gh ? false : true;\n/**\n * Represents Vuejs chart Component\n * ```vue\n *
\n * ```\n */\nvar ChartComponent = /** @class */ (function (_super) {\n __extends(ChartComponent, _super);\n function ChartComponent() {\n var _this = _super.call(this, arguments) || this;\n _this.propKeys = properties;\n _this.models = modelProps;\n _this.hasChildDirective = true;\n _this.hasInjectedModules = true;\n _this.tagMapper = { \"e-series-collection\": { \"e-series\": { \"e-trendlines\": \"e-trendline\", \"e-segments\": \"e-segment\" } }, \"e-axes\": { \"e-axis\": { \"e-striplines\": \"e-stripline\", \"e-multilevellabels\": { \"e-multilevellabel\": { \"e-categories\": \"e-category\" } } } }, \"e-rows\": \"e-row\", \"e-columns\": \"e-column\", \"e-rangecolorsettings\": \"e-rangecolorsetting\", \"e-annotations\": \"e-annotation\", \"e-selecteddataindexes\": \"e-selecteddataindex\", \"e-indicators\": \"e-indicator\" };\n _this.tagNameMapper = { \"e-series-collection\": \"e-series\", \"e-striplines\": \"e-stripLines\", \"e-multilevellabels\": \"e-multiLevelLabels\", \"e-rangecolorsettings\": \"e-rangeColorSettings\", \"e-selecteddataindexes\": \"e-selectedDataIndexes\" };\n _this.isVue3 = !isExecute;\n _this.ej2Instances = new Chart({});\n _this.ej2Instances._trigger = _this.ej2Instances.trigger;\n _this.ej2Instances.trigger = _this.trigger;\n _this.bindProperties();\n _this.ej2Instances._setProperties = _this.ej2Instances.setProperties;\n _this.ej2Instances.setProperties = _this.setProperties;\n _this.ej2Instances.clearTemplate = _this.clearTemplate;\n return _this;\n }\n ChartComponent.prototype.clearTemplate = function (templateNames) {\n if (!templateNames) {\n templateNames = Object.keys(this.templateCollection || {});\n }\n if (templateNames.length && this.templateCollection) {\n for (var _i = 0, templateNames_1 = templateNames; _i < templateNames_1.length; _i++) {\n var tempName = templateNames_1[_i];\n var elementCollection = this.templateCollection[tempName];\n if (elementCollection && elementCollection.length) {\n for (var _a = 0, elementCollection_1 = elementCollection; _a < elementCollection_1.length; _a++) {\n var ele = elementCollection_1[_a];\n var destroy = getValue('__vue__.$destroy', ele);\n if (destroy) {\n ele.__vue__.$destroy();\n }\n if (ele.innerHTML) {\n ele.innerHTML = '';\n }\n }\n delete this.templateCollection[tempName];\n }\n }\n }\n };\n ChartComponent.prototype.setProperties = function (prop, muteOnChange) {\n var _this = this;\n if (this.isVue3) {\n this.models = !this.models ? this.ej2Instances.referModels : this.models;\n }\n if (this.ej2Instances && this.ej2Instances._setProperties) {\n this.ej2Instances._setProperties(prop, muteOnChange);\n }\n if (prop && this.models && this.models.length) {\n Object.keys(prop).map(function (key) {\n _this.models.map(function (model) {\n if ((key === model) && !(/datasource/i.test(key))) {\n if (_this.isVue3) {\n _this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);\n }\n else {\n _this.$emit('update:' + key, prop[key]);\n _this.$emit('modelchanged', prop[key]);\n }\n }\n });\n });\n }\n };\n ChartComponent.prototype.trigger = function (eventName, eventProp, successHandler) {\n if (!isExecute) {\n this.models = !this.models ? this.ej2Instances.referModels : this.models;\n }\n if ((eventName === 'change' || eventName === 'input') && this.models && (this.models.length !== 0)) {\n var key = this.models.toString().match(/checked|value/) || [];\n var propKey = key[0];\n if (eventProp && key && !isUndefined(eventProp[propKey])) {\n if (!isExecute) {\n this.ej2Instances.vueInstance.$emit('update:' + propKey, eventProp[propKey]);\n this.ej2Instances.vueInstance.$emit('modelchanged', eventProp[propKey]);\n }\n else {\n if (eventName === 'change' || (this.$props && !this.$props.islazyUpdate)) {\n this.$emit('update:' + propKey, eventProp[propKey]);\n this.$emit('modelchanged', eventProp[propKey]);\n }\n }\n }\n }\n else if ((eventName === 'actionBegin' && eventProp.requestType === 'dateNavigate') && this.models && (this.models.length !== 0)) {\n var key = this.models.toString().match(/currentView|selectedDate/) || [];\n var propKey = key[0];\n if (eventProp && key && !isUndefined(eventProp[propKey])) {\n if (!isExecute) {\n this.ej2Instances.vueInstance.$emit('update:' + propKey, eventProp[propKey]);\n this.ej2Instances.vueInstance.$emit('modelchanged', eventProp[propKey]);\n }\n else {\n this.$emit('update:' + propKey, eventProp[propKey]);\n this.$emit('modelchanged', eventProp[propKey]);\n }\n }\n }\n if ((this.ej2Instances && this.ej2Instances._trigger)) {\n this.ej2Instances._trigger(eventName, eventProp, successHandler);\n }\n };\n ChartComponent.prototype.render = function (createElement) {\n var h = gh || createElement;\n var slots = null;\n if (!isNullOrUndefined(this.$slots.default)) {\n slots = gh ? this.$slots.default() : this.$slots.default;\n }\n return h('div', slots);\n };\n ChartComponent.prototype.addAxes = function (axisCollection) {\n return this.ej2Instances.addAxes(axisCollection);\n };\n ChartComponent.prototype.addSeries = function (seriesCollection) {\n return this.ej2Instances.addSeries(seriesCollection);\n };\n ChartComponent.prototype.clearSeries = function () {\n return this.ej2Instances.clearSeries();\n };\n ChartComponent.prototype.createChartSvg = function () {\n return this.ej2Instances.createChartSvg();\n };\n ChartComponent.prototype.export = function (type, fileName) {\n return this.ej2Instances.export(type, fileName);\n };\n ChartComponent.prototype.getLocalizedLabel = function (key) {\n return this.ej2Instances.getLocalizedLabel(key);\n };\n ChartComponent.prototype.print = function (id) {\n return this.ej2Instances.print(id);\n };\n ChartComponent.prototype.processData = function (render) {\n return this.ej2Instances.processData(render);\n };\n ChartComponent.prototype.refreshLiveData = function () {\n return this.ej2Instances.refreshLiveData();\n };\n ChartComponent.prototype.removeAxis = function (index) {\n return this.ej2Instances.removeAxis(index);\n };\n ChartComponent.prototype.removeSeries = function (index) {\n return this.ej2Instances.removeSeries(index);\n };\n ChartComponent.prototype.setAnnotationValue = function (annotationIndex, content) {\n return this.ej2Instances.setAnnotationValue(annotationIndex, content);\n };\n ChartComponent = __decorate([\n EJComponentDecorator({\n props: properties,\n model: {\n event: 'modelchanged'\n }\n }, isExecute)\n \n ], ChartComponent);\n return ChartComponent;\n}(ComponentBase));\nexport { ChartComponent };\nexport var ChartPlugin = {\n name: 'ejs-chart',\n install: function (Vue) {\n Vue.component(ChartPlugin.name, ChartComponent);\n Vue.component(SeriesPlugin.name, SeriesDirective);\n Vue.component(SeriesCollectionPlugin.name, SeriesCollectionDirective);\n Vue.component(TrendlinePlugin.name, TrendlineDirective);\n Vue.component(TrendlinesPlugin.name, TrendlinesDirective);\n Vue.component(SegmentPlugin.name, SegmentDirective);\n Vue.component(SegmentsPlugin.name, SegmentsDirective);\n Vue.component(AxisPlugin.name, AxisDirective);\n Vue.component(AxesPlugin.name, AxesDirective);\n Vue.component(StripLinePlugin.name, StripLineDirective);\n Vue.component(StripLinesPlugin.name, StripLinesDirective);\n Vue.component(MultiLevelLabelPlugin.name, MultiLevelLabelDirective);\n Vue.component(MultiLevelLabelsPlugin.name, MultiLevelLabelsDirective);\n Vue.component(CategoryPlugin.name, CategoryDirective);\n Vue.component(CategoriesPlugin.name, CategoriesDirective);\n Vue.component(RowPlugin.name, RowDirective);\n Vue.component(RowsPlugin.name, RowsDirective);\n Vue.component(ColumnPlugin.name, ColumnDirective);\n Vue.component(ColumnsPlugin.name, ColumnsDirective);\n Vue.component(RangeColorSettingPlugin.name, RangeColorSettingDirective);\n Vue.component(RangeColorSettingsPlugin.name, RangeColorSettingsDirective);\n Vue.component(AnnotationPlugin.name, AnnotationDirective);\n Vue.component(AnnotationsPlugin.name, AnnotationsDirective);\n Vue.component(SelectedDataIndexPlugin.name, SelectedDataIndexDirective);\n Vue.component(SelectedDataIndexesPlugin.name, SelectedDataIndexesDirective);\n Vue.component(IndicatorPlugin.name, IndicatorDirective);\n Vue.component(IndicatorsPlugin.name, IndicatorsDirective);\n }\n};\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","//! moment.js locale configuration\n//! locale : Yoruba Nigeria [yo]\n//! author : Atolagbe Abisoye : https://github.com/andela-batolagbe\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var yo = moment.defineLocale('yo', {\n months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split(\n '_'\n ),\n monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),\n weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),\n weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),\n weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY h:mm A',\n LLLL: 'dddd, D MMMM YYYY h:mm A',\n },\n calendar: {\n sameDay: '[Ònì ni] LT',\n nextDay: '[Ọ̀la ni] LT',\n nextWeek: \"dddd [Ọsẹ̀ tón'bọ] [ni] LT\",\n lastDay: '[Àna ni] LT',\n lastWeek: 'dddd [Ọsẹ̀ tólọ́] [ni] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'ní %s',\n past: '%s kọjá',\n s: 'ìsẹjú aayá die',\n ss: 'aayá %d',\n m: 'ìsẹjú kan',\n mm: 'ìsẹjú %d',\n h: 'wákati kan',\n hh: 'wákati %d',\n d: 'ọjọ́ kan',\n dd: 'ọjọ́ %d',\n M: 'osù kan',\n MM: 'osù %d',\n y: 'ọdún kan',\n yy: 'ọdún %d',\n },\n dayOfMonthOrdinalParse: /ọjọ́\\s\\d{1,2}/,\n ordinal: 'ọjọ́ %d',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return yo;\n\n})));\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","//! moment.js locale configuration\n//! locale : Slovenian [sl]\n//! author : Robert Sedovšek : https://github.com/sedovsek\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }\n\n var sl = moment.defineLocale('sl', {\n months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split(\n '_'\n ),\n monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),\n weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),\n weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD. MM. YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY H:mm',\n LLLL: 'dddd, D. MMMM YYYY H:mm',\n },\n calendar: {\n sameDay: '[danes ob] LT',\n nextDay: '[jutri ob] LT',\n\n nextWeek: function () {\n switch (this.day()) {\n case 0:\n return '[v] [nedeljo] [ob] LT';\n case 3:\n return '[v] [sredo] [ob] LT';\n case 6:\n return '[v] [soboto] [ob] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[v] dddd [ob] LT';\n }\n },\n lastDay: '[včeraj ob] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n return '[prejšnjo] [nedeljo] [ob] LT';\n case 3:\n return '[prejšnjo] [sredo] [ob] LT';\n case 6:\n return '[prejšnjo] [soboto] [ob] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[prejšnji] dddd [ob] LT';\n }\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: 'čez %s',\n past: 'pred %s',\n s: processRelativeTime,\n ss: processRelativeTime,\n m: processRelativeTime,\n mm: processRelativeTime,\n h: processRelativeTime,\n hh: processRelativeTime,\n d: processRelativeTime,\n dd: processRelativeTime,\n M: processRelativeTime,\n MM: processRelativeTime,\n y: processRelativeTime,\n yy: processRelativeTime,\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7, // The week that contains Jan 7th is the first week of the year.\n },\n });\n\n return sl;\n\n})));\n","//! moment.js locale configuration\n//! locale : Finnish [fi]\n//! author : Tarmo Aidantausta : https://github.com/bleadof\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(\n ' '\n ),\n numbersFuture = [\n 'nolla',\n 'yhden',\n 'kahden',\n 'kolmen',\n 'neljän',\n 'viiden',\n 'kuuden',\n numbersPast[7],\n numbersPast[8],\n numbersPast[9],\n ];\n function translate(number, withoutSuffix, key, isFuture) {\n var result = '';\n switch (key) {\n case 's':\n return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';\n case 'ss':\n result = isFuture ? 'sekunnin' : 'sekuntia';\n break;\n case 'm':\n return isFuture ? 'minuutin' : 'minuutti';\n case 'mm':\n result = isFuture ? 'minuutin' : 'minuuttia';\n break;\n case 'h':\n return isFuture ? 'tunnin' : 'tunti';\n case 'hh':\n result = isFuture ? 'tunnin' : 'tuntia';\n break;\n case 'd':\n return isFuture ? 'päivän' : 'päivä';\n case 'dd':\n result = isFuture ? 'päivän' : 'päivää';\n break;\n case 'M':\n return isFuture ? 'kuukauden' : 'kuukausi';\n case 'MM':\n result = isFuture ? 'kuukauden' : 'kuukautta';\n break;\n case 'y':\n return isFuture ? 'vuoden' : 'vuosi';\n case 'yy':\n result = isFuture ? 'vuoden' : 'vuotta';\n break;\n }\n result = verbalNumber(number, isFuture) + ' ' + result;\n return result;\n }\n function verbalNumber(number, isFuture) {\n return number < 10\n ? isFuture\n ? numbersFuture[number]\n : numbersPast[number]\n : number;\n }\n\n var fi = moment.defineLocale('fi', {\n months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split(\n '_'\n ),\n monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split(\n '_'\n ),\n weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split(\n '_'\n ),\n weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),\n weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),\n longDateFormat: {\n LT: 'HH.mm',\n LTS: 'HH.mm.ss',\n L: 'DD.MM.YYYY',\n LL: 'Do MMMM[ta] YYYY',\n LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',\n LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',\n l: 'D.M.YYYY',\n ll: 'Do MMM YYYY',\n lll: 'Do MMM YYYY, [klo] HH.mm',\n llll: 'ddd, Do MMM YYYY, [klo] HH.mm',\n },\n calendar: {\n sameDay: '[tänään] [klo] LT',\n nextDay: '[huomenna] [klo] LT',\n nextWeek: 'dddd [klo] LT',\n lastDay: '[eilen] [klo] LT',\n lastWeek: '[viime] dddd[na] [klo] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: '%s päästä',\n past: '%s sitten',\n s: translate,\n ss: translate,\n m: translate,\n mm: translate,\n h: translate,\n hh: translate,\n d: translate,\n dd: translate,\n M: translate,\n MM: translate,\n y: translate,\n yy: translate,\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return fi;\n\n})));\n","//! moment.js locale configuration\n//! locale : Arabic (Saudi Arabia) [ar-sa]\n//! author : Suhail Alkowaileet : https://github.com/xsoh\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var symbolMap = {\n '1': '١',\n '2': '٢',\n '3': '٣',\n '4': '٤',\n '5': '٥',\n '6': '٦',\n '7': '٧',\n '8': '٨',\n '9': '٩',\n '0': '٠',\n },\n numberMap = {\n '١': '1',\n '٢': '2',\n '٣': '3',\n '٤': '4',\n '٥': '5',\n '٦': '6',\n '٧': '7',\n '٨': '8',\n '٩': '9',\n '٠': '0',\n };\n\n var arSa = moment.defineLocale('ar-sa', {\n months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n '_'\n ),\n monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n '_'\n ),\n weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n meridiemParse: /ص|م/,\n isPM: function (input) {\n return 'م' === input;\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 12) {\n return 'ص';\n } else {\n return 'م';\n }\n },\n calendar: {\n sameDay: '[اليوم على الساعة] LT',\n nextDay: '[غدا على الساعة] LT',\n nextWeek: 'dddd [على الساعة] LT',\n lastDay: '[أمس على الساعة] LT',\n lastWeek: 'dddd [على الساعة] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'في %s',\n past: 'منذ %s',\n s: 'ثوان',\n ss: '%d ثانية',\n m: 'دقيقة',\n mm: '%d دقائق',\n h: 'ساعة',\n hh: '%d ساعات',\n d: 'يوم',\n dd: '%d أيام',\n M: 'شهر',\n MM: '%d أشهر',\n y: 'سنة',\n yy: '%d سنوات',\n },\n preparse: function (string) {\n return string\n .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n return numberMap[match];\n })\n .replace(/،/g, ',');\n },\n postformat: function (string) {\n return string\n .replace(/\\d/g, function (match) {\n return symbolMap[match];\n })\n .replace(/,/g, '،');\n },\n week: {\n dow: 0, // Sunday is the first day of the week.\n doy: 6, // The week that contains Jan 6th is the first week of the year.\n },\n });\n\n return arSa;\n\n})));\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n};\r\n/** Represents an HTTP response. */\r\nvar HttpResponse = /** @class */ (function () {\r\n function HttpResponse(statusCode, statusText, content) {\r\n this.statusCode = statusCode;\r\n this.statusText = statusText;\r\n this.content = content;\r\n }\r\n return HttpResponse;\r\n}());\r\nexport { HttpResponse };\r\n/** Abstraction over an HTTP client.\r\n *\r\n * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.\r\n */\r\nvar HttpClient = /** @class */ (function () {\r\n function HttpClient() {\r\n }\r\n HttpClient.prototype.get = function (url, options) {\r\n return this.send(__assign({}, options, { method: \"GET\", url: url }));\r\n };\r\n HttpClient.prototype.post = function (url, options) {\r\n return this.send(__assign({}, options, { method: \"POST\", url: url }));\r\n };\r\n HttpClient.prototype.delete = function (url, options) {\r\n return this.send(__assign({}, options, { method: \"DELETE\", url: url }));\r\n };\r\n /** Gets all cookies that apply to the specified URL.\r\n *\r\n * @param url The URL that the cookies are valid for.\r\n * @returns {string} A string containing all the key-value cookie pairs for the specified URL.\r\n */\r\n // @ts-ignore\r\n HttpClient.prototype.getCookieString = function (url) {\r\n return \"\";\r\n };\r\n return HttpClient;\r\n}());\r\nexport { HttpClient };\r\n//# sourceMappingURL=HttpClient.js.map","export default function _objectDestructuringEmpty(obj) {\n if (obj == null) throw new TypeError(\"Cannot destructure undefined\");\n}","//! moment.js locale configuration\n//! locale : Bulgarian [bg]\n//! author : Krasen Borisov : https://github.com/kraz\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var bg = moment.defineLocale('bg', {\n months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split(\n '_'\n ),\n monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),\n weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split(\n '_'\n ),\n weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),\n weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'D.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY H:mm',\n LLLL: 'dddd, D MMMM YYYY H:mm',\n },\n calendar: {\n sameDay: '[Днес в] LT',\n nextDay: '[Утре в] LT',\n nextWeek: 'dddd [в] LT',\n lastDay: '[Вчера в] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n case 3:\n case 6:\n return '[Миналата] dddd [в] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[Миналия] dddd [в] LT';\n }\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: 'след %s',\n past: 'преди %s',\n s: 'няколко секунди',\n ss: '%d секунди',\n m: 'минута',\n mm: '%d минути',\n h: 'час',\n hh: '%d часа',\n d: 'ден',\n dd: '%d дена',\n M: 'месец',\n MM: '%d месеца',\n y: 'година',\n yy: '%d години',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n ordinal: function (number) {\n var lastDigit = number % 10,\n last2Digits = number % 100;\n if (number === 0) {\n return number + '-ев';\n } else if (last2Digits === 0) {\n return number + '-ен';\n } else if (last2Digits > 10 && last2Digits < 20) {\n return number + '-ти';\n } else if (lastDigit === 1) {\n return number + '-ви';\n } else if (lastDigit === 2) {\n return number + '-ри';\n } else if (lastDigit === 7 || lastDigit === 8) {\n return number + '-ми';\n } else {\n return number + '-ти';\n }\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7, // The week that contains Jan 7th is the first week of the year.\n },\n });\n\n return bg;\n\n})));\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","//! moment.js locale configuration\n//! locale : Burmese [my]\n//! author : Squar team, mysquar.com\n//! author : David Rossellat : https://github.com/gholadr\n//! author : Tin Aung Lin : https://github.com/thanyawzinmin\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var symbolMap = {\n '1': '၁',\n '2': '၂',\n '3': '၃',\n '4': '၄',\n '5': '၅',\n '6': '၆',\n '7': '၇',\n '8': '၈',\n '9': '၉',\n '0': '၀',\n },\n numberMap = {\n '၁': '1',\n '၂': '2',\n '၃': '3',\n '၄': '4',\n '၅': '5',\n '၆': '6',\n '၇': '7',\n '၈': '8',\n '၉': '9',\n '၀': '0',\n };\n\n var my = moment.defineLocale('my', {\n months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split(\n '_'\n ),\n monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),\n weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split(\n '_'\n ),\n weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[ယနေ.] LT [မှာ]',\n nextDay: '[မနက်ဖြန်] LT [မှာ]',\n nextWeek: 'dddd LT [မှာ]',\n lastDay: '[မနေ.က] LT [မှာ]',\n lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'လာမည့် %s မှာ',\n past: 'လွန်ခဲ့သော %s က',\n s: 'စက္ကန်.အနည်းငယ်',\n ss: '%d စက္ကန့်',\n m: 'တစ်မိနစ်',\n mm: '%d မိနစ်',\n h: 'တစ်နာရီ',\n hh: '%d နာရီ',\n d: 'တစ်ရက်',\n dd: '%d ရက်',\n M: 'တစ်လ',\n MM: '%d လ',\n y: 'တစ်နှစ်',\n yy: '%d နှစ်',\n },\n preparse: function (string) {\n return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return my;\n\n})));\n","//! moment.js locale configuration\n//! locale : Galician [gl]\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var gl = moment.defineLocale('gl', {\n months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split(\n '_'\n ),\n monthsShort: 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),\n weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),\n weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY H:mm',\n LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',\n },\n calendar: {\n sameDay: function () {\n return '[hoxe ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';\n },\n nextDay: function () {\n return '[mañá ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';\n },\n nextWeek: function () {\n return 'dddd [' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT';\n },\n lastDay: function () {\n return '[onte ' + (this.hours() !== 1 ? 'á' : 'a') + '] LT';\n },\n lastWeek: function () {\n return (\n '[o] dddd [pasado ' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT'\n );\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: function (str) {\n if (str.indexOf('un') === 0) {\n return 'n' + str;\n }\n return 'en ' + str;\n },\n past: 'hai %s',\n s: 'uns segundos',\n ss: '%d segundos',\n m: 'un minuto',\n mm: '%d minutos',\n h: 'unha hora',\n hh: '%d horas',\n d: 'un día',\n dd: '%d días',\n M: 'un mes',\n MM: '%d meses',\n y: 'un ano',\n yy: '%d anos',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return gl;\n\n})));\n","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n store.inspectSource = function (it) {\n return functionToString.call(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","//! moment.js locale configuration\n//! locale : Spanish [es]\n//! author : Julio Napurí : https://github.com/julionc\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n '_'\n ),\n monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n monthsParse = [\n /^ene/i,\n /^feb/i,\n /^mar/i,\n /^abr/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^ago/i,\n /^sep/i,\n /^oct/i,\n /^nov/i,\n /^dic/i,\n ],\n monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n var es = moment.defineLocale('es', {\n months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n '_'\n ),\n monthsShort: function (m, format) {\n if (!m) {\n return monthsShortDot;\n } else if (/-MMM-/.test(format)) {\n return monthsShort[m.month()];\n } else {\n return monthsShortDot[m.month()];\n }\n },\n monthsRegex: monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n monthsShortStrictRegex: /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n monthsParse: monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY H:mm',\n LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',\n },\n calendar: {\n sameDay: function () {\n return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n nextDay: function () {\n return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n nextWeek: function () {\n return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n lastDay: function () {\n return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n lastWeek: function () {\n return (\n '[el] dddd [pasado a la' +\n (this.hours() !== 1 ? 's' : '') +\n '] LT'\n );\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: 'en %s',\n past: 'hace %s',\n s: 'unos segundos',\n ss: '%d segundos',\n m: 'un minuto',\n mm: '%d minutos',\n h: 'una hora',\n hh: '%d horas',\n d: 'un día',\n dd: '%d días',\n M: 'un mes',\n MM: '%d meses',\n y: 'un año',\n yy: '%d años',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n invalidDate: 'Fecha inválida',\n });\n\n return es;\n\n})));\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\n\n// `AdvanceStringIndex` abstract operation\n// https://tc39.es/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? charAt(S, index).length : 1);\n};\n","/*!\n * vue-router v3.4.9\n * (c) 2020 Evan You\n * @license MIT\n */\n/* */\n\nfunction assert (condition, message) {\n if (!condition) {\n throw new Error((\"[vue-router] \" + message))\n }\n}\n\nfunction warn (condition, message) {\n if (process.env.NODE_ENV !== 'production' && !condition) {\n typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message));\n }\n}\n\nfunction extend (a, b) {\n for (var key in b) {\n a[key] = b[key];\n }\n return a\n}\n\n/* */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n .replace(encodeReserveRE, encodeReserveReplacer)\n .replace(commaRE, ','); };\n\nfunction decode (str) {\n try {\n return decodeURIComponent(str)\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"Error decoding \\\"\" + str + \"\\\". Leaving it intact.\"));\n }\n }\n return str\n}\n\nfunction resolveQuery (\n query,\n extraQuery,\n _parseQuery\n) {\n if ( extraQuery === void 0 ) extraQuery = {};\n\n var parse = _parseQuery || parseQuery;\n var parsedQuery;\n try {\n parsedQuery = parse(query || '');\n } catch (e) {\n process.env.NODE_ENV !== 'production' && warn(false, e.message);\n parsedQuery = {};\n }\n for (var key in extraQuery) {\n var value = extraQuery[key];\n parsedQuery[key] = Array.isArray(value)\n ? value.map(castQueryParamValue)\n : castQueryParamValue(value);\n }\n return parsedQuery\n}\n\nvar castQueryParamValue = function (value) { return (value == null || typeof value === 'object' ? value : String(value)); };\n\nfunction parseQuery (query) {\n var res = {};\n\n query = query.trim().replace(/^(\\?|#|&)/, '');\n\n if (!query) {\n return res\n }\n\n query.split('&').forEach(function (param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = decode(parts.shift());\n var val = parts.length > 0 ? decode(parts.join('=')) : null;\n\n if (res[key] === undefined) {\n res[key] = val;\n } else if (Array.isArray(res[key])) {\n res[key].push(val);\n } else {\n res[key] = [res[key], val];\n }\n });\n\n return res\n}\n\nfunction stringifyQuery (obj) {\n var res = obj\n ? Object.keys(obj)\n .map(function (key) {\n var val = obj[key];\n\n if (val === undefined) {\n return ''\n }\n\n if (val === null) {\n return encode(key)\n }\n\n if (Array.isArray(val)) {\n var result = [];\n val.forEach(function (val2) {\n if (val2 === undefined) {\n return\n }\n if (val2 === null) {\n result.push(encode(key));\n } else {\n result.push(encode(key) + '=' + encode(val2));\n }\n });\n return result.join('&')\n }\n\n return encode(key) + '=' + encode(val)\n })\n .filter(function (x) { return x.length > 0; })\n .join('&')\n : null;\n return res ? (\"?\" + res) : ''\n}\n\n/* */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n record,\n location,\n redirectedFrom,\n router\n) {\n var stringifyQuery = router && router.options.stringifyQuery;\n\n var query = location.query || {};\n try {\n query = clone(query);\n } catch (e) {}\n\n var route = {\n name: location.name || (record && record.name),\n meta: (record && record.meta) || {},\n path: location.path || '/',\n hash: location.hash || '',\n query: query,\n params: location.params || {},\n fullPath: getFullPath(location, stringifyQuery),\n matched: record ? formatMatch(record) : []\n };\n if (redirectedFrom) {\n route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);\n }\n return Object.freeze(route)\n}\n\nfunction clone (value) {\n if (Array.isArray(value)) {\n return value.map(clone)\n } else if (value && typeof value === 'object') {\n var res = {};\n for (var key in value) {\n res[key] = clone(value[key]);\n }\n return res\n } else {\n return value\n }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n path: '/'\n});\n\nfunction formatMatch (record) {\n var res = [];\n while (record) {\n res.unshift(record);\n record = record.parent;\n }\n return res\n}\n\nfunction getFullPath (\n ref,\n _stringifyQuery\n) {\n var path = ref.path;\n var query = ref.query; if ( query === void 0 ) query = {};\n var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n var stringify = _stringifyQuery || stringifyQuery;\n return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b) {\n if (b === START) {\n return a === b\n } else if (!b) {\n return false\n } else if (a.path && b.path) {\n return (\n a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query)\n )\n } else if (a.name && b.name) {\n return (\n a.name === b.name &&\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query) &&\n isObjectEqual(a.params, b.params)\n )\n } else {\n return false\n }\n}\n\nfunction isObjectEqual (a, b) {\n if ( a === void 0 ) a = {};\n if ( b === void 0 ) b = {};\n\n // handle null value #1566\n if (!a || !b) { return a === b }\n var aKeys = Object.keys(a).sort();\n var bKeys = Object.keys(b).sort();\n if (aKeys.length !== bKeys.length) {\n return false\n }\n return aKeys.every(function (key, i) {\n var aVal = a[key];\n var bKey = bKeys[i];\n if (bKey !== key) { return false }\n var bVal = b[key];\n // query values can be null and undefined\n if (aVal == null || bVal == null) { return aVal === bVal }\n // check nested equality\n if (typeof aVal === 'object' && typeof bVal === 'object') {\n return isObjectEqual(aVal, bVal)\n }\n return String(aVal) === String(bVal)\n })\n}\n\nfunction isIncludedRoute (current, target) {\n return (\n current.path.replace(trailingSlashRE, '/').indexOf(\n target.path.replace(trailingSlashRE, '/')\n ) === 0 &&\n (!target.hash || current.hash === target.hash) &&\n queryIncludes(current.query, target.query)\n )\n}\n\nfunction queryIncludes (current, target) {\n for (var key in target) {\n if (!(key in current)) {\n return false\n }\n }\n return true\n}\n\nfunction handleRouteEntered (route) {\n for (var i = 0; i < route.matched.length; i++) {\n var record = route.matched[i];\n for (var name in record.instances) {\n var instance = record.instances[name];\n var cbs = record.enteredCbs[name];\n if (!instance || !cbs) { continue }\n delete record.enteredCbs[name];\n for (var i$1 = 0; i$1 < cbs.length; i$1++) {\n if (!instance._isBeingDestroyed) { cbs[i$1](instance); }\n }\n }\n }\n}\n\nvar View = {\n name: 'RouterView',\n functional: true,\n props: {\n name: {\n type: String,\n default: 'default'\n }\n },\n render: function render (_, ref) {\n var props = ref.props;\n var children = ref.children;\n var parent = ref.parent;\n var data = ref.data;\n\n // used by devtools to display a router-view badge\n data.routerView = true;\n\n // directly use parent context's createElement() function\n // so that components rendered by router-view can resolve named slots\n var h = parent.$createElement;\n var name = props.name;\n var route = parent.$route;\n var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n // determine current view depth, also check to see if the tree\n // has been toggled inactive but kept-alive.\n var depth = 0;\n var inactive = false;\n while (parent && parent._routerRoot !== parent) {\n var vnodeData = parent.$vnode ? parent.$vnode.data : {};\n if (vnodeData.routerView) {\n depth++;\n }\n if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {\n inactive = true;\n }\n parent = parent.$parent;\n }\n data.routerViewDepth = depth;\n\n // render previous view if the tree is inactive and kept-alive\n if (inactive) {\n var cachedData = cache[name];\n var cachedComponent = cachedData && cachedData.component;\n if (cachedComponent) {\n // #2301\n // pass props\n if (cachedData.configProps) {\n fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);\n }\n return h(cachedComponent, data, children)\n } else {\n // render previous empty view\n return h()\n }\n }\n\n var matched = route.matched[depth];\n var component = matched && matched.components[name];\n\n // render empty node if no matched route or no config component\n if (!matched || !component) {\n cache[name] = null;\n return h()\n }\n\n // cache component\n cache[name] = { component: component };\n\n // attach instance registration hook\n // this will be called in the instance's injected lifecycle hooks\n data.registerRouteInstance = function (vm, val) {\n // val could be undefined for unregistration\n var current = matched.instances[name];\n if (\n (val && current !== vm) ||\n (!val && current === vm)\n ) {\n matched.instances[name] = val;\n }\n }\n\n // also register instance in prepatch hook\n // in case the same component instance is reused across different routes\n ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n matched.instances[name] = vnode.componentInstance;\n };\n\n // register instance in init hook\n // in case kept-alive component be actived when routes changed\n data.hook.init = function (vnode) {\n if (vnode.data.keepAlive &&\n vnode.componentInstance &&\n vnode.componentInstance !== matched.instances[name]\n ) {\n matched.instances[name] = vnode.componentInstance;\n }\n\n // if the route transition has already been confirmed then we weren't\n // able to call the cbs during confirmation as the component was not\n // registered yet, so we call it here.\n handleRouteEntered(route);\n };\n\n var configProps = matched.props && matched.props[name];\n // save route and configProps in cache\n if (configProps) {\n extend(cache[name], {\n route: route,\n configProps: configProps\n });\n fillPropsinData(component, data, route, configProps);\n }\n\n return h(component, data, children)\n }\n};\n\nfunction fillPropsinData (component, data, route, configProps) {\n // resolve props\n var propsToPass = data.props = resolveProps(route, configProps);\n if (propsToPass) {\n // clone to prevent mutation\n propsToPass = data.props = extend({}, propsToPass);\n // pass non-declared props as attrs\n var attrs = data.attrs = data.attrs || {};\n for (var key in propsToPass) {\n if (!component.props || !(key in component.props)) {\n attrs[key] = propsToPass[key];\n delete propsToPass[key];\n }\n }\n }\n}\n\nfunction resolveProps (route, config) {\n switch (typeof config) {\n case 'undefined':\n return\n case 'object':\n return config\n case 'function':\n return config(route)\n case 'boolean':\n return config ? route.params : undefined\n default:\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n \"expecting an object, function or boolean.\"\n );\n }\n }\n}\n\n/* */\n\nfunction resolvePath (\n relative,\n base,\n append\n) {\n var firstChar = relative.charAt(0);\n if (firstChar === '/') {\n return relative\n }\n\n if (firstChar === '?' || firstChar === '#') {\n return base + relative\n }\n\n var stack = base.split('/');\n\n // remove trailing segment if:\n // - not appending\n // - appending to trailing slash (last segment is empty)\n if (!append || !stack[stack.length - 1]) {\n stack.pop();\n }\n\n // resolve relative path\n var segments = relative.replace(/^\\//, '').split('/');\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n if (segment === '..') {\n stack.pop();\n } else if (segment !== '.') {\n stack.push(segment);\n }\n }\n\n // ensure leading slash\n if (stack[0] !== '') {\n stack.unshift('');\n }\n\n return stack.join('/')\n}\n\nfunction parsePath (path) {\n var hash = '';\n var query = '';\n\n var hashIndex = path.indexOf('#');\n if (hashIndex >= 0) {\n hash = path.slice(hashIndex);\n path = path.slice(0, hashIndex);\n }\n\n var queryIndex = path.indexOf('?');\n if (queryIndex >= 0) {\n query = path.slice(queryIndex + 1);\n path = path.slice(0, queryIndex);\n }\n\n return {\n path: path,\n query: query,\n hash: hash\n }\n}\n\nfunction cleanPath (path) {\n return path.replace(/\\/\\//g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = [];\n var key = 0;\n var index = 0;\n var path = '';\n var defaultDelimiter = options && options.delimiter || '/';\n var res;\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0];\n var escaped = res[1];\n var offset = res.index;\n path += str.slice(index, offset);\n index = offset + m.length;\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1];\n continue\n }\n\n var next = str[index];\n var prefix = res[2];\n var name = res[3];\n var capture = res[4];\n var group = res[5];\n var modifier = res[6];\n var asterisk = res[7];\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path);\n path = '';\n }\n\n var partial = prefix != null && next != null && next !== prefix;\n var repeat = modifier === '+' || modifier === '*';\n var optional = modifier === '?' || modifier === '*';\n var delimiter = res[2] || defaultDelimiter;\n var pattern = capture || group;\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n });\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index);\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path);\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n var path = '';\n var data = obj || {};\n var options = opts || {};\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys;\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n });\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = [];\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source);\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n var strict = options.strict;\n var end = options.end !== false;\n var route = '';\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n route += escapeString(token);\n } else {\n var prefix = escapeString(token.prefix);\n var capture = '(?:' + token.pattern + ')';\n\n keys.push(token);\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*';\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?';\n } else {\n capture = prefix + '(' + capture + ')?';\n }\n } else {\n capture = prefix + '(' + capture + ')';\n }\n\n route += capture;\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/');\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n }\n\n if (end) {\n route += '$';\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/* */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n path,\n params,\n routeMsg\n) {\n params = params || {};\n try {\n var filler =\n regexpCompileCache[path] ||\n (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n\n // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}\n // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string\n if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }\n\n return filler(params, { pretty: true })\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n // Fix #3072 no warn if `pathMatch` is string\n warn(typeof params.pathMatch === 'string', (\"missing param for \" + routeMsg + \": \" + (e.message)));\n }\n return ''\n } finally {\n // delete the 0 if it was added\n delete params[0];\n }\n}\n\n/* */\n\nfunction normalizeLocation (\n raw,\n current,\n append,\n router\n) {\n var next = typeof raw === 'string' ? { path: raw } : raw;\n // named target\n if (next._normalized) {\n return next\n } else if (next.name) {\n next = extend({}, raw);\n var params = next.params;\n if (params && typeof params === 'object') {\n next.params = extend({}, params);\n }\n return next\n }\n\n // relative params\n if (!next.path && next.params && current) {\n next = extend({}, next);\n next._normalized = true;\n var params$1 = extend(extend({}, current.params), next.params);\n if (current.name) {\n next.name = current.name;\n next.params = params$1;\n } else if (current.matched.length) {\n var rawPath = current.matched[current.matched.length - 1].path;\n next.path = fillParams(rawPath, params$1, (\"path \" + (current.path)));\n } else if (process.env.NODE_ENV !== 'production') {\n warn(false, \"relative params navigation requires a current route.\");\n }\n return next\n }\n\n var parsedPath = parsePath(next.path || '');\n var basePath = (current && current.path) || '/';\n var path = parsedPath.path\n ? resolvePath(parsedPath.path, basePath, append || next.append)\n : basePath;\n\n var query = resolveQuery(\n parsedPath.query,\n next.query,\n router && router.options.parseQuery\n );\n\n var hash = next.hash || parsedPath.hash;\n if (hash && hash.charAt(0) !== '#') {\n hash = \"#\" + hash;\n }\n\n return {\n _normalized: true,\n path: path,\n query: query,\n hash: hash\n }\n}\n\n/* */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar noop = function () {};\n\nvar Link = {\n name: 'RouterLink',\n props: {\n to: {\n type: toTypes,\n required: true\n },\n tag: {\n type: String,\n default: 'a'\n },\n exact: Boolean,\n append: Boolean,\n replace: Boolean,\n activeClass: String,\n exactActiveClass: String,\n ariaCurrentValue: {\n type: String,\n default: 'page'\n },\n event: {\n type: eventTypes,\n default: 'click'\n }\n },\n render: function render (h) {\n var this$1 = this;\n\n var router = this.$router;\n var current = this.$route;\n var ref = router.resolve(\n this.to,\n current,\n this.append\n );\n var location = ref.location;\n var route = ref.route;\n var href = ref.href;\n\n var classes = {};\n var globalActiveClass = router.options.linkActiveClass;\n var globalExactActiveClass = router.options.linkExactActiveClass;\n // Support global empty active class\n var activeClassFallback =\n globalActiveClass == null ? 'router-link-active' : globalActiveClass;\n var exactActiveClassFallback =\n globalExactActiveClass == null\n ? 'router-link-exact-active'\n : globalExactActiveClass;\n var activeClass =\n this.activeClass == null ? activeClassFallback : this.activeClass;\n var exactActiveClass =\n this.exactActiveClass == null\n ? exactActiveClassFallback\n : this.exactActiveClass;\n\n var compareTarget = route.redirectedFrom\n ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)\n : route;\n\n classes[exactActiveClass] = isSameRoute(current, compareTarget);\n classes[activeClass] = this.exact\n ? classes[exactActiveClass]\n : isIncludedRoute(current, compareTarget);\n\n var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;\n\n var handler = function (e) {\n if (guardEvent(e)) {\n if (this$1.replace) {\n router.replace(location, noop);\n } else {\n router.push(location, noop);\n }\n }\n };\n\n var on = { click: guardEvent };\n if (Array.isArray(this.event)) {\n this.event.forEach(function (e) {\n on[e] = handler;\n });\n } else {\n on[this.event] = handler;\n }\n\n var data = { class: classes };\n\n var scopedSlot =\n !this.$scopedSlots.$hasNormal &&\n this.$scopedSlots.default &&\n this.$scopedSlots.default({\n href: href,\n route: route,\n navigate: handler,\n isActive: classes[activeClass],\n isExactActive: classes[exactActiveClass]\n });\n\n if (scopedSlot) {\n if (scopedSlot.length === 1) {\n return scopedSlot[0]\n } else if (scopedSlot.length > 1 || !scopedSlot.length) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n (\"RouterLink with to=\\\"\" + (this.to) + \"\\\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.\")\n );\n }\n return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)\n }\n }\n\n if (this.tag === 'a') {\n data.on = on;\n data.attrs = { href: href, 'aria-current': ariaCurrentValue };\n } else {\n // find the first
child and apply listener and href\n var a = findAnchor(this.$slots.default);\n if (a) {\n // in case the is a static node\n a.isStatic = false;\n var aData = (a.data = extend({}, a.data));\n aData.on = aData.on || {};\n // transform existing events in both objects into arrays so we can push later\n for (var event in aData.on) {\n var handler$1 = aData.on[event];\n if (event in on) {\n aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];\n }\n }\n // append new listeners for router-link\n for (var event$1 in on) {\n if (event$1 in aData.on) {\n // on[event] is always a function\n aData.on[event$1].push(on[event$1]);\n } else {\n aData.on[event$1] = handler;\n }\n }\n\n var aAttrs = (a.data.attrs = extend({}, a.data.attrs));\n aAttrs.href = href;\n aAttrs['aria-current'] = ariaCurrentValue;\n } else {\n // doesn't have child, apply listener to self\n data.on = on;\n }\n }\n\n return h(this.tag, data, this.$slots.default)\n }\n};\n\nfunction guardEvent (e) {\n // don't redirect with control keys\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n // don't redirect when preventDefault called\n if (e.defaultPrevented) { return }\n // don't redirect on right click\n if (e.button !== undefined && e.button !== 0) { return }\n // don't redirect if `target=\"_blank\"`\n if (e.currentTarget && e.currentTarget.getAttribute) {\n var target = e.currentTarget.getAttribute('target');\n if (/\\b_blank\\b/i.test(target)) { return }\n }\n // this may be a Weex event which doesn't have this method\n if (e.preventDefault) {\n e.preventDefault();\n }\n return true\n}\n\nfunction findAnchor (children) {\n if (children) {\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.tag === 'a') {\n return child\n }\n if (child.children && (child = findAnchor(child.children))) {\n return child\n }\n }\n }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n if (install.installed && _Vue === Vue) { return }\n install.installed = true;\n\n _Vue = Vue;\n\n var isDef = function (v) { return v !== undefined; };\n\n var registerInstance = function (vm, callVal) {\n var i = vm.$options._parentVnode;\n if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n i(vm, callVal);\n }\n };\n\n Vue.mixin({\n beforeCreate: function beforeCreate () {\n if (isDef(this.$options.router)) {\n this._routerRoot = this;\n this._router = this.$options.router;\n this._router.init(this);\n Vue.util.defineReactive(this, '_route', this._router.history.current);\n } else {\n this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n }\n registerInstance(this, this);\n },\n destroyed: function destroyed () {\n registerInstance(this);\n }\n });\n\n Object.defineProperty(Vue.prototype, '$router', {\n get: function get () { return this._routerRoot._router }\n });\n\n Object.defineProperty(Vue.prototype, '$route', {\n get: function get () { return this._routerRoot._route }\n });\n\n Vue.component('RouterView', View);\n Vue.component('RouterLink', Link);\n\n var strats = Vue.config.optionMergeStrategies;\n // use the same hook merging strategy for route hooks\n strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/* */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/* */\n\nfunction createRouteMap (\n routes,\n oldPathList,\n oldPathMap,\n oldNameMap\n) {\n // the path list is used to control path matching priority\n var pathList = oldPathList || [];\n // $flow-disable-line\n var pathMap = oldPathMap || Object.create(null);\n // $flow-disable-line\n var nameMap = oldNameMap || Object.create(null);\n\n routes.forEach(function (route) {\n addRouteRecord(pathList, pathMap, nameMap, route);\n });\n\n // ensure wildcard routes are always at the end\n for (var i = 0, l = pathList.length; i < l; i++) {\n if (pathList[i] === '*') {\n pathList.push(pathList.splice(i, 1)[0]);\n l--;\n i--;\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n // warn if routes do not include leading slashes\n var found = pathList\n // check for missing leading slash\n .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });\n\n if (found.length > 0) {\n var pathNames = found.map(function (path) { return (\"- \" + path); }).join('\\n');\n warn(false, (\"Non-nested routes must include a leading slash character. Fix the following routes: \\n\" + pathNames));\n }\n }\n\n return {\n pathList: pathList,\n pathMap: pathMap,\n nameMap: nameMap\n }\n}\n\nfunction addRouteRecord (\n pathList,\n pathMap,\n nameMap,\n route,\n parent,\n matchAs\n) {\n var path = route.path;\n var name = route.name;\n if (process.env.NODE_ENV !== 'production') {\n assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n assert(\n typeof route.component !== 'string',\n \"route config \\\"component\\\" for path: \" + (String(\n path || name\n )) + \" cannot be a \" + \"string id. Use an actual component instead.\"\n );\n\n warn(\n // eslint-disable-next-line no-control-regex\n !/[^\\u0000-\\u007F]+/.test(path),\n \"Route with path \\\"\" + path + \"\\\" contains unencoded characters, make sure \" +\n \"your path is correctly encoded before passing it to the router. Use \" +\n \"encodeURI to encode static segments of your path.\"\n );\n }\n\n var pathToRegexpOptions =\n route.pathToRegexpOptions || {};\n var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);\n\n if (typeof route.caseSensitive === 'boolean') {\n pathToRegexpOptions.sensitive = route.caseSensitive;\n }\n\n var record = {\n path: normalizedPath,\n regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n components: route.components || { default: route.component },\n instances: {},\n enteredCbs: {},\n name: name,\n parent: parent,\n matchAs: matchAs,\n redirect: route.redirect,\n beforeEnter: route.beforeEnter,\n meta: route.meta || {},\n props:\n route.props == null\n ? {}\n : route.components\n ? route.props\n : { default: route.props }\n };\n\n if (route.children) {\n // Warn if route is named, does not redirect and has a default child route.\n // If users navigate to this route by name, the default child will\n // not be rendered (GH Issue #629)\n if (process.env.NODE_ENV !== 'production') {\n if (\n route.name &&\n !route.redirect &&\n route.children.some(function (child) { return /^\\/?$/.test(child.path); })\n ) {\n warn(\n false,\n \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'\\\"), \" +\n \"the default child route will not be rendered. Remove the name from \" +\n \"this route and use the name of the default child route for named \" +\n \"links instead.\"\n );\n }\n }\n route.children.forEach(function (child) {\n var childMatchAs = matchAs\n ? cleanPath((matchAs + \"/\" + (child.path)))\n : undefined;\n addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n });\n }\n\n if (!pathMap[record.path]) {\n pathList.push(record.path);\n pathMap[record.path] = record;\n }\n\n if (route.alias !== undefined) {\n var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];\n for (var i = 0; i < aliases.length; ++i) {\n var alias = aliases[i];\n if (process.env.NODE_ENV !== 'production' && alias === path) {\n warn(\n false,\n (\"Found an alias with the same value as the path: \\\"\" + path + \"\\\". You have to remove that alias. It will be ignored in development.\")\n );\n // skip in dev to make it work\n continue\n }\n\n var aliasRoute = {\n path: alias,\n children: route.children\n };\n addRouteRecord(\n pathList,\n pathMap,\n nameMap,\n aliasRoute,\n parent,\n record.path || '/' // matchAs\n );\n }\n }\n\n if (name) {\n if (!nameMap[name]) {\n nameMap[name] = record;\n } else if (process.env.NODE_ENV !== 'production' && !matchAs) {\n warn(\n false,\n \"Duplicate named routes definition: \" +\n \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n );\n }\n }\n}\n\nfunction compileRouteRegex (\n path,\n pathToRegexpOptions\n) {\n var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n if (process.env.NODE_ENV !== 'production') {\n var keys = Object.create(null);\n regex.keys.forEach(function (key) {\n warn(\n !keys[key.name],\n (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\")\n );\n keys[key.name] = true;\n });\n }\n return regex\n}\n\nfunction normalizePath (\n path,\n parent,\n strict\n) {\n if (!strict) { path = path.replace(/\\/$/, ''); }\n if (path[0] === '/') { return path }\n if (parent == null) { return path }\n return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/* */\n\n\n\nfunction createMatcher (\n routes,\n router\n) {\n var ref = createRouteMap(routes);\n var pathList = ref.pathList;\n var pathMap = ref.pathMap;\n var nameMap = ref.nameMap;\n\n function addRoutes (routes) {\n createRouteMap(routes, pathList, pathMap, nameMap);\n }\n\n function match (\n raw,\n currentRoute,\n redirectedFrom\n ) {\n var location = normalizeLocation(raw, currentRoute, false, router);\n var name = location.name;\n\n if (name) {\n var record = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n }\n if (!record) { return _createRoute(null, location) }\n var paramNames = record.regex.keys\n .filter(function (key) { return !key.optional; })\n .map(function (key) { return key.name; });\n\n if (typeof location.params !== 'object') {\n location.params = {};\n }\n\n if (currentRoute && typeof currentRoute.params === 'object') {\n for (var key in currentRoute.params) {\n if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n location.params[key] = currentRoute.params[key];\n }\n }\n }\n\n location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n return _createRoute(record, location, redirectedFrom)\n } else if (location.path) {\n location.params = {};\n for (var i = 0; i < pathList.length; i++) {\n var path = pathList[i];\n var record$1 = pathMap[path];\n if (matchRoute(record$1.regex, location.path, location.params)) {\n return _createRoute(record$1, location, redirectedFrom)\n }\n }\n }\n // no match\n return _createRoute(null, location)\n }\n\n function redirect (\n record,\n location\n ) {\n var originalRedirect = record.redirect;\n var redirect = typeof originalRedirect === 'function'\n ? originalRedirect(createRoute(record, location, null, router))\n : originalRedirect;\n\n if (typeof redirect === 'string') {\n redirect = { path: redirect };\n }\n\n if (!redirect || typeof redirect !== 'object') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n );\n }\n return _createRoute(null, location)\n }\n\n var re = redirect;\n var name = re.name;\n var path = re.path;\n var query = location.query;\n var hash = location.hash;\n var params = location.params;\n query = re.hasOwnProperty('query') ? re.query : query;\n hash = re.hasOwnProperty('hash') ? re.hash : hash;\n params = re.hasOwnProperty('params') ? re.params : params;\n\n if (name) {\n // resolved named direct\n var targetRecord = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n }\n return match({\n _normalized: true,\n name: name,\n query: query,\n hash: hash,\n params: params\n }, undefined, location)\n } else if (path) {\n // 1. resolve relative redirect\n var rawPath = resolveRecordPath(path, record);\n // 2. resolve params\n var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n // 3. rematch with existing query and hash\n return match({\n _normalized: true,\n path: resolvedPath,\n query: query,\n hash: hash\n }, undefined, location)\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n }\n return _createRoute(null, location)\n }\n }\n\n function alias (\n record,\n location,\n matchAs\n ) {\n var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n var aliasedMatch = match({\n _normalized: true,\n path: aliasedPath\n });\n if (aliasedMatch) {\n var matched = aliasedMatch.matched;\n var aliasedRecord = matched[matched.length - 1];\n location.params = aliasedMatch.params;\n return _createRoute(aliasedRecord, location)\n }\n return _createRoute(null, location)\n }\n\n function _createRoute (\n record,\n location,\n redirectedFrom\n ) {\n if (record && record.redirect) {\n return redirect(record, redirectedFrom || location)\n }\n if (record && record.matchAs) {\n return alias(record, location, record.matchAs)\n }\n return createRoute(record, location, redirectedFrom, router)\n }\n\n return {\n match: match,\n addRoutes: addRoutes\n }\n}\n\nfunction matchRoute (\n regex,\n path,\n params\n) {\n var m = path.match(regex);\n\n if (!m) {\n return false\n } else if (!params) {\n return true\n }\n\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = regex.keys[i - 1];\n if (key) {\n // Fix #1994: using * with props: true generates a param named 0\n params[key.name || 'pathMatch'] = typeof m[i] === 'string' ? decode(m[i]) : m[i];\n }\n }\n\n return true\n}\n\nfunction resolveRecordPath (path, record) {\n return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/* */\n\n// use User Timing api (if present) for more accurate key precision\nvar Time =\n inBrowser && window.performance && window.performance.now\n ? window.performance\n : Date;\n\nfunction genStateKey () {\n return Time.now().toFixed(3)\n}\n\nvar _key = genStateKey();\n\nfunction getStateKey () {\n return _key\n}\n\nfunction setStateKey (key) {\n return (_key = key)\n}\n\n/* */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n // Prevent browser scroll behavior on History popstate\n if ('scrollRestoration' in window.history) {\n window.history.scrollRestoration = 'manual';\n }\n // Fix for #1585 for Firefox\n // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with\n // window.location.protocol + '//' + window.location.host\n // location.host contains the port and location.hostname doesn't\n var protocolAndPath = window.location.protocol + '//' + window.location.host;\n var absolutePath = window.location.href.replace(protocolAndPath, '');\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, window.history.state);\n stateCopy.key = getStateKey();\n window.history.replaceState(stateCopy, '', absolutePath);\n window.addEventListener('popstate', handlePopState);\n return function () {\n window.removeEventListener('popstate', handlePopState);\n }\n}\n\nfunction handleScroll (\n router,\n to,\n from,\n isPop\n) {\n if (!router.app) {\n return\n }\n\n var behavior = router.options.scrollBehavior;\n if (!behavior) {\n return\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n }\n\n // wait until re-render finishes before scrolling\n router.app.$nextTick(function () {\n var position = getScrollPosition();\n var shouldScroll = behavior.call(\n router,\n to,\n from,\n isPop ? position : null\n );\n\n if (!shouldScroll) {\n return\n }\n\n if (typeof shouldScroll.then === 'function') {\n shouldScroll\n .then(function (shouldScroll) {\n scrollToPosition((shouldScroll), position);\n })\n .catch(function (err) {\n if (process.env.NODE_ENV !== 'production') {\n assert(false, err.toString());\n }\n });\n } else {\n scrollToPosition(shouldScroll, position);\n }\n });\n}\n\nfunction saveScrollPosition () {\n var key = getStateKey();\n if (key) {\n positionStore[key] = {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n }\n}\n\nfunction handlePopState (e) {\n saveScrollPosition();\n if (e.state && e.state.key) {\n setStateKey(e.state.key);\n }\n}\n\nfunction getScrollPosition () {\n var key = getStateKey();\n if (key) {\n return positionStore[key]\n }\n}\n\nfunction getElementPosition (el, offset) {\n var docEl = document.documentElement;\n var docRect = docEl.getBoundingClientRect();\n var elRect = el.getBoundingClientRect();\n return {\n x: elRect.left - docRect.left - offset.x,\n y: elRect.top - docRect.top - offset.y\n }\n}\n\nfunction isValidPosition (obj) {\n return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n y: isNumber(obj.y) ? obj.y : window.pageYOffset\n }\n}\n\nfunction normalizeOffset (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : 0,\n y: isNumber(obj.y) ? obj.y : 0\n }\n}\n\nfunction isNumber (v) {\n return typeof v === 'number'\n}\n\nvar hashStartsWithNumberRE = /^#\\d/;\n\nfunction scrollToPosition (shouldScroll, position) {\n var isObject = typeof shouldScroll === 'object';\n if (isObject && typeof shouldScroll.selector === 'string') {\n // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]\n // but at the same time, it doesn't make much sense to select an element with an id and an extra selector\n var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line\n ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line\n : document.querySelector(shouldScroll.selector);\n\n if (el) {\n var offset =\n shouldScroll.offset && typeof shouldScroll.offset === 'object'\n ? shouldScroll.offset\n : {};\n offset = normalizeOffset(offset);\n position = getElementPosition(el, offset);\n } else if (isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n } else if (isObject && isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n\n if (position) {\n // $flow-disable-line\n if ('scrollBehavior' in document.documentElement.style) {\n window.scrollTo({\n left: position.x,\n top: position.y,\n // $flow-disable-line\n behavior: shouldScroll.behavior\n });\n } else {\n window.scrollTo(position.x, position.y);\n }\n }\n}\n\n/* */\n\nvar supportsPushState =\n inBrowser &&\n (function () {\n var ua = window.navigator.userAgent;\n\n if (\n (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1\n ) {\n return false\n }\n\n return window.history && typeof window.history.pushState === 'function'\n })();\n\nfunction pushState (url, replace) {\n saveScrollPosition();\n // try...catch the pushState call to get around Safari\n // DOM Exception 18 where it limits to 100 pushState calls\n var history = window.history;\n try {\n if (replace) {\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, history.state);\n stateCopy.key = getStateKey();\n history.replaceState(stateCopy, '', url);\n } else {\n history.pushState({ key: setStateKey(genStateKey()) }, '', url);\n }\n } catch (e) {\n window.location[replace ? 'replace' : 'assign'](url);\n }\n}\n\nfunction replaceState (url) {\n pushState(url, true);\n}\n\n/* */\n\nfunction runQueue (queue, fn, cb) {\n var step = function (index) {\n if (index >= queue.length) {\n cb();\n } else {\n if (queue[index]) {\n fn(queue[index], function () {\n step(index + 1);\n });\n } else {\n step(index + 1);\n }\n }\n };\n step(0);\n}\n\n// When changing thing, also edit router.d.ts\nvar NavigationFailureType = {\n redirected: 2,\n aborted: 4,\n cancelled: 8,\n duplicated: 16\n};\n\nfunction createNavigationRedirectedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.redirected,\n (\"Redirected when going from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (stringifyRoute(\n to\n )) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createNavigationDuplicatedError (from, to) {\n var error = createRouterError(\n from,\n to,\n NavigationFailureType.duplicated,\n (\"Avoided redundant navigation to current location: \\\"\" + (from.fullPath) + \"\\\".\")\n );\n // backwards compatible with the first introduction of Errors\n error.name = 'NavigationDuplicated';\n return error\n}\n\nfunction createNavigationCancelledError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.cancelled,\n (\"Navigation cancelled from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" with a new navigation.\")\n )\n}\n\nfunction createNavigationAbortedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.aborted,\n (\"Navigation aborted from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createRouterError (from, to, type, message) {\n var error = new Error(message);\n error._isRouter = true;\n error.from = from;\n error.to = to;\n error.type = type;\n\n return error\n}\n\nvar propertiesToLog = ['params', 'query', 'hash'];\n\nfunction stringifyRoute (to) {\n if (typeof to === 'string') { return to }\n if ('path' in to) { return to.path }\n var location = {};\n propertiesToLog.forEach(function (key) {\n if (key in to) { location[key] = to[key]; }\n });\n return JSON.stringify(location, null, 2)\n}\n\nfunction isError (err) {\n return Object.prototype.toString.call(err).indexOf('Error') > -1\n}\n\nfunction isNavigationFailure (err, errorType) {\n return (\n isError(err) &&\n err._isRouter &&\n (errorType == null || err.type === errorType)\n )\n}\n\n/* */\n\nfunction resolveAsyncComponents (matched) {\n return function (to, from, next) {\n var hasAsync = false;\n var pending = 0;\n var error = null;\n\n flatMapComponents(matched, function (def, _, match, key) {\n // if it's a function and doesn't have cid attached,\n // assume it's an async component resolve function.\n // we are not using Vue's default async resolving mechanism because\n // we want to halt the navigation until the incoming component has been\n // resolved.\n if (typeof def === 'function' && def.cid === undefined) {\n hasAsync = true;\n pending++;\n\n var resolve = once(function (resolvedDef) {\n if (isESModule(resolvedDef)) {\n resolvedDef = resolvedDef.default;\n }\n // save resolved on async factory in case it's used elsewhere\n def.resolved = typeof resolvedDef === 'function'\n ? resolvedDef\n : _Vue.extend(resolvedDef);\n match.components[key] = resolvedDef;\n pending--;\n if (pending <= 0) {\n next();\n }\n });\n\n var reject = once(function (reason) {\n var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n process.env.NODE_ENV !== 'production' && warn(false, msg);\n if (!error) {\n error = isError(reason)\n ? reason\n : new Error(msg);\n next(error);\n }\n });\n\n var res;\n try {\n res = def(resolve, reject);\n } catch (e) {\n reject(e);\n }\n if (res) {\n if (typeof res.then === 'function') {\n res.then(resolve, reject);\n } else {\n // new syntax in Vue 2.3\n var comp = res.component;\n if (comp && typeof comp.then === 'function') {\n comp.then(resolve, reject);\n }\n }\n }\n }\n });\n\n if (!hasAsync) { next(); }\n }\n}\n\nfunction flatMapComponents (\n matched,\n fn\n) {\n return flatten(matched.map(function (m) {\n return Object.keys(m.components).map(function (key) { return fn(\n m.components[key],\n m.instances[key],\n m, key\n ); })\n }))\n}\n\nfunction flatten (arr) {\n return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n typeof Symbol === 'function' &&\n typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n var called = false;\n return function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (called) { return }\n called = true;\n return fn.apply(this, args)\n }\n}\n\n/* */\n\nvar History = function History (router, base) {\n this.router = router;\n this.base = normalizeBase(base);\n // start with a route object that stands for \"nowhere\"\n this.current = START;\n this.pending = null;\n this.ready = false;\n this.readyCbs = [];\n this.readyErrorCbs = [];\n this.errorCbs = [];\n this.listeners = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n if (this.ready) {\n cb();\n } else {\n this.readyCbs.push(cb);\n if (errorCb) {\n this.readyErrorCbs.push(errorCb);\n }\n }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (\n location,\n onComplete,\n onAbort\n) {\n var this$1 = this;\n\n var route;\n // catch redirect option https://github.com/vuejs/vue-router/issues/3201\n try {\n route = this.router.match(location, this.current);\n } catch (e) {\n this.errorCbs.forEach(function (cb) {\n cb(e);\n });\n // Exception should still be thrown\n throw e\n }\n var prev = this.current;\n this.confirmTransition(\n route,\n function () {\n this$1.updateRoute(route);\n onComplete && onComplete(route);\n this$1.ensureURL();\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n\n // fire ready cbs once\n if (!this$1.ready) {\n this$1.ready = true;\n this$1.readyCbs.forEach(function (cb) {\n cb(route);\n });\n }\n },\n function (err) {\n if (onAbort) {\n onAbort(err);\n }\n if (err && !this$1.ready) {\n // Initial redirection should not mark the history as ready yet\n // because it's triggered by the redirection instead\n // https://github.com/vuejs/vue-router/issues/3225\n // https://github.com/vuejs/vue-router/issues/3331\n if (!isNavigationFailure(err, NavigationFailureType.redirected) || prev !== START) {\n this$1.ready = true;\n this$1.readyErrorCbs.forEach(function (cb) {\n cb(err);\n });\n }\n }\n }\n );\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n var this$1 = this;\n\n var current = this.current;\n this.pending = route;\n var abort = function (err) {\n // changed after adding errors with\n // https://github.com/vuejs/vue-router/pull/3047 before that change,\n // redirect and aborted navigation would produce an err == null\n if (!isNavigationFailure(err) && isError(err)) {\n if (this$1.errorCbs.length) {\n this$1.errorCbs.forEach(function (cb) {\n cb(err);\n });\n } else {\n warn(false, 'uncaught error during route navigation:');\n console.error(err);\n }\n }\n onAbort && onAbort(err);\n };\n var lastRouteIndex = route.matched.length - 1;\n var lastCurrentIndex = current.matched.length - 1;\n if (\n isSameRoute(route, current) &&\n // in the case the route map has been dynamically appended to\n lastRouteIndex === lastCurrentIndex &&\n route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]\n ) {\n this.ensureURL();\n return abort(createNavigationDuplicatedError(current, route))\n }\n\n var ref = resolveQueue(\n this.current.matched,\n route.matched\n );\n var updated = ref.updated;\n var deactivated = ref.deactivated;\n var activated = ref.activated;\n\n var queue = [].concat(\n // in-component leave guards\n extractLeaveGuards(deactivated),\n // global before hooks\n this.router.beforeHooks,\n // in-component update hooks\n extractUpdateHooks(updated),\n // in-config enter guards\n activated.map(function (m) { return m.beforeEnter; }),\n // async components\n resolveAsyncComponents(activated)\n );\n\n var iterator = function (hook, next) {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n try {\n hook(route, current, function (to) {\n if (to === false) {\n // next(false) -> abort navigation, ensure current URL\n this$1.ensureURL(true);\n abort(createNavigationAbortedError(current, route));\n } else if (isError(to)) {\n this$1.ensureURL(true);\n abort(to);\n } else if (\n typeof to === 'string' ||\n (typeof to === 'object' &&\n (typeof to.path === 'string' || typeof to.name === 'string'))\n ) {\n // next('/') or next({ path: '/' }) -> redirect\n abort(createNavigationRedirectedError(current, route));\n if (typeof to === 'object' && to.replace) {\n this$1.replace(to);\n } else {\n this$1.push(to);\n }\n } else {\n // confirm transition and pass on the value\n next(to);\n }\n });\n } catch (e) {\n abort(e);\n }\n };\n\n runQueue(queue, iterator, function () {\n // wait until async components are resolved before\n // extracting in-component enter guards\n var enterGuards = extractEnterGuards(activated);\n var queue = enterGuards.concat(this$1.router.resolveHooks);\n runQueue(queue, iterator, function () {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n this$1.pending = null;\n onComplete(route);\n if (this$1.router.app) {\n this$1.router.app.$nextTick(function () {\n handleRouteEntered(route);\n });\n }\n });\n });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n this.current = route;\n this.cb && this.cb(route);\n};\n\nHistory.prototype.setupListeners = function setupListeners () {\n // Default implementation is empty\n};\n\nHistory.prototype.teardown = function teardown () {\n // clean up event listeners\n // https://github.com/vuejs/vue-router/issues/2341\n this.listeners.forEach(function (cleanupListener) {\n cleanupListener();\n });\n this.listeners = [];\n\n // reset current history route\n // https://github.com/vuejs/vue-router/issues/3294\n this.current = START;\n this.pending = null;\n};\n\nfunction normalizeBase (base) {\n if (!base) {\n if (inBrowser) {\n // respect tag\n var baseEl = document.querySelector('base');\n base = (baseEl && baseEl.getAttribute('href')) || '/';\n // strip full URL origin\n base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n } else {\n base = '/';\n }\n }\n // make sure there's the starting slash\n if (base.charAt(0) !== '/') {\n base = '/' + base;\n }\n // remove trailing slash\n return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n current,\n next\n) {\n var i;\n var max = Math.max(current.length, next.length);\n for (i = 0; i < max; i++) {\n if (current[i] !== next[i]) {\n break\n }\n }\n return {\n updated: next.slice(0, i),\n activated: next.slice(i),\n deactivated: current.slice(i)\n }\n}\n\nfunction extractGuards (\n records,\n name,\n bind,\n reverse\n) {\n var guards = flatMapComponents(records, function (def, instance, match, key) {\n var guard = extractGuard(def, name);\n if (guard) {\n return Array.isArray(guard)\n ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n : bind(guard, instance, match, key)\n }\n });\n return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n def,\n key\n) {\n if (typeof def !== 'function') {\n // extend now so that global mixins are applied.\n def = _Vue.extend(def);\n }\n return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n if (instance) {\n return function boundRouteGuard () {\n return guard.apply(instance, arguments)\n }\n }\n}\n\nfunction extractEnterGuards (\n activated\n) {\n return extractGuards(\n activated,\n 'beforeRouteEnter',\n function (guard, _, match, key) {\n return bindEnterGuard(guard, match, key)\n }\n )\n}\n\nfunction bindEnterGuard (\n guard,\n match,\n key\n) {\n return function routeEnterGuard (to, from, next) {\n return guard(to, from, function (cb) {\n if (typeof cb === 'function') {\n if (!match.enteredCbs[key]) {\n match.enteredCbs[key] = [];\n }\n match.enteredCbs[key].push(cb);\n }\n next(cb);\n })\n }\n}\n\n/* */\n\nvar HTML5History = /*@__PURE__*/(function (History) {\n function HTML5History (router, base) {\n History.call(this, router, base);\n\n this._startLocation = getLocation(this.base);\n }\n\n if ( History ) HTML5History.__proto__ = History;\n HTML5History.prototype = Object.create( History && History.prototype );\n HTML5History.prototype.constructor = HTML5History;\n\n HTML5History.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n\n // Avoiding first `popstate` event dispatched in some browsers but first\n // history route not updated since async guard at the same time.\n var location = getLocation(this$1.base);\n if (this$1.current === START && location === this$1._startLocation) {\n return\n }\n\n this$1.transitionTo(location, function (route) {\n if (supportsScroll) {\n handleScroll(router, route, current, true);\n }\n });\n };\n window.addEventListener('popstate', handleRoutingEvent);\n this.listeners.push(function () {\n window.removeEventListener('popstate', handleRoutingEvent);\n });\n };\n\n HTML5History.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n pushState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n replaceState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.ensureURL = function ensureURL (push) {\n if (getLocation(this.base) !== this.current.fullPath) {\n var current = cleanPath(this.base + this.current.fullPath);\n push ? pushState(current) : replaceState(current);\n }\n };\n\n HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n return getLocation(this.base)\n };\n\n return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n var path = window.location.pathname;\n if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) {\n path = path.slice(base.length);\n }\n return (path || '/') + window.location.search + window.location.hash\n}\n\n/* */\n\nvar HashHistory = /*@__PURE__*/(function (History) {\n function HashHistory (router, base, fallback) {\n History.call(this, router, base);\n // check history fallback deeplinking\n if (fallback && checkFallback(this.base)) {\n return\n }\n ensureSlash();\n }\n\n if ( History ) HashHistory.__proto__ = History;\n HashHistory.prototype = Object.create( History && History.prototype );\n HashHistory.prototype.constructor = HashHistory;\n\n // this is delayed until the app mounts\n // to avoid the hashchange listener being fired too early\n HashHistory.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n if (!ensureSlash()) {\n return\n }\n this$1.transitionTo(getHash(), function (route) {\n if (supportsScroll) {\n handleScroll(this$1.router, route, current, true);\n }\n if (!supportsPushState) {\n replaceHash(route.fullPath);\n }\n });\n };\n var eventType = supportsPushState ? 'popstate' : 'hashchange';\n window.addEventListener(\n eventType,\n handleRoutingEvent\n );\n this.listeners.push(function () {\n window.removeEventListener(eventType, handleRoutingEvent);\n });\n };\n\n HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n pushHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n replaceHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HashHistory.prototype.ensureURL = function ensureURL (push) {\n var current = this.current.fullPath;\n if (getHash() !== current) {\n push ? pushHash(current) : replaceHash(current);\n }\n };\n\n HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n return getHash()\n };\n\n return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n var location = getLocation(base);\n if (!/^\\/#/.test(location)) {\n window.location.replace(cleanPath(base + '/#' + location));\n return true\n }\n}\n\nfunction ensureSlash () {\n var path = getHash();\n if (path.charAt(0) === '/') {\n return true\n }\n replaceHash('/' + path);\n return false\n}\n\nfunction getHash () {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var index = href.indexOf('#');\n // empty path\n if (index < 0) { return '' }\n\n href = href.slice(index + 1);\n\n return href\n}\n\nfunction getUrl (path) {\n var href = window.location.href;\n var i = href.indexOf('#');\n var base = i >= 0 ? href.slice(0, i) : href;\n return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n if (supportsPushState) {\n pushState(getUrl(path));\n } else {\n window.location.hash = path;\n }\n}\n\nfunction replaceHash (path) {\n if (supportsPushState) {\n replaceState(getUrl(path));\n } else {\n window.location.replace(getUrl(path));\n }\n}\n\n/* */\n\nvar AbstractHistory = /*@__PURE__*/(function (History) {\n function AbstractHistory (router, base) {\n History.call(this, router, base);\n this.stack = [];\n this.index = -1;\n }\n\n if ( History ) AbstractHistory.__proto__ = History;\n AbstractHistory.prototype = Object.create( History && History.prototype );\n AbstractHistory.prototype.constructor = AbstractHistory;\n\n AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);\n this$1.index++;\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.go = function go (n) {\n var this$1 = this;\n\n var targetIndex = this.index + n;\n if (targetIndex < 0 || targetIndex >= this.stack.length) {\n return\n }\n var route = this.stack[targetIndex];\n this.confirmTransition(\n route,\n function () {\n var prev = this$1.current;\n this$1.index = targetIndex;\n this$1.updateRoute(route);\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n },\n function (err) {\n if (isNavigationFailure(err, NavigationFailureType.duplicated)) {\n this$1.index = targetIndex;\n }\n }\n );\n };\n\n AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n var current = this.stack[this.stack.length - 1];\n return current ? current.fullPath : '/'\n };\n\n AbstractHistory.prototype.ensureURL = function ensureURL () {\n // noop\n };\n\n return AbstractHistory;\n}(History));\n\n/* */\n\nvar VueRouter = function VueRouter (options) {\n if ( options === void 0 ) options = {};\n\n this.app = null;\n this.apps = [];\n this.options = options;\n this.beforeHooks = [];\n this.resolveHooks = [];\n this.afterHooks = [];\n this.matcher = createMatcher(options.routes || [], this);\n\n var mode = options.mode || 'hash';\n this.fallback =\n mode === 'history' && !supportsPushState && options.fallback !== false;\n if (this.fallback) {\n mode = 'hash';\n }\n if (!inBrowser) {\n mode = 'abstract';\n }\n this.mode = mode;\n\n switch (mode) {\n case 'history':\n this.history = new HTML5History(this, options.base);\n break\n case 'hash':\n this.history = new HashHistory(this, options.base, this.fallback);\n break\n case 'abstract':\n this.history = new AbstractHistory(this, options.base);\n break\n default:\n if (process.env.NODE_ENV !== 'production') {\n assert(false, (\"invalid mode: \" + mode));\n }\n }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (raw, current, redirectedFrom) {\n return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n var this$1 = this;\n\n process.env.NODE_ENV !== 'production' &&\n assert(\n install.installed,\n \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n \"before creating root instance.\"\n );\n\n this.apps.push(app);\n\n // set up app destroyed handler\n // https://github.com/vuejs/vue-router/issues/2639\n app.$once('hook:destroyed', function () {\n // clean out app from this.apps array once destroyed\n var index = this$1.apps.indexOf(app);\n if (index > -1) { this$1.apps.splice(index, 1); }\n // ensure we still have a main app or null if no apps\n // we do not release the router so it can be reused\n if (this$1.app === app) { this$1.app = this$1.apps[0] || null; }\n\n if (!this$1.app) { this$1.history.teardown(); }\n });\n\n // main app previously initialized\n // return as we don't need to set up new history listener\n if (this.app) {\n return\n }\n\n this.app = app;\n\n var history = this.history;\n\n if (history instanceof HTML5History || history instanceof HashHistory) {\n var handleInitialScroll = function (routeOrError) {\n var from = history.current;\n var expectScroll = this$1.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll && 'fullPath' in routeOrError) {\n handleScroll(this$1, routeOrError, from, false);\n }\n };\n var setupListeners = function (routeOrError) {\n history.setupListeners();\n handleInitialScroll(routeOrError);\n };\n history.transitionTo(\n history.getCurrentLocation(),\n setupListeners,\n setupListeners\n );\n }\n\n history.listen(function (route) {\n this$1.apps.forEach(function (app) {\n app._route = route;\n });\n });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.push(location, resolve, reject);\n })\n } else {\n this.history.push(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.replace(location, resolve, reject);\n })\n } else {\n this.history.replace(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.go = function go (n) {\n this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n var route = to\n ? to.matched\n ? to\n : this.resolve(to).route\n : this.currentRoute;\n if (!route) {\n return []\n }\n return [].concat.apply(\n [],\n route.matched.map(function (m) {\n return Object.keys(m.components).map(function (key) {\n return m.components[key]\n })\n })\n )\n};\n\nVueRouter.prototype.resolve = function resolve (\n to,\n current,\n append\n) {\n current = current || this.history.current;\n var location = normalizeLocation(to, current, append, this);\n var route = this.match(location, current);\n var fullPath = route.redirectedFrom || route.fullPath;\n var base = this.history.base;\n var href = createHref(base, fullPath, this.mode);\n return {\n location: location,\n route: route,\n href: href,\n // for backwards compat\n normalizedTo: location,\n resolved: route\n }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n this.matcher.addRoutes(routes);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nfunction registerHook (list, fn) {\n list.push(fn);\n return function () {\n var i = list.indexOf(fn);\n if (i > -1) { list.splice(i, 1); }\n }\n}\n\nfunction createHref (base, fullPath, mode) {\n var path = mode === 'hash' ? '#' + fullPath : fullPath;\n return base ? cleanPath(base + '/' + path) : path\n}\n\nVueRouter.install = install;\nVueRouter.version = '3.4.9';\nVueRouter.isNavigationFailure = isNavigationFailure;\nVueRouter.NavigationFailureType = NavigationFailureType;\n\nif (inBrowser && window.Vue) {\n window.Vue.use(VueRouter);\n}\n\nexport default VueRouter;\n","//! moment.js locale configuration\n//! locale : Greek [el]\n//! author : Aggelos Karalias : https://github.com/mehiel\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }\n\n var el = moment.defineLocale('el', {\n monthsNominativeEl: 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split(\n '_'\n ),\n monthsGenitiveEl: 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split(\n '_'\n ),\n months: function (momentToFormat, format) {\n if (!momentToFormat) {\n return this._monthsNominativeEl;\n } else if (\n typeof format === 'string' &&\n /D/.test(format.substring(0, format.indexOf('MMMM')))\n ) {\n // if there is a day number before 'MMMM'\n return this._monthsGenitiveEl[momentToFormat.month()];\n } else {\n return this._monthsNominativeEl[momentToFormat.month()];\n }\n },\n monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),\n weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split(\n '_'\n ),\n weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),\n weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),\n meridiem: function (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'μμ' : 'ΜΜ';\n } else {\n return isLower ? 'πμ' : 'ΠΜ';\n }\n },\n isPM: function (input) {\n return (input + '').toLowerCase()[0] === 'μ';\n },\n meridiemParse: /[ΠΜ]\\.?Μ?\\.?/i,\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY h:mm A',\n LLLL: 'dddd, D MMMM YYYY h:mm A',\n },\n calendarEl: {\n sameDay: '[Σήμερα {}] LT',\n nextDay: '[Αύριο {}] LT',\n nextWeek: 'dddd [{}] LT',\n lastDay: '[Χθες {}] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 6:\n return '[το προηγούμενο] dddd [{}] LT';\n default:\n return '[την προηγούμενη] dddd [{}] LT';\n }\n },\n sameElse: 'L',\n },\n calendar: function (key, mom) {\n var output = this._calendarEl[key],\n hours = mom && mom.hours();\n if (isFunction(output)) {\n output = output.apply(mom);\n }\n return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις');\n },\n relativeTime: {\n future: 'σε %s',\n past: '%s πριν',\n s: 'λίγα δευτερόλεπτα',\n ss: '%d δευτερόλεπτα',\n m: 'ένα λεπτό',\n mm: '%d λεπτά',\n h: 'μία ώρα',\n hh: '%d ώρες',\n d: 'μία μέρα',\n dd: '%d μέρες',\n M: 'ένας μήνας',\n MM: '%d μήνες',\n y: 'ένας χρόνος',\n yy: '%d χρόνια',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}η/,\n ordinal: '%dη',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4st is the first week of the year.\n },\n });\n\n return el;\n\n})));\n","//! moment.js locale configuration\n//! locale : Polish [pl]\n//! author : Rafal Hirsz : https://github.com/evoL\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split(\n '_'\n ),\n monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split(\n '_'\n );\n function plural(n) {\n return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;\n }\n function translate(number, withoutSuffix, key) {\n var result = number + ' ';\n switch (key) {\n case 'ss':\n return result + (plural(number) ? 'sekundy' : 'sekund');\n case 'm':\n return withoutSuffix ? 'minuta' : 'minutę';\n case 'mm':\n return result + (plural(number) ? 'minuty' : 'minut');\n case 'h':\n return withoutSuffix ? 'godzina' : 'godzinę';\n case 'hh':\n return result + (plural(number) ? 'godziny' : 'godzin');\n case 'MM':\n return result + (plural(number) ? 'miesiące' : 'miesięcy');\n case 'yy':\n return result + (plural(number) ? 'lata' : 'lat');\n }\n }\n\n var pl = moment.defineLocale('pl', {\n months: function (momentToFormat, format) {\n if (!momentToFormat) {\n return monthsNominative;\n } else if (format === '') {\n // Hack: if format empty we know this is used to generate\n // RegExp by moment. Give then back both valid forms of months\n // in RegExp ready format.\n return (\n '(' +\n monthsSubjective[momentToFormat.month()] +\n '|' +\n monthsNominative[momentToFormat.month()] +\n ')'\n );\n } else if (/D MMMM/.test(format)) {\n return monthsSubjective[momentToFormat.month()];\n } else {\n return monthsNominative[momentToFormat.month()];\n }\n },\n monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),\n weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split(\n '_'\n ),\n weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),\n weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Dziś o] LT',\n nextDay: '[Jutro o] LT',\n nextWeek: function () {\n switch (this.day()) {\n case 0:\n return '[W niedzielę o] LT';\n\n case 2:\n return '[We wtorek o] LT';\n\n case 3:\n return '[W środę o] LT';\n\n case 6:\n return '[W sobotę o] LT';\n\n default:\n return '[W] dddd [o] LT';\n }\n },\n lastDay: '[Wczoraj o] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n return '[W zeszłą niedzielę o] LT';\n case 3:\n return '[W zeszłą środę o] LT';\n case 6:\n return '[W zeszłą sobotę o] LT';\n default:\n return '[W zeszły] dddd [o] LT';\n }\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: 'za %s',\n past: '%s temu',\n s: 'kilka sekund',\n ss: translate,\n m: translate,\n mm: translate,\n h: translate,\n hh: translate,\n d: '1 dzień',\n dd: '%d dni',\n M: 'miesiąc',\n MM: translate,\n y: 'rok',\n yy: translate,\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return pl;\n\n})));\n","/* eslint-disable no-inner-declarations */\nimport { extend, merge, isNullOrUndefined, getValue } from '@syncfusion/ej2-base';\nimport { attributes, prepend, isVisible, append, addClass } from '@syncfusion/ej2-base';\nimport { compile } from '@syncfusion/ej2-base';\nimport { DataManager, Query } from '@syncfusion/ej2-data';\nexport var cssClass = {\n li: 'e-list-item',\n ul: 'e-list-parent e-ul',\n group: 'e-list-group-item',\n icon: 'e-list-icon',\n text: 'e-list-text',\n check: 'e-list-check',\n checked: 'e-checked',\n selected: 'e-selected',\n expanded: 'e-expanded',\n textContent: 'e-text-content',\n hasChild: 'e-has-child',\n level: 'e-level',\n url: 'e-list-url',\n collapsible: 'e-icon-collapsible',\n disabled: 'e-disabled',\n image: 'e-list-img',\n iconWrapper: 'e-icon-wrapper',\n anchorWrap: 'e-anchor-wrap',\n navigable: 'e-navigable'\n};\n/**\n * Base List Generator\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport var ListBase;\n(function (ListBase) {\n /**\n *\n * Default mapped fields.\n */\n ListBase.defaultMappedFields = {\n id: 'id',\n text: 'text',\n url: 'url',\n value: 'value',\n isChecked: 'isChecked',\n enabled: 'enabled',\n expanded: 'expanded',\n selected: 'selected',\n iconCss: 'iconCss',\n child: 'child',\n isVisible: 'isVisible',\n hasChildren: 'hasChildren',\n tooltip: 'tooltip',\n htmlAttributes: 'htmlAttributes',\n urlAttributes: 'urlAttributes',\n imageAttributes: 'imageAttributes',\n imageUrl: 'imageUrl',\n groupBy: null,\n sortBy: null\n };\n var defaultAriaAttributes = {\n level: 1,\n listRole: 'presentation',\n itemRole: 'presentation',\n groupItemRole: 'group',\n itemText: 'list-item',\n wrapperRole: 'presentation'\n };\n var defaultListBaseOptions = {\n showCheckBox: false,\n showIcon: false,\n enableHtmlSanitizer: false,\n expandCollapse: false,\n fields: ListBase.defaultMappedFields,\n ariaAttributes: defaultAriaAttributes,\n listClass: '',\n itemClass: '',\n processSubChild: false,\n sortOrder: 'None',\n template: null,\n groupTemplate: null,\n headerTemplate: null,\n expandIconClass: 'e-icon-collapsible',\n moduleName: 'list',\n expandIconPosition: 'Right',\n itemNavigable: false\n };\n /**\n * Function helps to created and return the UL Li element based on your data.\n *\n * @param {createElementParams} createElement - Specifies an array of JSON data.\n *\n * @param {{Object}[]} dataSource - Specifies an array of JSON data.\n *\n * @param {ListBaseOptions} options? - Specifies the list options that need to provide.\n *\n * @param {boolean} isSingleLevel? - Specifies the list options that need to provide.\n *\n * @param {any} componentInstance? - Specifies the list options that need to provide.\n *\n * @returns {createElement} createListFromJson - Specifies the list options that need to provide.\n */\n function createList(createElement, dataSource, \n // eslint-disable-next-line\n options, isSingleLevel, componentInstance) {\n var curOpt = extend({}, defaultListBaseOptions, options);\n var ariaAttributes = extend({}, defaultAriaAttributes, curOpt.ariaAttributes);\n var type = typeofData(dataSource).typeof;\n if (type === 'string' || type === 'number') {\n return createListFromArray(createElement, dataSource, isSingleLevel, options, componentInstance);\n }\n else {\n return createListFromJson(createElement, dataSource, options, ariaAttributes.level, isSingleLevel, componentInstance);\n }\n }\n ListBase.createList = createList;\n /**\n * Function helps to created an element list based on string array input .\n *\n * @param {createElementParams} createElement - Specifies an array of JSON data.\n *\n * @param {{Object}[]} dataSource - Specifies an array of JSON data.\n *\n * @param {ListBaseOptions} options? - Specifies the list options that need to provide.\n *\n * @param {boolean} isSingleLevel? - Specifies the list options that need to provide.\n *\n * @param {any} componentInstance? - Specifies the list options that need to provide.\n *\n * @returns {createElement} generateUL - returns the list options that need to provide.\n */\n function createListFromArray(createElement, dataSource, \n // tslint:disable-next-line\n // eslint-disable-next-line\n isSingleLevel, options, componentInstance) {\n var subChild = createListItemFromArray(createElement, dataSource, isSingleLevel, options, componentInstance);\n return generateUL(createElement, subChild, null, options);\n }\n ListBase.createListFromArray = createListFromArray;\n /**\n * Function helps to created an element list based on string array input .\n *\n * @param {createElementParams} createElement - Specifies an array of JSON data.\n *\n * @param {{Object}[]} dataSource - Specifies an array of JSON data.\n *\n * @param {ListBaseOptions} options? - Specifies the list options that need to provide.\n *\n * @param {boolean} isSingleLevel? - Specifies the list options that need to provide.\n *\n * @param {any} componentInstance? - Specifies the list options that need to provide.\n *\n * @returns {HTMLElement[]} subChild - returns the list options that need to provide.\n */\n function createListItemFromArray(createElement, dataSource, \n // eslint-disable-next-line\n isSingleLevel, options, componentInstance) {\n var subChild = [];\n var curOpt = extend({}, defaultListBaseOptions, options);\n cssClass = getModuleClass(curOpt.moduleName);\n var id = generateId(); // generate id for drop-down-list option.\n for (var i = 0; i < dataSource.length; i++) {\n if (isNullOrUndefined(dataSource[i])) {\n continue;\n }\n var li = void 0;\n if (curOpt.itemCreating && typeof curOpt.itemCreating === 'function') {\n var curData = {\n dataSource: dataSource,\n curData: dataSource[i],\n text: dataSource[i],\n options: curOpt\n };\n curOpt.itemCreating(curData);\n }\n if (isSingleLevel) {\n li = generateSingleLevelLI(createElement, dataSource[i], undefined, null, null, [], null, id, i, options);\n }\n else {\n li = generateLI(createElement, dataSource[i], undefined, null, null, options, componentInstance);\n }\n if (curOpt.itemCreated && typeof curOpt.itemCreated === 'function') {\n var curData = {\n dataSource: dataSource,\n curData: dataSource[i],\n text: dataSource[i],\n item: li,\n options: curOpt\n };\n curOpt.itemCreated(curData);\n }\n subChild.push(li);\n }\n return subChild;\n }\n ListBase.createListItemFromArray = createListItemFromArray;\n /**\n * Function helps to created an element list based on array of JSON input .\n *\n * @param {createElementParams} createElement - Specifies an array of JSON data.\n *\n * @param {{Object}[]} dataSource - Specifies an array of JSON data.\n *\n * @param {ListBaseOptions} options? - Specifies the list options that need to provide.\n *\n * @param {boolean} isSingleLevel? - Specifies the list options that need to provide.\n *\n * @param {number} level? - Specifies the list options that need to provide.\n *\n * @param {any} componentInstance? - Specifies the list options that need to provide.\n *\n * @returns {HTMLElement[]} child - returns the list options that need to provide.\n */\n function createListItemFromJson(createElement, dataSource, \n // eslint-disable-next-line\n options, level, isSingleLevel, componentInstance) {\n var curOpt = extend({}, defaultListBaseOptions, options);\n cssClass = getModuleClass(curOpt.moduleName);\n var fields = (componentInstance &&\n (componentInstance.getModuleName() == \"listview\" || componentInstance.getModuleName() == \"multiselect\")) ? curOpt.fields : extend({}, ListBase.defaultMappedFields, curOpt.fields);\n var ariaAttributes = extend({}, defaultAriaAttributes, curOpt.ariaAttributes);\n var id;\n var checkboxElement = [];\n if (level) {\n ariaAttributes.level = level;\n }\n var child = [];\n var li;\n var anchorElement;\n if (dataSource && dataSource.length && !isNullOrUndefined(typeofData(dataSource).item) &&\n // eslint-disable-next-line no-prototype-builtins\n !typeofData(dataSource).item.hasOwnProperty(fields.id)) {\n id = generateId(); // generate id for drop-down-list option.\n }\n for (var i = 0; i < dataSource.length; i++) {\n var fieldData = getFieldValues(dataSource[i], fields);\n if (isNullOrUndefined(dataSource[i])) {\n continue;\n }\n if (curOpt.itemCreating && typeof curOpt.itemCreating === 'function') {\n var curData = {\n dataSource: dataSource,\n curData: dataSource[i],\n text: fieldData[fields.text],\n options: curOpt,\n fields: fields\n };\n curOpt.itemCreating(curData);\n }\n var curItem = dataSource[i];\n if (curOpt.itemCreating && typeof curOpt.itemCreating === 'function') {\n fieldData = getFieldValues(dataSource[i], fields);\n }\n // eslint-disable-next-line no-prototype-builtins\n if (fieldData.hasOwnProperty(fields.id) && !isNullOrUndefined(fieldData[fields.id])) {\n id = fieldData[fields.id];\n }\n var innerEle = [];\n if (curOpt.showCheckBox) {\n if (curOpt.itemNavigable && (fieldData[fields.url] || fieldData[fields.urlAttributes])) {\n checkboxElement.push(createElement('input', { className: cssClass.check, attrs: { type: 'checkbox' } }));\n }\n else {\n innerEle.push(createElement('input', { className: cssClass.check, attrs: { type: 'checkbox' } }));\n }\n }\n if (isSingleLevel === true) {\n // eslint-disable-next-line no-prototype-builtins\n if (curOpt.showIcon && fieldData.hasOwnProperty(fields.iconCss) && !isNullOrUndefined(fieldData[fields.iconCss])) {\n innerEle.push(createElement('span', { className: cssClass.icon + ' ' + fieldData[fields.iconCss] }));\n }\n li = generateSingleLevelLI(createElement, curItem, fieldData, fields, curOpt.itemClass, innerEle, \n // eslint-disable-next-line no-prototype-builtins\n (curItem.hasOwnProperty('isHeader') &&\n curItem.isHeader) ? true : false, id, i, options);\n anchorElement = li.querySelector('.' + cssClass.anchorWrap);\n if (curOpt.itemNavigable && checkboxElement.length) {\n prepend(checkboxElement, li.firstElementChild);\n }\n }\n else {\n li = generateLI(createElement, curItem, fieldData, fields, curOpt.itemClass, options, componentInstance);\n li.classList.add(cssClass.level + '-' + ariaAttributes.level);\n li.setAttribute('aria-level', ariaAttributes.level.toString());\n anchorElement = li.querySelector('.' + cssClass.anchorWrap);\n // eslint-disable-next-line no-prototype-builtins\n if (fieldData.hasOwnProperty(fields.tooltip)) {\n li.setAttribute('title', fieldData[fields.tooltip]);\n }\n // eslint-disable-next-line no-prototype-builtins\n if (fieldData.hasOwnProperty(fields.htmlAttributes) && fieldData[fields.htmlAttributes]) {\n setAttribute(li, fieldData[fields.htmlAttributes]);\n }\n // eslint-disable-next-line no-prototype-builtins\n if (fieldData.hasOwnProperty(fields.enabled) && fieldData[fields.enabled] === false) {\n li.classList.add(cssClass.disabled);\n }\n // eslint-disable-next-line no-prototype-builtins\n if (fieldData.hasOwnProperty(fields.isVisible) && fieldData[fields.isVisible] === false) {\n li.style.display = 'none';\n }\n // eslint-disable-next-line no-prototype-builtins\n if (fieldData.hasOwnProperty(fields.imageUrl) && !isNullOrUndefined(fieldData[fields.imageUrl])\n && !curOpt.template) {\n var attr = { src: fieldData[fields.imageUrl] };\n merge(attr, fieldData[fields.imageAttributes]);\n var imageElemnt = createElement('img', { className: cssClass.image, attrs: attr });\n if (anchorElement) {\n anchorElement.insertAdjacentElement('afterbegin', imageElemnt);\n }\n else {\n prepend([imageElemnt], li.firstElementChild);\n }\n }\n // eslint-disable-next-line no-prototype-builtins\n if (curOpt.showIcon && fieldData.hasOwnProperty(fields.iconCss) &&\n !isNullOrUndefined(fieldData[fields.iconCss]) && !curOpt.template) {\n var iconElement = createElement('div', { className: cssClass.icon + ' ' + fieldData[fields.iconCss] });\n if (anchorElement) {\n anchorElement.insertAdjacentElement('afterbegin', iconElement);\n }\n else {\n prepend([iconElement], li.firstElementChild);\n }\n }\n if (innerEle.length) {\n prepend(innerEle, li.firstElementChild);\n }\n if (curOpt.itemNavigable && checkboxElement.length) {\n prepend(checkboxElement, li.firstElementChild);\n }\n processSubChild(createElement, fieldData, fields, dataSource, curOpt, li, ariaAttributes.level);\n }\n if (anchorElement) {\n addClass([li], [cssClass.navigable]);\n }\n if (curOpt.itemCreated && typeof curOpt.itemCreated === 'function') {\n var curData = {\n dataSource: dataSource,\n curData: dataSource[i],\n text: fieldData[fields.text],\n item: li,\n options: curOpt,\n fields: fields\n };\n curOpt.itemCreated(curData);\n }\n checkboxElement = [];\n child.push(li);\n }\n return child;\n }\n ListBase.createListItemFromJson = createListItemFromJson;\n /**\n * Function helps to created an element list based on array of JSON input .\n *\n * @param {createElementParams} createElement - Specifies an array of JSON data.\n *\n * @param {{Object}[]} dataSource - Specifies an array of JSON data.\n *\n * @param {ListBaseOptions} options? - Specifies the list options that need to provide.\n *\n * @param {number} level? - Specifies the list options that need to provide.\n *\n * @param {boolean} isSingleLevel? - Specifies the list options that need to provide.\n *\n * @param {any} componentInstance? - Specifies the list options that need to provide.\n *\n * @returns {createElement} generateUL - Specifies the list options that need to provide.\n */\n function createListFromJson(createElement, dataSource, \n // eslint-disable-next-line\n options, level, isSingleLevel, componentInstance) {\n var curOpt = extend({}, defaultListBaseOptions, options);\n var li = createListItemFromJson(createElement, dataSource, options, level, isSingleLevel, componentInstance);\n return generateUL(createElement, li, curOpt.listClass, options);\n }\n ListBase.createListFromJson = createListFromJson;\n /**\n * Return the next or previous visible element.\n *\n * @param {Element[]|NodeList} elementArray - An element array to find next or previous element.\n * @param {Element} li - An element to find next or previous after this element.\n * @param {boolean} isPrevious? - Specify when the need get previous element from array.\n */\n function getSiblingLI(elementArray, element, isPrevious) {\n cssClass = getModuleClass(defaultListBaseOptions.moduleName);\n if (!elementArray || !elementArray.length) {\n return void 0;\n }\n var siblingLI;\n var liIndex;\n var liCollections = Array.prototype.slice.call(elementArray);\n if (element) {\n liIndex = indexOf(element, liCollections);\n }\n else {\n liIndex = (isPrevious === true ? liCollections.length : -1);\n }\n siblingLI = liCollections[liIndex + (isPrevious === true ? -1 : 1)];\n while (siblingLI && (!isVisible(siblingLI) || siblingLI.classList.contains(cssClass.disabled))) {\n liIndex = liIndex + (isPrevious === true ? -1 : 1);\n siblingLI = liCollections[liIndex];\n }\n return siblingLI;\n }\n ListBase.getSiblingLI = getSiblingLI;\n /**\n * Return the index of the li element\n *\n * @param {Element} item - An element to find next or previous after this element.\n * @param {Element[]} elementArray - An element array to find index of given li.\n */\n function indexOf(item, elementArray) {\n if (!elementArray || !item) {\n return void 0;\n }\n else {\n var liCollections = elementArray;\n liCollections = Array.prototype.slice.call(elementArray);\n return liCollections.indexOf(item);\n }\n }\n ListBase.indexOf = indexOf;\n /**\n * Returns the grouped data from given dataSource.\n *\n * @param {{Object}[]} dataSource - The JSON data which is necessary to process.\n * @param {FieldsMapping} fields - Fields that are mapped from the data source.\n * @param {SortOrder} sortOrder- Specifies final result sort order.\n */\n function groupDataSource(dataSource, fields, sortOrder) {\n if (sortOrder === void 0) { sortOrder = 'None'; }\n var curFields = extend({}, ListBase.defaultMappedFields, fields);\n var cusQuery = new Query().group(curFields.groupBy);\n // need to remove once sorting issues fixed in DataManager\n cusQuery = addSorting(sortOrder, 'key', cusQuery);\n var ds = getDataSource(dataSource, cusQuery);\n dataSource = [];\n for (var j = 0; j < ds.length; j++) {\n var itemObj = ds[j].items;\n var grpItem = {};\n var hdr = 'isHeader';\n grpItem[curFields.text] = ds[j].key;\n grpItem[hdr] = true;\n var newtext = curFields.text;\n if (newtext === 'id') {\n newtext = 'text';\n grpItem[newtext] = ds[j].key;\n }\n grpItem._id = 'group-list-item-' + (ds[j].key ?\n ds[j].key.toString().trim() : 'undefined');\n grpItem.items = itemObj;\n dataSource.push(grpItem);\n for (var k = 0; k < itemObj.length; k++) {\n dataSource.push(itemObj[k]);\n }\n }\n return dataSource;\n }\n ListBase.groupDataSource = groupDataSource;\n /**\n * Returns a sorted query object.\n *\n * @param {SortOrder} sortOrder - Specifies that sort order.\n * @param {string} sortBy - Specifies sortBy fields.\n * @param {Query} query - Pass if any existing query.\n */\n function addSorting(sortOrder, sortBy, query) {\n if (query === void 0) { query = new Query(); }\n if (sortOrder === 'Ascending') {\n query.sortBy(sortBy, 'ascending', true);\n }\n else if (sortOrder === 'Descending') {\n query.sortBy(sortBy, 'descending', true);\n }\n else {\n for (var i = 0; i < query.queries.length; i++) {\n if (query.queries[i].fn === 'onSortBy') {\n query.queries.splice(i, 1);\n }\n }\n }\n return query;\n }\n ListBase.addSorting = addSorting;\n /**\n * Return an array of JSON Data that processed based on queries.\n *\n * @param {{Object}[]} dataSource - Specifies local JSON data source.\n *\n * @param {Query} query - Specifies query that need to process.\n */\n function getDataSource(dataSource, query) {\n // eslint-disable-next-line\n return new DataManager(dataSource)\n .executeLocal(query);\n }\n ListBase.getDataSource = getDataSource;\n /**\n * Created JSON data based the UL and LI element\n *\n * @param {HTMLElement|Element} element - UL element that need to convert as a JSON\n * @param {ListBaseOptions} options? - Specifies listbase option for fields.\n */\n function createJsonFromElement(element, options) {\n var curOpt = extend({}, defaultListBaseOptions, options);\n var fields = extend({}, ListBase.defaultMappedFields, curOpt.fields);\n var curEle = element.cloneNode(true);\n // eslint-disable-next-line\n var jsonAr = [];\n curEle.classList.add('json-parent');\n var childs = curEle.querySelectorAll('.json-parent>li');\n curEle.classList.remove('json-parent');\n for (var i = 0; i < childs.length; i++) {\n var li = childs[i];\n var anchor = li.querySelector('a');\n var ul = li.querySelector('ul');\n // eslint-disable-next-line\n var json = {};\n var childNodes = anchor ? anchor.childNodes : li.childNodes;\n var keys = Object.keys(childNodes);\n for (var i_1 = 0; i_1 < childNodes.length; i_1++) {\n if (!(childNodes[Number(keys[i_1])]).hasChildNodes()) {\n json[fields.text] = childNodes[Number(keys[i_1])].textContent;\n }\n }\n var attributes_1 = getAllAttributes(li);\n if (attributes_1.id) {\n json[fields.id] = attributes_1.id;\n delete attributes_1.id;\n }\n else {\n json[fields.id] = generateId();\n }\n if (Object.keys(attributes_1).length) {\n json[fields.htmlAttributes] = attributes_1;\n }\n if (anchor) {\n attributes_1 = getAllAttributes(anchor);\n if (Object.keys(attributes_1).length) {\n json[fields.urlAttributes] = attributes_1;\n }\n }\n if (ul) {\n json[fields.child] = createJsonFromElement(ul, options);\n }\n jsonAr.push(json);\n }\n return jsonAr;\n }\n ListBase.createJsonFromElement = createJsonFromElement;\n function typeofData(data) {\n var match = { typeof: null, item: null };\n for (var i = 0; i < data.length; i++) {\n if (!isNullOrUndefined(data[i])) {\n return match = { typeof: typeof data[i], item: data[i] };\n }\n }\n return match;\n }\n function setAttribute(element, elementAttributes) {\n var attr = {};\n merge(attr, elementAttributes);\n if (attr.class) {\n addClass([element], attr.class.split(' '));\n delete attr.class;\n }\n attributes(element, attr);\n }\n function getAllAttributes(element) {\n var attributes = {};\n var attr = element.attributes;\n for (var index = 0; index < attr.length; index++) {\n attributes[attr[index].nodeName] = attr[index].nodeValue;\n }\n return attributes;\n }\n /**\n * Created UL element from content template.\n *\n * @param {string} template - that need to convert and generate li element.\n * @param {{Object}[]} dataSource - Specifies local JSON data source.\n * @param {ListBaseOptions} options? - Specifies listbase option for fields.\n */\n function renderContentTemplate(createElement, template, dataSource, \n // eslint-disable-next-line\n fields, options, componentInstance) {\n cssClass = getModuleClass(defaultListBaseOptions.moduleName);\n var ulElement = createElement('ul', { className: cssClass.ul, attrs: { role: 'presentation' } });\n var curOpt = extend({}, defaultListBaseOptions, options);\n var curFields = extend({}, ListBase.defaultMappedFields, fields);\n // eslint-disable-next-line\n var compiledString = compileTemplate(template);\n var liCollection = [];\n var value;\n var id = generateId(); // generate id for drop-down-list option.\n for (var i = 0; i < dataSource.length; i++) {\n var fieldData = getFieldValues(dataSource[i], curFields);\n var curItem = dataSource[i];\n var isHeader = curItem.isHeader;\n if (typeof dataSource[i] === 'string' || typeof dataSource[i] === 'number') {\n value = curItem;\n }\n else {\n value = fieldData[curFields.value];\n }\n if (curOpt.itemCreating && typeof curOpt.itemCreating === 'function') {\n var curData = {\n dataSource: dataSource,\n curData: curItem,\n text: value,\n options: curOpt,\n fields: curFields\n };\n curOpt.itemCreating(curData);\n }\n if (curOpt.itemCreating && typeof curOpt.itemCreating === 'function') {\n fieldData = getFieldValues(dataSource[i], curFields);\n if (typeof dataSource[i] === 'string' || typeof dataSource[i] === 'number') {\n value = curItem;\n }\n else {\n value = fieldData[curFields.value];\n }\n }\n var li = createElement('li', {\n id: id + '-' + i,\n className: isHeader ? cssClass.group : cssClass.li, attrs: { role: 'presentation' }\n });\n if (isHeader) {\n if (typeof dataSource[i] === 'string' || typeof dataSource[i] === 'number') {\n li.innerText = curItem;\n }\n else {\n li.innerText = fieldData[curFields.text];\n }\n }\n else {\n var currentID = isHeader ? curOpt.groupTemplateID : curOpt.templateID;\n if (isHeader) {\n if (componentInstance && componentInstance.getModuleName() !== 'listview') {\n // eslint-disable-next-line\n var compiledElement = compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate, null, li);\n if (compiledElement) {\n append(compiledElement, li);\n }\n }\n else {\n append(compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate), li);\n }\n }\n else {\n if (componentInstance && componentInstance.getModuleName() !== 'listview') {\n // eslint-disable-next-line\n var compiledElement = compiledString(curItem, componentInstance, 'template', currentID, !!curOpt.isStringTemplate, null, li);\n if (compiledElement) {\n append(compiledElement, li);\n }\n }\n else {\n append(compiledString(curItem, componentInstance, 'template', currentID, !!curOpt.isStringTemplate), li);\n }\n }\n li.setAttribute('data-value', isNullOrUndefined(value) ? 'null' : value);\n li.setAttribute('role', 'option');\n }\n if (curOpt.itemCreated && typeof curOpt.itemCreated === 'function') {\n var curData = {\n dataSource: dataSource,\n curData: curItem,\n text: value,\n item: li,\n options: curOpt,\n fields: curFields\n };\n curOpt.itemCreated(curData);\n }\n liCollection.push(li);\n }\n append(liCollection, ulElement);\n return ulElement;\n }\n ListBase.renderContentTemplate = renderContentTemplate;\n /**\n * Created header items from group template.\n *\n * @param {string} template - that need to convert and generate li element.\n *\n * @param {{Object}[]} dataSource - Specifies local JSON data source.\n *\n * @param {FieldsMapping} fields - Specifies fields for mapping the dataSource.\n *\n * @param {Element[]} headerItems? - Specifies listbase header items.\n */\n // tslint:disable-next-line\n function renderGroupTemplate(groupTemplate, groupDataSource, fields, \n // eslint-disable-next-line\n headerItems, options, componentInstance) {\n // eslint-disable-next-line @typescript-eslint/ban-types\n var compiledString = compileTemplate(groupTemplate);\n var curFields = extend({}, ListBase.defaultMappedFields, fields);\n var curOpt = extend({}, defaultListBaseOptions, options);\n var category = curFields.groupBy;\n for (var _i = 0, headerItems_1 = headerItems; _i < headerItems_1.length; _i++) {\n var header = headerItems_1[_i];\n var headerData = {};\n headerData[category] = header.textContent;\n header.innerHTML = '';\n if (componentInstance && componentInstance.getModuleName() !== 'listview') {\n // eslint-disable-next-line\n var compiledElement = compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, header);\n if (compiledElement) {\n append(compiledElement, header);\n }\n }\n else {\n append(compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate), header);\n }\n }\n return headerItems;\n }\n ListBase.renderGroupTemplate = renderGroupTemplate;\n function generateId() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n ListBase.generateId = generateId;\n function processSubChild(createElement, fieldData, fields, ds, options, element, level) {\n // Get SubList\n var subDS = fieldData[fields.child] || [];\n var hasChildren = fieldData[fields.hasChildren];\n //Create Sub child\n if (subDS.length) {\n hasChildren = true;\n element.classList.add(cssClass.hasChild);\n if (options.processSubChild) {\n var subLi = createListFromJson(createElement, subDS, options, ++level);\n element.appendChild(subLi);\n }\n }\n // Create expand and collapse node\n if (!!options.expandCollapse && hasChildren && !options.template) {\n element.firstElementChild.classList.add(cssClass.iconWrapper);\n // eslint-disable-next-line @typescript-eslint/ban-types\n var expandElement = options.expandIconPosition === 'Left' ? prepend : append;\n expandElement([createElement('div', { className: 'e-icons ' + options.expandIconClass })], element.querySelector('.' + cssClass.textContent));\n }\n }\n function generateSingleLevelLI(createElement, item, fieldData, fields, className, innerElements, grpLI, id, index, options) {\n var curOpt = extend({}, defaultListBaseOptions, options);\n var ariaAttributes = extend({}, defaultAriaAttributes, curOpt.ariaAttributes);\n var text = item;\n var value = item;\n var dataSource;\n if (typeof item !== 'string' && typeof item !== 'number' && typeof item !== 'boolean') {\n dataSource = item;\n text = (typeof fieldData[fields.text] === 'boolean' || typeof fieldData[fields.text] === 'number') ?\n fieldData[fields.text] : (fieldData[fields.text] || '');\n value = fieldData[fields.value];\n }\n var elementID;\n if (!isNullOrUndefined(dataSource) && !isNullOrUndefined(fieldData[fields.id])\n && fieldData[fields.id] !== '') {\n elementID = id;\n }\n else {\n elementID = id + '-' + index;\n }\n var li = createElement('li', {\n className: (grpLI === true ? cssClass.group : cssClass.li) + ' ' + (isNullOrUndefined(className) ? '' : className),\n id: elementID, attrs: (ariaAttributes.groupItemRole !== '' && ariaAttributes.itemRole !== '' ?\n { role: (grpLI === true ? ariaAttributes.groupItemRole : ariaAttributes.itemRole) } : {})\n });\n // eslint-disable-next-line no-prototype-builtins\n if (dataSource && fieldData.hasOwnProperty(fields.enabled) && fieldData[fields.enabled].toString() === 'false') {\n li.classList.add(cssClass.disabled);\n }\n if (grpLI) {\n li.innerText = text;\n }\n else {\n li.setAttribute('data-value', isNullOrUndefined(value) ? 'null' : value);\n li.setAttribute('role', 'option');\n // eslint-disable-next-line no-prototype-builtins\n if (dataSource && fieldData.hasOwnProperty(fields.htmlAttributes) && fieldData[fields.htmlAttributes]) {\n setAttribute(li, fieldData[fields.htmlAttributes]);\n }\n if (innerElements.length && !curOpt.itemNavigable) {\n append(innerElements, li);\n }\n if (dataSource && (fieldData[fields.url] || (fieldData[fields.urlAttributes] &&\n fieldData[fields.urlAttributes].href))) {\n li.appendChild(anchorTag(createElement, dataSource, fields, text, innerElements, curOpt.itemNavigable));\n }\n else {\n if (innerElements.length && curOpt.itemNavigable) {\n append(innerElements, li);\n }\n li.appendChild(document.createTextNode(text));\n }\n }\n return li;\n }\n function getModuleClass(moduleName) {\n var moduleClass;\n // eslint-disable-next-line\n return moduleClass = {\n li: \"e-\" + moduleName + \"-item\",\n ul: \"e-\" + moduleName + \"-parent e-ul\",\n group: \"e-\" + moduleName + \"-group-item\",\n icon: \"e-\" + moduleName + \"-icon\",\n text: \"e-\" + moduleName + \"-text\",\n check: \"e-\" + moduleName + \"-check\",\n checked: 'e-checked',\n selected: 'e-selected',\n expanded: 'e-expanded',\n textContent: 'e-text-content',\n hasChild: 'e-has-child',\n level: 'e-level',\n url: \"e-\" + moduleName + \"-url\",\n collapsible: 'e-icon-collapsible',\n disabled: 'e-disabled',\n image: \"e-\" + moduleName + \"-img\",\n iconWrapper: 'e-icon-wrapper',\n anchorWrap: 'e-anchor-wrap',\n navigable: 'e-navigable'\n };\n }\n function anchorTag(createElement, dataSource, fields, text, innerElements, isFullNavigation) {\n var fieldData = getFieldValues(dataSource, fields);\n var attr = { href: fieldData[fields.url] };\n // eslint-disable-next-line no-prototype-builtins\n if (fieldData.hasOwnProperty(fields.urlAttributes) && fieldData[fields.urlAttributes]) {\n merge(attr, fieldData[fields.urlAttributes]);\n attr.href = fieldData[fields.url] ? fieldData[fields.url] :\n fieldData[fields.urlAttributes].href;\n }\n var anchorTag;\n if (!isFullNavigation) {\n anchorTag = createElement('a', { className: cssClass.text + ' ' + cssClass.url, innerHTML: text });\n }\n else {\n anchorTag = createElement('a', { className: cssClass.text + ' ' + cssClass.url });\n var anchorWrapper = createElement('div', { className: cssClass.anchorWrap });\n if (innerElements && innerElements.length) {\n append(innerElements, anchorWrapper);\n }\n anchorWrapper.appendChild(document.createTextNode(text));\n append([anchorWrapper], anchorTag);\n }\n setAttribute(anchorTag, attr);\n return anchorTag;\n }\n // tslint:disable-next-line\n /* tslint:disable:align */\n function generateLI(createElement, item, fieldData, \n // eslint-disable-next-line\n fields, className, options, componentInstance) {\n var curOpt = extend({}, defaultListBaseOptions, options);\n var ariaAttributes = extend({}, defaultAriaAttributes, curOpt.ariaAttributes);\n var text = item;\n var uID;\n var grpLI;\n var dataSource;\n if (typeof item !== 'string' && typeof item !== 'number') {\n dataSource = item;\n text = fieldData[fields.text] || '';\n // tslint:disable-next-line\n uID = (isNullOrUndefined(fieldData['_id'])) ? fieldData[fields.id] : fieldData['_id'];\n // eslint-disable-next-line no-prototype-builtins\n grpLI = (item.hasOwnProperty('isHeader') && item.isHeader)\n ? true : false;\n }\n if (options && options.enableHtmlSanitizer) {\n // eslint-disable-next-line no-self-assign\n text = text;\n }\n var li = createElement('li', {\n className: (grpLI === true ? cssClass.group : cssClass.li) + ' ' + (isNullOrUndefined(className) ? '' : className),\n attrs: (ariaAttributes.groupItemRole !== '' && ariaAttributes.itemRole !== '' ?\n { role: (grpLI === true ? ariaAttributes.groupItemRole : ariaAttributes.itemRole) } : {})\n });\n if (!isNullOrUndefined(uID) === true) {\n li.setAttribute('data-uid', uID);\n }\n else {\n li.setAttribute('data-uid', generateId());\n }\n if (grpLI && options && options.groupTemplate) {\n // eslint-disable-next-line @typescript-eslint/ban-types\n var compiledString = compileTemplate(options.groupTemplate);\n if (componentInstance && componentInstance.getModuleName() !== 'listview') {\n // eslint-disable-next-line\n var compiledElement = compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, li);\n if (compiledElement) {\n append(compiledElement, li);\n }\n }\n else {\n append(compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate), li);\n }\n }\n else if (!grpLI && options && options.template) {\n // eslint-disable-next-line @typescript-eslint/ban-types\n var compiledString = compileTemplate(options.template);\n if (componentInstance && componentInstance.getModuleName() !== 'listview') {\n // eslint-disable-next-line\n var compiledElement = compiledString(item, componentInstance, 'template', curOpt.templateID, !!curOpt.isStringTemplate, null, li);\n if (compiledElement) {\n append(compiledElement, li);\n }\n }\n else {\n append(compiledString(item, componentInstance, 'template', curOpt.templateID, !!curOpt.isStringTemplate), li);\n }\n }\n else {\n var innerDiv = createElement('div', {\n className: cssClass.textContent,\n attrs: (ariaAttributes.wrapperRole !== '' ? { role: ariaAttributes.wrapperRole } : {})\n });\n if (dataSource && (fieldData[fields.url] || (fieldData[fields.urlAttributes] &&\n fieldData[fields.urlAttributes].href))) {\n innerDiv.appendChild(anchorTag(createElement, dataSource, fields, text, null, curOpt.itemNavigable));\n }\n else {\n var element = createElement('span', {\n className: cssClass.text,\n attrs: (ariaAttributes.itemText !== '' ? { role: ariaAttributes.itemText } : {})\n });\n if (options && options.enableHtmlSanitizer) {\n element.innerText = text;\n }\n else {\n element.innerHTML = text;\n }\n innerDiv.appendChild(element);\n }\n li.appendChild(innerDiv);\n }\n return li;\n }\n /**\n * Returns UL element based on the given LI element.\n *\n * @param {HTMLElement[]} liElement - Specifies array of LI element.\n *\n * @param {string} className? - Specifies class name that need to be added in UL element.\n *\n * @param {ListBaseOptions} options? - Specifies ListBase options.\n */\n function generateUL(createElement, liElement, className, options) {\n var curOpt = extend({}, defaultListBaseOptions, options);\n var ariaAttributes = extend({}, defaultAriaAttributes, curOpt.ariaAttributes);\n cssClass = getModuleClass(curOpt.moduleName);\n var ulElement = createElement('ul', {\n className: cssClass.ul + ' ' + (isNullOrUndefined(className) ? '' : className),\n attrs: (ariaAttributes.listRole !== '' ? { role: ariaAttributes.listRole } : {})\n });\n append(liElement, ulElement);\n return ulElement;\n }\n ListBase.generateUL = generateUL;\n /**\n * Returns LI element with additional DIV tag based on the given LI element.\n *\n * @param {liElement} liElement - Specifies LI element.\n *\n * @param {string} className? - Specifies class name that need to be added in created DIV element.\n *\n * @param {ListBaseOptions} options? - Specifies ListBase options.\n */\n function generateIcon(createElement, liElement, className, options) {\n var curOpt = extend({}, defaultListBaseOptions, options);\n cssClass = getModuleClass(curOpt.moduleName);\n // eslint-disable-next-line @typescript-eslint/ban-types\n var expandElement = curOpt.expandIconPosition === 'Left' ? prepend : append;\n expandElement([createElement('div', {\n className: 'e-icons ' + curOpt.expandIconClass + ' ' +\n (isNullOrUndefined(className) ? '' : className)\n })], liElement.querySelector('.' + cssClass.textContent));\n return liElement;\n }\n ListBase.generateIcon = generateIcon;\n})(ListBase || (ListBase = {}));\n/**\n * Used to get dataSource item from complex data using fields.\n *\n * @param {Object} dataSource - Specifies an JSON or String data.\n *\n * @param {FieldsMapping} fields - Fields that are mapped from the dataSource.\n */\nexport function getFieldValues(dataItem, fields) {\n var fieldData = {};\n if (isNullOrUndefined(dataItem) || typeof (dataItem) === 'string' || typeof (dataItem) === 'number'\n || !isNullOrUndefined(dataItem.isHeader)) {\n return dataItem;\n }\n else {\n for (var _i = 0, _a = Object.keys(fields); _i < _a.length; _i++) {\n var field = _a[_i];\n var dataField = fields[field];\n var value = !isNullOrUndefined(dataField) &&\n typeof (dataField) === 'string' ? getValue(dataField, dataItem) : undefined;\n if (!isNullOrUndefined(value)) {\n fieldData[dataField] = value;\n }\n }\n }\n return fieldData;\n}\nfunction compileTemplate(template) {\n if (template) {\n try {\n if (document.querySelector(template)) {\n return compile(document.querySelector(template).innerHTML.trim());\n }\n }\n catch (e) {\n return compile(template);\n }\n }\n return undefined;\n}\n","//! moment.js locale configuration\n//! locale : Persian [fa]\n//! author : Ebrahim Byagowi : https://github.com/ebraminio\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var symbolMap = {\n '1': '۱',\n '2': '۲',\n '3': '۳',\n '4': '۴',\n '5': '۵',\n '6': '۶',\n '7': '۷',\n '8': '۸',\n '9': '۹',\n '0': '۰',\n },\n numberMap = {\n '۱': '1',\n '۲': '2',\n '۳': '3',\n '۴': '4',\n '۵': '5',\n '۶': '6',\n '۷': '7',\n '۸': '8',\n '۹': '9',\n '۰': '0',\n };\n\n var fa = moment.defineLocale('fa', {\n months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(\n '_'\n ),\n monthsShort: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(\n '_'\n ),\n weekdays: 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split(\n '_'\n ),\n weekdaysShort: 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split(\n '_'\n ),\n weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm',\n },\n meridiemParse: /قبل از ظهر|بعد از ظهر/,\n isPM: function (input) {\n return /بعد از ظهر/.test(input);\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 12) {\n return 'قبل از ظهر';\n } else {\n return 'بعد از ظهر';\n }\n },\n calendar: {\n sameDay: '[امروز ساعت] LT',\n nextDay: '[فردا ساعت] LT',\n nextWeek: 'dddd [ساعت] LT',\n lastDay: '[دیروز ساعت] LT',\n lastWeek: 'dddd [پیش] [ساعت] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'در %s',\n past: '%s پیش',\n s: 'چند ثانیه',\n ss: '%d ثانیه',\n m: 'یک دقیقه',\n mm: '%d دقیقه',\n h: 'یک ساعت',\n hh: '%d ساعت',\n d: 'یک روز',\n dd: '%d روز',\n M: 'یک ماه',\n MM: '%d ماه',\n y: 'یک سال',\n yy: '%d سال',\n },\n preparse: function (string) {\n return string\n .replace(/[۰-۹]/g, function (match) {\n return numberMap[match];\n })\n .replace(/،/g, ',');\n },\n postformat: function (string) {\n return string\n .replace(/\\d/g, function (match) {\n return symbolMap[match];\n })\n .replace(/,/g, '،');\n },\n dayOfMonthOrdinalParse: /\\d{1,2}م/,\n ordinal: '%dم',\n week: {\n dow: 6, // Saturday is the first day of the week.\n doy: 12, // The week that contains Jan 12th is the first week of the year.\n },\n });\n\n return fa;\n\n})));\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","//! moment.js locale configuration\n//! locale : Arabic [ar]\n//! author : Abdel Said: https://github.com/abdelsaid\n//! author : Ahmed Elkhatib\n//! author : forabi https://github.com/forabi\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var symbolMap = {\n '1': '١',\n '2': '٢',\n '3': '٣',\n '4': '٤',\n '5': '٥',\n '6': '٦',\n '7': '٧',\n '8': '٨',\n '9': '٩',\n '0': '٠',\n },\n numberMap = {\n '١': '1',\n '٢': '2',\n '٣': '3',\n '٤': '4',\n '٥': '5',\n '٦': '6',\n '٧': '7',\n '٨': '8',\n '٩': '9',\n '٠': '0',\n },\n pluralForm = function (n) {\n return n === 0\n ? 0\n : n === 1\n ? 1\n : n === 2\n ? 2\n : n % 100 >= 3 && n % 100 <= 10\n ? 3\n : n % 100 >= 11\n ? 4\n : 5;\n },\n plurals = {\n s: [\n 'أقل من ثانية',\n 'ثانية واحدة',\n ['ثانيتان', 'ثانيتين'],\n '%d ثوان',\n '%d ثانية',\n '%d ثانية',\n ],\n m: [\n 'أقل من دقيقة',\n 'دقيقة واحدة',\n ['دقيقتان', 'دقيقتين'],\n '%d دقائق',\n '%d دقيقة',\n '%d دقيقة',\n ],\n h: [\n 'أقل من ساعة',\n 'ساعة واحدة',\n ['ساعتان', 'ساعتين'],\n '%d ساعات',\n '%d ساعة',\n '%d ساعة',\n ],\n d: [\n 'أقل من يوم',\n 'يوم واحد',\n ['يومان', 'يومين'],\n '%d أيام',\n '%d يومًا',\n '%d يوم',\n ],\n M: [\n 'أقل من شهر',\n 'شهر واحد',\n ['شهران', 'شهرين'],\n '%d أشهر',\n '%d شهرا',\n '%d شهر',\n ],\n y: [\n 'أقل من عام',\n 'عام واحد',\n ['عامان', 'عامين'],\n '%d أعوام',\n '%d عامًا',\n '%d عام',\n ],\n },\n pluralize = function (u) {\n return function (number, withoutSuffix, string, isFuture) {\n var f = pluralForm(number),\n str = plurals[u][pluralForm(number)];\n if (f === 2) {\n str = str[withoutSuffix ? 0 : 1];\n }\n return str.replace(/%d/i, number);\n };\n },\n months = [\n 'يناير',\n 'فبراير',\n 'مارس',\n 'أبريل',\n 'مايو',\n 'يونيو',\n 'يوليو',\n 'أغسطس',\n 'سبتمبر',\n 'أكتوبر',\n 'نوفمبر',\n 'ديسمبر',\n ];\n\n var ar = moment.defineLocale('ar', {\n months: months,\n monthsShort: months,\n weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'D/\\u200FM/\\u200FYYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n meridiemParse: /ص|م/,\n isPM: function (input) {\n return 'م' === input;\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 12) {\n return 'ص';\n } else {\n return 'م';\n }\n },\n calendar: {\n sameDay: '[اليوم عند الساعة] LT',\n nextDay: '[غدًا عند الساعة] LT',\n nextWeek: 'dddd [عند الساعة] LT',\n lastDay: '[أمس عند الساعة] LT',\n lastWeek: 'dddd [عند الساعة] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'بعد %s',\n past: 'منذ %s',\n s: pluralize('s'),\n ss: pluralize('s'),\n m: pluralize('m'),\n mm: pluralize('m'),\n h: pluralize('h'),\n hh: pluralize('h'),\n d: pluralize('d'),\n dd: pluralize('d'),\n M: pluralize('M'),\n MM: pluralize('M'),\n y: pluralize('y'),\n yy: pluralize('y'),\n },\n preparse: function (string) {\n return string\n .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n return numberMap[match];\n })\n .replace(/،/g, ',');\n },\n postformat: function (string) {\n return string\n .replace(/\\d/g, function (match) {\n return symbolMap[match];\n })\n .replace(/,/g, '،');\n },\n week: {\n dow: 6, // Saturday is the first day of the week.\n doy: 12, // The week that contains Jan 12th is the first week of the year.\n },\n });\n\n return ar;\n\n})));\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isBefore;\n\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\n\nvar _toDate = _interopRequireDefault(require(\"./toDate\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction isBefore(str) {\n var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : String(new Date());\n (0, _assertString.default)(str);\n var comparison = (0, _toDate.default)(date);\n var original = (0, _toDate.default)(str);\n return !!(original && comparison && original < comparison);\n}\n\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","//! moment.js locale configuration\n//! locale : Bengali [bn]\n//! author : Kaushik Gandhi : https://github.com/kaushikgandhi\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var symbolMap = {\n '1': '১',\n '2': '২',\n '3': '৩',\n '4': '৪',\n '5': '৫',\n '6': '৬',\n '7': '৭',\n '8': '৮',\n '9': '৯',\n '0': '০',\n },\n numberMap = {\n '১': '1',\n '২': '2',\n '৩': '3',\n '৪': '4',\n '৫': '5',\n '৬': '6',\n '৭': '7',\n '৮': '8',\n '৯': '9',\n '০': '0',\n };\n\n var bn = moment.defineLocale('bn', {\n months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(\n '_'\n ),\n monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(\n '_'\n ),\n weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(\n '_'\n ),\n weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),\n weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),\n longDateFormat: {\n LT: 'A h:mm সময়',\n LTS: 'A h:mm:ss সময়',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY, A h:mm সময়',\n LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',\n },\n calendar: {\n sameDay: '[আজ] LT',\n nextDay: '[আগামীকাল] LT',\n nextWeek: 'dddd, LT',\n lastDay: '[গতকাল] LT',\n lastWeek: '[গত] dddd, LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: '%s পরে',\n past: '%s আগে',\n s: 'কয়েক সেকেন্ড',\n ss: '%d সেকেন্ড',\n m: 'এক মিনিট',\n mm: '%d মিনিট',\n h: 'এক ঘন্টা',\n hh: '%d ঘন্টা',\n d: 'এক দিন',\n dd: '%d দিন',\n M: 'এক মাস',\n MM: '%d মাস',\n y: 'এক বছর',\n yy: '%d বছর',\n },\n preparse: function (string) {\n return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,\n meridiemHour: function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (\n (meridiem === 'রাত' && hour >= 4) ||\n (meridiem === 'দুপুর' && hour < 5) ||\n meridiem === 'বিকাল'\n ) {\n return hour + 12;\n } else {\n return hour;\n }\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 4) {\n return 'রাত';\n } else if (hour < 10) {\n return 'সকাল';\n } else if (hour < 17) {\n return 'দুপুর';\n } else if (hour < 20) {\n return 'বিকাল';\n } else {\n return 'রাত';\n }\n },\n week: {\n dow: 0, // Sunday is the first day of the week.\n doy: 6, // The week that contains Jan 6th is the first week of the year.\n },\n });\n\n return bn;\n\n})));\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","//! moment.js locale configuration\n//! locale : Chinese (Taiwan) [zh-tw]\n//! author : Ben : https://github.com/ben-lin\n//! author : Chris Lam : https://github.com/hehachris\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var zhTw = moment.defineLocale('zh-tw', {\n months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(\n '_'\n ),\n monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n '_'\n ),\n weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n weekdaysMin: '日_一_二_三_四_五_六'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'YYYY/MM/DD',\n LL: 'YYYY年M月D日',\n LLL: 'YYYY年M月D日 HH:mm',\n LLLL: 'YYYY年M月D日dddd HH:mm',\n l: 'YYYY/M/D',\n ll: 'YYYY年M月D日',\n lll: 'YYYY年M月D日 HH:mm',\n llll: 'YYYY年M月D日dddd HH:mm',\n },\n meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n meridiemHour: function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {\n return hour;\n } else if (meridiem === '中午') {\n return hour >= 11 ? hour : hour + 12;\n } else if (meridiem === '下午' || meridiem === '晚上') {\n return hour + 12;\n }\n },\n meridiem: function (hour, minute, isLower) {\n var hm = hour * 100 + minute;\n if (hm < 600) {\n return '凌晨';\n } else if (hm < 900) {\n return '早上';\n } else if (hm < 1130) {\n return '上午';\n } else if (hm < 1230) {\n return '中午';\n } else if (hm < 1800) {\n return '下午';\n } else {\n return '晚上';\n }\n },\n calendar: {\n sameDay: '[今天] LT',\n nextDay: '[明天] LT',\n nextWeek: '[下]dddd LT',\n lastDay: '[昨天] LT',\n lastWeek: '[上]dddd LT',\n sameElse: 'L',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(日|月|週)/,\n ordinal: function (number, period) {\n switch (period) {\n case 'd':\n case 'D':\n case 'DDD':\n return number + '日';\n case 'M':\n return number + '月';\n case 'w':\n case 'W':\n return number + '週';\n default:\n return number;\n }\n },\n relativeTime: {\n future: '%s後',\n past: '%s前',\n s: '幾秒',\n ss: '%d 秒',\n m: '1 分鐘',\n mm: '%d 分鐘',\n h: '1 小時',\n hh: '%d 小時',\n d: '1 天',\n dd: '%d 天',\n M: '1 個月',\n MM: '%d 個月',\n y: '1 年',\n yy: '%d 年',\n },\n });\n\n return zhTw;\n\n})));\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","'use strict';\nvar regexpFlags = require('./regexp-flags');\nvar stickyHelpers = require('./regexp-sticky-helpers');\n\nvar nativeExec = RegExp.prototype.exec;\n// This always refers to the native implementation, because the\n// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,\n// which loads this file before patching the method.\nvar nativeReplace = String.prototype.replace;\n\nvar patchedExec = nativeExec;\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/;\n var re2 = /b*/g;\n nativeExec.call(re1, 'a');\n nativeExec.call(re2, 'a');\n return re1.lastIndex !== 0 || re2.lastIndex !== 0;\n})();\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;\n\nif (PATCH) {\n patchedExec = function exec(str) {\n var re = this;\n var lastIndex, reCopy, match, i;\n var sticky = UNSUPPORTED_Y && re.sticky;\n var flags = regexpFlags.call(re);\n var source = re.source;\n var charsAdded = 0;\n var strCopy = str;\n\n if (sticky) {\n flags = flags.replace('y', '');\n if (flags.indexOf('g') === -1) {\n flags += 'g';\n }\n\n strCopy = String(str).slice(re.lastIndex);\n // Support anchored sticky behavior.\n if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\\n')) {\n source = '(?: ' + source + ')';\n strCopy = ' ' + strCopy;\n charsAdded++;\n }\n // ^(? + rx + ) is needed, in combination with some str slicing, to\n // simulate the 'y' flag.\n reCopy = new RegExp('^(?:' + source + ')', flags);\n }\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + source + '$(?!\\\\s)', flags);\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;\n\n match = nativeExec.call(sticky ? reCopy : re, strCopy);\n\n if (sticky) {\n if (match) {\n match.input = match.input.slice(charsAdded);\n match[0] = match[0].slice(charsAdded);\n match.index = re.lastIndex;\n re.lastIndex += match[0].length;\n } else re.lastIndex = 0;\n } else if (UPDATES_LAST_INDEX_WRONG && match) {\n re.lastIndex = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/\n nativeReplace.call(match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","/**\n * Utilities to get information about the current environment\n */\nexport var getEnv = function getEnv(key) {\n var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var env = typeof process !== 'undefined' && process ? process.env || {} : {};\n\n if (!key) {\n /* istanbul ignore next */\n return env;\n }\n\n return env[key] || fallback;\n};\nexport var getNoWarn = function getNoWarn() {\n return getEnv('BOOTSTRAP_VUE_NO_WARN') || getEnv('NODE_ENV') === 'production';\n};","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n function plural(word, num) {\n var forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11\n ? forms[0]\n : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)\n ? forms[1]\n : forms[2];\n }\n function relativeTimeWithPlural(number, withoutSuffix, key) {\n var format = {\n ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',\n mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',\n hh: 'час_часа_часов',\n dd: 'день_дня_дней',\n MM: 'месяц_месяца_месяцев',\n yy: 'год_года_лет',\n };\n if (key === 'm') {\n return withoutSuffix ? 'минута' : 'минуту';\n } else {\n return number + ' ' + plural(format[key], +number);\n }\n }\n var monthsParse = [\n /^янв/i,\n /^фев/i,\n /^мар/i,\n /^апр/i,\n /^ма[йя]/i,\n /^июн/i,\n /^июл/i,\n /^авг/i,\n /^сен/i,\n /^окт/i,\n /^ноя/i,\n /^дек/i,\n ];\n\n // http://new.gramota.ru/spravka/rules/139-prop : § 103\n // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637\n // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753\n var ru = moment.defineLocale('ru', {\n months: {\n format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split(\n '_'\n ),\n standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(\n '_'\n ),\n },\n monthsShort: {\n // по CLDR именно \"июл.\" и \"июн.\", но какой смысл менять букву на точку?\n format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split(\n '_'\n ),\n standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split(\n '_'\n ),\n },\n weekdays: {\n standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split(\n '_'\n ),\n format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split(\n '_'\n ),\n isFormat: /\\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/,\n },\n weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n monthsParse: monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n\n // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки\n monthsRegex: /^(январ[ья]|янв\\.?|феврал[ья]|февр?\\.?|марта?|мар\\.?|апрел[ья]|апр\\.?|ма[йя]|июн[ья]|июн\\.?|июл[ья]|июл\\.?|августа?|авг\\.?|сентябр[ья]|сент?\\.?|октябр[ья]|окт\\.?|ноябр[ья]|нояб?\\.?|декабр[ья]|дек\\.?)/i,\n\n // копия предыдущего\n monthsShortRegex: /^(январ[ья]|янв\\.?|феврал[ья]|февр?\\.?|марта?|мар\\.?|апрел[ья]|апр\\.?|ма[йя]|июн[ья]|июн\\.?|июл[ья]|июл\\.?|августа?|авг\\.?|сентябр[ья]|сент?\\.?|октябр[ья]|окт\\.?|ноябр[ья]|нояб?\\.?|декабр[ья]|дек\\.?)/i,\n\n // полные названия с падежами\n monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,\n\n // Выражение, которое соответствует только сокращённым формам\n monthsShortStrictRegex: /^(янв\\.|февр?\\.|мар[т.]|апр\\.|ма[яй]|июн[ья.]|июл[ья.]|авг\\.|сент?\\.|окт\\.|нояб?\\.|дек\\.)/i,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY г.',\n LLL: 'D MMMM YYYY г., H:mm',\n LLLL: 'dddd, D MMMM YYYY г., H:mm',\n },\n calendar: {\n sameDay: '[Сегодня, в] LT',\n nextDay: '[Завтра, в] LT',\n lastDay: '[Вчера, в] LT',\n nextWeek: function (now) {\n if (now.week() !== this.week()) {\n switch (this.day()) {\n case 0:\n return '[В следующее] dddd, [в] LT';\n case 1:\n case 2:\n case 4:\n return '[В следующий] dddd, [в] LT';\n case 3:\n case 5:\n case 6:\n return '[В следующую] dddd, [в] LT';\n }\n } else {\n if (this.day() === 2) {\n return '[Во] dddd, [в] LT';\n } else {\n return '[В] dddd, [в] LT';\n }\n }\n },\n lastWeek: function (now) {\n if (now.week() !== this.week()) {\n switch (this.day()) {\n case 0:\n return '[В прошлое] dddd, [в] LT';\n case 1:\n case 2:\n case 4:\n return '[В прошлый] dddd, [в] LT';\n case 3:\n case 5:\n case 6:\n return '[В прошлую] dddd, [в] LT';\n }\n } else {\n if (this.day() === 2) {\n return '[Во] dddd, [в] LT';\n } else {\n return '[В] dddd, [в] LT';\n }\n }\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: 'через %s',\n past: '%s назад',\n s: 'несколько секунд',\n ss: relativeTimeWithPlural,\n m: relativeTimeWithPlural,\n mm: relativeTimeWithPlural,\n h: 'час',\n hh: relativeTimeWithPlural,\n d: 'день',\n dd: relativeTimeWithPlural,\n M: 'месяц',\n MM: relativeTimeWithPlural,\n y: 'год',\n yy: relativeTimeWithPlural,\n },\n meridiemParse: /ночи|утра|дня|вечера/i,\n isPM: function (input) {\n return /^(дня|вечера)$/.test(input);\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 4) {\n return 'ночи';\n } else if (hour < 12) {\n return 'утра';\n } else if (hour < 17) {\n return 'дня';\n } else {\n return 'вечера';\n }\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-(й|го|я)/,\n ordinal: function (number, period) {\n switch (period) {\n case 'M':\n case 'd':\n case 'DDD':\n return number + '-й';\n case 'D':\n return number + '-го';\n case 'w':\n case 'W':\n return number + '-я';\n default:\n return number;\n }\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return ru;\n\n})));\n","//! moment.js locale configuration\n//! locale : Mongolian [mn]\n//! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n function translate(number, withoutSuffix, key, isFuture) {\n switch (key) {\n case 's':\n return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';\n case 'ss':\n return number + (withoutSuffix ? ' секунд' : ' секундын');\n case 'm':\n case 'mm':\n return number + (withoutSuffix ? ' минут' : ' минутын');\n case 'h':\n case 'hh':\n return number + (withoutSuffix ? ' цаг' : ' цагийн');\n case 'd':\n case 'dd':\n return number + (withoutSuffix ? ' өдөр' : ' өдрийн');\n case 'M':\n case 'MM':\n return number + (withoutSuffix ? ' сар' : ' сарын');\n case 'y':\n case 'yy':\n return number + (withoutSuffix ? ' жил' : ' жилийн');\n default:\n return number;\n }\n }\n\n var mn = moment.defineLocale('mn', {\n months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split(\n '_'\n ),\n monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),\n weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),\n weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'YYYY-MM-DD',\n LL: 'YYYY оны MMMMын D',\n LLL: 'YYYY оны MMMMын D HH:mm',\n LLLL: 'dddd, YYYY оны MMMMын D HH:mm',\n },\n meridiemParse: /ҮӨ|ҮХ/i,\n isPM: function (input) {\n return input === 'ҮХ';\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 12) {\n return 'ҮӨ';\n } else {\n return 'ҮХ';\n }\n },\n calendar: {\n sameDay: '[Өнөөдөр] LT',\n nextDay: '[Маргааш] LT',\n nextWeek: '[Ирэх] dddd LT',\n lastDay: '[Өчигдөр] LT',\n lastWeek: '[Өнгөрсөн] dddd LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: '%s дараа',\n past: '%s өмнө',\n s: translate,\n ss: translate,\n m: translate,\n mm: translate,\n h: translate,\n hh: translate,\n d: translate,\n dd: translate,\n M: translate,\n MM: translate,\n y: translate,\n yy: translate,\n },\n dayOfMonthOrdinalParse: /\\d{1,2} өдөр/,\n ordinal: function (number, period) {\n switch (period) {\n case 'd':\n case 'D':\n case 'DDD':\n return number + ' өдөр';\n default:\n return number;\n }\n },\n });\n\n return mn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Kyrgyz [ky]\n//! author : Chyngyz Arystan uulu : https://github.com/chyngyz\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var suffixes = {\n 0: '-чү',\n 1: '-чи',\n 2: '-чи',\n 3: '-чү',\n 4: '-чү',\n 5: '-чи',\n 6: '-чы',\n 7: '-чи',\n 8: '-чи',\n 9: '-чу',\n 10: '-чу',\n 20: '-чы',\n 30: '-чу',\n 40: '-чы',\n 50: '-чү',\n 60: '-чы',\n 70: '-чи',\n 80: '-чи',\n 90: '-чу',\n 100: '-чү',\n };\n\n var ky = moment.defineLocale('ky', {\n months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(\n '_'\n ),\n monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split(\n '_'\n ),\n weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split(\n '_'\n ),\n weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),\n weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Бүгүн саат] LT',\n nextDay: '[Эртең саат] LT',\n nextWeek: 'dddd [саат] LT',\n lastDay: '[Кечээ саат] LT',\n lastWeek: '[Өткөн аптанын] dddd [күнү] [саат] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: '%s ичинде',\n past: '%s мурун',\n s: 'бирнече секунд',\n ss: '%d секунд',\n m: 'бир мүнөт',\n mm: '%d мүнөт',\n h: 'бир саат',\n hh: '%d саат',\n d: 'бир күн',\n dd: '%d күн',\n M: 'бир ай',\n MM: '%d ай',\n y: 'бир жыл',\n yy: '%d жыл',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-(чи|чы|чү|чу)/,\n ordinal: function (number) {\n var a = number % 10,\n b = number >= 100 ? 100 : null;\n return number + (suffixes[number] || suffixes[a] || suffixes[b]);\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7, // The week that contains Jan 7th is the first week of the year.\n },\n });\n\n return ky;\n\n})));\n","//! moment.js locale configuration\n//! locale : Romanian [ro]\n//! author : Vlad Gurdiga : https://github.com/gurdiga\n//! author : Valentin Agachi : https://github.com/avaly\n//! author : Emanuel Cepoi : https://github.com/cepem\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n function relativeTimeWithPlural(number, withoutSuffix, key) {\n var format = {\n ss: 'secunde',\n mm: 'minute',\n hh: 'ore',\n dd: 'zile',\n MM: 'luni',\n yy: 'ani',\n },\n separator = ' ';\n if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {\n separator = ' de ';\n }\n return number + separator + format[key];\n }\n\n var ro = moment.defineLocale('ro', {\n months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(\n '_'\n ),\n monthsShort: 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),\n weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),\n weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY H:mm',\n LLLL: 'dddd, D MMMM YYYY H:mm',\n },\n calendar: {\n sameDay: '[azi la] LT',\n nextDay: '[mâine la] LT',\n nextWeek: 'dddd [la] LT',\n lastDay: '[ieri la] LT',\n lastWeek: '[fosta] dddd [la] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'peste %s',\n past: '%s în urmă',\n s: 'câteva secunde',\n ss: relativeTimeWithPlural,\n m: 'un minut',\n mm: relativeTimeWithPlural,\n h: 'o oră',\n hh: relativeTimeWithPlural,\n d: 'o zi',\n dd: relativeTimeWithPlural,\n M: 'o lună',\n MM: relativeTimeWithPlural,\n y: 'un an',\n yy: relativeTimeWithPlural,\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7, // The week that contains Jan 7th is the first week of the year.\n },\n });\n\n return ro;\n\n})));\n","var script = {\n created: function created() {\n var _this = this;\n\n window.addEventListener('online', function (event) {\n _this.$emit('status', true);\n\n _this.$emit('event', event);\n });\n window.addEventListener('offline', function (event) {\n _this.$emit('status', false);\n\n _this.$emit('event', event);\n });\n }\n};\n\nfunction normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\n if (typeof shadowMode !== 'boolean') {\n createInjectorSSR = createInjector;\n createInjector = shadowMode;\n shadowMode = false;\n }\n\n var options = typeof script === 'function' ? script.options : script;\n\n if (template && template.render) {\n options.render = template.render;\n options.staticRenderFns = template.staticRenderFns;\n options._compiled = true;\n\n if (isFunctionalTemplate) {\n options.functional = true;\n }\n }\n\n if (scopeId) {\n options._scopeId = scopeId;\n }\n\n var hook;\n\n if (moduleIdentifier) {\n hook = function hook(context) {\n context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;\n\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__;\n }\n\n if (style) {\n style.call(this, createInjectorSSR(context));\n }\n\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier);\n }\n };\n\n options._ssrRegister = hook;\n } else if (style) {\n hook = shadowMode ? function (context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));\n } : function (context) {\n style.call(this, createInjector(context));\n };\n }\n\n if (hook) {\n if (options.functional) {\n var originalRender = options.render;\n\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context);\n return originalRender(h, context);\n };\n } else {\n var existing = options.beforeCreate;\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\n }\n }\n\n return script;\n}\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function() {\n var _vm = this;\n var _h = _vm.$createElement;\n var _c = _vm._self._c || _h;\n return _c(\"div\")\n};\nvar __vue_staticRenderFns__ = [];\n__vue_render__._withStripped = true;\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport default __vue_component__;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Touch, Component, EventHandler, selectAll, getUniqueID, removeClass } from '@syncfusion/ej2-base';\nimport { NotifyPropertyChanges, Property, Browser, detach, createElement as buildTag } from '@syncfusion/ej2-base';\nimport { classList, isNullOrUndefined } from '@syncfusion/ej2-base';\nvar CLS_ROOT = 'e-vscroll';\nvar CLS_RTL = 'e-rtl';\nvar CLS_DISABLE = 'e-overlay';\nvar CLS_VSCROLLBAR = 'e-vscroll-bar';\nvar CLS_VSCROLLCON = 'e-vscroll-content';\nvar CLS_NAVARROW = 'e-nav-arrow';\nvar CLS_NAVUPARROW = 'e-nav-up-arrow';\nvar CLS_NAVDOWNARROW = 'e-nav-down-arrow';\nvar CLS_VSCROLLNAV = 'e-scroll-nav';\nvar CLS_VSCROLLNAVUP = 'e-scroll-up-nav';\nvar CLS_VSCROLLNAVDOWN = 'e-scroll-down-nav';\nvar CLS_DEVICE = 'e-scroll-device';\nvar CLS_OVERLAY = 'e-scroll-overlay';\nvar CLS_UPOVERLAY = 'e-scroll-up-overlay';\nvar CLS_DOWNOVERLAY = 'e-scroll-down-overlay';\nvar OVERLAY_MAXWID = 40;\n/**\n * VScroll module is introduces vertical scroller when content exceeds the current viewing area.\n * It can be useful for the components like Toolbar, Tab which needs vertical scrolling alone.\n * Hidden content can be view by touch moving or icon click.\n * ```html\n * \n * \n * ```\n */\nvar VScroll = /** @class */ (function (_super) {\n __extends(VScroll, _super);\n /**\n * Initializes a new instance of the VScroll class.\n *\n * @param {VScrollModel} options - Specifies VScroll model properties as options.\n * @param {string | HTMLElement} element - Specifies the element for which vertical scrolling applies.\n */\n function VScroll(options, element) {\n return _super.call(this, options, element) || this;\n }\n /**\n * Initialize the event handler\n *\n * @private\n * @returns {void}\n */\n VScroll.prototype.preRender = function () {\n this.browser = Browser.info.name;\n this.browserCheck = this.browser === 'mozilla';\n this.isDevice = Browser.isDevice;\n this.customStep = true;\n var ele = this.element;\n this.ieCheck = this.browser === 'edge' || this.browser === 'msie';\n this.initialize();\n if (ele.id === '') {\n ele.id = getUniqueID('vscroll');\n this.uniqueId = true;\n }\n ele.style.display = 'block';\n if (this.enableRtl) {\n ele.classList.add(CLS_RTL);\n }\n };\n /**\n * To Initialize the vertical scroll rendering\n *\n * @private\n * @returns {void}\n */\n VScroll.prototype.render = function () {\n this.touchModule = new Touch(this.element, { scroll: this.touchHandler.bind(this), swipe: this.swipeHandler.bind(this) });\n EventHandler.add(this.scrollEle, 'scroll', this.scrollEventHandler, this);\n if (!this.isDevice) {\n this.createNavIcon(this.element);\n }\n else {\n this.element.classList.add(CLS_DEVICE);\n this.createOverlayElement(this.element);\n }\n this.setScrollState();\n EventHandler.add(this.element, 'wheel', this.wheelEventHandler, this);\n };\n VScroll.prototype.setScrollState = function () {\n if (isNullOrUndefined(this.scrollStep) || this.scrollStep < 0) {\n this.scrollStep = this.scrollEle.offsetHeight;\n this.customStep = false;\n }\n else {\n this.customStep = true;\n }\n };\n VScroll.prototype.initialize = function () {\n var scrollCnt = buildTag('div', { className: CLS_VSCROLLCON });\n var scrollBar = buildTag('div', { className: CLS_VSCROLLBAR });\n scrollBar.setAttribute('tabindex', '-1');\n var ele = this.element;\n var innerEle = [].slice.call(ele.children);\n for (var _i = 0, innerEle_1 = innerEle; _i < innerEle_1.length; _i++) {\n var ele_1 = innerEle_1[_i];\n scrollCnt.appendChild(ele_1);\n }\n scrollBar.appendChild(scrollCnt);\n ele.appendChild(scrollBar);\n scrollBar.style.overflowY = 'hidden';\n this.scrollEle = scrollBar;\n this.scrollItems = scrollCnt;\n };\n VScroll.prototype.getPersistData = function () {\n var keyEntity = ['scrollStep'];\n return this.addOnPersist(keyEntity);\n };\n /**\n * Returns the current module name.\n *\n * @returns {string} - It returns the current module name.\n * @private\n */\n VScroll.prototype.getModuleName = function () {\n return 'vScroll';\n };\n /**\n * Removes the control from the DOM and also removes all its related events.\n *\n * @returns {void}\n */\n VScroll.prototype.destroy = function () {\n var el = this.element;\n el.style.display = '';\n removeClass([this.element], [CLS_ROOT, CLS_DEVICE]);\n var navs = selectAll('.e-' + el.id + '_nav.' + CLS_VSCROLLNAV, el);\n var overlays = selectAll('.' + CLS_OVERLAY, el);\n [].slice.call(overlays).forEach(function (ele) {\n detach(ele);\n });\n for (var _i = 0, _a = [].slice.call(this.scrollItems.children); _i < _a.length; _i++) {\n var elem = _a[_i];\n el.appendChild(elem);\n }\n if (this.uniqueId) {\n this.element.removeAttribute('id');\n }\n detach(this.scrollEle);\n if (navs.length > 0) {\n detach(navs[0]);\n if (!isNullOrUndefined(navs[1])) {\n detach(navs[1]);\n }\n }\n EventHandler.remove(this.scrollEle, 'scroll', this.scrollEventHandler);\n this.touchModule.destroy();\n this.touchModule = null;\n _super.prototype.destroy.call(this);\n };\n /**\n * Specifies the value to disable/enable the VScroll component.\n * When set to `true` , the component will be disabled.\n *\n * @param {boolean} value - Based on this Boolean value, VScroll will be enabled (false) or disabled (true).\n * @returns {void}.\n */\n VScroll.prototype.disable = function (value) {\n var navEle = selectAll('.e-scroll-nav:not(.' + CLS_DISABLE + ')', this.element);\n if (value) {\n this.element.classList.add(CLS_DISABLE);\n }\n else {\n this.element.classList.remove(CLS_DISABLE);\n }\n [].slice.call(navEle).forEach(function (el) {\n el.setAttribute('tabindex', !value ? '0' : '-1');\n });\n };\n VScroll.prototype.createOverlayElement = function (element) {\n var id = element.id.concat('_nav');\n var downOverlayEle = buildTag('div', { className: CLS_OVERLAY + ' ' + CLS_DOWNOVERLAY });\n var clsDown = 'e-' + element.id.concat('_nav ' + CLS_VSCROLLNAV + ' ' + CLS_VSCROLLNAVDOWN);\n var downEle = buildTag('div', { id: id.concat('down'), className: clsDown });\n var navItem = buildTag('div', { className: CLS_NAVDOWNARROW + ' ' + CLS_NAVARROW + ' e-icons' });\n downEle.appendChild(navItem);\n var upEle = buildTag('div', { className: CLS_OVERLAY + ' ' + CLS_UPOVERLAY });\n if (this.ieCheck) {\n downEle.classList.add('e-ie-align');\n }\n element.appendChild(downOverlayEle);\n element.appendChild(downEle);\n element.insertBefore(upEle, element.firstChild);\n this.eventBinding([downEle]);\n };\n VScroll.prototype.createNavIcon = function (element) {\n var id = element.id.concat('_nav');\n var clsDown = 'e-' + element.id.concat('_nav ' + CLS_VSCROLLNAV + ' ' + CLS_VSCROLLNAVDOWN);\n var nav = buildTag('div', { id: id.concat('_down'), className: clsDown });\n nav.setAttribute('aria-disabled', 'false');\n var navItem = buildTag('div', { className: CLS_NAVDOWNARROW + ' ' + CLS_NAVARROW + ' e-icons' });\n var clsUp = 'e-' + element.id.concat('_nav ' + CLS_VSCROLLNAV + ' ' + CLS_VSCROLLNAVUP);\n var navElement = buildTag('div', { id: id.concat('_up'), className: clsUp + ' ' + CLS_DISABLE });\n navElement.setAttribute('aria-disabled', 'true');\n var navUpItem = buildTag('div', { className: CLS_NAVUPARROW + ' ' + CLS_NAVARROW + ' e-icons' });\n navElement.appendChild(navUpItem);\n nav.appendChild(navItem);\n nav.setAttribute('tabindex', '0');\n element.appendChild(nav);\n element.insertBefore(navElement, element.firstChild);\n if (this.ieCheck) {\n nav.classList.add('e-ie-align');\n navElement.classList.add('e-ie-align');\n }\n this.eventBinding([nav, navElement]);\n };\n VScroll.prototype.onKeyPress = function (ev) {\n var _this = this;\n if (ev.key === 'Enter') {\n var timeoutFun_1 = function () {\n _this.keyTimeout = true;\n _this.eleScrolling(10, ev.target, true);\n };\n this.keyTimer = window.setTimeout(function () {\n timeoutFun_1();\n }, 100);\n }\n };\n VScroll.prototype.onKeyUp = function (ev) {\n if (ev.key !== 'Enter') {\n return;\n }\n if (this.keyTimeout) {\n this.keyTimeout = false;\n }\n else {\n ev.target.click();\n }\n clearTimeout(this.keyTimer);\n };\n VScroll.prototype.eventBinding = function (element) {\n var _this = this;\n [].slice.call(element).forEach(function (ele) {\n new Touch(ele, { tapHold: _this.tabHoldHandler.bind(_this), tapHoldThreshold: 500 });\n ele.addEventListener('keydown', _this.onKeyPress.bind(_this));\n ele.addEventListener('keyup', _this.onKeyUp.bind(_this));\n ele.addEventListener('mouseup', _this.repeatScroll.bind(_this));\n ele.addEventListener('touchend', _this.repeatScroll.bind(_this));\n ele.addEventListener('contextmenu', function (e) {\n e.preventDefault();\n });\n EventHandler.add(ele, 'click', _this.clickEventHandler, _this);\n });\n };\n VScroll.prototype.repeatScroll = function () {\n clearInterval(this.timeout);\n };\n VScroll.prototype.tabHoldHandler = function (ev) {\n var _this = this;\n var trgt = ev.originalEvent.target;\n trgt = this.contains(trgt, CLS_VSCROLLNAV) ? trgt.firstElementChild : trgt;\n var scrollDistance = 10;\n var timeoutFun = function () {\n _this.eleScrolling(scrollDistance, trgt, true);\n };\n this.timeout = window.setInterval(function () {\n timeoutFun();\n }, 50);\n };\n VScroll.prototype.contains = function (element, className) {\n return element.classList.contains(className);\n };\n VScroll.prototype.eleScrolling = function (scrollDis, trgt, isContinuous) {\n var classList = trgt.classList;\n if (classList.contains(CLS_VSCROLLNAV)) {\n classList = trgt.querySelector('.' + CLS_NAVARROW).classList;\n }\n if (classList.contains(CLS_NAVDOWNARROW)) {\n this.frameScrollRequest(scrollDis, 'add', isContinuous);\n }\n else if (classList.contains(CLS_NAVUPARROW)) {\n this.frameScrollRequest(scrollDis, '', isContinuous);\n }\n };\n VScroll.prototype.clickEventHandler = function (event) {\n this.eleScrolling(this.scrollStep, event.target, false);\n };\n VScroll.prototype.wheelEventHandler = function (e) {\n e.preventDefault();\n this.frameScrollRequest(this.scrollStep, (e.deltaY > 0 ? 'add' : ''), false);\n };\n VScroll.prototype.swipeHandler = function (e) {\n var swipeElement = this.scrollEle;\n var distance;\n if (e.velocity <= 1) {\n distance = e.distanceY / (e.velocity * 10);\n }\n else {\n distance = e.distanceY / e.velocity;\n }\n var start = 0.5;\n var animate = function () {\n var step = Math.sin(start);\n if (step <= 0) {\n window.cancelAnimationFrame(step);\n }\n else {\n if (e.swipeDirection === 'Up') {\n swipeElement.scrollTop += distance * step;\n }\n else if (e.swipeDirection === 'Down') {\n swipeElement.scrollTop -= distance * step;\n }\n start -= 0.02;\n window.requestAnimationFrame(animate);\n }\n };\n animate();\n };\n VScroll.prototype.scrollUpdating = function (scrollVal, action) {\n if (action === 'add') {\n this.scrollEle.scrollTop += scrollVal;\n }\n else {\n this.scrollEle.scrollTop -= scrollVal;\n }\n };\n VScroll.prototype.frameScrollRequest = function (scrollValue, action, isContinuous) {\n var _this = this;\n var step = 10;\n if (isContinuous) {\n this.scrollUpdating(scrollValue, action);\n return;\n }\n if (!this.customStep) {\n [].slice.call(selectAll('.' + CLS_OVERLAY, this.element)).forEach(function (el) {\n scrollValue -= el.offsetHeight;\n });\n }\n var animate = function () {\n if (scrollValue < step) {\n window.cancelAnimationFrame(step);\n }\n else {\n _this.scrollUpdating(step, action);\n scrollValue -= step;\n window.requestAnimationFrame(animate);\n }\n };\n animate();\n };\n VScroll.prototype.touchHandler = function (e) {\n var el = this.scrollEle;\n var distance = e.distanceY;\n if (e.scrollDirection === 'Up') {\n el.scrollTop = el.scrollTop + distance;\n }\n else if (e.scrollDirection === 'Down') {\n el.scrollTop = el.scrollTop - distance;\n }\n };\n VScroll.prototype.arrowDisabling = function (addDisableCls, removeDisableCls) {\n if (this.isDevice) {\n var arrowEle = isNullOrUndefined(addDisableCls) ? removeDisableCls : addDisableCls;\n var arrowIcon = arrowEle.querySelector('.' + CLS_NAVARROW);\n if (isNullOrUndefined(addDisableCls)) {\n classList(arrowIcon, [CLS_NAVDOWNARROW], [CLS_NAVUPARROW]);\n }\n else {\n classList(arrowIcon, [CLS_NAVUPARROW], [CLS_NAVDOWNARROW]);\n }\n }\n else {\n addDisableCls.classList.add(CLS_DISABLE);\n addDisableCls.setAttribute('aria-disabled', 'true');\n addDisableCls.removeAttribute('tabindex');\n removeDisableCls.classList.remove(CLS_DISABLE);\n removeDisableCls.setAttribute('aria-disabled', 'false');\n removeDisableCls.setAttribute('tabindex', '0');\n }\n this.repeatScroll();\n };\n VScroll.prototype.scrollEventHandler = function (e) {\n var target = e.target;\n var height = target.offsetHeight;\n var navUpEle = this.element.querySelector('.' + CLS_VSCROLLNAVUP);\n var navDownEle = this.element.querySelector('.' + CLS_VSCROLLNAVDOWN);\n var upOverlay = this.element.querySelector('.' + CLS_UPOVERLAY);\n var downOverlay = this.element.querySelector('.' + CLS_DOWNOVERLAY);\n var scrollTop = target.scrollTop;\n if (scrollTop <= 0) {\n scrollTop = -scrollTop;\n }\n if (this.isDevice) {\n if (scrollTop < OVERLAY_MAXWID) {\n upOverlay.style.height = scrollTop + 'px';\n }\n else {\n upOverlay.style.height = '40px';\n }\n if ((target.scrollHeight - Math.ceil(height + scrollTop)) < OVERLAY_MAXWID) {\n downOverlay.style.height = (target.scrollHeight - Math.ceil(height + scrollTop)) + 'px';\n }\n else {\n downOverlay.style.height = '40px';\n }\n }\n if (scrollTop === 0) {\n this.arrowDisabling(navUpEle, navDownEle);\n }\n else if (Math.ceil(height + scrollTop + .1) >= target.scrollHeight) {\n this.arrowDisabling(navDownEle, navUpEle);\n }\n else {\n var disEle = this.element.querySelector('.' + CLS_VSCROLLNAV + '.' + CLS_DISABLE);\n if (disEle) {\n disEle.classList.remove(CLS_DISABLE);\n disEle.setAttribute('aria-disabled', 'false');\n disEle.setAttribute('tabindex', '0');\n }\n }\n };\n /**\n * Gets called when the model property changes.The data that describes the old and new values of property that changed.\n *\n * @param {VScrollModel} newProp - It contains the new value of data.\n * @param {VScrollModel} oldProp - It contains the old value of data.\n * @returns {void}\n * @private\n */\n VScroll.prototype.onPropertyChanged = function (newProp, oldProp) {\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'scrollStep':\n this.setScrollState();\n break;\n case 'enableRtl':\n if (newProp.enableRtl) {\n this.element.classList.add(CLS_RTL);\n }\n else {\n this.element.classList.remove(CLS_RTL);\n }\n break;\n }\n }\n };\n __decorate([\n Property(null)\n ], VScroll.prototype, \"scrollStep\", void 0);\n VScroll = __decorate([\n NotifyPropertyChanges\n ], VScroll);\n return VScroll;\n}(Component));\nexport { VScroll };\n","//! moment.js locale configuration\n//! locale : Welsh [cy]\n//! author : Robert Allen : https://github.com/robgallen\n//! author : https://github.com/ryangreaves\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var cy = moment.defineLocale('cy', {\n months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split(\n '_'\n ),\n monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split(\n '_'\n ),\n weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split(\n '_'\n ),\n weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),\n weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),\n weekdaysParseExact: true,\n // time formats are the same as en-gb\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Heddiw am] LT',\n nextDay: '[Yfory am] LT',\n nextWeek: 'dddd [am] LT',\n lastDay: '[Ddoe am] LT',\n lastWeek: 'dddd [diwethaf am] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'mewn %s',\n past: '%s yn ôl',\n s: 'ychydig eiliadau',\n ss: '%d eiliad',\n m: 'munud',\n mm: '%d munud',\n h: 'awr',\n hh: '%d awr',\n d: 'diwrnod',\n dd: '%d diwrnod',\n M: 'mis',\n MM: '%d mis',\n y: 'blwyddyn',\n yy: '%d flynedd',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,\n // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh\n ordinal: function (number) {\n var b = number,\n output = '',\n lookup = [\n '',\n 'af',\n 'il',\n 'ydd',\n 'ydd',\n 'ed',\n 'ed',\n 'ed',\n 'fed',\n 'fed',\n 'fed', // 1af to 10fed\n 'eg',\n 'fed',\n 'eg',\n 'eg',\n 'fed',\n 'eg',\n 'eg',\n 'fed',\n 'eg',\n 'fed', // 11eg to 20fed\n ];\n if (b > 20) {\n if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {\n output = 'fed'; // not 30ain, 70ain or 90ain\n } else {\n output = 'ain';\n }\n } else if (b > 0) {\n output = lookup[b];\n }\n return number + output;\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return cy;\n\n})));\n","// --- General ---\nexport var RX_ARRAY_NOTATION = /\\[(\\d+)]/g;\nexport var RX_BV_PREFIX = /^(BV?)/;\nexport var RX_DIGITS = /^\\d+$/;\nexport var RX_EXTENSION = /^\\..+/;\nexport var RX_HASH = /^#/;\nexport var RX_HASH_ID = /^#[A-Za-z]+[\\w\\-:.]*$/;\nexport var RX_HTML_TAGS = /(<([^>]+)>)/gi;\nexport var RX_HYPHENATE = /\\B([A-Z])/g;\nexport var RX_LOWER_UPPER = /([a-z])([A-Z])/g;\nexport var RX_NUMBER = /^[0-9]*\\.?[0-9]+$/;\nexport var RX_PLUS = /\\+/g;\nexport var RX_REGEXP_REPLACE = /[-/\\\\^$*+?.()|[\\]{}]/g;\nexport var RX_SPACES = /[\\s\\uFEFF\\xA0]+/g;\nexport var RX_SPACE_SPLIT = /\\s+/;\nexport var RX_STAR = /\\/\\*$/;\nexport var RX_START_SPACE_WORD = /(\\s|^)(\\w)/g;\nexport var RX_TRIM_LEFT = /^\\s+/;\nexport var RX_TRIM_RIGHT = /\\s+$/;\nexport var RX_UNDERSCORE = /_/g;\nexport var RX_UN_KEBAB = /-(\\w)/g; // --- Date ---\n// Loose YYYY-MM-DD matching, ignores any appended time inforation\n// Matches '1999-12-20', '1999-1-1', '1999-01-20T22:51:49.118Z', '1999-01-02 13:00:00'\n\nexport var RX_DATE = /^\\d+-\\d\\d?-\\d\\d?(?:\\s|T|$)/; // Used to split off the date parts of the YYYY-MM-DD string\n\nexport var RX_DATE_SPLIT = /-|\\s|T/; // Time string RegEx (optional seconds)\n\nexport var RX_TIME = /^([0-1]?[0-9]|2[0-3]):[0-5]?[0-9](:[0-5]?[0-9])?$/; // --- URL ---\n// HREFs must end with a hash followed by at least one non-hash character\n\nexport var RX_HREF = /^.*(#[^#]+)$/;\nexport var RX_ENCODED_COMMA = /%2C/g;\nexport var RX_ENCODE_REVERSE = /[!'()*]/g;\nexport var RX_QUERY_START = /^(\\?|#|&)/; // --- Aspect ---\n\nexport var RX_ASPECT = /^\\d+(\\.\\d*)?[/:]\\d+(\\.\\d*)?$/;\nexport var RX_ASPECT_SEPARATOR = /[/:]/; // --- Grid ---\n\nexport var RX_COL_CLASS = /^col-/; // --- Icon ---\n\nexport var RX_ICON_PREFIX = /^BIcon/; // --- Locale ---\n\nexport var RX_STRIP_LOCALE_MODS = /-u-.+/;","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { EventHandler, Property, Internationalization, NotifyPropertyChanges } from '@syncfusion/ej2-base';\nimport { KeyboardEvents, Animation, Browser } from '@syncfusion/ej2-base';\nimport { cldrData, L10n, Component, getDefaultDateObject, rippleEffect, Event } from '@syncfusion/ej2-base';\nimport { remove, addClass, detach, removeClass, closest, append, attributes, setStyleAttribute } from '@syncfusion/ej2-base';\nimport { isNullOrUndefined, formatUnit, getValue, extend, getUniqueID, ChildProperty } from '@syncfusion/ej2-base';\nimport { Popup } from '@syncfusion/ej2-popups';\nimport { Input } from '@syncfusion/ej2-inputs';\nimport { ListBase } from '@syncfusion/ej2-lists';\nvar WRAPPERCLASS = 'e-time-wrapper';\nvar POPUP = 'e-popup';\nvar ERROR = 'e-error';\nvar POPUPDIMENSION = '240px';\nvar DAY = new Date().getDate();\nvar MONTH = new Date().getMonth();\nvar YEAR = new Date().getFullYear();\nvar ROOT = 'e-timepicker';\nvar LIBRARY = 'e-lib';\nvar CONTROL = 'e-control';\nvar CONTENT = 'e-content';\nvar SELECTED = 'e-active';\nvar HOVER = 'e-hover';\nvar NAVIGATION = 'e-navigation';\nvar DISABLED = 'e-disabled';\nvar ICONANIMATION = 'e-icon-anim';\nvar TIMEICON = 'e-time-icon';\nvar CLEARICON = 'e-clear-icon';\nvar FOCUS = 'e-input-focus';\nvar LISTCLASS = 'e-list-item';\nvar HALFPOSITION = 2;\nvar ANIMATIONDURATION = 50;\nvar OVERFLOW = 'e-time-overflow';\nvar OFFSETVAL = 4;\nvar EDITABLE = 'e-non-edit';\nvar wrapperAttributes = ['title', 'class', 'style'];\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport var TimePickerBase;\n(function (TimePickerBase) {\n // eslint-disable-next-line max-len, jsdoc/require-jsdoc\n function createListItems(createdEl, min, max, globalize, timeFormat, step) {\n var formatOptions;\n if (this.calendarMode === 'Gregorian') {\n formatOptions = { format: timeFormat, type: 'time' };\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n formatOptions = { format: timeFormat, type: 'time', calendar: 'islamic' };\n }\n var start;\n var interval = step * 60000;\n var listItems = [];\n var timeCollections = [];\n start = +(min.setMilliseconds(0));\n var end = +(max.setMilliseconds(0));\n while (end >= start) {\n timeCollections.push(start);\n listItems.push(globalize.formatDate(new Date(start), { format: timeFormat, type: 'time' }));\n start += interval;\n }\n var listTag = ListBase.createList(createdEl, listItems, null, true);\n return { collection: timeCollections, list: listTag };\n }\n TimePickerBase.createListItems = createListItems;\n})(TimePickerBase || (TimePickerBase = {}));\nvar TimeMaskPlaceholder = /** @class */ (function (_super) {\n __extends(TimeMaskPlaceholder, _super);\n function TimeMaskPlaceholder() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('day')\n ], TimeMaskPlaceholder.prototype, \"day\", void 0);\n __decorate([\n Property('month')\n ], TimeMaskPlaceholder.prototype, \"month\", void 0);\n __decorate([\n Property('year')\n ], TimeMaskPlaceholder.prototype, \"year\", void 0);\n __decorate([\n Property('day of the week')\n ], TimeMaskPlaceholder.prototype, \"dayOfTheWeek\", void 0);\n __decorate([\n Property('hour')\n ], TimeMaskPlaceholder.prototype, \"hour\", void 0);\n __decorate([\n Property('minute')\n ], TimeMaskPlaceholder.prototype, \"minute\", void 0);\n __decorate([\n Property('second')\n ], TimeMaskPlaceholder.prototype, \"second\", void 0);\n return TimeMaskPlaceholder;\n}(ChildProperty));\nexport { TimeMaskPlaceholder };\n/**\n * TimePicker is an intuitive interface component which provides an options to select a time value\n * from popup list or to set a desired time value.\n * ```\n * \n * \n * ```\n */\nvar TimePicker = /** @class */ (function (_super) {\n __extends(TimePicker, _super);\n /**\n * Constructor for creating the widget\n *\n * @param {TimePickerModel} options - Specifies the TimePicker model.\n * @param {string | HTMLInputElement} element - Specifies the element to render as component.\n * @private\n */\n function TimePicker(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.liCollections = [];\n _this.timeCollections = [];\n _this.disableItemCollection = [];\n _this.invalidValueString = null;\n _this.isAngular = false;\n _this.preventChange = false;\n _this.maskedDateValue = '';\n _this.moduleName = _this.getModuleName();\n _this.timeOptions = options;\n return _this;\n }\n /**\n * Initialize the event handler\n *\n * @returns {void}\n * @private\n */\n TimePicker.prototype.preRender = function () {\n this.keyConfigure = {\n enter: 'enter',\n escape: 'escape',\n end: 'end',\n tab: 'tab',\n home: 'home',\n down: 'downarrow',\n up: 'uparrow',\n left: 'leftarrow',\n right: 'rightarrow',\n open: 'alt+downarrow',\n close: 'alt+uparrow'\n };\n this.cloneElement = this.element.cloneNode(true);\n removeClass([this.cloneElement], [ROOT, CONTROL, LIBRARY]);\n this.inputElement = this.element;\n this.angularTag = null;\n this.formElement = closest(this.element, 'form');\n if (this.element.tagName === 'EJS-TIMEPICKER') {\n this.angularTag = this.element.tagName;\n this.inputElement = this.createElement('input');\n this.element.appendChild(this.inputElement);\n }\n this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';\n this.element.removeAttribute('tabindex');\n this.openPopupEventArgs = {\n appendTo: document.body\n };\n };\n // element creation\n TimePicker.prototype.render = function () {\n this.initialize();\n this.createInputElement();\n this.updateHtmlAttributeToWrapper();\n this.setTimeAllowEdit();\n this.setEnable();\n this.validateInterval();\n this.bindEvents();\n this.validateDisable();\n this.setValue(this.getFormattedValue(this.value));\n if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {\n this.updateInputValue(this.maskedDateValue);\n this.checkErrorState(this.maskedDateValue);\n }\n this.anchor = this.inputElement;\n this.inputElement.setAttribute('value', this.inputElement.value);\n this.inputEleValue = this.getDateObject(this.inputElement.value);\n this.renderComplete();\n };\n TimePicker.prototype.setTimeAllowEdit = function () {\n if (this.allowEdit) {\n if (!this.readonly) {\n this.inputElement.removeAttribute('readonly');\n }\n }\n else {\n attributes(this.inputElement, { 'readonly': '' });\n }\n this.clearIconState();\n };\n TimePicker.prototype.clearIconState = function () {\n if (!this.allowEdit && this.inputWrapper && !this.readonly) {\n if (this.inputElement.value === '') {\n removeClass([this.inputWrapper.container], [EDITABLE]);\n }\n else {\n addClass([this.inputWrapper.container], [EDITABLE]);\n }\n }\n else if (this.inputWrapper) {\n removeClass([this.inputWrapper.container], [EDITABLE]);\n }\n };\n TimePicker.prototype.validateDisable = function () {\n this.setMinMax(this.initMin, this.initMax);\n this.popupCreation();\n this.popupObj.destroy();\n this.popupWrapper = this.popupObj = null;\n if ((!isNaN(+this.value) && this.value !== null)) {\n if (!this.valueIsDisable(this.value)) {\n //disable value given in value property so reset the date based on current date\n if (this.strictMode) {\n this.resetState();\n }\n this.initValue = null;\n this.initMax = this.getDateObject(this.initMax);\n this.initMin = this.getDateObject(this.initMin);\n this.timeCollections = this.liCollections = [];\n this.setMinMax(this.initMin, this.initMax);\n }\n }\n };\n TimePicker.prototype.validationAttribute = function (target, input) {\n var name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');\n input.setAttribute('name', name);\n target.removeAttribute('name');\n var attributes = ['required', 'aria-required', 'form'];\n for (var i = 0; i < attributes.length; i++) {\n if (isNullOrUndefined(target.getAttribute(attributes[i]))) {\n continue;\n }\n var attr = target.getAttribute(attributes[i]);\n input.setAttribute(attributes[i], attr);\n target.removeAttribute(attributes[i]);\n }\n };\n TimePicker.prototype.initialize = function () {\n this.globalize = new Internationalization(this.locale);\n this.defaultCulture = new Internationalization('en');\n this.checkTimeFormat();\n this.checkInvalidValue(this.value);\n // persist the value property.\n this.setProperties({ value: this.checkDateValue(new Date(this.checkInValue(this.value))) }, true);\n this.setProperties({ min: this.checkDateValue(new Date(this.checkInValue(this.min))) }, true);\n this.setProperties({ max: this.checkDateValue(new Date(this.checkInValue(this.max))) }, true);\n this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkInValue(this.scrollTo))) }, true);\n if (this.angularTag !== null) {\n this.validationAttribute(this.element, this.inputElement);\n }\n this.updateHtmlAttributeToElement();\n this.checkAttributes(false); //check the input element attributes\n var localeText = { placeholder: this.placeholder };\n this.l10n = new L10n('timepicker', localeText, this.locale);\n this.setProperties({ placeholder: this.placeholder || this.l10n.getConstant('placeholder') }, true);\n this.initValue = this.checkDateValue(this.value);\n this.initMin = this.checkDateValue(this.min);\n this.initMax = this.checkDateValue(this.max);\n this.isNavigate = this.isPreventBlur = this.isTextSelected = false;\n this.activeIndex = this.valueWithMinutes = this.prevDate = null;\n if (!isNullOrUndefined(this.element.getAttribute('id'))) {\n if (this.angularTag !== null) {\n this.inputElement.id = this.element.getAttribute('id') + '_input';\n }\n }\n else {\n //for angular case\n this.element.id = getUniqueID('ej2_timepicker');\n if (this.angularTag !== null) {\n attributes(this.inputElement, { 'id': this.element.id + '_input' });\n }\n }\n if (isNullOrUndefined(this.inputElement.getAttribute('name'))) {\n attributes(this.inputElement, { 'name': this.element.id });\n }\n if (this.enableMask) {\n this.notify(\"createMask\", {\n module: \"MaskedDateTime\",\n });\n }\n };\n TimePicker.prototype.checkTimeFormat = function () {\n if (this.format) {\n if (typeof this.format === 'string') {\n this.formatString = this.format;\n }\n else if (!isNullOrUndefined(this.format.skeleton) && this.format.skeleton !== '') {\n var skeletonString = this.format.skeleton;\n this.formatString = this.globalize.getDatePattern({ type: 'time', skeleton: skeletonString });\n }\n else {\n this.formatString = this.globalize.getDatePattern({ type: 'time', skeleton: 'short' });\n }\n }\n else {\n this.formatString = null;\n }\n };\n TimePicker.prototype.checkDateValue = function (value) {\n return (!isNullOrUndefined(value) && value instanceof Date && !isNaN(+value)) ? value : null;\n };\n TimePicker.prototype.createInputElement = function () {\n var updatedCssClassesValue = this.cssClass;\n var isBindClearAction = this.enableMask ? false : true;\n if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {\n updatedCssClassesValue = (this.cssClass.replace(/\\s+/g, ' ')).trim();\n }\n this.inputWrapper = Input.createInput({\n element: this.inputElement,\n bindClearAction: isBindClearAction,\n floatLabelType: this.floatLabelType,\n properties: {\n readonly: this.readonly,\n placeholder: this.placeholder,\n cssClass: updatedCssClassesValue,\n enabled: this.enabled,\n enableRtl: this.enableRtl,\n showClearButton: this.showClearButton\n },\n buttons: [' e-input-group-icon e-time-icon e-icons']\n }, this.createElement);\n this.inputWrapper.container.style.width = this.setWidth(this.width);\n attributes(this.inputElement, {\n 'aria-haspopup': 'true', 'aria-autocomplete': 'list', 'tabindex': '0', 'aria-activedescendant': 'null',\n 'aria-owns': this.element.id + '_options', 'aria-expanded': 'false', 'role': 'combobox', 'autocomplete': 'off',\n 'autocorrect': 'off', 'autocapitalize': 'off', 'spellcheck': 'false', 'aria-disabled': 'false', 'aria-invalid': 'false'\n });\n if (!this.isNullOrEmpty(this.inputStyle)) {\n Input.addAttributes({ 'style': this.inputStyle }, this.inputElement);\n }\n addClass([this.inputWrapper.container], WRAPPERCLASS);\n };\n TimePicker.prototype.getCldrDateTimeFormat = function () {\n var culture = new Internationalization(this.locale);\n var cldrTime;\n var dateFormat = culture.getDatePattern({ skeleton: 'yMd' });\n if (this.isNullOrEmpty(this.formatString)) {\n cldrTime = dateFormat + ' ' + this.cldrFormat('time');\n }\n else {\n cldrTime = this.formatString;\n }\n return cldrTime;\n };\n TimePicker.prototype.checkInvalidValue = function (value) {\n var isInvalid = false;\n if (typeof value !== 'object' && !isNullOrUndefined(value)) {\n var valueString = value;\n if (typeof valueString === 'string') {\n valueString = valueString.trim();\n }\n var valueExpression = null;\n var valueExp = null;\n if (typeof value === 'number') {\n valueString = value.toString();\n }\n else if (typeof value === 'string') {\n if (!(/^[a-zA-Z0-9- ]*$/).test(value)) {\n valueExpression = this.setCurrentDate(this.getDateObject(value));\n if (isNullOrUndefined(valueExpression)) {\n valueExpression = this.checkDateValue(this.globalize.parseDate(valueString, {\n format: this.getCldrDateTimeFormat(), type: 'datetime'\n }));\n if (isNullOrUndefined(valueExpression)) {\n valueExpression = this.checkDateValue(this.globalize.parseDate(valueString, {\n format: this.formatString, type: 'dateTime', skeleton: 'yMd'\n }));\n }\n }\n }\n }\n valueExp = this.globalize.parseDate(valueString, {\n format: this.getCldrDateTimeFormat(), type: 'datetime'\n });\n valueExpression = (!isNullOrUndefined(valueExp) && valueExp instanceof Date && !isNaN(+valueExp)) ? valueExp : null;\n if (isNullOrUndefined(valueExpression) && valueString.replace(/\\s/g, '').length) {\n var extISOString = null;\n var basicISOString = null;\n // eslint-disable-next-line\n 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)?)?/;\n // eslint-disable-next-line\n 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)?)?/;\n if ((!extISOString.test(valueString) && !basicISOString.test(valueString))\n || ((/^[a-zA-Z0-9- ]*$/).test(value)) || isNaN(+new Date('' + valueString))) {\n isInvalid = true;\n }\n else {\n valueExpression = new Date('' + valueString);\n }\n }\n if (isInvalid) {\n if (!this.strictMode) {\n this.invalidValueString = valueString;\n }\n this.setProperties({ value: null }, true);\n this.initValue = null;\n }\n else {\n this.setProperties({ value: valueExpression }, true);\n this.initValue = this.value;\n }\n }\n };\n TimePicker.prototype.requiredModules = function () {\n var modules = [];\n if (this.enableMask) {\n modules.push({ args: [this], member: 'MaskedDateTime' });\n }\n return modules;\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TimePicker.prototype.cldrFormat = function (type) {\n var cldrDateTimeString;\n if (this.locale === 'en' || this.locale === 'en-US') {\n cldrDateTimeString = (getValue('timeFormats.short', getDefaultDateObject()));\n }\n else {\n cldrDateTimeString = (this.getCultureTimeObject(cldrData, '' + this.locale));\n }\n return cldrDateTimeString;\n };\n // destroy function\n TimePicker.prototype.destroy = function () {\n this.hide();\n this.unBindEvents();\n var ariaAttribute = {\n 'aria-haspopup': 'true', 'aria-autocomplete': 'list', 'tabindex': '0', 'aria-activedescendant': 'null',\n 'aria-owns': this.element.id + '_options', 'aria-expanded': 'false', 'role': 'combobox', 'autocomplete': 'off',\n 'autocorrect': 'off', 'autocapitalize': 'off', 'spellcheck': 'false', 'aria-disabled': 'true', 'aria-invalid': 'false'\n };\n if (this.inputElement) {\n Input.removeAttributes(ariaAttribute, this.inputElement);\n if (this.angularTag === null) {\n this.inputWrapper.container.parentElement.appendChild(this.inputElement);\n }\n if (!isNullOrUndefined(this.cloneElement.getAttribute('tabindex'))) {\n this.inputElement.setAttribute('tabindex', this.tabIndex);\n }\n else {\n this.inputElement.removeAttribute('tabindex');\n }\n this.ensureInputAttribute();\n this.enableElement([this.inputElement]);\n this.inputElement.classList.remove('e-input');\n if (isNullOrUndefined(this.cloneElement.getAttribute('disabled'))) {\n Input.setEnabled(true, this.inputElement, this.floatLabelType);\n }\n }\n if (this.inputWrapper.container) {\n detach(this.inputWrapper.container);\n }\n this.inputWrapper = this.popupWrapper = this.cloneElement = undefined;\n this.liCollections = this.timeCollections = this.disableItemCollection = [];\n if (!isNullOrUndefined(this.rippleFn)) {\n this.rippleFn();\n }\n _super.prototype.destroy.call(this);\n if (this.formElement) {\n EventHandler.remove(this.formElement, 'reset', this.formResetHandler);\n }\n };\n TimePicker.prototype.ensureInputAttribute = function () {\n var propertyList = [];\n for (var i = 0; i < this.inputElement.attributes.length; i++) {\n propertyList[i] = this.inputElement.attributes[i].name;\n }\n for (var i = 0; i < propertyList.length; i++) {\n if (!isNullOrUndefined(this.cloneElement.getAttribute(propertyList[i]))) {\n this.inputElement.setAttribute(propertyList[i], this.cloneElement.getAttribute(propertyList[i]));\n if (propertyList[i].toLowerCase() === 'value') {\n this.inputElement.value = this.cloneElement.getAttribute(propertyList[i]);\n }\n }\n else {\n this.inputElement.removeAttribute(propertyList[i]);\n if (propertyList[i].toLowerCase() === 'value') {\n this.inputElement.value = '';\n }\n }\n }\n };\n //popup creation\n TimePicker.prototype.popupCreation = function () {\n this.popupWrapper = this.createElement('div', {\n className: ROOT + ' ' + POPUP,\n attrs: { 'id': this.element.id + '_popup', 'style': 'visibility:hidden' }\n });\n if (!isNullOrUndefined(this.cssClass)) {\n this.popupWrapper.className += ' ' + this.cssClass;\n }\n if (!isNullOrUndefined(this.step) && this.step > 0) {\n this.generateList();\n append([this.listWrapper], this.popupWrapper);\n }\n this.openPopupEventArgs.appendTo.appendChild(this.popupWrapper);\n this.addSelection();\n this.renderPopup();\n detach(this.popupWrapper);\n };\n TimePicker.prototype.getPopupHeight = function () {\n var height = parseInt(POPUPDIMENSION, 10);\n var popupHeight = this.popupWrapper.getBoundingClientRect().height;\n return popupHeight > height ? height : popupHeight;\n };\n TimePicker.prototype.generateList = function () {\n this.createListItems();\n this.wireListEvents();\n var rippleModel = { duration: 300, selector: '.' + LISTCLASS };\n this.rippleFn = rippleEffect(this.listWrapper, rippleModel);\n this.liCollections = this.listWrapper.querySelectorAll('.' + LISTCLASS);\n };\n TimePicker.prototype.renderPopup = function () {\n var _this = this;\n this.containerStyle = this.inputWrapper.container.getBoundingClientRect();\n this.popupObj = new Popup(this.popupWrapper, {\n width: this.setPopupWidth(this.width),\n zIndex: this.zIndex,\n targetType: 'relative',\n position: Browser.isDevice ? { X: 'center', Y: 'center' } : { X: 'left', Y: 'bottom' },\n collision: Browser.isDevice ? { X: 'fit', Y: 'fit' } : { X: 'flip', Y: 'flip' },\n enableRtl: this.enableRtl,\n relateTo: Browser.isDevice ? document.body : this.inputWrapper.container,\n offsetY: OFFSETVAL,\n open: function () {\n _this.popupWrapper.style.visibility = 'visible';\n addClass([_this.inputWrapper.buttons[0]], SELECTED);\n }, close: function () {\n removeClass([_this.inputWrapper.buttons[0]], SELECTED);\n _this.unWireListEvents();\n _this.inputElement.setAttribute('aria-activedescendant', 'null');\n remove(_this.popupObj.element);\n _this.popupObj.destroy();\n _this.popupWrapper.innerHTML = '';\n _this.listWrapper = _this.popupWrapper = _this.listTag = undefined;\n }, targetExitViewport: function () {\n if (!Browser.isDevice) {\n _this.hide();\n }\n }\n });\n if (!Browser.isDevice) {\n this.popupObj.collision = { X: 'none', Y: 'flip' };\n }\n this.popupObj.element.style.maxHeight = POPUPDIMENSION;\n };\n //util function\n TimePicker.prototype.getFormattedValue = function (value) {\n if (isNullOrUndefined(this.checkDateValue(value))) {\n return null;\n }\n else {\n return this.globalize.formatDate(value, { skeleton: 'medium', type: 'time' });\n }\n };\n TimePicker.prototype.getDateObject = function (text) {\n if (!this.isNullOrEmpty(text)) {\n var dateValue = this.createDateObj(text);\n var value = !this.isNullOrEmpty(this.initValue);\n if (this.checkDateValue(dateValue)) {\n var date = value ? this.initValue.getDate() : DAY;\n var month = value ? this.initValue.getMonth() : MONTH;\n var year = value ? this.initValue.getFullYear() : YEAR;\n return new Date(year, month, date, dateValue.getHours(), dateValue.getMinutes(), dateValue.getSeconds());\n }\n }\n return null;\n };\n TimePicker.prototype.updateHtmlAttributeToWrapper = function () {\n if (!isNullOrUndefined(this.htmlAttributes)) {\n for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {\n var key = _a[_i];\n if (wrapperAttributes.indexOf(key) > -1) {\n if (key === 'class') {\n var updatedClassesValue = (this.htmlAttributes[key].replace(/\\s+/g, ' ')).trim();\n if (updatedClassesValue !== '') {\n addClass([this.inputWrapper.container], updatedClassesValue.split(' '));\n }\n }\n else if (key === 'style') {\n var timeStyle = this.inputWrapper.container.getAttribute(key);\n timeStyle = !isNullOrUndefined(timeStyle) ? (timeStyle + this.htmlAttributes[key]) :\n this.htmlAttributes[key];\n this.inputWrapper.container.setAttribute(key, timeStyle);\n }\n else {\n this.inputWrapper.container.setAttribute(key, this.htmlAttributes[key]);\n }\n }\n }\n }\n };\n TimePicker.prototype.updateHtmlAttributeToElement = function () {\n if (!isNullOrUndefined(this.htmlAttributes)) {\n for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {\n var key = _a[_i];\n if (wrapperAttributes.indexOf(key) < 0) {\n this.inputElement.setAttribute(key, this.htmlAttributes[key]);\n }\n }\n }\n };\n TimePicker.prototype.updateCssClass = function (cssClassNew, cssClassOld) {\n if (!isNullOrUndefined(cssClassOld)) {\n cssClassOld = (cssClassOld.replace(/\\s+/g, ' ')).trim();\n }\n if (!isNullOrUndefined(cssClassNew)) {\n cssClassNew = (cssClassNew.replace(/\\s+/g, ' ')).trim();\n }\n Input.setCssClass(cssClassNew, [this.inputWrapper.container], cssClassOld);\n if (this.popupWrapper) {\n Input.setCssClass(cssClassNew, [this.popupWrapper], cssClassOld);\n }\n };\n TimePicker.prototype.removeErrorClass = function () {\n removeClass([this.inputWrapper.container], ERROR);\n attributes(this.inputElement, { 'aria-invalid': 'false' });\n };\n TimePicker.prototype.checkErrorState = function (val) {\n var value = this.getDateObject(val);\n if ((this.validateState(value) && !this.invalidValueString) || (this.enableMask && this.inputElement.value === this.maskedDateValue)) {\n this.removeErrorClass();\n }\n else {\n addClass([this.inputWrapper.container], ERROR);\n attributes(this.inputElement, { 'aria-invalid': 'true' });\n }\n };\n TimePicker.prototype.validateInterval = function () {\n if (!isNullOrUndefined(this.step) && this.step > 0) {\n this.enableElement([this.inputWrapper.buttons[0]]);\n }\n else {\n this.disableTimeIcon();\n }\n };\n TimePicker.prototype.disableTimeIcon = function () {\n this.disableElement([this.inputWrapper.buttons[0]]);\n this.hide();\n };\n TimePicker.prototype.disableElement = function (element) {\n addClass(element, DISABLED);\n };\n TimePicker.prototype.enableElement = function (element) {\n removeClass(element, DISABLED);\n };\n TimePicker.prototype.selectInputText = function () {\n this.inputElement.setSelectionRange(0, (this.inputElement).value.length);\n };\n TimePicker.prototype.setCursorToEnd = function () {\n this.inputElement.setSelectionRange((this.inputElement).value.length, (this.inputElement).value.length);\n };\n TimePicker.prototype.getMeridianText = function () {\n var meridian;\n if (this.locale === 'en' || this.locale === 'en-US') {\n meridian = getValue('dayPeriods.format.wide', getDefaultDateObject());\n }\n else {\n var gregorianFormat = '.dates.calendars.gregorian.dayPeriods.format.abbreviated';\n var mainVal = 'main.';\n meridian = getValue(mainVal + '' + this.locale + gregorianFormat, cldrData);\n }\n return meridian;\n };\n TimePicker.prototype.getCursorSelection = function () {\n var input = (this.inputElement);\n var start = 0;\n var end = 0;\n if (!isNaN(input.selectionStart)) {\n start = input.selectionStart;\n end = input.selectionEnd;\n }\n return { start: Math.abs(start), end: Math.abs(end) };\n };\n TimePicker.prototype.getActiveElement = function () {\n if (!isNullOrUndefined(this.popupWrapper)) {\n return this.popupWrapper.querySelectorAll('.' + SELECTED);\n }\n else {\n return null;\n }\n };\n TimePicker.prototype.isNullOrEmpty = function (value) {\n if (isNullOrUndefined(value) || (typeof value === 'string' && value.trim() === '')) {\n return true;\n }\n else {\n return false;\n }\n };\n TimePicker.prototype.setWidth = function (width) {\n if (typeof width === 'number') {\n width = formatUnit(width);\n }\n else if (typeof width === 'string') {\n width = (width.match(/px|%|em/)) ? width : formatUnit(width);\n }\n else {\n width = '100%';\n }\n return width;\n };\n TimePicker.prototype.setPopupWidth = function (width) {\n width = this.setWidth(width);\n if (width.indexOf('%') > -1) {\n var inputWidth = this.containerStyle.width * parseFloat(width) / 100;\n width = inputWidth.toString() + 'px';\n }\n return width;\n };\n TimePicker.prototype.setScrollPosition = function () {\n var element = this.selectedElement;\n if (!isNullOrUndefined(element)) {\n this.findScrollTop(element);\n }\n else if (this.popupWrapper && this.checkDateValue(this.scrollTo)) {\n this.setScrollTo();\n }\n };\n TimePicker.prototype.findScrollTop = function (element) {\n var listHeight = this.getPopupHeight();\n var nextEle = element.nextElementSibling;\n var height = nextEle ? nextEle.offsetTop : element.offsetTop;\n var liHeight = element.getBoundingClientRect().height;\n if ((height + element.offsetTop) > listHeight) {\n this.popupWrapper.scrollTop = nextEle ? (height - (listHeight / HALFPOSITION + liHeight / HALFPOSITION)) : height;\n }\n else {\n this.popupWrapper.scrollTop = 0;\n }\n };\n TimePicker.prototype.setScrollTo = function () {\n var element;\n if (!isNullOrUndefined(this.popupWrapper)) {\n var items = this.popupWrapper.querySelectorAll('.' + LISTCLASS);\n if (items.length) {\n var initialTime = this.timeCollections[0];\n var scrollTime = this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();\n element = items[Math.round((scrollTime - initialTime) / (this.step * 60000))];\n }\n }\n else {\n this.popupWrapper.scrollTop = 0;\n }\n if (!isNullOrUndefined(element)) {\n this.findScrollTop(element);\n }\n else {\n this.popupWrapper.scrollTop = 0;\n }\n };\n TimePicker.prototype.getText = function () {\n return (isNullOrUndefined(this.checkDateValue(this.value))) ? '' : this.getValue(this.value);\n };\n TimePicker.prototype.getValue = function (value) {\n return (isNullOrUndefined(this.checkDateValue(value))) ? null : this.globalize.formatDate(value, {\n format: this.cldrTimeFormat(), type: 'time'\n });\n };\n TimePicker.prototype.cldrDateFormat = function () {\n var cldrDate;\n if (this.locale === 'en' || this.locale === 'en-US') {\n cldrDate = (getValue('dateFormats.short', getDefaultDateObject()));\n }\n else {\n cldrDate = (this.getCultureDateObject(cldrData, '' + this.locale));\n }\n return cldrDate;\n };\n TimePicker.prototype.cldrTimeFormat = function () {\n var cldrTime;\n if (this.isNullOrEmpty(this.formatString)) {\n if (this.locale === 'en' || this.locale === 'en-US') {\n cldrTime = (getValue('timeFormats.short', getDefaultDateObject()));\n }\n else {\n cldrTime = (this.getCultureTimeObject(cldrData, '' + this.locale));\n }\n }\n else {\n cldrTime = this.formatString;\n }\n return cldrTime;\n };\n TimePicker.prototype.dateToNumeric = function () {\n var cldrTime;\n if (this.locale === 'en' || this.locale === 'en-US') {\n cldrTime = (getValue('timeFormats.medium', getDefaultDateObject()));\n }\n else {\n cldrTime = (getValue('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.medium', cldrData));\n }\n return cldrTime;\n };\n TimePicker.prototype.getExactDateTime = function (value) {\n if (isNullOrUndefined(this.checkDateValue(value))) {\n return null;\n }\n else {\n return this.globalize.formatDate(value, { format: this.dateToNumeric(), type: 'time' });\n }\n };\n TimePicker.prototype.setValue = function (value) {\n var time = this.checkValue(value);\n if (!this.strictMode && !this.validateState(time)) {\n if (this.checkDateValue(this.valueWithMinutes) === null) {\n this.initValue = this.valueWithMinutes = null;\n }\n this.validateMinMax(this.value, this.min, this.max);\n }\n else {\n if (this.isNullOrEmpty(time)) {\n this.initValue = null;\n this.validateMinMax(this.value, this.min, this.max);\n }\n else {\n this.initValue = this.compareFormatChange(time);\n }\n }\n this.updateInput(true, this.initValue);\n };\n TimePicker.prototype.compareFormatChange = function (value) {\n if (isNullOrUndefined(value)) {\n return null;\n }\n return (value !== this.getText()) ? this.getDateObject(value) : this.getDateObject(this.value);\n };\n TimePicker.prototype.updatePlaceHolder = function () {\n Input.setPlaceholder(this.l10n.getConstant('placeholder'), this.inputElement);\n };\n //event related functions\n TimePicker.prototype.updateInputValue = function (value) {\n Input.setValue(value, this.inputElement, this.floatLabelType, this.showClearButton);\n };\n TimePicker.prototype.preventEventBubbling = function (e) {\n e.preventDefault();\n this.interopAdaptor.invokeMethodAsync('OnTimeIconClick');\n };\n TimePicker.prototype.popupHandler = function (e) {\n if (!this.enabled) {\n return;\n }\n if (Browser.isDevice) {\n this.inputElement.setAttribute('readonly', '');\n }\n e.preventDefault();\n if (this.isPopupOpen()) {\n this.closePopup(0, e);\n }\n else {\n this.inputElement.focus();\n this.show(e);\n }\n };\n TimePicker.prototype.mouseDownHandler = function () {\n if (!this.enabled) {\n return;\n }\n if (!this.readonly) {\n this.inputElement.setSelectionRange(0, 0);\n EventHandler.add(this.inputElement, 'mouseup', this.mouseUpHandler, this);\n }\n };\n TimePicker.prototype.mouseUpHandler = function (event) {\n if (!this.readonly) {\n event.preventDefault();\n if (this.enableMask) {\n event.preventDefault();\n this.notify(\"setMaskSelection\", {\n module: \"MaskedDateTime\"\n });\n return;\n }\n else {\n EventHandler.remove(this.inputElement, 'mouseup', this.mouseUpHandler);\n var curPos = this.getCursorSelection();\n if (!(curPos.start === 0 && curPos.end === this.inputElement.value.length)) {\n if (this.inputElement.value.length > 0) {\n this.cursorDetails = this.focusSelection();\n }\n this.inputElement.setSelectionRange(this.cursorDetails.start, this.cursorDetails.end);\n }\n }\n }\n };\n TimePicker.prototype.focusSelection = function () {\n var regex = new RegExp('^[a-zA-Z0-9]+$');\n var split = this.inputElement.value.split('');\n split.push(' ');\n var curPos = this.getCursorSelection();\n var start = 0;\n var end = 0;\n var isSeparator = false;\n if (!this.isTextSelected) {\n for (var i = 0; i < split.length; i++) {\n if (!regex.test(split[i])) {\n end = i;\n isSeparator = true;\n }\n if (isSeparator) {\n if (curPos.start >= start && curPos.end <= end) {\n // eslint-disable-next-line no-self-assign\n end = end;\n this.isTextSelected = true;\n break;\n }\n else {\n start = i + 1;\n isSeparator = false;\n }\n }\n }\n }\n else {\n start = curPos.start;\n end = curPos.end;\n this.isTextSelected = false;\n }\n return { start: start, end: end };\n };\n TimePicker.prototype.inputHandler = function (event) {\n if (!this.readonly && this.enabled) {\n if (event.action !== 'right' && event.action !== 'left' && event.action !== 'tab') {\n event.preventDefault();\n }\n switch (event.action) {\n case 'home':\n case 'end':\n case 'up':\n case 'down':\n if (this.enableMask && !this.readonly && !this.isPopupOpen()) {\n event.preventDefault();\n this.notify(\"keyDownHandler\", {\n module: \"MaskedDateTime\",\n e: event\n });\n }\n if (!this.enableMask || this.isPopupOpen()) {\n this.keyHandler(event);\n }\n break;\n case 'enter':\n if (this.isNavigate) {\n this.selectedElement = this.liCollections[this.activeIndex];\n this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);\n this.updateValue(this.valueWithMinutes, event);\n }\n else {\n this.updateValue(this.inputElement.value, event);\n }\n this.hide();\n this.isNavigate = false;\n if (this.isPopupOpen()) {\n event.stopPropagation();\n }\n break;\n case 'open':\n this.show(event);\n break;\n case 'escape':\n this.updateInputValue(this.objToString(this.value));\n if (this.enableMask) {\n if (!this.value) {\n this.updateInputValue(this.maskedDateValue);\n }\n this.createMask();\n }\n this.previousState(this.value);\n this.hide();\n break;\n case 'close':\n this.hide();\n break;\n case 'right':\n case 'left':\n case 'tab':\n case 'shiftTab':\n if (!this.isPopupOpen() && this.enableMask && !this.readonly) {\n if ((this.inputElement.selectionStart == 0 && this.inputElement.selectionEnd == this.inputElement.value.length) ||\n (this.inputElement.selectionEnd !== this.inputElement.value.length && event.action == 'tab') ||\n (this.inputElement.selectionStart !== 0 && event.action == 'shiftTab') || (event.action == 'left' || event.action == 'right')) {\n event.preventDefault();\n }\n this.notify(\"keyDownHandler\", { module: \"MaskedDateTime\",\n e: event\n });\n }\n break;\n default:\n this.isNavigate = false;\n break;\n }\n }\n };\n TimePicker.prototype.onMouseClick = function (event) {\n var target = event.target;\n var li = this.selectedElement = closest(target, '.' + LISTCLASS);\n this.setSelection(li, event);\n if (li && li.classList.contains(LISTCLASS)) {\n this.hide();\n }\n };\n TimePicker.prototype.closePopup = function (delay, e) {\n var _this = this;\n if (this.isPopupOpen() && this.popupWrapper) {\n var args = {\n popup: this.popupObj,\n event: e || null,\n cancel: false,\n name: 'open'\n };\n removeClass([document.body], OVERFLOW);\n this.trigger('close', args, function (args) {\n if (!args.cancel) {\n var animModel = {\n name: 'FadeOut',\n duration: ANIMATIONDURATION,\n delay: delay ? delay : 0\n };\n _this.popupObj.hide(new Animation(animModel));\n removeClass([_this.inputWrapper.container], [ICONANIMATION]);\n attributes(_this.inputElement, { 'aria-expanded': 'false' });\n EventHandler.remove(document, 'mousedown touchstart', _this.documentClickHandler);\n }\n if (Browser.isDevice && _this.modal) {\n _this.modal.style.display = 'none';\n _this.modal.outerHTML = '';\n _this.modal = null;\n }\n if (Browser.isDevice) {\n if (!isNullOrUndefined(_this.mobileTimePopupWrap)) {\n _this.mobileTimePopupWrap.remove();\n _this.mobileTimePopupWrap = null;\n }\n }\n if (Browser.isDevice && _this.allowEdit && !_this.readonly) {\n _this.inputElement.removeAttribute('readonly');\n }\n });\n }\n else {\n if (Browser.isDevice && this.allowEdit && !this.readonly) {\n this.inputElement.removeAttribute('readonly');\n }\n }\n };\n TimePicker.prototype.disposeServerPopup = function () {\n if (this.popupWrapper) {\n this.popupWrapper.style.visibility = 'hidden';\n this.popupWrapper.style.top = '-9999px';\n this.popupWrapper.style.left = '-9999px';\n this.popupWrapper.style.width = '0px';\n this.popupWrapper.style.height = '0px';\n }\n };\n TimePicker.prototype.checkValueChange = function (event, isNavigation) {\n if (!this.strictMode && !this.validateState(this.valueWithMinutes)) {\n if (this.checkDateValue(this.valueWithMinutes) === null) {\n this.initValue = this.valueWithMinutes = null;\n }\n this.setProperties({ value: this.compareFormatChange(this.inputElement.value) }, true);\n this.initValue = this.valueWithMinutes = this.compareFormatChange(this.inputElement.value);\n this.prevValue = this.inputElement.value;\n if (+this.prevDate !== +this.value) {\n this.changeEvent(event);\n }\n }\n else {\n if (!isNavigation) {\n if ((this.prevValue !== this.inputElement.value) || isNullOrUndefined(this.checkDateValue(this.value))) {\n this.valueProcess(event, this.compareFormatChange(this.inputElement.value));\n }\n }\n else {\n var value = this.getDateObject(new Date(this.timeCollections[this.activeIndex]));\n if (+this.prevDate !== +value) {\n this.valueProcess(event, value);\n }\n }\n }\n };\n TimePicker.prototype.onMouseOver = function (event) {\n var currentLi = closest(event.target, '.' + LISTCLASS);\n this.setHover(currentLi, HOVER);\n };\n TimePicker.prototype.setHover = function (li, className) {\n if (this.enabled && this.isValidLI(li) && !li.classList.contains(className)) {\n this.removeHover(className);\n addClass([li], className);\n if (className === NAVIGATION) {\n li.setAttribute('aria-selected', 'true');\n }\n }\n };\n TimePicker.prototype.setSelection = function (li, event) {\n if (this.isValidLI(li)) {\n this.checkValue(li.getAttribute('data-value'));\n if (this.enableMask) {\n this.notify(\"setMaskSelection\", {\n module: \"MaskedDateTime\"\n });\n }\n this.selectedElement = li;\n this.activeIndex = Array.prototype.slice.call(this.liCollections).indexOf(li);\n this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);\n addClass([this.selectedElement], SELECTED);\n this.selectedElement.setAttribute('aria-selected', 'true');\n this.checkValueChange(event, true);\n }\n };\n TimePicker.prototype.onMouseLeave = function () {\n this.removeHover(HOVER);\n };\n TimePicker.prototype.scrollHandler = function () {\n if (this.getModuleName() === 'timepicker' && Browser.isDevice) {\n return;\n }\n else {\n this.hide();\n }\n };\n TimePicker.prototype.setMinMax = function (minVal, maxVal) {\n if (isNullOrUndefined(this.checkDateValue(minVal))) {\n this.initMin = this.getDateObject('12:00:00 AM');\n }\n if (isNullOrUndefined(this.checkDateValue(maxVal))) {\n this.initMax = this.getDateObject('11:59:59 PM');\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TimePicker.prototype.validateMinMax = function (dateVal, minVal, maxVal) {\n var value = dateVal instanceof Date ? dateVal : this.getDateObject(dateVal);\n if (!isNullOrUndefined(this.checkDateValue(value))) {\n dateVal = this.strictOperation(this.initMin, this.initMax, dateVal, value);\n }\n else if (+(this.createDateObj(this.getFormattedValue(this.initMin))) >\n +(this.createDateObj(this.getFormattedValue(this.initMax)))) {\n this.disableTimeIcon();\n }\n if (this.strictMode) {\n dateVal = this.valueIsDisable(dateVal) ? dateVal : null;\n }\n this.checkErrorState(dateVal);\n return dateVal;\n };\n TimePicker.prototype.valueIsDisable = function (value) {\n if (this.disableItemCollection.length > 0) {\n if (this.disableItemCollection.length === this.timeCollections.length) {\n return false;\n }\n var time = value instanceof Date ? this.objToString(value) : value;\n for (var index = 0; index < this.disableItemCollection.length; index++) {\n if (time === this.disableItemCollection[index]) {\n return false;\n }\n }\n }\n return true;\n };\n TimePicker.prototype.validateState = function (val) {\n if (!this.strictMode) {\n if (this.valueIsDisable(val)) {\n var value = typeof val === 'string' ? this.setCurrentDate(this.getDateObject(val)) :\n this.setCurrentDate(this.getDateObject(val));\n var maxValue = this.setCurrentDate(this.getDateObject(this.initMax));\n var minValue = this.setCurrentDate(this.getDateObject(this.initMin));\n if (!isNullOrUndefined(this.checkDateValue(value))) {\n if ((+(value) > +(maxValue)) || (+(value) < +(minValue))) {\n return false;\n }\n }\n else {\n if ((+(maxValue) < +(minValue)) || this.inputElement.value !== '') {\n return false;\n }\n }\n }\n else {\n return false;\n }\n }\n return true;\n };\n TimePicker.prototype.strictOperation = function (minimum, maximum, dateVal, val) {\n var maxValue = this.createDateObj(this.getFormattedValue(maximum));\n var minValue = this.createDateObj(this.getFormattedValue(minimum));\n var value = this.createDateObj(this.getFormattedValue(val));\n if (this.strictMode) {\n if (+minValue > +maxValue) {\n this.disableTimeIcon();\n this.initValue = this.getDateObject(maxValue);\n this.updateInputValue(this.getValue(this.initValue));\n if (this.enableMask) {\n this.createMask();\n }\n return this.inputElement.value;\n }\n else if (+minValue >= +value) {\n return this.getDateObject(minValue);\n }\n else if (+value >= +maxValue || +minValue === +maxValue) {\n return this.getDateObject(maxValue);\n }\n }\n else {\n if (+minValue > +maxValue) {\n this.disableTimeIcon();\n if (!isNaN(+this.createDateObj(dateVal))) {\n return dateVal;\n }\n }\n }\n return dateVal;\n };\n TimePicker.prototype.bindEvents = function () {\n EventHandler.add(this.inputWrapper.buttons[0], 'mousedown', this.popupHandler, this);\n EventHandler.add(this.inputElement, 'blur', this.inputBlurHandler, this);\n EventHandler.add(this.inputElement, 'focus', this.inputFocusHandler, this);\n EventHandler.add(this.inputElement, 'change', this.inputChangeHandler, this);\n EventHandler.add(this.inputElement, 'input', this.inputEventHandler, this);\n if (this.enableMask) {\n EventHandler.add(this.inputElement, 'keydown', this.keydownHandler, this);\n }\n if (this.showClearButton && this.inputWrapper.clearButton) {\n EventHandler.add(this.inputWrapper.clearButton, 'mousedown', this.clearHandler, this);\n }\n if (this.formElement) {\n EventHandler.add(this.formElement, 'reset', this.formResetHandler, this);\n }\n if (!Browser.isDevice) {\n this.keyConfigure = extend(this.keyConfigure, this.keyConfigs);\n this.inputEvent = new KeyboardEvents(this.inputWrapper.container, {\n keyAction: this.inputHandler.bind(this),\n keyConfigs: this.keyConfigure,\n eventName: 'keydown'\n });\n if (this.showClearButton && this.inputElement) {\n EventHandler.add(this.inputElement, 'mousedown', this.mouseDownHandler, this);\n }\n }\n };\n TimePicker.prototype.keydownHandler = function (e) {\n switch (e.code) {\n case 'Delete':\n if (this.enableMask && !this.popupObj && !this.readonly) {\n this.notify(\"keyDownHandler\", {\n module: \"MaskedDateTime\",\n e: e\n });\n }\n break;\n default:\n break;\n }\n };\n TimePicker.prototype.formResetHandler = function () {\n if (!this.enabled) {\n return;\n }\n if (!this.inputElement.disabled) {\n var timeValue = this.inputElement.getAttribute('value');\n var val = this.checkDateValue(this.inputEleValue);\n if (this.element.tagName === 'EJS-TIMEPICKER') {\n val = null;\n timeValue = '';\n this.inputElement.setAttribute('value', '');\n }\n this.setProperties({ value: val }, true);\n this.prevDate = this.value;\n this.valueWithMinutes = this.value;\n this.initValue = this.value;\n if (this.inputElement) {\n this.updateInputValue(timeValue);\n if (this.enableMask) {\n if (!timeValue) {\n this.updateInputValue(this.maskedDateValue);\n }\n this.createMask();\n }\n this.checkErrorState(timeValue);\n this.prevValue = this.inputElement.value;\n }\n }\n };\n TimePicker.prototype.inputChangeHandler = function (e) {\n if (!this.enabled) {\n return;\n }\n e.stopPropagation();\n };\n TimePicker.prototype.inputEventHandler = function () {\n if (this.enableMask) {\n this.notify(\"inputHandler\", {\n module: \"MaskedDateTime\"\n });\n }\n };\n TimePicker.prototype.unBindEvents = function () {\n if (this.inputWrapper) {\n EventHandler.remove(this.inputWrapper.buttons[0], 'mousedown touchstart', this.popupHandler);\n }\n EventHandler.remove(this.inputElement, 'blur', this.inputBlurHandler);\n EventHandler.remove(this.inputElement, 'focus', this.inputFocusHandler);\n EventHandler.remove(this.inputElement, 'change', this.inputChangeHandler);\n EventHandler.remove(this.inputElement, 'input', this.inputEventHandler);\n if (this.inputEvent) {\n this.inputEvent.destroy();\n }\n EventHandler.remove(this.inputElement, 'mousedown touchstart', this.mouseDownHandler);\n if (this.showClearButton && !isNullOrUndefined(this.inputWrapper.clearButton)) {\n EventHandler.remove(this.inputWrapper.clearButton, 'mousedown touchstart', this.clearHandler);\n }\n if (this.formElement) {\n EventHandler.remove(this.formElement, 'reset', this.formResetHandler);\n }\n };\n TimePicker.prototype.bindClearEvent = function () {\n if (this.showClearButton && this.inputWrapper.clearButton) {\n EventHandler.add(this.inputWrapper.clearButton, 'mousedown', this.clearHandler, this);\n }\n };\n TimePicker.prototype.raiseClearedEvent = function (e) {\n var clearedArgs = {\n event: e\n };\n this.trigger('cleared', clearedArgs);\n };\n TimePicker.prototype.clearHandler = function (e) {\n if (!this.enabled) {\n return;\n }\n e.preventDefault();\n if (!isNullOrUndefined(this.value)) {\n this.clear(e);\n }\n else {\n this.resetState();\n this.raiseClearedEvent(e);\n }\n if (this.popupWrapper) {\n this.popupWrapper.scrollTop = 0;\n }\n if (this.enableMask) {\n this.notify(\"clearHandler\", {\n module: \"MaskedDateTime\"\n });\n }\n };\n TimePicker.prototype.clear = function (event) {\n this.setProperties({ value: null }, true);\n this.initValue = null;\n this.resetState();\n this.raiseClearedEvent(event);\n this.changeEvent(event);\n };\n TimePicker.prototype.setZIndex = function () {\n if (this.popupObj) {\n this.popupObj.zIndex = this.zIndex;\n this.popupObj.dataBind();\n }\n };\n TimePicker.prototype.checkAttributes = function (isDynamic) {\n var attributes = isDynamic ? isNullOrUndefined(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :\n ['step', 'disabled', 'readonly', 'style', 'name', 'value', 'min', 'max', 'placeholder'];\n var value;\n for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {\n var prop = attributes_1[_i];\n if (!isNullOrUndefined(this.inputElement.getAttribute(prop))) {\n switch (prop) {\n case 'disabled':\n if ((isNullOrUndefined(this.timeOptions) || (this.timeOptions['enabled'] === undefined)) || isDynamic) {\n var enabled = this.inputElement.getAttribute(prop) === 'disabled' ||\n this.inputElement.getAttribute(prop) === '' || this.inputElement.getAttribute(prop) === 'true' ? false : true;\n this.setProperties({ enabled: enabled }, !isDynamic);\n }\n break;\n case 'style':\n this.inputStyle = this.inputElement.getAttribute(prop);\n break;\n case 'readonly':\n if ((isNullOrUndefined(this.timeOptions) || (this.timeOptions['readonly'] === undefined)) || isDynamic) {\n var readonly = this.inputElement.getAttribute(prop) === 'readonly' ||\n this.inputElement.getAttribute(prop) === '' || this.inputElement.getAttribute(prop) === 'true' ? true : false;\n this.setProperties({ readonly: readonly }, !isDynamic);\n }\n break;\n case 'name':\n this.inputElement.setAttribute('name', this.inputElement.getAttribute(prop));\n break;\n case 'step':\n this.step = parseInt(this.inputElement.getAttribute(prop), 10);\n break;\n case 'placeholder':\n if ((isNullOrUndefined(this.timeOptions) || (this.timeOptions['placeholder'] === undefined)) || isDynamic) {\n this.setProperties({ placeholder: this.inputElement.getAttribute(prop) }, !isDynamic);\n }\n break;\n case 'min':\n if ((isNullOrUndefined(this.timeOptions) || (this.timeOptions['min'] === undefined)) || isDynamic) {\n value = new Date(this.inputElement.getAttribute(prop));\n if (!isNullOrUndefined(this.checkDateValue(value))) {\n this.setProperties({ min: value }, !isDynamic);\n }\n }\n break;\n case 'max':\n if ((isNullOrUndefined(this.timeOptions) || (this.timeOptions['max'] === undefined)) || isDynamic) {\n value = new Date(this.inputElement.getAttribute(prop));\n if (!isNullOrUndefined(this.checkDateValue(value))) {\n this.setProperties({ max: value }, !isDynamic);\n }\n }\n break;\n case 'value':\n if ((isNullOrUndefined(this.timeOptions) || (this.timeOptions['value'] === undefined)) || isDynamic) {\n value = new Date(this.inputElement.getAttribute(prop));\n if (!isNullOrUndefined(this.checkDateValue(value))) {\n this.initValue = value;\n this.updateInput(false, this.initValue);\n this.setProperties({ value: value }, !isDynamic);\n }\n }\n break;\n }\n }\n }\n };\n TimePicker.prototype.setCurrentDate = function (value) {\n if (isNullOrUndefined(this.checkDateValue(value))) {\n return null;\n }\n return new Date(YEAR, MONTH, DAY, value.getHours(), value.getMinutes(), value.getSeconds());\n };\n TimePicker.prototype.getTextFormat = function () {\n var time = 0;\n if (this.cldrTimeFormat().split(' ')[0] === 'a' || this.cldrTimeFormat().indexOf('a') === 0) {\n time = 1;\n }\n else if (this.cldrTimeFormat().indexOf('a') < 0) {\n var strArray = this.cldrTimeFormat().split(' ');\n for (var i = 0; i < strArray.length; i++) {\n if (strArray[i].toLowerCase().indexOf('h') >= 0) {\n time = i;\n break;\n }\n }\n }\n return time;\n };\n TimePicker.prototype.updateValue = function (value, event) {\n var val;\n if (this.isNullOrEmpty(value)) {\n this.resetState();\n }\n else {\n val = this.checkValue(value);\n if (this.strictMode) {\n // this case set previous value to the text box when set invalid date\n var inputVal = (val === null && value.trim().length > 0) ?\n this.previousState(this.prevDate) : this.inputElement.value;\n this.updateInputValue(inputVal);\n if (this.enableMask) {\n if (!inputVal) {\n this.updateInputValue(this.maskedDateValue);\n }\n this.createMask();\n }\n }\n }\n this.checkValueChange(event, typeof value === 'string' ? false : true);\n };\n TimePicker.prototype.previousState = function (date) {\n var value = this.getDateObject(date);\n for (var i = 0; i < this.timeCollections.length; i++) {\n if (+value === this.timeCollections[i]) {\n this.activeIndex = i;\n this.selectedElement = this.liCollections[i];\n this.valueWithMinutes = new Date(this.timeCollections[i]);\n break;\n }\n }\n return this.prevValue;\n };\n TimePicker.prototype.resetState = function () {\n this.removeSelection();\n Input.setValue('', this.inputElement, this.floatLabelType, false);\n this.valueWithMinutes = this.activeIndex = null;\n if (!this.strictMode) {\n this.checkErrorState(null);\n }\n };\n TimePicker.prototype.objToString = function (val) {\n if (isNullOrUndefined(this.checkDateValue(val))) {\n return null;\n }\n else {\n return this.globalize.formatDate(val, { format: this.cldrTimeFormat(), type: 'time' });\n }\n };\n TimePicker.prototype.checkValue = function (value) {\n if (!this.isNullOrEmpty(value)) {\n var date = value instanceof Date ? value : this.getDateObject(value);\n return this.validateValue(date, value);\n }\n this.resetState();\n return this.valueWithMinutes = null;\n };\n TimePicker.prototype.validateValue = function (date, value) {\n var time;\n var val = this.validateMinMax(value, this.min, this.max);\n var newval = this.createDateObj(val);\n if (this.getFormattedValue(newval) !== this.getFormattedValue(this.value)) {\n this.valueWithMinutes = isNullOrUndefined(newval) ? null : newval;\n time = this.objToString(this.valueWithMinutes);\n }\n else {\n if (this.strictMode) {\n //for strict mode case, when value not present within a range. Reset the nearest range value.\n date = newval;\n }\n this.valueWithMinutes = this.checkDateValue(date);\n time = this.objToString(this.valueWithMinutes);\n }\n if (!this.strictMode && isNullOrUndefined(time)) {\n var value_1 = val.trim().length > 0 ? val : '';\n this.updateInputValue(value_1);\n if (this.enableMask) {\n if (!value_1) {\n this.updateInputValue(this.maskedDateValue);\n }\n }\n }\n else {\n this.updateInputValue(time);\n if (this.enableMask) {\n if (time == '') {\n this.updateInputValue(this.maskedDateValue);\n }\n this.createMask();\n }\n }\n return time;\n };\n TimePicker.prototype.createMask = function () {\n this.notify(\"createMask\", {\n module: \"MaskedDateTime\",\n });\n };\n TimePicker.prototype.findNextElement = function (event) {\n var textVal = (this.inputElement).value;\n var value = isNullOrUndefined(this.valueWithMinutes) ? this.createDateObj(textVal) :\n this.getDateObject(this.valueWithMinutes);\n var timeVal = null;\n var count = this.liCollections.length;\n var collections = this.timeCollections;\n if (!isNullOrUndefined(this.checkDateValue(value)) || !isNullOrUndefined(this.activeIndex)) {\n if (event.action === 'home') {\n var index = this.validLiElement(0);\n timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));\n this.activeIndex = index;\n }\n else if (event.action === 'end') {\n var index = this.validLiElement(collections.length - 1, true);\n timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));\n this.activeIndex = index;\n }\n else {\n if (event.action === 'down') {\n for (var i = 0; i < count; i++) {\n if (+value < this.timeCollections[i]) {\n var index = this.validLiElement(i);\n timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));\n this.activeIndex = index;\n break;\n }\n else if (i === count - 1) {\n var index = this.validLiElement(0);\n timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));\n this.activeIndex = index;\n break;\n }\n }\n }\n else {\n for (var i = count - 1; i >= 0; i--) {\n if (+value > this.timeCollections[i]) {\n var index = this.validLiElement(i, true);\n timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));\n this.activeIndex = index;\n break;\n }\n else if (i === 0) {\n var index = this.validLiElement(count - 1);\n timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));\n this.activeIndex = index;\n break;\n }\n }\n }\n }\n this.selectedElement = this.liCollections[this.activeIndex];\n this.elementValue(isNullOrUndefined(timeVal) ? null : new Date(timeVal));\n }\n else {\n this.selectNextItem(event);\n }\n };\n TimePicker.prototype.selectNextItem = function (event) {\n var index = this.validLiElement(0, event.action === 'down' ? false : true);\n this.activeIndex = index;\n this.selectedElement = this.liCollections[index];\n this.elementValue(new Date(this.timeCollections[index]));\n };\n TimePicker.prototype.elementValue = function (value) {\n if (!isNullOrUndefined(this.checkDateValue(value))) {\n this.checkValue(value);\n }\n };\n TimePicker.prototype.validLiElement = function (index, backward) {\n var elementIndex = null;\n var items = isNullOrUndefined(this.popupWrapper) ? this.liCollections :\n this.popupWrapper.querySelectorAll('.' + LISTCLASS);\n var isCheck = true;\n if (items.length) {\n if (backward) {\n for (var i = index; i >= 0; i--) {\n if (!items[i].classList.contains(DISABLED)) {\n elementIndex = i;\n break;\n }\n else if (i === 0) {\n if (isCheck) {\n index = i = items.length;\n isCheck = false;\n }\n }\n }\n }\n else {\n for (var i = index; i <= items.length - 1; i++) {\n if (!items[i].classList.contains(DISABLED)) {\n elementIndex = i;\n break;\n }\n else if (i === items.length - 1) {\n if (isCheck) {\n index = i = -1;\n isCheck = false;\n }\n }\n }\n }\n }\n return elementIndex;\n };\n TimePicker.prototype.keyHandler = function (event) {\n if (isNullOrUndefined(this.step) || this.step <= 0 || this.inputWrapper.buttons[0].classList.contains(DISABLED)) {\n return;\n }\n var count = this.timeCollections.length;\n if (isNullOrUndefined(this.getActiveElement()) || this.getActiveElement().length === 0) {\n if (this.liCollections.length > 0) {\n if (isNullOrUndefined(this.value) && isNullOrUndefined(this.activeIndex)) {\n var index = this.validLiElement(0, event.action === 'down' ? false : true);\n this.activeIndex = index;\n this.selectedElement = this.liCollections[index];\n this.elementValue(new Date(this.timeCollections[index]));\n }\n else {\n this.findNextElement(event);\n }\n }\n else {\n this.findNextElement(event);\n }\n }\n else {\n var nextItem = void 0;\n if ((event.keyCode >= 37) && (event.keyCode <= 40)) {\n var index = (event.keyCode === 40 || event.keyCode === 39) ? ++this.activeIndex : --this.activeIndex;\n this.activeIndex = index = this.activeIndex === (count) ? 0 : this.activeIndex;\n this.activeIndex = index = this.activeIndex < 0 ? (count - 1) : this.activeIndex;\n this.activeIndex = index = this.validLiElement(this.activeIndex, (event.keyCode === 40 || event.keyCode === 39) ?\n false : true);\n nextItem = isNullOrUndefined(this.timeCollections[index]) ? this.timeCollections[0] : this.timeCollections[index];\n }\n else if (event.action === 'home') {\n var index = this.validLiElement(0);\n this.activeIndex = index;\n nextItem = this.timeCollections[index];\n }\n else if (event.action === 'end') {\n var index = this.validLiElement(count - 1, true);\n this.activeIndex = index;\n nextItem = this.timeCollections[index];\n }\n this.selectedElement = this.liCollections[this.activeIndex];\n this.elementValue(new Date(nextItem));\n }\n this.isNavigate = true;\n this.setHover(this.selectedElement, NAVIGATION);\n this.setActiveDescendant();\n this.selectInputText();\n if (this.isPopupOpen() && this.selectedElement !== null && (!event || event.type !== 'click')) {\n this.setScrollPosition();\n }\n };\n TimePicker.prototype.getCultureTimeObject = function (ld, c) {\n return getValue('main.' + c + '.dates.calendars.gregorian.timeFormats.short', ld);\n };\n TimePicker.prototype.getCultureDateObject = function (ld, c) {\n return getValue('main.' + c + '.dates.calendars.gregorian.dateFormats.short', ld);\n };\n TimePicker.prototype.wireListEvents = function () {\n EventHandler.add(this.listWrapper, 'click', this.onMouseClick, this);\n if (!Browser.isDevice) {\n EventHandler.add(this.listWrapper, 'mouseover', this.onMouseOver, this);\n EventHandler.add(this.listWrapper, 'mouseout', this.onMouseLeave, this);\n }\n };\n TimePicker.prototype.unWireListEvents = function () {\n if (this.listWrapper) {\n EventHandler.remove(this.listWrapper, 'click', this.onMouseClick);\n if (!Browser.isDevice) {\n EventHandler.remove(this.listWrapper, 'mouseover', this.onMouseOver);\n EventHandler.remove(this.listWrapper, 'mouseout', this.onMouseLeave);\n }\n }\n };\n TimePicker.prototype.valueProcess = function (event, value) {\n var result = (isNullOrUndefined(this.checkDateValue(value))) ? null : value;\n if (+this.prevDate !== +result) {\n this.initValue = result;\n this.changeEvent(event);\n }\n };\n TimePicker.prototype.changeEvent = function (e) {\n this.addSelection();\n this.updateInput(true, this.initValue);\n var eventArgs = {\n event: (e || null),\n value: this.value,\n text: (this.inputElement).value,\n isInteracted: !isNullOrUndefined(e),\n element: this.element\n };\n eventArgs.value = this.valueWithMinutes || this.getDateObject(this.inputElement.value);\n this.prevDate = this.valueWithMinutes || this.getDateObject(this.inputElement.value);\n if (this.isAngular && this.preventChange) {\n this.preventChange = false;\n }\n else {\n this.trigger('change', eventArgs);\n }\n this.invalidValueString = null;\n this.checkErrorState(this.value);\n };\n TimePicker.prototype.updateInput = function (isUpdate, date) {\n if (isUpdate) {\n this.prevValue = this.getValue(date);\n }\n this.prevDate = this.valueWithMinutes = date;\n if ((typeof date !== 'number') || (this.value && +new Date(+this.value).setMilliseconds(0)) !== +date) {\n this.setProperties({ value: date }, true);\n if (this.enableMask) {\n this.createMask();\n }\n }\n if (!this.strictMode && isNullOrUndefined(this.value) && this.invalidValueString) {\n this.checkErrorState(this.invalidValueString);\n this.updateInputValue(this.invalidValueString);\n }\n this.clearIconState();\n };\n TimePicker.prototype.setActiveDescendant = function () {\n if (!isNullOrUndefined(this.selectedElement)) {\n attributes(this.inputElement, { 'aria-activedescendant': this.selectedElement.getAttribute('id') });\n }\n else {\n attributes(this.inputElement, { 'aria-activedescendant': 'null' });\n }\n };\n TimePicker.prototype.removeSelection = function () {\n this.removeHover(HOVER);\n if (!isNullOrUndefined(this.popupWrapper)) {\n var items = this.popupWrapper.querySelectorAll('.' + SELECTED);\n if (items.length) {\n removeClass(items, SELECTED);\n items[0].removeAttribute('aria-selected');\n }\n }\n };\n TimePicker.prototype.removeHover = function (className) {\n var hoveredItem = this.getHoverItem(className);\n if (hoveredItem && hoveredItem.length) {\n removeClass(hoveredItem, className);\n if (className === NAVIGATION) {\n hoveredItem[0].removeAttribute('aria-selected');\n }\n }\n };\n TimePicker.prototype.getHoverItem = function (className) {\n var hoveredItem;\n if (!isNullOrUndefined(this.popupWrapper)) {\n hoveredItem = this.popupWrapper.querySelectorAll('.' + className);\n }\n return hoveredItem;\n };\n TimePicker.prototype.setActiveClass = function () {\n if (!isNullOrUndefined(this.popupWrapper)) {\n var items = this.popupWrapper.querySelectorAll('.' + LISTCLASS);\n if (items.length) {\n for (var i = 0; i < items.length; i++) {\n if ((this.timeCollections[i] === +this.getDateObject(this.valueWithMinutes))) {\n items[i].setAttribute('aria-selected', 'true');\n this.selectedElement = items[i];\n this.activeIndex = i;\n break;\n }\n }\n }\n }\n };\n TimePicker.prototype.addSelection = function () {\n this.selectedElement = null;\n this.removeSelection();\n this.setActiveClass();\n if (!isNullOrUndefined(this.selectedElement)) {\n addClass([this.selectedElement], SELECTED);\n this.selectedElement.setAttribute('aria-selected', 'true');\n }\n };\n TimePicker.prototype.isValidLI = function (li) {\n return (li && li.classList.contains(LISTCLASS) && !li.classList.contains(DISABLED));\n };\n TimePicker.prototype.createDateObj = function (val) {\n var formatStr = null;\n var today = this.globalize.formatDate(new Date(), { format: formatStr, skeleton: 'short', type: 'date' });\n var value = null;\n if (typeof val === 'string') {\n if (val.toUpperCase().indexOf('AM') > -1 || val.toUpperCase().indexOf('PM') > -1) {\n today = this.defaultCulture.formatDate(new Date(), { format: formatStr, skeleton: 'short', type: 'date' });\n value = isNaN(+new Date(today + ' ' + val)) ? null : new Date(new Date(today + ' ' + val).setMilliseconds(0));\n if (isNullOrUndefined(value)) {\n value = this.timeParse(today, val);\n }\n }\n else {\n value = this.timeParse(today, val);\n }\n }\n else if (val instanceof Date) {\n value = val;\n }\n return value;\n };\n TimePicker.prototype.timeParse = function (today, val) {\n var value;\n value = this.globalize.parseDate(today + ' ' + val, {\n format: this.cldrDateFormat() + ' ' + this.cldrTimeFormat(), type: 'datetime'\n });\n value = isNullOrUndefined(value) ? this.globalize.parseDate(today + ' ' + val, {\n format: this.cldrDateFormat() + ' ' + this.dateToNumeric(), type: 'datetime'\n }) : value;\n value = isNullOrUndefined(value) ? value : new Date(value.setMilliseconds(0));\n return value;\n };\n TimePicker.prototype.createListItems = function () {\n var _this = this;\n this.listWrapper = this.createElement('div', { className: CONTENT, attrs: { 'tabindex': '0' } });\n var start;\n var interval = this.step * 60000;\n var listItems = [];\n this.timeCollections = [];\n this.disableItemCollection = [];\n start = +(this.getDateObject(this.initMin).setMilliseconds(0));\n var end = +(this.getDateObject(this.initMax).setMilliseconds(0));\n while (end >= start) {\n this.timeCollections.push(start);\n listItems.push(this.globalize.formatDate(new Date(start), { format: this.cldrTimeFormat(), type: 'time' }));\n start += interval;\n }\n var listBaseOptions = {\n itemCreated: function (args) {\n var eventArgs = {\n element: args.item,\n text: args.text, value: _this.getDateObject(args.text), isDisabled: false\n };\n _this.trigger('itemRender', eventArgs, function (eventArgs) {\n if (eventArgs.isDisabled) {\n eventArgs.element.classList.add(DISABLED);\n }\n if (eventArgs.element.classList.contains(DISABLED)) {\n _this.disableItemCollection.push(eventArgs.element.getAttribute('data-value'));\n }\n });\n }\n };\n this.listTag = ListBase.createList(this.createElement, listItems, listBaseOptions, true);\n attributes(this.listTag, { 'role': 'listbox', 'aria-hidden': 'false', 'id': this.element.id + '_options' });\n append([this.listTag], this.listWrapper);\n };\n TimePicker.prototype.documentClickHandler = function (event) {\n var target = event.target;\n if ((!isNullOrUndefined(this.popupObj) && (this.inputWrapper.container.contains(target) ||\n (this.popupObj.element && this.popupObj.element.contains(target)))) && event.type !== 'touchstart') {\n event.preventDefault();\n }\n if (!(closest(target, '[id=\"' + this.popupObj.element.id + '\"]')) && target !== this.inputElement\n && target !== (this.inputWrapper && this.inputWrapper.buttons[0]) &&\n target !== (this.inputWrapper && this.inputWrapper.clearButton) &&\n target !== (this.inputWrapper && this.inputWrapper.container)) {\n if (this.isPopupOpen()) {\n this.hide();\n this.focusOut();\n }\n }\n else if (target !== this.inputElement) {\n if (!Browser.isDevice) {\n this.isPreventBlur = (Browser.isIE || Browser.info.name === 'edge') && (document.activeElement === this.inputElement)\n && (target === this.popupWrapper);\n }\n }\n };\n TimePicker.prototype.setEnableRtl = function () {\n Input.setEnableRtl(this.enableRtl, [this.inputWrapper.container]);\n if (this.popupObj) {\n this.popupObj.enableRtl = this.enableRtl;\n this.popupObj.dataBind();\n }\n };\n TimePicker.prototype.setEnable = function () {\n Input.setEnabled(this.enabled, this.inputElement, this.floatLabelType);\n if (this.enabled) {\n removeClass([this.inputWrapper.container], DISABLED);\n attributes(this.inputElement, { 'aria-disabled': 'false' });\n this.inputElement.setAttribute('tabindex', this.tabIndex);\n }\n else {\n this.hide();\n addClass([this.inputWrapper.container], DISABLED);\n attributes(this.inputElement, { 'aria-disabled': 'true' });\n this.inputElement.tabIndex = -1;\n }\n };\n TimePicker.prototype.getProperty = function (date, val) {\n if (val === 'min') {\n this.initMin = this.checkDateValue(new Date(this.checkInValue(date.min)));\n this.setProperties({ min: this.initMin }, true);\n }\n else {\n this.initMax = this.checkDateValue(new Date(this.checkInValue(date.max)));\n this.setProperties({ max: this.initMax }, true);\n }\n if (this.inputElement.value === '') {\n this.validateMinMax(this.value, this.min, this.max);\n }\n else {\n this.checkValue(this.inputElement.value);\n }\n this.checkValueChange(null, false);\n };\n TimePicker.prototype.inputBlurHandler = function (e) {\n if (!this.enabled) {\n return;\n }\n // IE popup closing issue when click over the scrollbar\n if (this.isPreventBlur && this.isPopupOpen()) {\n this.inputElement.focus();\n return;\n }\n this.closePopup(0, e);\n if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {\n if (this.inputElement.value == this.maskedDateValue && !this.value && (this.floatLabelType == 'Auto' || this.floatLabelType == 'Never' || this.placeholder)) {\n this.updateInputValue('');\n }\n }\n removeClass([this.inputWrapper.container], [FOCUS]);\n var blurArguments = {\n model: this\n };\n this.trigger('blur', blurArguments);\n if (this.getText() !== this.inputElement.value) {\n this.updateValue((this.inputElement).value, e);\n }\n else if (this.inputElement.value.trim().length === 0) {\n this.resetState();\n }\n this.cursorDetails = null;\n this.isNavigate = false;\n if (this.inputElement.value === '') {\n this.invalidValueString = null;\n }\n };\n /**\n * Focuses out the TimePicker textbox element.\n *\n * @returns {void}\n */\n TimePicker.prototype.focusOut = function () {\n if (document.activeElement === this.inputElement) {\n this.inputElement.blur();\n removeClass([this.inputWrapper.container], [FOCUS]);\n var blurArguments = {\n model: this\n };\n this.trigger('blur', blurArguments);\n }\n };\n TimePicker.prototype.isPopupOpen = function () {\n if (this.popupWrapper && this.popupWrapper.classList.contains('' + ROOT)) {\n return true;\n }\n return false;\n };\n TimePicker.prototype.inputFocusHandler = function () {\n if (!this.enabled) {\n return;\n }\n var focusArguments = {\n model: this\n };\n if (!this.readonly && !Browser.isDevice && !this.enableMask) {\n this.selectInputText();\n }\n if (this.enableMask && !this.inputElement.value && this.placeholder) {\n if (this.maskedDateValue && !this.value && (this.floatLabelType == 'Auto' || this.floatLabelType == 'Never' || this.placeholder)) {\n this.updateInputValue(this.maskedDateValue);\n this.inputElement.selectionStart = 0;\n this.inputElement.selectionEnd = this.inputElement.value.length;\n }\n }\n this.trigger('focus', focusArguments);\n this.clearIconState();\n if (this.openOnFocus) {\n this.show();\n }\n };\n /**\n * Focused the TimePicker textbox element.\n *\n * @returns {void}\n */\n TimePicker.prototype.focusIn = function () {\n if (document.activeElement !== this.inputElement && this.enabled) {\n this.inputElement.focus();\n }\n };\n /**\n * Hides the TimePicker popup.\n *\n * @returns {void}\n\n */\n TimePicker.prototype.hide = function () {\n this.closePopup(100, null);\n this.clearIconState();\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-param */\n /**\n * Opens the popup to show the list items.\n *\n * @returns {void}\n\n */\n TimePicker.prototype.show = function (event) {\n var _this = this;\n if ((this.enabled && this.readonly) || !this.enabled || this.popupWrapper) {\n return;\n }\n else {\n this.popupCreation();\n if (Browser.isDevice && this.listWrapper) {\n this.modal = this.createElement('div');\n this.modal.className = '' + ROOT + ' e-time-modal';\n document.body.className += ' ' + OVERFLOW;\n document.body.appendChild(this.modal);\n }\n if (Browser.isDevice) {\n this.mobileTimePopupWrap = this.createElement('div', { className: 'e-timepicker-mob-popup-wrap' });\n document.body.appendChild(this.mobileTimePopupWrap);\n }\n this.openPopupEventArgs = {\n popup: this.popupObj || null,\n cancel: false,\n event: event || null,\n name: 'open',\n appendTo: Browser.isDevice ? this.mobileTimePopupWrap : document.body\n };\n var eventArgs = this.openPopupEventArgs;\n this.trigger('open', eventArgs, function (eventArgs) {\n _this.openPopupEventArgs = eventArgs;\n if (!_this.openPopupEventArgs.cancel && !_this.inputWrapper.buttons[0].classList.contains(DISABLED)) {\n _this.openPopupEventArgs.appendTo.appendChild(_this.popupWrapper);\n _this.popupAlignment(_this.openPopupEventArgs);\n _this.setScrollPosition();\n if (!Browser.isDevice) {\n _this.inputElement.focus();\n }\n var openAnimation = {\n name: 'FadeIn',\n duration: ANIMATIONDURATION\n };\n _this.popupObj.refreshPosition(_this.anchor);\n if (_this.zIndex === 1000) {\n _this.popupObj.show(new Animation(openAnimation), _this.element);\n }\n else {\n _this.popupObj.show(new Animation(openAnimation), null);\n }\n _this.setActiveDescendant();\n attributes(_this.inputElement, { 'aria-expanded': 'true' });\n addClass([_this.inputWrapper.container], FOCUS);\n EventHandler.add(document, 'mousedown touchstart', _this.documentClickHandler, _this);\n _this.setOverlayIndex(_this.mobileTimePopupWrap, _this.popupObj.element, _this.modal, Browser.isDevice);\n }\n else {\n _this.popupObj.destroy();\n _this.popupWrapper = _this.listTag = undefined;\n _this.liCollections = _this.timeCollections = _this.disableItemCollection = [];\n _this.popupObj = null;\n }\n });\n }\n };\n /* eslint-enable valid-jsdoc, jsdoc/require-param */\n TimePicker.prototype.setOverlayIndex = function (popupWrapper, timePopupElement, modal, isDevice) {\n if (isDevice && !isNullOrUndefined(timePopupElement) && !isNullOrUndefined(modal) && !isNullOrUndefined(popupWrapper)) {\n var index = parseInt(timePopupElement.style.zIndex, 10) ? parseInt(timePopupElement.style.zIndex, 10) : 1000;\n modal.style.zIndex = (index - 1).toString();\n popupWrapper.style.zIndex = index.toString();\n }\n };\n TimePicker.prototype.formatValues = function (type) {\n var value;\n if (typeof type === 'number') {\n value = formatUnit(type);\n }\n else if (typeof type === 'string') {\n value = (type.match(/px|%|em/)) ? type : isNaN(parseInt(type, 10)) ? type : formatUnit(type);\n }\n return value;\n };\n TimePicker.prototype.popupAlignment = function (args) {\n args.popup.position.X = this.formatValues(args.popup.position.X);\n args.popup.position.Y = this.formatValues(args.popup.position.Y);\n if (!isNaN(parseFloat(args.popup.position.X)) || !isNaN(parseFloat(args.popup.position.Y))) {\n this.popupObj.relateTo = this.anchor = document.body;\n this.popupObj.targetType = 'container';\n }\n if (!isNaN(parseFloat(args.popup.position.X))) {\n this.popupObj.offsetX = parseFloat(args.popup.position.X);\n }\n if (!isNaN(parseFloat(args.popup.position.Y))) {\n this.popupObj.offsetY = parseFloat(args.popup.position.Y);\n }\n if (!Browser.isDevice) {\n switch (args.popup.position.X) {\n case 'left':\n break;\n case 'right':\n args.popup.offsetX = this.containerStyle.width;\n break;\n case 'center':\n args.popup.offsetX = -(this.containerStyle.width / 2);\n break;\n }\n switch (args.popup.position.Y) {\n case 'top':\n break;\n case 'bottom':\n break;\n case 'center':\n args.popup.offsetY = -(this.containerStyle.height / 2);\n break;\n }\n if (args.popup.position.X === 'center' && args.popup.position.Y === 'center') {\n this.popupObj.relateTo = this.inputWrapper.container;\n this.anchor = this.inputElement;\n this.popupObj.targetType = 'relative';\n }\n }\n else {\n if (args.popup.position.X === 'center' && args.popup.position.Y === 'center') {\n this.popupObj.relateTo = this.anchor = document.body;\n this.popupObj.offsetY = 0;\n this.popupObj.targetType = 'container';\n this.popupObj.collision = { X: 'fit', Y: 'fit' };\n }\n }\n };\n /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * Gets the properties to be maintained upon browser refresh.\n *\n * @returns {string}\n */\n TimePicker.prototype.getPersistData = function () {\n var keyEntity = ['value'];\n return this.addOnPersist(keyEntity);\n };\n /* eslint-enable valid-jsdoc, jsdoc/require-returns-description */\n /**\n * To get component name\n *\n * @returns {string} Returns the component name.\n * @private\n */\n TimePicker.prototype.getModuleName = function () {\n return 'timepicker';\n };\n /**\n * Called internally if any of the property value changed.\n *\n * @param {TimePickerModel} newProp - Returns the dynamic property value of the component.\n * @param {TimePickerModel} oldProp - Returns the previous property value of the component.\n * @returns {void}\n * @private\n */\n TimePicker.prototype.onPropertyChanged = function (newProp, oldProp) {\n for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {\n var prop = _a[_i];\n switch (prop) {\n case 'placeholder':\n Input.setPlaceholder(newProp.placeholder, this.inputElement);\n this.inputElement.setAttribute('aria-placeholder', newProp.placeholder);\n break;\n case 'readonly':\n Input.setReadonly(this.readonly, this.inputElement, this.floatLabelType);\n if (this.readonly) {\n this.hide();\n }\n this.setTimeAllowEdit();\n break;\n case 'enabled':\n this.setProperties({ enabled: newProp.enabled }, true);\n this.setEnable();\n break;\n case 'allowEdit':\n this.setTimeAllowEdit();\n break;\n case 'enableRtl':\n this.setProperties({ enableRtl: newProp.enableRtl }, true);\n this.setEnableRtl();\n break;\n case 'cssClass':\n this.updateCssClass(newProp.cssClass, oldProp.cssClass);\n break;\n case 'zIndex':\n this.setProperties({ zIndex: newProp.zIndex }, true);\n this.setZIndex();\n break;\n case 'htmlAttributes':\n this.updateHtmlAttributeToElement();\n this.updateHtmlAttributeToWrapper();\n this.checkAttributes(true);\n break;\n case 'min':\n case 'max':\n this.getProperty(newProp, prop);\n break;\n case 'showClearButton':\n Input.setClearButton(this.showClearButton, this.inputElement, this.inputWrapper);\n this.bindClearEvent();\n break;\n case 'locale':\n this.setProperties({ locale: newProp.locale }, true);\n this.globalize = new Internationalization(this.locale);\n this.l10n.setLocale(this.locale);\n this.updatePlaceHolder();\n this.setValue(this.value);\n if (this.enableMask) {\n this.notify(\"createMask\", {\n module: \"MaskedDateTime\",\n });\n }\n break;\n case 'width':\n setStyleAttribute(this.inputWrapper.container, { 'width': this.setWidth(newProp.width) });\n this.containerStyle = this.inputWrapper.container.getBoundingClientRect();\n break;\n case 'format':\n this.setProperties({ format: newProp.format }, true);\n this.checkTimeFormat();\n this.setValue(this.value);\n if (this.enableMask) {\n this.createMask();\n if (!this.value) {\n this.updateInputValue(this.maskedDateValue);\n }\n }\n break;\n case 'value':\n this.invalidValueString = null;\n this.checkInvalidValue(newProp.value);\n newProp.value = this.value;\n if (!this.invalidValueString) {\n if (typeof newProp.value === 'string') {\n this.setProperties({ value: this.checkDateValue(new Date(newProp.value)) }, true);\n newProp.value = this.value;\n }\n else {\n if ((newProp.value && +new Date(+newProp.value).setMilliseconds(0)) !== +this.value) {\n newProp.value = this.checkDateValue(new Date('' + newProp.value));\n }\n }\n this.initValue = newProp.value;\n newProp.value = this.compareFormatChange(this.checkValue(newProp.value));\n }\n else {\n this.updateInputValue(this.invalidValueString);\n this.checkErrorState(this.invalidValueString);\n }\n this.checkValueChange(null, false);\n if (this.isPopupOpen()) {\n this.setScrollPosition();\n }\n if (this.isAngular && this.preventChange) {\n this.preventChange = false;\n }\n if (this.enableMask) {\n this.notify(\"createMask\", {\n module: \"MaskedDateTime\",\n });\n }\n break;\n case 'floatLabelType':\n this.floatLabelType = newProp.floatLabelType;\n Input.removeFloating(this.inputWrapper);\n Input.addFloating(this.inputElement, this.floatLabelType, this.placeholder);\n break;\n case 'strictMode':\n this.invalidValueString = null;\n if (newProp.strictMode) {\n this.checkErrorState(null);\n }\n this.setProperties({ strictMode: newProp.strictMode }, true);\n this.checkValue((this.inputElement).value);\n this.checkValueChange(null, false);\n break;\n case 'scrollTo':\n if (this.checkDateValue(new Date(this.checkInValue(newProp.scrollTo)))) {\n if (this.popupWrapper) {\n this.setScrollTo();\n }\n this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkInValue(newProp.scrollTo))) }, true);\n }\n else {\n this.setProperties({ scrollTo: null }, true);\n }\n break;\n case 'enableMask':\n if (this.enableMask) {\n this.notify(\"createMask\", {\n module: \"MaskedDateTime\",\n });\n this.updateInputValue(this.maskedDateValue);\n }\n else {\n if (this.inputElement.value === this.maskedDateValue) {\n this.updateInputValue('');\n }\n }\n break;\n }\n }\n };\n TimePicker.prototype.checkInValue = function (inValue) {\n if (inValue instanceof Date) {\n return (inValue.toUTCString());\n }\n else {\n return ('' + inValue);\n }\n };\n __decorate([\n Property(null)\n ], TimePicker.prototype, \"width\", void 0);\n __decorate([\n Property(null)\n ], TimePicker.prototype, \"cssClass\", void 0);\n __decorate([\n Property(false)\n ], TimePicker.prototype, \"strictMode\", void 0);\n __decorate([\n Property(null)\n ], TimePicker.prototype, \"keyConfigs\", void 0);\n __decorate([\n Property(null)\n ], TimePicker.prototype, \"format\", void 0);\n __decorate([\n Property(true)\n ], TimePicker.prototype, \"enabled\", void 0);\n __decorate([\n Property(false)\n ], TimePicker.prototype, \"readonly\", void 0);\n __decorate([\n Property({})\n ], TimePicker.prototype, \"htmlAttributes\", void 0);\n __decorate([\n Property('Never')\n ], TimePicker.prototype, \"floatLabelType\", void 0);\n __decorate([\n Property(null)\n ], TimePicker.prototype, \"placeholder\", void 0);\n __decorate([\n Property(1000)\n ], TimePicker.prototype, \"zIndex\", void 0);\n __decorate([\n Property(false)\n ], TimePicker.prototype, \"enablePersistence\", void 0);\n __decorate([\n Property(true)\n ], TimePicker.prototype, \"showClearButton\", void 0);\n __decorate([\n Property(30)\n ], TimePicker.prototype, \"step\", void 0);\n __decorate([\n Property(null)\n ], TimePicker.prototype, \"scrollTo\", void 0);\n __decorate([\n Property(null)\n ], TimePicker.prototype, \"value\", void 0);\n __decorate([\n Property(null)\n ], TimePicker.prototype, \"min\", void 0);\n __decorate([\n Property(null)\n ], TimePicker.prototype, \"max\", void 0);\n __decorate([\n Property(true)\n ], TimePicker.prototype, \"allowEdit\", void 0);\n __decorate([\n Property(false)\n ], TimePicker.prototype, \"openOnFocus\", void 0);\n __decorate([\n Property(false)\n ], TimePicker.prototype, \"enableMask\", void 0);\n __decorate([\n Property({ day: 'day', month: 'month', year: 'year', hour: 'hour', minute: 'minute', second: 'second', dayOfTheWeek: 'day of the week' })\n ], TimePicker.prototype, \"maskPlaceholder\", void 0);\n __decorate([\n Event()\n ], TimePicker.prototype, \"change\", void 0);\n __decorate([\n Event()\n ], TimePicker.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], TimePicker.prototype, \"destroyed\", void 0);\n __decorate([\n Event()\n ], TimePicker.prototype, \"open\", void 0);\n __decorate([\n Event()\n ], TimePicker.prototype, \"itemRender\", void 0);\n __decorate([\n Event()\n ], TimePicker.prototype, \"close\", void 0);\n __decorate([\n Event()\n ], TimePicker.prototype, \"cleared\", void 0);\n __decorate([\n Event()\n ], TimePicker.prototype, \"blur\", void 0);\n __decorate([\n Event()\n ], TimePicker.prototype, \"focus\", void 0);\n TimePicker = __decorate([\n NotifyPropertyChanges\n ], TimePicker);\n return TimePicker;\n}(Component));\nexport { TimePicker };\n/* eslint-enable @typescript-eslint/no-explicit-any */\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar nativeDefineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return nativeDefineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","//! moment.js locale configuration\n//! locale : French [fr]\n//! author : John Fischer : https://github.com/jfroffice\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var monthsStrictRegex = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,\n monthsShortStrictRegex = /(janv\\.?|févr\\.?|mars|avr\\.?|mai|juin|juil\\.?|août|sept\\.?|oct\\.?|nov\\.?|déc\\.?)/i,\n monthsRegex = /(janv\\.?|févr\\.?|mars|avr\\.?|mai|juin|juil\\.?|août|sept\\.?|oct\\.?|nov\\.?|déc\\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,\n monthsParse = [\n /^janv/i,\n /^févr/i,\n /^mars/i,\n /^avr/i,\n /^mai/i,\n /^juin/i,\n /^juil/i,\n /^août/i,\n /^sept/i,\n /^oct/i,\n /^nov/i,\n /^déc/i,\n ];\n\n var fr = moment.defineLocale('fr', {\n months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(\n '_'\n ),\n monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(\n '_'\n ),\n monthsRegex: monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: monthsStrictRegex,\n monthsShortStrictRegex: monthsShortStrictRegex,\n monthsParse: monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Aujourd’hui à] LT',\n nextDay: '[Demain à] LT',\n nextWeek: 'dddd [à] LT',\n lastDay: '[Hier à] LT',\n lastWeek: 'dddd [dernier à] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'dans %s',\n past: 'il y a %s',\n s: 'quelques secondes',\n ss: '%d secondes',\n m: 'une minute',\n mm: '%d minutes',\n h: 'une heure',\n hh: '%d heures',\n d: 'un jour',\n dd: '%d jours',\n M: 'un mois',\n MM: '%d mois',\n y: 'un an',\n yy: '%d ans',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(er|)/,\n ordinal: function (number, period) {\n switch (period) {\n // TODO: Return 'e' when day of month > 1. Move this case inside\n // block for masculine words below.\n // See https://github.com/moment/moment/issues/3375\n case 'D':\n return number + (number === 1 ? 'er' : '');\n\n // Words with masculine grammatical gender: mois, trimestre, jour\n default:\n case 'M':\n case 'Q':\n case 'DDD':\n case 'd':\n return number + (number === 1 ? 'er' : 'e');\n\n // Words with feminine grammatical gender: semaine\n case 'w':\n case 'W':\n return number + (number === 1 ? 're' : 'e');\n }\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return fr;\n\n})));\n","'use strict';\n\nvar fails = require('./fails');\n\n// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,\n// so we use an intermediate function.\nfunction RE(s, f) {\n return RegExp(s, f);\n}\n\nexports.UNSUPPORTED_Y = fails(function () {\n // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError\n var re = RE('a', 'y');\n re.lastIndex = 2;\n return re.exec('abcd') != null;\n});\n\nexports.BROKEN_CARET = fails(function () {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=773687\n var re = RE('^r', 'gy');\n re.lastIndex = 2;\n return re.exec('str') != null;\n});\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isAfter;\n\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\n\nvar _toDate = _interopRequireDefault(require(\"./toDate\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction isAfter(str) {\n var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : String(new Date());\n (0, _assertString.default)(str);\n var comparison = (0, _toDate.default)(date);\n var original = (0, _toDate.default)(str);\n return !!(original && comparison && original > comparison);\n}\n\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { append, prepend, createElement, extend, EventHandler, closest, addClass } from '@syncfusion/ej2-base';\nimport { isNullOrUndefined, setStyleAttribute, remove } from '@syncfusion/ej2-base';\nimport { EventBase } from './event-base';\nimport * as cls from '../base/css-constant';\nimport * as events from '../base/constant';\nimport * as util from '../base/util';\nvar EVENT_GAP = 0;\n/**\n * Month view events render\n */\nvar MonthEvent = /** @class */ (function (_super) {\n __extends(MonthEvent, _super);\n function MonthEvent(parent) {\n var _this = _super.call(this, parent) || this;\n _this.renderedEvents = [];\n _this.monthHeaderHeight = 0;\n _this.moreIndicatorHeight = 19;\n _this.renderType = 'day';\n _this.element = _this.parent.activeView.getPanel();\n _this.fields = _this.parent.eventFields;\n _this.maxHeight = _this.parent.eventSettings.enableMaxHeight && !_this.parent.eventSettings.enableIndicator\n && !_this.parent.rowAutoHeight;\n _this.withIndicator = _this.parent.eventSettings.enableMaxHeight && _this.parent.eventSettings.enableIndicator\n && !_this.parent.rowAutoHeight;\n _this.maxOrIndicator = (_this.maxHeight || _this.withIndicator);\n _this.moreIndicatorHeight =\n (_this.parent.rowAutoHeight && _this.parent.eventSettings.ignoreWhitespace) ? 0 : _this.moreIndicatorHeight;\n _this.addEventListener();\n return _this;\n }\n MonthEvent.prototype.removeEventWrapper = function (appElement) {\n if (appElement.length > 0) {\n appElement = (this.parent.currentView === 'Month') ? appElement : [appElement[0]];\n for (var _i = 0, appElement_1 = appElement; _i < appElement_1.length; _i++) {\n var wrap = appElement_1[_i];\n if (!wrap.classList.contains('e-more-indicator') && wrap.parentElement && wrap.parentElement.parentNode) {\n remove(wrap.parentElement);\n }\n }\n }\n };\n MonthEvent.prototype.renderAppointments = function () {\n if (this.parent.dragAndDropModule) {\n this.parent.dragAndDropModule.setDragArea();\n }\n var conWrap = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);\n if (this.parent.rowAutoHeight) {\n this.parent.uiStateValues.top = conWrap.scrollTop;\n this.parent.uiStateValues.left = conWrap.scrollLeft;\n }\n var appointmentWrapper = [].slice.call(this.element.querySelectorAll('.' + cls.APPOINTMENT_WRAPPER_CLASS));\n if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {\n for (var i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {\n var appElement = [].slice.call(this.element.querySelectorAll('.e-appointment-wrapper ' + '[data-group-index=\"' +\n this.parent.crudModule.crudObj.sourceEvent[i].groupIndex + '\"]'));\n this.removeEventWrapper(appElement);\n if (this.parent.crudModule.crudObj.targetEvent[i] && this.parent.crudModule.crudObj.sourceEvent[i].groupIndex !==\n this.parent.crudModule.crudObj.targetEvent[i].groupIndex) {\n var ele = [].slice.call(this.element.querySelectorAll('.e-appointment-wrapper ' + '[data-group-index=\"' +\n this.parent.crudModule.crudObj.targetEvent[i].groupIndex + '\"]'));\n this.removeEventWrapper(ele);\n }\n }\n }\n else {\n for (var _i = 0, appointmentWrapper_1 = appointmentWrapper; _i < appointmentWrapper_1.length; _i++) {\n var wrap = appointmentWrapper_1[_i];\n remove(wrap);\n }\n }\n this.removeHeightProperty(cls.CONTENT_TABLE_CLASS);\n if (!this.element.querySelector('.' + cls.WORK_CELLS_CLASS)) {\n return;\n }\n if (this.parent.currentView === 'Month') {\n var wrapper = createElement('div', { className: cls.APPOINTMENT_WRAPPER_CLASS });\n var cellTd = this.parent.element.querySelector('.' + cls.WORK_CELLS_CLASS);\n cellTd.appendChild(wrapper);\n this.monthHeaderHeight = wrapper.offsetTop - cellTd.offsetTop;\n cellTd.removeChild(wrapper);\n }\n this.eventHeight = util.getElementHeightFromClass(this.element, cls.APPOINTMENT_CLASS);\n var scrollTop = conWrap.scrollTop;\n if (this.parent.rowAutoHeight && this.parent.virtualScrollModule && !isNullOrUndefined(this.parent.currentAction)) {\n conWrap.scrollTop = conWrap.scrollTop - 1;\n }\n if (this.parent.activeViewOptions.group.resources.length > 0) {\n this.renderResourceEvents();\n if (this.parent.virtualScrollModule) {\n this.parent.virtualScrollModule.updateFocusedWorkCell();\n }\n }\n else {\n this.renderEventsHandler(this.parent.activeView.renderDates, this.parent.activeViewOptions.workDays);\n }\n if (this.parent.rowAutoHeight) {\n this.updateBlockElements();\n var data = {\n cssProperties: this.parent.getCssProperties(),\n module: this.parent.getModuleName(),\n isPreventScrollUpdate: true,\n scrollPosition: { left: this.parent.uiStateValues.left, top: this.parent.uiStateValues.top }\n };\n if (this.parent.virtualScrollModule) {\n if (this.parent.currentAction) {\n conWrap.scrollTop = scrollTop;\n this.parent.currentAction = null;\n }\n else {\n this.parent.virtualScrollModule.updateVirtualScrollHeight();\n }\n }\n if (!this.parent.enablePersistence) {\n this.parent.notify(events.contentReady, {});\n }\n this.parent.notify(events.scrollUiUpdate, data);\n if (this.parent.currentView === 'Month' && this.parent.showWeekNumber) {\n var totalCells_1 = [].slice.call(this.parent.element.querySelectorAll('.e-content-wrap table tr td:first-child'));\n var weekNumberCells = [].slice.call(this.parent.element.querySelectorAll('.' + cls.WEEK_NUMBER_CLASS));\n weekNumberCells.forEach(function (cell, i) {\n var height = totalCells_1[i].offsetHeight;\n setStyleAttribute(cell, { 'height': height + 'px' });\n });\n this.parent.element.querySelector('.' + cls.WEEK_NUMBER_WRAPPER_CLASS).scrollTop =\n this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS).scrollTop;\n }\n }\n this.parent.renderTemplates();\n };\n MonthEvent.prototype.renderEventsHandler = function (dateRender, workDays, resData) {\n this.renderedEvents = [];\n var eventsList;\n var blockList;\n var resIndex = 0;\n if (resData) {\n resIndex = resData.groupIndex;\n this.cssClass = resData.cssClass;\n this.groupOrder = resData.groupOrder;\n eventsList = this.parent.eventBase.filterEventsByResource(resData, this.parent.eventsProcessed);\n blockList = this.parent.eventBase.filterEventsByResource(resData, this.parent.blockProcessed);\n this.workCells = [].slice.call(this.element.querySelectorAll('.' + cls.WORK_CELLS_CLASS + '[data-group-index=\"' + resIndex + '\"]'));\n }\n else {\n eventsList = this.parent.eventsProcessed;\n blockList = this.parent.blockProcessed;\n this.workCells = [].slice.call(this.element.querySelectorAll('.' + cls.WORK_CELLS_CLASS));\n }\n this.sortByDateTime(eventsList);\n this.sortByDateTime(blockList);\n if (this.parent.currentView === 'Month' && this.parent.rowAutoHeight && this.parent.activeViewOptions.group.resources.length === 0) {\n var totalCells = [].slice.call(this.parent.element.querySelectorAll('.e-content-wrap table tr td:first-child'));\n var height_1 = this.parent.height === 'auto' ? (this.parent.element.querySelector('.e-content-wrap').clientHeight +\n this.parent.element.querySelector('.e-date-header-wrap').clientHeight) / totalCells.length\n : this.parent.element.querySelector('.e-schedule-table').clientHeight / totalCells.length;\n totalCells.forEach(function (cell) {\n setStyleAttribute(cell, { 'height': height_1 + 'px' });\n });\n }\n var cellDetail = this.workCells.slice(-1)[0].getBoundingClientRect();\n this.cellWidth = cellDetail.width;\n this.cellHeight = cellDetail.height;\n this.dateRender = dateRender;\n var filteredDates = this.getRenderedDates(dateRender);\n this.getSlotDates(workDays);\n this.processBlockEvents(blockList, resIndex, resData);\n for (var _i = 0, eventsList_1 = eventsList; _i < eventsList_1.length; _i++) {\n var event_1 = eventsList_1[_i];\n if (this.parent.resourceBase && !resData) {\n this.cssClass = this.parent.resourceBase.getCssClass(event_1);\n }\n var spannedEvents = this.splitEvent(event_1, filteredDates || this.dateRender);\n for (var _a = 0, spannedEvents_1 = spannedEvents; _a < spannedEvents_1.length; _a++) {\n var event_2 = spannedEvents_1[_a];\n if (this.maxHeight) {\n var sDate = this.parent.currentView === 'Month' ? event_2[this.fields.startTime] :\n this.getStartTime(event_2, event_2.data);\n if (this.getIndex(sDate) > 0) {\n continue;\n }\n }\n this.updateIndicatorIcon(event_2);\n this.renderEvents(event_2, resIndex, eventsList);\n }\n }\n this.cssClass = null;\n this.groupOrder = null;\n };\n MonthEvent.prototype.processBlockEvents = function (blockEvents, resIndex, resData) {\n for (var _i = 0, blockEvents_1 = blockEvents; _i < blockEvents_1.length; _i++) {\n var event_3 = blockEvents_1[_i];\n if (this.parent.resourceBase && !resData) {\n this.cssClass = this.parent.resourceBase.getCssClass(event_3);\n }\n var blockSpannedList = [];\n if (this.renderType === 'day' && !event_3[this.fields.isAllDay]) {\n var temp = extend({}, event_3, null, true);\n var isSameDate = this.isSameDate(temp[this.fields.startTime], temp[this.fields.endTime]);\n temp.isBlockIcon = isSameDate;\n if (!isSameDate && util.getDateInMs(temp[this.fields.startTime]) > 0) {\n var e = extend({}, event_3, null, true);\n e[this.fields.endTime] = util.addDays(util.resetTime(new Date(event_3[this.fields.startTime] + '')), 1);\n e.isBlockIcon = true;\n temp[this.fields.startTime] = e[this.fields.endTime];\n blockSpannedList.push(e);\n }\n isSameDate = this.isSameDate(temp[this.fields.startTime], temp[this.fields.endTime]);\n if (!isSameDate && util.getDateInMs(temp[this.fields.endTime]) > 0) {\n var e = extend({}, event_3, null, true);\n e[this.fields.startTime] = util.resetTime(new Date(event_3[this.fields.endTime] + ''));\n e.isBlockIcon = true;\n blockSpannedList.push(e);\n temp[this.fields.endTime] = e[this.fields.startTime];\n }\n blockSpannedList.push(temp);\n }\n else {\n blockSpannedList.push(event_3);\n }\n for (var _a = 0, blockSpannedList_1 = blockSpannedList; _a < blockSpannedList_1.length; _a++) {\n var blockEvent = blockSpannedList_1[_a];\n var spannedEvents = this.splitEvent(blockEvent, this.dateRender);\n for (var _b = 0, spannedEvents_2 = spannedEvents; _b < spannedEvents_2.length; _b++) {\n var event_4 = spannedEvents_2[_b];\n this.renderBlockEvents(event_4, resIndex, !!blockEvent.isBlockIcon);\n }\n }\n }\n };\n MonthEvent.prototype.isSameDate = function (start, end) {\n return new Date(+start).setHours(0, 0, 0, 0) === new Date(+end).setHours(0, 0, 0, 0);\n };\n MonthEvent.prototype.renderBlockEvents = function (event, resIndex, isIcon) {\n var eventData = event.data;\n var startTime = this.getStartTime(event, eventData);\n var endTime = this.getEndTime(event, eventData);\n var day = this.parent.getIndexOfDate(this.dateRender, util.resetTime(new Date(startTime.getTime())));\n if (day < 0 || startTime > endTime) {\n return;\n }\n var cellTd = this.getCellTd(day);\n var position = this.getPosition(startTime, endTime, event[this.fields.isAllDay], day);\n if (!isIcon) {\n var diffInDays = eventData.count;\n var appWidth = this.getEventWidth(startTime, endTime, event[this.fields.isAllDay], diffInDays);\n appWidth = (appWidth <= 0) ? this.cellWidth : appWidth;\n var appLeft = (this.parent.enableRtl) ? 0 : position;\n var appRight = (this.parent.enableRtl) ? position : 0;\n var appHeight = this.cellHeight - this.monthHeaderHeight;\n var appTop = this.getRowTop(resIndex);\n var blockElement = this.createBlockAppointmentElement(event, resIndex);\n setStyleAttribute(blockElement, {\n 'width': appWidth + 'px', 'height': appHeight + 'px', 'left': appLeft + 'px',\n 'right': appRight + 'px', 'top': appTop + 'px'\n });\n this.renderEventElement(event, blockElement, cellTd);\n }\n else {\n this.renderBlockIndicator(cellTd, position, resIndex);\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n MonthEvent.prototype.renderBlockIndicator = function (cellTd, position, resIndex) {\n var blockIndicator = createElement('div', { className: 'e-icons ' + cls.BLOCK_INDICATOR_CLASS });\n if (isNullOrUndefined(cellTd.querySelector('.' + cls.BLOCK_INDICATOR_CLASS))) {\n cellTd.appendChild(blockIndicator);\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n MonthEvent.prototype.getStartTime = function (event, eventData) {\n return event[this.fields.startTime];\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n MonthEvent.prototype.getEndTime = function (event, eventData) {\n return event[this.fields.endTime];\n };\n MonthEvent.prototype.getCellTd = function (day) {\n return this.workCells[day];\n };\n MonthEvent.prototype.getEventWidth = function (startDate, endDate, isAllDay, count) {\n return count * this.cellWidth - 1;\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n MonthEvent.prototype.getPosition = function (startTime, endTime, isAllDay, day) {\n return 0;\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n MonthEvent.prototype.getRowTop = function (resIndex) {\n return 0;\n };\n MonthEvent.prototype.updateIndicatorIcon = function (event) {\n if (this.parent.currentView.indexOf('Timeline') === -1 || this.parent.currentView === 'TimelineMonth'\n || event[this.fields.isAllDay]) {\n return;\n }\n var cloneData = event.data;\n var start = this.parent.activeView.getStartHour();\n var end = this.parent.activeView.getEndHour();\n var startHour = util.getStartEndHours(event[this.fields.startTime], start, end);\n var endHour = util.getStartEndHours(event[this.fields.endTime], start, end);\n var actualStartTime = cloneData[this.fields.startTime];\n var actualEndTime = cloneData[this.fields.endTime];\n cloneData.isLeft = cloneData.isLeft || actualStartTime.getTime() < startHour.startHour.getTime();\n cloneData.isRight = cloneData.isRight || actualEndTime.getTime() > endHour.endHour.getTime();\n if (util.resetTime(actualStartTime).getTime() !== util.resetTime(actualEndTime).getTime()) {\n var actualStartHour = startHour.startHour;\n var actualEndHour = endHour.endHour;\n var startTime = new Date(util.resetTime(actualStartTime));\n startTime.setHours(actualEndHour.getHours(), actualEndHour.getMinutes(), actualEndHour.getSeconds());\n cloneData.isLeft = cloneData.isLeft || actualStartTime.getTime() >= (actualStartHour.getDate() === startHour.endHour.getDate() ?\n startTime.getTime() : util.addDays(startTime, 1).getTime());\n if (actualEndTime.getTime() !== util.resetTime(actualEndTime).getTime()) {\n var endTime = new Date(util.resetTime(actualEndTime));\n cloneData.isRight = cloneData.isRight || actualEndTime.getTime() <=\n endTime.setHours(actualStartHour.getHours(), actualStartHour.getMinutes(), actualStartHour.getSeconds());\n }\n }\n };\n MonthEvent.prototype.renderResourceEvents = function () {\n var resources = this.parent.uiStateValues.isGroupAdaptive ?\n [this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :\n this.parent.resourceBase.lastResourceLevel;\n if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {\n for (var i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {\n var sourceRes = this.parent.crudModule.crudObj.sourceEvent[i];\n this.renderEventsHandler(sourceRes.renderDates, sourceRes.workDays, sourceRes);\n if (this.parent.crudModule.crudObj.sourceEvent[i].groupIndex !==\n this.parent.crudModule.crudObj.targetEvent[i].groupIndex) {\n var target = this.parent.crudModule.crudObj.targetEvent[i];\n this.renderEventsHandler(target.renderDates, target.workDays, target);\n }\n }\n this.parent.crudModule.crudObj.isCrudAction = false;\n }\n else {\n for (var _i = 0, resources_1 = resources; _i < resources_1.length; _i++) {\n var slotData = resources_1[_i];\n this.renderEventsHandler(slotData.renderDates, slotData.workDays, slotData);\n }\n }\n };\n MonthEvent.prototype.getSlotDates = function (workDays) {\n this.slots = [];\n var dates = this.dateRender.map(function (date) { return +date; });\n var noOfDays = this.parent.activeViewOptions.showWeekend ? util.WEEK_LENGTH : workDays.length;\n while (dates.length > 0) {\n this.slots.push(dates.splice(0, noOfDays));\n }\n };\n MonthEvent.prototype.createAppointmentElement = function (record, resIndex, isCloneElement) {\n if (isCloneElement === void 0) { isCloneElement = false; }\n var eventSubject = (record[this.fields.subject] || this.parent.eventSettings.fields.subject.default ||\n this.parent.localeObj.getConstant('addTitle'));\n var newRecord = extend({}, record, record.data, true);\n var attrs = {\n 'data-id': 'Appointment_' + record[this.fields.id],\n 'role': 'button', 'tabindex': '0',\n 'aria-readonly': this.parent.eventBase.getReadonlyAttribute(record), 'aria-selected': 'false', 'aria-grabbed': 'true',\n 'aria-label': this.parent.getAnnouncementString(newRecord, eventSubject)\n };\n if (!isCloneElement) {\n attrs['data-guid'] = record.Guid;\n }\n if (this.parent.activeViewOptions.group.resources.length > 0) {\n attrs['data-group-index'] = resIndex.toString();\n }\n var appointmentWrapper = createElement('div', { className: cls.APPOINTMENT_CLASS, attrs: attrs });\n if (!isNullOrUndefined(this.cssClass)) {\n addClass([appointmentWrapper], this.cssClass);\n }\n if (record[this.fields.isReadonly]) {\n addClass([appointmentWrapper], 'e-read-only');\n }\n var appointmentDetails = createElement('div', { className: cls.APPOINTMENT_DETAILS });\n appointmentWrapper.appendChild(appointmentDetails);\n var templateElement;\n var eventData = record.data;\n var eventObj = this.getEventData(record);\n if (!isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)) {\n var scheduleId = this.parent.element.id + '_';\n var viewName = this.parent.activeViewOptions.eventTemplateName;\n var templateId = scheduleId + viewName + 'eventTemplate';\n templateElement = this.parent.getAppointmentTemplate()(eventObj, this.parent, 'eventTemplate', templateId, false);\n }\n else {\n var eventLocation = (record[this.fields.location] || this.parent.eventSettings.fields.location.default || '');\n var appointmentSubject = createElement('div', {\n className: cls.SUBJECT_CLASS,\n innerHTML: (eventSubject + (eventLocation ? '; ' + eventLocation : ''))\n });\n var appointmentStartTime = createElement('div', {\n className: cls.APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + cls.DISABLE_CLASS : ''),\n innerHTML: this.parent.getTimeString(eventData[this.fields.startTime])\n });\n var appointmentEndTime = createElement('div', {\n className: cls.APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + cls.DISABLE_CLASS : ''),\n innerHTML: this.parent.getTimeString(eventData[this.fields.endTime])\n });\n if (this.parent.currentView === 'Month') {\n if (record[this.fields.isAllDay]) {\n templateElement = [appointmentSubject];\n addClass([appointmentSubject], 'e-text-center');\n }\n else if (eventData.count <= 1 && !eventData.isLeft && !eventData.isRight) {\n templateElement = [appointmentStartTime, appointmentSubject];\n }\n else {\n templateElement = [];\n addClass([appointmentSubject], 'e-text-center');\n if (!eventData.isLeft) {\n templateElement.push(appointmentStartTime);\n }\n templateElement.push(appointmentSubject);\n if (!eventData.isRight) {\n templateElement.push(appointmentEndTime);\n }\n }\n }\n else {\n var innerElement = void 0;\n if (record[this.fields.isAllDay]) {\n var allDayString = createElement('div', {\n className: cls.APPOINTMENT_TIME, innerHTML: this.parent.localeObj.getConstant('allDay')\n });\n innerElement = [appointmentSubject, allDayString];\n }\n else {\n var timeString = this.parent.getTimeString(eventData[this.fields.startTime])\n + ' - ' + this.parent.getTimeString(eventData[this.fields.endTime]);\n var appTime = createElement('div', {\n className: cls.APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + cls.DISABLE_CLASS : ''), innerHTML: timeString\n });\n var appLocation = createElement('div', { className: cls.LOCATION_CLASS, innerHTML: eventLocation });\n innerElement = [appointmentSubject, appTime, appLocation];\n }\n var wrap = createElement('div', { className: 'e-inner-wrap' });\n append(innerElement, wrap);\n templateElement = [wrap];\n }\n }\n append(templateElement, appointmentDetails);\n this.appendEventIcons(record, appointmentDetails);\n this.renderResizeHandler(appointmentWrapper, record.data, record[this.fields.isReadonly]);\n return appointmentWrapper;\n };\n MonthEvent.prototype.appendEventIcons = function (record, appointmentDetails) {\n var eventData = record.data;\n if (!isNullOrUndefined(record[this.fields.recurrenceRule]) || !isNullOrUndefined(record[this.fields.recurrenceID])) {\n var iconClass = (record[this.fields.id] === record[this.fields.recurrenceID]) ?\n cls.EVENT_RECURRENCE_ICON_CLASS : cls.EVENT_RECURRENCE_EDIT_ICON_CLASS;\n appointmentDetails.appendChild(createElement('div', {\n className: cls.ICON + ' ' + iconClass + (this.parent.isAdaptive ? ' ' + cls.DISABLE_CLASS : '')\n }));\n }\n if (eventData.isLeft) {\n var iconLeft = createElement('div', {\n className: cls.EVENT_INDICATOR_CLASS + ' ' + cls.ICON + ' ' + cls.EVENT_ICON_LEFT_CLASS\n });\n prepend([iconLeft], appointmentDetails);\n }\n if (eventData.isRight) {\n var iconRight = createElement('div', {\n className: cls.EVENT_INDICATOR_CLASS + ' ' + cls.ICON + ' ' + cls.EVENT_ICON_RIGHT_CLASS\n });\n append([iconRight], appointmentDetails);\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n MonthEvent.prototype.renderEvents = function (event, resIndex, eventsList) {\n var startTime = event[this.fields.startTime];\n var endTime = event[this.fields.endTime];\n var day = this.parent.getIndexOfDate(this.dateRender, util.resetTime(startTime));\n if (day < 0) {\n return;\n }\n if ((startTime.getTime() < this.parent.minDate.getTime()) || (endTime.getTime() > this.parent.maxDate.getTime())) {\n return;\n }\n var overlapCount = this.getIndex(startTime);\n event.Index = overlapCount;\n var appHeight = this.eventHeight;\n this.renderedEvents.push(extend({}, event, null, true));\n var diffInDays = event.data.count;\n if (startTime.getTime() <= endTime.getTime()) {\n var appWidth = (diffInDays * this.cellWidth) - 5;\n var cellTd = this.workCells[day];\n var appTop = (overlapCount * (appHeight + EVENT_GAP));\n var height = this.monthHeaderHeight + ((overlapCount + 1) * (appHeight + EVENT_GAP)) + this.moreIndicatorHeight;\n var enableAppRender = this.maxOrIndicator ? overlapCount < 1 ? true : false : this.cellHeight > height;\n if (this.parent.rowAutoHeight || enableAppRender) {\n var appointmentElement = void 0;\n if (this.inlineValue) {\n appointmentElement = this.parent.inlineModule.createInlineAppointmentElement();\n }\n else {\n appointmentElement = this.createAppointmentElement(event, resIndex);\n }\n this.applyResourceColor(appointmentElement, event, 'backgroundColor', this.groupOrder);\n this.wireAppointmentEvents(appointmentElement, event);\n setStyleAttribute(appointmentElement, { 'width': appWidth + 'px', 'top': appTop + 'px' });\n this.renderEventElement(event, appointmentElement, cellTd);\n if (this.parent.rowAutoHeight) {\n var firstChild = cellTd.parentElement.firstElementChild;\n this.updateCellHeight(firstChild, height);\n }\n }\n else {\n for (var i = 0; i < diffInDays; i++) {\n var cellTd_1 = this.workCells[day + i];\n if (cellTd_1 && isNullOrUndefined(cellTd_1.querySelector('.' + cls.MORE_INDICATOR_CLASS))) {\n var startDate = new Date(this.dateRender[day + i].getTime());\n var endDate = util.addDays(this.dateRender[day + i], 1);\n var groupIndex = cellTd_1.getAttribute('data-group-index');\n var filterEvents = this.getFilteredEvents(startDate, endDate, groupIndex);\n var appArea = this.cellHeight - this.monthHeaderHeight - this.moreIndicatorHeight;\n appHeight = this.withIndicator ? appArea : appHeight;\n var renderedAppCount = Math.floor(appArea / (appHeight + EVENT_GAP));\n var count = (filterEvents.length - renderedAppCount) <= 0 ? 1 : (filterEvents.length - renderedAppCount);\n var moreIndicatorElement = this.getMoreIndicatorElement(count, startDate, endDate);\n if (!isNullOrUndefined(groupIndex)) {\n moreIndicatorElement.setAttribute('data-group-index', groupIndex);\n }\n moreIndicatorElement.style.top = appArea + 'px';\n moreIndicatorElement.style.width = this.cellWidth - 2 + 'px';\n this.renderElement(cellTd_1, moreIndicatorElement);\n EventHandler.add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);\n }\n }\n }\n }\n };\n MonthEvent.prototype.updateCellHeight = function (cell, height) {\n if ((height > cell.offsetHeight)) {\n setStyleAttribute(cell, { 'height': height + 'px' });\n }\n };\n MonthEvent.prototype.updateBlockElements = function () {\n var blockElement = [].slice.call(this.element.querySelectorAll('.' + cls.BLOCK_APPOINTMENT_CLASS));\n for (var _i = 0, blockElement_1 = blockElement; _i < blockElement_1.length; _i++) {\n var element = blockElement_1[_i];\n var target = closest(element, 'tr');\n this.monthHeaderHeight = element.offsetParent.offsetTop - target.offsetTop;\n element.style.height = ((target.offsetHeight - 1) - this.monthHeaderHeight) + 'px';\n var firstChild = target.firstElementChild;\n var width = Math.round(element.offsetWidth / firstChild.offsetWidth);\n element.style.width = (firstChild.offsetWidth * width) + 'px';\n }\n };\n // eslint-disable-next-line max-len\n MonthEvent.prototype.getFilteredEvents = function (startDate, endDate, groupIndex, eventsList) {\n var filteredEvents;\n if (isNullOrUndefined(groupIndex)) {\n filteredEvents = this.filterEvents(startDate, endDate);\n }\n else {\n var data = this.parent.resourceBase.lastResourceLevel[parseInt(groupIndex, 10)];\n filteredEvents = this.filterEvents(startDate, endDate, isNullOrUndefined(eventsList) ? undefined : eventsList, data);\n }\n return filteredEvents;\n };\n MonthEvent.prototype.getOverlapEvents = function (date, appointments) {\n var appointmentsList = [];\n for (var _i = 0, appointments_1 = appointments; _i < appointments_1.length; _i++) {\n var app = appointments_1[_i];\n var dateTime = util.resetTime(date).getTime();\n if ((util.resetTime(app[this.fields.startTime]).getTime() <= dateTime) &&\n (util.resetTime(app[this.fields.endTime]).getTime() >= dateTime)) {\n appointmentsList.push(app);\n }\n }\n return appointmentsList;\n };\n MonthEvent.prototype.getIndex = function (date) {\n var appIndex = -1;\n var appointments = this.renderedEvents;\n if (appointments.length > 0) {\n var appointmentsList = this.getOverlapEvents(date, appointments);\n var appLevel = appointmentsList.map(function (obj) { return obj.Index; });\n appIndex = (appLevel.length > 0) ? this.getSmallestMissingNumber(appLevel) : 0;\n }\n return (appIndex === -1) ? 0 : appIndex;\n };\n MonthEvent.prototype.moreIndicatorClick = function (event) {\n var _this = this;\n var target = closest(event.target, '.' + cls.MORE_INDICATOR_CLASS);\n var startDate = new Date(parseInt(target.getAttribute('data-start-date'), 10));\n var endDate = new Date(parseInt(target.getAttribute('data-end-date'), 10));\n var groupIndex = target.getAttribute('data-group-index');\n var moreArgs = {\n cancel: false, event: event, element: target, isPopupOpen: true,\n startTime: startDate, endTime: endDate, viewName: this.parent.getNavigateView()\n };\n if (groupIndex) {\n moreArgs.groupIndex = parseInt(groupIndex, 10);\n }\n this.parent.trigger(events.moreEventsClick, moreArgs, function (clickArgs) {\n if (!clickArgs.cancel) {\n if (clickArgs.isPopupOpen) {\n var filteredEvents = _this.getFilteredEvents(startDate, endDate, groupIndex);\n var moreArgs_1 = { date: startDate, event: filteredEvents, element: event.target };\n _this.parent.quickPopup.moreEventClick(moreArgs_1, endDate, groupIndex);\n }\n else {\n _this.parent.setProperties({ selectedDate: startDate }, true);\n _this.parent.changeView(clickArgs.viewName, event);\n }\n }\n });\n };\n MonthEvent.prototype.renderEventElement = function (event, appointmentElement, cellTd) {\n var _this = this;\n var eventType = appointmentElement.classList.contains(cls.BLOCK_APPOINTMENT_CLASS) ? 'blockEvent' : 'event';\n var isAppointment = appointmentElement.classList.contains(cls.APPOINTMENT_CLASS);\n var eventObj = this.getEventData(event);\n var args = { data: eventObj, element: appointmentElement, cancel: false, type: eventType };\n this.parent.trigger(events.eventRendered, args, function (eventArgs) {\n if (eventArgs.cancel) {\n _this.renderedEvents.pop();\n }\n else {\n _this.renderElement(cellTd, appointmentElement, isAppointment);\n }\n });\n };\n MonthEvent.prototype.getEventData = function (event) {\n var eventObj = extend({}, event, null, true);\n eventObj[this.fields.startTime] = event.data[this.fields.startTime];\n eventObj[this.fields.endTime] = event.data[this.fields.endTime];\n return eventObj;\n };\n MonthEvent.prototype.renderElement = function (cellTd, element, isAppointment) {\n if (isAppointment === void 0) { isAppointment = false; }\n if (this.maxOrIndicator && isAppointment) {\n this.setMaxEventHeight(element, cellTd);\n }\n var wrapperEle = cellTd.querySelector('.' + cls.APPOINTMENT_WRAPPER_CLASS);\n if (wrapperEle) {\n wrapperEle.appendChild(element);\n }\n else {\n var wrapper = createElement('div', { className: cls.APPOINTMENT_WRAPPER_CLASS });\n wrapper.appendChild(element);\n cellTd.appendChild(wrapper);\n }\n };\n MonthEvent.prototype.getMoreIndicatorElement = function (count, startDate, endDate) {\n var moreIndicatorElement = createElement('div', {\n className: cls.MORE_INDICATOR_CLASS,\n innerHTML: '+' + this.parent.globalize.formatNumber(count) + ' ' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more')),\n attrs: {\n 'tabindex': '0',\n 'data-start-date': startDate.getTime().toString(),\n 'data-end-date': endDate.getTime().toString(),\n 'role': 'list'\n }\n });\n return moreIndicatorElement;\n };\n MonthEvent.prototype.removeHeightProperty = function (selector) {\n var rows = [].slice.call(this.element.querySelectorAll('.' + selector + ' tbody tr'));\n for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {\n var row = rows_1[_i];\n row.firstElementChild.style.height = '';\n }\n };\n MonthEvent.prototype.setMaxEventHeight = function (event, cell) {\n var headerHeight = util.getOuterHeight(cell.querySelector('.' + cls.DATE_HEADER_CLASS));\n var height = (cell.offsetHeight - headerHeight) - (this.maxHeight ? 0 : this.moreIndicatorHeight);\n setStyleAttribute(event, { 'height': height + 'px', 'align-items': 'center' });\n };\n MonthEvent.prototype.destroy = function () {\n this.element = null;\n this.fields = null;\n this.maxHeight = null;\n this.withIndicator = null;\n this.maxOrIndicator = null;\n this.moreIndicatorHeight = null;\n this.removeEventListener();\n _super.prototype.destroy.call(this);\n };\n return MonthEvent;\n}(EventBase));\nexport { MonthEvent };\n","//! moment.js locale configuration\n//! locale : Arabic (Algeria) [ar-dz]\n//! author : Amine Roukh: https://github.com/Amine27\n//! author : Abdel Said: https://github.com/abdelsaid\n//! author : Ahmed Elkhatib\n//! author : forabi https://github.com/forabi\n//! author : Noureddine LOUAHEDJ : https://github.com/noureddinem\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var pluralForm = function (n) {\n return n === 0\n ? 0\n : n === 1\n ? 1\n : n === 2\n ? 2\n : n % 100 >= 3 && n % 100 <= 10\n ? 3\n : n % 100 >= 11\n ? 4\n : 5;\n },\n plurals = {\n s: [\n 'أقل من ثانية',\n 'ثانية واحدة',\n ['ثانيتان', 'ثانيتين'],\n '%d ثوان',\n '%d ثانية',\n '%d ثانية',\n ],\n m: [\n 'أقل من دقيقة',\n 'دقيقة واحدة',\n ['دقيقتان', 'دقيقتين'],\n '%d دقائق',\n '%d دقيقة',\n '%d دقيقة',\n ],\n h: [\n 'أقل من ساعة',\n 'ساعة واحدة',\n ['ساعتان', 'ساعتين'],\n '%d ساعات',\n '%d ساعة',\n '%d ساعة',\n ],\n d: [\n 'أقل من يوم',\n 'يوم واحد',\n ['يومان', 'يومين'],\n '%d أيام',\n '%d يومًا',\n '%d يوم',\n ],\n M: [\n 'أقل من شهر',\n 'شهر واحد',\n ['شهران', 'شهرين'],\n '%d أشهر',\n '%d شهرا',\n '%d شهر',\n ],\n y: [\n 'أقل من عام',\n 'عام واحد',\n ['عامان', 'عامين'],\n '%d أعوام',\n '%d عامًا',\n '%d عام',\n ],\n },\n pluralize = function (u) {\n return function (number, withoutSuffix, string, isFuture) {\n var f = pluralForm(number),\n str = plurals[u][pluralForm(number)];\n if (f === 2) {\n str = str[withoutSuffix ? 0 : 1];\n }\n return str.replace(/%d/i, number);\n };\n },\n months = [\n 'جانفي',\n 'فيفري',\n 'مارس',\n 'أفريل',\n 'ماي',\n 'جوان',\n 'جويلية',\n 'أوت',\n 'سبتمبر',\n 'أكتوبر',\n 'نوفمبر',\n 'ديسمبر',\n ];\n\n var arDz = moment.defineLocale('ar-dz', {\n months: months,\n monthsShort: months,\n weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'D/\\u200FM/\\u200FYYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n meridiemParse: /ص|م/,\n isPM: function (input) {\n return 'م' === input;\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 12) {\n return 'ص';\n } else {\n return 'م';\n }\n },\n calendar: {\n sameDay: '[اليوم عند الساعة] LT',\n nextDay: '[غدًا عند الساعة] LT',\n nextWeek: 'dddd [عند الساعة] LT',\n lastDay: '[أمس عند الساعة] LT',\n lastWeek: 'dddd [عند الساعة] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'بعد %s',\n past: 'منذ %s',\n s: pluralize('s'),\n ss: pluralize('s'),\n m: pluralize('m'),\n mm: pluralize('m'),\n h: pluralize('h'),\n hh: pluralize('h'),\n d: pluralize('d'),\n dd: pluralize('d'),\n M: pluralize('M'),\n MM: pluralize('M'),\n y: pluralize('y'),\n yy: pluralize('y'),\n },\n postformat: function (string) {\n return string.replace(/,/g, '،');\n },\n week: {\n dow: 0, // Sunday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return arDz;\n\n})));\n","var userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /web0s(?!.*chrome)/i.test(userAgent);\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\nvar fails = require('../internals/fails');\nvar has = require('../internals/has');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar anObject = require('../internals/an-object');\nvar toObject = require('../internals/to-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar nativeObjectCreate = require('../internals/object-create');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar shared = require('../internals/shared');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar uid = require('../internals/uid');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineWellKnownSymbol = require('../internals/define-well-known-symbol');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar HIDDEN = sharedKey('hidden');\nvar SYMBOL = 'Symbol';\nvar PROTOTYPE = 'prototype';\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(SYMBOL);\nvar ObjectPrototype = Object[PROTOTYPE];\nvar $Symbol = global.Symbol;\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;\nvar nativePropertyIsEnumerable = propertyIsEnumerableModule.f;\nvar AllSymbols = shared('symbols');\nvar ObjectPrototypeSymbols = shared('op-symbols');\nvar StringToSymbolRegistry = shared('string-to-symbol-registry');\nvar SymbolToStringRegistry = shared('symbol-to-string-registry');\nvar WellKnownSymbolsStore = shared('wks');\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDescriptor = DESCRIPTORS && fails(function () {\n return nativeObjectCreate(nativeDefineProperty({}, 'a', {\n get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (O, P, Attributes) {\n var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);\n if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];\n nativeDefineProperty(O, P, Attributes);\n if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {\n nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);\n }\n} : nativeDefineProperty;\n\nvar wrap = function (tag, description) {\n var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);\n setInternalState(symbol, {\n type: SYMBOL,\n tag: tag,\n description: description\n });\n if (!DESCRIPTORS) symbol.description = description;\n return symbol;\n};\n\nvar isSymbol = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return Object(it) instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(O, P, Attributes) {\n if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);\n anObject(O);\n var key = toPrimitive(P, true);\n anObject(Attributes);\n if (has(AllSymbols, key)) {\n if (!Attributes.enumerable) {\n if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));\n O[HIDDEN][key] = true;\n } else {\n if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;\n Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });\n } return setSymbolDescriptor(O, key, Attributes);\n } return nativeDefineProperty(O, key, Attributes);\n};\n\nvar $defineProperties = function defineProperties(O, Properties) {\n anObject(O);\n var properties = toIndexedObject(Properties);\n var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));\n $forEach(keys, function (key) {\n if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);\n });\n return O;\n};\n\nvar $create = function create(O, Properties) {\n return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);\n};\n\nvar $propertyIsEnumerable = function propertyIsEnumerable(V) {\n var P = toPrimitive(V, true);\n var enumerable = nativePropertyIsEnumerable.call(this, P);\n if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;\n return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;\n};\n\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {\n var it = toIndexedObject(O);\n var key = toPrimitive(P, true);\n if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;\n var descriptor = nativeGetOwnPropertyDescriptor(it, key);\n if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {\n descriptor.enumerable = true;\n }\n return descriptor;\n};\n\nvar $getOwnPropertyNames = function getOwnPropertyNames(O) {\n var names = nativeGetOwnPropertyNames(toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);\n });\n return result;\n};\n\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(O) {\n var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;\n var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {\n result.push(AllSymbols[key]);\n }\n });\n return result;\n};\n\n// `Symbol` constructor\n// https://tc39.es/ecma262/#sec-symbol-constructor\nif (!NATIVE_SYMBOL) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');\n var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);\n var tag = uid(description);\n var setter = function (value) {\n if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));\n };\n if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });\n return wrap(tag, description);\n };\n\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return getInternalState(this).tag;\n });\n\n redefine($Symbol, 'withoutSetter', function (description) {\n return wrap(uid(description), description);\n });\n\n propertyIsEnumerableModule.f = $propertyIsEnumerable;\n definePropertyModule.f = $defineProperty;\n getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;\n getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;\n getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;\n\n wrappedWellKnownSymbolModule.f = function (name) {\n return wrap(wellKnownSymbol(name), name);\n };\n\n if (DESCRIPTORS) {\n // https://github.com/tc39/proposal-Symbol-description\n nativeDefineProperty($Symbol[PROTOTYPE], 'description', {\n configurable: true,\n get: function description() {\n return getInternalState(this).description;\n }\n });\n if (!IS_PURE) {\n redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });\n }\n }\n}\n\n$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {\n Symbol: $Symbol\n});\n\n$forEach(objectKeys(WellKnownSymbolsStore), function (name) {\n defineWellKnownSymbol(name);\n});\n\n$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {\n // `Symbol.for` method\n // https://tc39.es/ecma262/#sec-symbol.for\n 'for': function (key) {\n var string = String(key);\n if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];\n var symbol = $Symbol(string);\n StringToSymbolRegistry[string] = symbol;\n SymbolToStringRegistry[symbol] = string;\n return symbol;\n },\n // `Symbol.keyFor` method\n // https://tc39.es/ecma262/#sec-symbol.keyfor\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');\n if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];\n },\n useSetter: function () { USE_SETTER = true; },\n useSimple: function () { USE_SETTER = false; }\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {\n // `Object.create` method\n // https://tc39.es/ecma262/#sec-object.create\n create: $create,\n // `Object.defineProperty` method\n // https://tc39.es/ecma262/#sec-object.defineproperty\n defineProperty: $defineProperty,\n // `Object.defineProperties` method\n // https://tc39.es/ecma262/#sec-object.defineproperties\n defineProperties: $defineProperties,\n // `Object.getOwnPropertyDescriptor` method\n // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {\n // `Object.getOwnPropertyNames` method\n // https://tc39.es/ecma262/#sec-object.getownpropertynames\n getOwnPropertyNames: $getOwnPropertyNames,\n // `Object.getOwnPropertySymbols` method\n // https://tc39.es/ecma262/#sec-object.getownpropertysymbols\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\n$({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n return getOwnPropertySymbolsModule.f(toObject(it));\n }\n});\n\n// `JSON.stringify` method behavior with symbols\n// https://tc39.es/ecma262/#sec-json.stringify\nif ($stringify) {\n var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {\n var symbol = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) != '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) != '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) != '{}';\n });\n\n $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {\n // eslint-disable-next-line no-unused-vars\n stringify: function stringify(it, replacer, space) {\n var args = [it];\n var index = 1;\n var $replacer;\n while (arguments.length > index) args.push(arguments[index++]);\n $replacer = replacer;\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return $stringify.apply(null, args);\n }\n });\n}\n\n// `Symbol.prototype[@@toPrimitive]` method\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\nif (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {\n createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n}\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag($Symbol, SYMBOL);\n\nhiddenKeys[HIDDEN] = true;\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call,no-throw-literal\n method.call(null, argument || function () { throw 1; }, 1);\n });\n};\n","!function(t,e){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)(\"object\"==typeof exports?exports:t)[r]=n[r]}}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,\"a\",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p=\"/dist/\",e(e.s=6)}([function(t,e,n){\"use strict\";function r(){d=!1}function i(t){if(!t)return void(f!==m&&(f=m,r()));if(t!==f){if(t.length!==m.length)throw new Error(\"Custom alphabet for shortid must be \"+m.length+\" unique characters. You submitted \"+t.length+\" characters: \"+t);var e=t.split(\"\").filter(function(t,e,n){return e!==n.lastIndexOf(t)});if(e.length)throw new Error(\"Custom alphabet for shortid must be \"+m.length+\" unique characters. These characters were not unique: \"+e.join(\", \"));f=t,r()}}function o(t){return i(t),f}function a(t){h.seed(t),p!==t&&(r(),p=t)}function s(){f||i(m);for(var t,e=f.split(\"\"),n=[],r=h.nextValue();e.length>0;)r=h.nextValue(),t=Math.floor(r*e.length),n.push(e.splice(t,1)[0]);return n.join(\"\")}function c(){return d||(d=s())}function u(t){return c()[t]}function l(){return f||m}var f,p,d,h=n(19),m=\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-\";t.exports={get:l,characters:o,seed:a,lookup:u,shuffled:c}},function(t,e,n){\"use strict\";var r=n(5),i=n.n(r);e.a={animateIn:function(t){i()({targets:t,translateY:\"-35px\",opacity:1,duration:300,easing:\"easeOutCubic\"})},animateOut:function(t,e){i()({targets:t,opacity:0,marginTop:\"-40px\",duration:300,easing:\"easeOutExpo\",complete:e})},animateOutBottom:function(t,e){i()({targets:t,opacity:0,marginBottom:\"-40px\",duration:300,easing:\"easeOutExpo\",complete:e})},animateReset:function(t){i()({targets:t,left:0,opacity:1,duration:300,easing:\"easeOutExpo\"})},animatePanning:function(t,e,n){i()({targets:t,duration:10,easing:\"easeOutQuad\",left:e,opacity:n})},animatePanEnd:function(t,e){i()({targets:t,opacity:0,duration:300,easing:\"easeOutExpo\",complete:e})},clearAnimation:function(t){var e=i.a.timeline();t.forEach(function(t){e.add({targets:t.el,opacity:0,right:\"-40px\",duration:300,offset:\"-=150\",easing:\"easeOutExpo\",complete:function(){t.remove()}})})}}},function(t,e,n){\"use strict\";t.exports=n(16)},function(t,e,n){\"use strict\";n.d(e,\"a\",function(){return s});var r=n(8),i=n(1),o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a=n(2);n(11).polyfill();var s=function t(e){var n=this;return this.id=a.generate(),this.options=e,this.cached_options={},this.global={},this.groups=[],this.toasts=[],this.container=null,l(this),u(this),this.group=function(e){e||(e={}),e.globalToasts||(e.globalToasts={}),Object.assign(e.globalToasts,n.global);var r=new t(e);return n.groups.push(r),r},this.register=function(t,e,r){return r=r||{},f(n,t,e,r)},this.show=function(t,e){return c(n,t,e)},this.success=function(t,e){return e=e||{},e.type=\"success\",c(n,t,e)},this.info=function(t,e){return e=e||{},e.type=\"info\",c(n,t,e)},this.error=function(t,e){return e=e||{},e.type=\"error\",c(n,t,e)},this.remove=function(t){n.toasts=n.toasts.filter(function(e){return e.el.hash!==t.hash}),t.parentNode&&t.parentNode.removeChild(t)},this.clear=function(t){return i.a.clearAnimation(n.toasts,function(){t&&t()}),n.toasts=[],!0},this},c=function(t,e,i){i=i||{};var a=null;if(\"object\"!==(void 0===i?\"undefined\":o(i)))return console.error(\"Options should be a type of object. given : \"+i),null;t.options.singleton&&t.toasts.length>0&&(t.cached_options=i,t.toasts[t.toasts.length-1].goAway(0));var s=Object.assign({},t.options);return Object.assign(s,i),a=n.i(r.a)(t,e,s),t.toasts.push(a),a},u=function(t){var e=t.options.globalToasts,n=function(e,n){return\"string\"==typeof n&&t[n]?t[n].apply(t,[e,{}]):c(t,e,n)};e&&(t.global={},Object.keys(e).forEach(function(r){t.global[r]=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e[r].apply(null,[t,n])}}))},l=function(t){var e=document.createElement(\"div\");e.id=t.id,e.setAttribute(\"role\",\"status\"),e.setAttribute(\"aria-live\",\"polite\"),e.setAttribute(\"aria-atomic\",\"false\"),document.body.appendChild(e),t.container=e},f=function(t,e,n,r){t.options.globalToasts||(t.options.globalToasts={}),t.options.globalToasts[e]=function(t,e){var i=null;return\"string\"==typeof n&&(i=n),\"function\"==typeof n&&(i=n(t)),e(i,r)},u(t)}},function(t,e,n){n(22);var r=n(21)(null,null,null,null);t.exports=r.exports},function(t,e,n){(function(n){var r,i,o,a={scope:{}};a.defineProperty=\"function\"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){if(n.get||n.set)throw new TypeError(\"ES3 does not support getters and setters.\");t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},a.getGlobal=function(t){return\"undefined\"!=typeof window&&window===t?t:void 0!==n&&null!=n?n:t},a.global=a.getGlobal(this),a.SYMBOL_PREFIX=\"jscomp_symbol_\",a.initSymbol=function(){a.initSymbol=function(){},a.global.Symbol||(a.global.Symbol=a.Symbol)},a.symbolCounter_=0,a.Symbol=function(t){return a.SYMBOL_PREFIX+(t||\"\")+a.symbolCounter_++},a.initSymbolIterator=function(){a.initSymbol();var t=a.global.Symbol.iterator;t||(t=a.global.Symbol.iterator=a.global.Symbol(\"iterator\")),\"function\"!=typeof Array.prototype[t]&&a.defineProperty(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return a.arrayIterator(this)}}),a.initSymbolIterator=function(){}},a.arrayIterator=function(t){var e=0;return a.iteratorPrototype(function(){return en&&(n+=1),1n?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var n=/hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g.exec(t)||/hsla\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*([\\d.]+)\\)/g.exec(t);t=parseInt(n[1])/360;var r=parseInt(n[2])/100,i=parseInt(n[3])/100,n=n[4]||1;if(0==r)i=r=t=i;else{var o=.5>i?i*(1+r):i+r-i*r,a=2*i-o,i=e(a,o,t+1/3),r=e(a,o,t);t=e(a,o,t-1/3)}return\"rgba(\"+255*i+\",\"+255*r+\",\"+255*t+\",\"+n+\")\"}function f(t){if(t=/([\\+\\-]?[0-9#\\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t))return t[2]}function p(t){return-1=d.currentTime)for(var x=0;x=h||!e)&&(d.began||(d.began=!0,o(\"begin\")),o(\"run\")),g>s&&g