').addClass('dx-treelist-wrapper').get(0);\n var scroll = this['_createComponent'](element, 'dxScrollView', { scrollByThumb: true });\n var self = this;\n var $scrollContent = $.fn.constructor(scroll['content']());\n var $element = $.fn.constructor(this.element());\n $scrollContent.append($.fn.constructor('
')[0]);\n var context = ko.contextFor($element.get(0));\n var treeListController = this.option('treeListController');\n var options = ko.computed(() => {\n return {\n itemsProvider: this._itemsProvider(), onItemsVisibilityChanged: () => {\n if (self['_popup']) {\n self['_popup']._renderPosition();\n }\n }, selectedPath: selectedPath, treeListController: treeListController, path: this._path\n };\n });\n var childContext = context.createChildContext({ options });\n ko.applyBindingsToDescendants(childContext, $scrollContent.get(0));\n $.fn.constructor(this['_popup'].content()).append(element);\n }\n}\nregisterComponent('dxFieldListPicker', dxFieldListPicker);\n","/**\r\n* DevExpress Analytics (dx-analytics-core-bindings.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { addToBindingsCache } from './property-grid/widgets/internal/_bindingsCache';\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-none\\', css: { \\'dxd-state-active\\': (!bottom() && !left() && !top() && !right()), \\'dxrd-disabled-button\\': disabled }, click: function() { setNone() }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-none'; }, 'css': function () { return { 'dxd-state-active': (!$context.$data.bottom() && !$context.$data.left() && !$context.$data.top() && !$context.$data.right()), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setNone(); }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-all\\', css: { \\'dxd-state-active\\': (bottom() && left() && top() && right()), \\'dxrd-disabled-button\\': disabled }, click: function() { setAll() }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-all'; }, 'css': function () { return { 'dxd-state-active': ($context.$data.bottom() && $context.$data.left() && $context.$data.top() && $context.$data.right()), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setAll(); }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-left\\', css: { \\'dxd-state-active\\': left(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'left\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-left'; }, 'css': function () { return { 'dxd-state-active': $context.$data.left(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('left'); }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-top\\', css: { \\'dxd-state-active\\': top(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'top\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-top'; }, 'css': function () { return { 'dxd-state-active': $context.$data.top(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('top'); }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-right\\', css: { \\'dxd-state-active\\': right(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'right\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-right'; }, 'css': function () { return { 'dxd-state-active': $context.$data.right(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('right'); }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-bottom\\', css: { \\'dxd-state-active\\': bottom(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'bottom\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-bottom'; }, 'css': function () { return { 'dxd-state-active': $context.$data.bottom(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('bottom'); }; } }; });\naddToBindingsCache('with: value', function ($context, $element) { return { 'with': function () { return $context.$data.value; } }; });\naddToBindingsCache('dxBorderEditor: { value: value, disabled: disabled }', function ($context, $element) { return { 'dxBorderEditor': function () { return { 'value': $context.$data.value, 'disabled': $context.$data.disabled }; } }; });\naddToBindingsCache('dxColorBox: { value: displayValue, placeholder: $root.getLocalization(\\'(Not set)\\', \\'ReportStringId.UD_PropertyGrid_NotSetText\\'), editAlphaChannel: true, disabled: disabled, dropDownOptions: { container: $root.getPopupContainer($element), position: { at: \\'left bottom\\', collision: \\'flipfit flipfit\\', my: \\'left top\\', boundary: $root.getPopupContainer($element), of: $element } }, inputAttr: { \\'aria-label\\': displayName, id: editorInputId } }', function ($context, $element) { return { 'dxColorBox': function () { return { 'value': $context.$data.displayValue, 'placeholder': $context.$root.getLocalization('(Not set)', 'ReportStringId.UD_PropertyGrid_NotSetText'), 'editAlphaChannel': true, 'disabled': $context.$data.disabled, 'dropDownOptions': { 'container': $context.$root.getPopupContainer($element), 'position': { 'at': 'left bottom', 'collision': 'flipfit flipfit', 'my': 'left top', 'boundary': $context.$root.getPopupContainer($element), 'of': $element } }, 'inputAttr': { 'aria-label': $context.$data.displayName, 'id': $context.$data.editorInputId } }; } }; });\naddToBindingsCache('dxExpressionEditor: getOptions({ options: value, fieldListProvider: $root.dataBindingsProvider, displayNameProvider: $root.displayNameProvider && $root.displayNameProvider() })', function ($context, $element) { return { 'dxExpressionEditor': function () { return $context.$data.getOptions({ 'options': $context.$data.value, 'fieldListProvider': $context.$root.dataBindingsProvider, 'displayNameProvider': $context.$root.displayNameProvider && $context.$root.displayNameProvider() }); } }; });\naddToBindingsCache('if: $data.value()', function ($context, $element) { return { 'if': function () { return $context.$data.value(); } }; });\naddToBindingsCache('dxFieldListPicker: { path: path, acceptCustomValue: true, value: value, displayValue: $displayName, itemsProvider: $root.dataBindingsProvider, treeListController: treeListController, disabled: disabled, inputAttr: {id: editorInputId} }', function ($context, $element) { return { 'dxFieldListPicker': function () { return { 'path': $context.$data.path, 'acceptCustomValue': true, 'value': $context.$data.value, 'displayValue': $context.$data.$displayName, 'itemsProvider': $context.$root.dataBindingsProvider, 'treeListController': $context.$data.treeListController, 'disabled': $context.$data.disabled, 'inputAttr': { 'id': $context.$data.editorInputId } }; } }; });\naddToBindingsCache('displayNameExtender: { path: path, dataMember: value }', function ($context, $element) { return { 'displayNameExtender': function () { return { 'path': $context.$data.path, 'dataMember': $context.$data.value }; } }; });\naddToBindingsCache('if: visible', function ($context, $element) { return { 'if': function () { return $context.$data.visible; } }; });\naddToBindingsCache('dxFilterEditor: { options: value, fieldListProvider: $root.dataBindingsProvider, getDisplayNameByPath: $root.getDisplayNameByPath, displayNameProvider: $root.displayNameProvider && $root.displayNameProvider() }', function ($context, $element) { return { 'dxFilterEditor': function () { return { 'options': $context.$data.value, 'fieldListProvider': $context.$root.dataBindingsProvider, 'getDisplayNameByPath': $context.$root.getDisplayNameByPath, 'displayNameProvider': $context.$root.displayNameProvider && $context.$root.displayNameProvider() }; } }; });\naddToBindingsCache('dxFilterEditor: { options: value, fieldListProvider: $root.dataBindingsGroupProvider, getDisplayNameByPath: $root.getDisplayNameByPath, displayNameProvider: $root.displayNameProvider && $root.displayNameProvider() }', function ($context, $element) { return { 'dxFilterEditor': function () { return { 'options': $context.$data.value, 'fieldListProvider': $context.$root.dataBindingsGroupProvider, 'getDisplayNameByPath': $context.$root.getDisplayNameByPath, 'displayNameProvider': $context.$root.displayNameProvider && $context.$root.displayNameProvider() }; } }; });\naddToBindingsCache('dxFormatEditor: { value: value, disabled: disabled, actions: $data.actions, customPatterns: $data.customPatterns }', function ($context, $element) { return { 'dxFormatEditor': function () { return { 'value': $context.$data.value, 'disabled': $context.$data.disabled, 'actions': $context.$data.actions, 'customPatterns': $context.$data.customPatterns }; } }; });\naddToBindingsCache('dxTextBox: getOptions({ value: value, disabled: disabled, inputAttr: { \\'aria-label\\': displayName, id: editorInputId } }), dxValidator: { validationRules: (validationRules || []) }', function ($context, $element) { return { 'dxTextBox': function () { return $context.$data.getOptions({ 'value': $context.$data.value, 'disabled': $context.$data.disabled, 'inputAttr': { 'aria-label': $context.$data.displayName, 'id': $context.$data.editorInputId } }); }, 'dxValidator': function () { return { 'validationRules': ($context.$data.validationRules || []) }; } }; });\naddToBindingsCache('template: { name: \\'dx-propertieseditor\\', data: viewmodel }', function ($context, $element) { return { 'template': function () { return { 'name': 'dx-propertieseditor', 'data': $context.$data.viewmodel }; } }; });\naddToBindingsCache('dxPropertyGrid: { target: ko.observable($data), level: $parent.level, textToSearch: $parent.textToSearch }', function ($context, $element) { return { 'dxPropertyGrid': function () { return { 'target': $context.ko.observable($context.$data), 'level': $context.$parent.level, 'textToSearch': $context.$parent.textToSearch }; } }; });\naddToBindingsCache('dxPropertyGrid: { target: value, level: editor.level + 1, parentDisabled: editor.disabled }', function ($context, $element) { return { 'dxPropertyGrid': function () { return { 'target': $context.$data.value, 'level': $context.$data.editor.level + 1, 'parentDisabled': $context.$data.editor.disabled }; } }; });\naddToBindingsCache('if: $data.visible() && $data.editorCreated()', function ($context, $element) { return { 'if': function () { return $context.$data.visible() && $context.$data.editorCreated(); } }; });\naddToBindingsCache('dxTextAlignmentEditor: { value: value, disabled: disabled }', function ($context, $element) { return { 'dxTextAlignmentEditor': function () { return { 'value': $context.$data.value, 'disabled': $context.$data.disabled }; } }; });\naddToBindingsCache('treelist: options', function ($context, $element) { return { 'treelist': function () { return $context.$data.options; } }; });\naddToBindingsCache('if: options', function ($context, $element) { return { 'if': function () { return $context.$data.options; } }; });\naddToBindingsCache('style: { transform: snapLineSurfaces[0].transform() }', function ($context, $element) { return { 'style': function () { return { 'transform': $context.$data.snapLineSurfaces[0].transform() }; } }; });\naddToBindingsCache('style: { transform: snapLineSurfaces[1].transform() }', function ($context, $element) { return { 'style': function () { return { 'transform': $context.$data.snapLineSurfaces[1].transform() }; } }; });\naddToBindingsCache('style: { transform: snapLineSurfaces[2].transform() }', function ($context, $element) { return { 'style': function () { return { 'transform': $context.$data.snapLineSurfaces[2].transform() }; } }; });\naddToBindingsCache('style: { transform: snapLineSurfaces[3].transform() }', function ($context, $element) { return { 'style': function () { return { 'transform': $context.$data.snapLineSurfaces[3].transform() }; } }; });\naddToBindingsCache('template: templateName, click: function(_, e) { !$root.selection.disabled() && $root.selection.clickHandler($data, e); e.stopPropagation(); }', function ($context, $element) { return { 'template': function () { return $context.$data.templateName; }, 'click': function () { return function (_, e) { !$context.$root.selection.disabled() && $context.$root.selection.clickHandler($context.$data, e); e.stopPropagation(); }; } }; });\naddToBindingsCache('cssArray: [surfaceClass($element), { \\'dx-accessibility\\': $data.accessibilityCompliant } ]', function ($context, $element) { return { 'cssArray': function () { return [$context.$data.surfaceClass($element), { 'dx-accessibility': $context.$data.accessibilityCompliant }]; } }; });\naddToBindingsCache('visible: (!$data.designMode || designMode()), cssArray: [$data.rootStyle, { \\'dx-rtl\\' : $data.rtl, \\'dx-ltr\\': !$data.rtl }]', function ($context, $element) { return { 'visible': function () { return (!$context.$data.designMode || $context.$data.designMode()); }, 'cssArray': function () { return [$context.$data.rootStyle, { 'dx-rtl': $context.$data.rtl, 'dx-ltr': !$context.$data.rtl }]; } }; });\naddToBindingsCache('ifnot: isLoading', function ($context, $element) { return { 'ifnot': function () { return $context.$data.isLoading; } }; });\naddToBindingsCache('with: surface', function ($context, $element) { return { 'with': function () { return $context.$data.surface; } }; });\naddToBindingsCache('if: isLoading', function ($context, $element) { return { 'if': function () { return $context.$data.isLoading; } }; });\naddToBindingsCache('foreach: parts', function ($context, $element) { return { 'foreach': function () { return $context.$data.parts; } }; });\naddToBindingsCache('template: { name: templateName, data: model }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.templateName, 'data': $context.$data.model }; } }; });\naddToBindingsCache('if: ($data.addOns)', function ($context, $element) { return { 'if': function () { return ($context.$data.addOns); } }; });\naddToBindingsCache('foreach: addOns', function ($context, $element) { return { 'foreach': function () { return $context.$data.addOns; } }; });\naddToBindingsCache('text: verticalString', function ($context, $element) { return { 'text': function () { return $context.$data.verticalString; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-top\\', css: { \\'dxd-state-active\\': top(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'top\\', \\'Vertical\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-top'; }, 'css': function () { return { 'dxd-state-active': $context.$data.top(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('top', 'Vertical'); }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-middle\\', css: { \\'dxd-state-active\\': middle(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'middle\\', \\'Vertical\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-middle'; }, 'css': function () { return { 'dxd-state-active': $context.$data.middle(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('middle', 'Vertical'); }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-bottom\\', css: { \\'dxd-state-active\\': bottom(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'bottom\\', \\'Vertical\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-bottom'; }, 'css': function () { return { 'dxd-state-active': $context.$data.bottom(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('bottom', 'Vertical'); }; } }; });\naddToBindingsCache('text: horizontalString', function ($context, $element) { return { 'text': function () { return $context.$data.horizontalString; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-left\\', css: { \\'dxd-state-active\\': left(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'left\\', \\'Horizontal\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-left'; }, 'css': function () { return { 'dxd-state-active': $context.$data.left(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('left', 'Horizontal'); }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-center\\', css: { \\'dxd-state-active\\': center(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'center\\', \\'Horizontal\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-center'; }, 'css': function () { return { 'dxd-state-active': $context.$data.center(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('center', 'Horizontal'); }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-right\\', css: { \\'dxd-state-active\\': right(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'right\\', \\'Horizontal\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-right'; }, 'css': function () { return { 'dxd-state-active': $context.$data.right(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('right', 'Horizontal'); }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-justify\\', css: { \\'dxd-state-active\\': justify(), \\'dxrd-disabled-button\\': disabled }, click: function() { setValue(\\'justify\\', \\'Horizontal\\') }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-justify'; }, 'css': function () { return { 'dxd-state-active': $context.$data.justify(), 'dxrd-disabled-button': $context.$data.disabled }; }, 'click': function () { return function () { $context.$data.setValue('justify', 'Horizontal'); }; } }; });\naddToBindingsCache('dxButtonWithTemplate: { onClick: togglePopoverVisible, disabled: disabled, icon: ko.unwrap($data.imageTemplateName), iconClass: ko.unwrap($data.imageClassName) }, attr: { id: id, title: text }', function ($context, $element) { return { 'dxButtonWithTemplate': function () { return { 'onClick': $context.$data.togglePopoverVisible, 'disabled': $context.$data.disabled, 'icon': $context.ko.unwrap($context.$data.imageTemplateName), 'iconClass': $context.ko.unwrap($context.$data.imageClassName) }; }, 'attr': function () { return { 'id': $context.$data.id, 'title': $context.$data.text }; } }; });\naddToBindingsCache('dxPopup: { width: 235, height: \\'auto\\', position: { my: $root.rtl ? \\'left top\\': \\'right top\\', at: \\'bottom\\', of: (\\'#\\' + id) }, showTitle: false, showCloseButton: false, animation: {}, hideOnOutsideClick: true, container: ($data.getContainer || function(_e, selector) { return selector; })($element, \\'.dxrd-action-items-container\\'), shading: false, visible: popoverVisible }', function ($context, $element) { return { 'dxPopup': function () { return { 'width': 235, 'height': 'auto', 'position': { 'my': $context.$root.rtl ? 'left top' : 'right top', 'at': 'bottom', 'of': ('#' + $context.$data.id) }, 'showTitle': false, 'showCloseButton': false, 'animation': {}, 'hideOnOutsideClick': true, 'container': ($context.$data.getContainer || function (_e, selector) { return selector; })($element, '.dxrd-action-items-container'), 'shading': false, 'visible': $context.$data.popoverVisible }; } }; });\naddToBindingsCache('dxclick: clickAction, css: { \\'dxrd-disabled-button\\': disabled }', function ($context, $element) { return { 'dxclick': function () { return $context.$data.clickAction; }, 'css': function () { return { 'dxrd-disabled-button': $context.$data.disabled }; } }; });\naddToBindingsCache('css: ko.unwrap($data.imageClassName), template: {name: ko.unwrap($data.imageTemplateName), if: !!ko.unwrap($data.imageTemplateName)}, attr: { title: $data.displayText && $data.displayText() || text }', function ($context, $element) { return { 'css': function () { return $context.ko.unwrap($context.$data.imageClassName); }, 'template': function () { return { 'name': $context.ko.unwrap($context.$data.imageTemplateName), 'if': !!$context.ko.unwrap($context.$data.imageTemplateName) }; }, 'attr': function () { return { 'title': $context.$data.displayText && $context.$data.displayText() || $context.$data.text }; } }; });\naddToBindingsCache('if: $data.contentTemplate', function ($context, $element) { return { 'if': function () { return $context.$data.contentTemplate; } }; });\naddToBindingsCache('template: contentTemplate', function ($context, $element) { return { 'template': function () { return $context.$data.contentTemplate; } }; });\naddToBindingsCache('if: !$data.contentTemplate', function ($context, $element) { return { 'if': function () { return !$context.$data.contentTemplate; } }; });\naddToBindingsCache('foreach: actions', function ($context, $element) { return { 'foreach': function () { return $context.$data.actions; } }; });\naddToBindingsCache('styleunit: { top: $data.top, left: $data.left, width: $data.width, height: $data.height }, css: { \\'dxrd-locked\\': $data.isLocked }', function ($context, $element) { return { 'styleunit': function () { return { 'top': $context.$data.top, 'left': $context.$data.left, 'width': $context.$data.width, 'height': $context.$data.height }; }, 'css': function () { return { 'dxrd-locked': $context.$data.isLocked }; } }; });\naddToBindingsCache('styleunit: { left: $data.left, top: $data.top, width: $data.width, height: $data.height }, css: $data.className', function ($context, $element) { return { 'styleunit': function () { return { 'left': $context.$data.left, 'top': $context.$data.top, 'width': $context.$data.width, 'height': $context.$data.height }; }, 'css': function () { return $context.$data.className; } }; });\naddToBindingsCache('template: { name: $data.template, data: $data.data }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.template, 'data': $context.$data.data }; } }; });\naddToBindingsCache('css: $data.imageClassName, template: {name: $data.imageTemplateName, if: !!ko.unwrap($data.imageTemplateName)}', function ($context, $element) { return { 'css': function () { return $context.$data.imageClassName; }, 'template': function () { return { 'name': $context.$data.imageTemplateName, 'if': !!$context.ko.unwrap($context.$data.imageTemplateName) }; } }; });\naddToBindingsCache('text: text, attr: { title: text }', function ($context, $element) { return { 'text': function () { return $context.$data.text; }, 'attr': function () { return { 'title': $context.$data.text }; } }; });\naddToBindingsCache('foreach: $data.controls()', function ($context, $element) { return { 'foreach': function () { return $context.$data.controls(); } }; });\naddToBindingsCache('with: $parent.customData()', function ($context, $element) { return { 'with': function () { return $context.$parent.customData(); } }; });\naddToBindingsCache('dxclick: function(e) { if(stopPropagation) { stopPropagation = false; } else { toggleAppMenu() } }, template: \\'dxrd-svg-menu-menu\\', css: {\\'dxd-state-active\\': appMenuVisible }', function ($context, $element) { return { 'dxclick': function () { return function (e) { if ($context.$data.stopPropagation) {\n $context.$data.stopPropagation = false;\n }\n else {\n $context.$data.toggleAppMenu();\n } }; }, 'template': function () { return 'dxrd-svg-menu-menu'; }, 'css': function () { return { 'dxd-state-active': $context.$data.appMenuVisible }; } }; });\naddToBindingsCache('dxPopup: { width: 250, wrapperAttr: { class: \\'dxd-menu-back-color dxd-back-primary2\\' }, height: \\'100%\\' , position: $data.rtl ? { my: \\'right top\\' , at: \\'left top\\' , offset: \\'-10 0\\' } : { my: \\'left top\\' , at: \\'right top\\' , offset: \\'10 0\\' }, showTitle: false, showCloseButton: false, container: getMenuPopupContainer($element), target: getMenuPopupTarget($element), animation: {}, hideOnOutsideClick: function(e) { var buttonClassName = \\'dxrd-menu-button-image\\'; var parentClassList = e.target.parentNode && e.target.parentNode.parentNode && e.target.parentNode.parentNode.classList; stopPropagation = (e.target.classList && e.target.classList.contains(buttonClassName)) || (parentClassList && parentClassList.contains(buttonClassName)); return true; }, shading: false, focusStateEnabled: false, visible: appMenuVisible }', function ($context, $element) { return { 'dxPopup': function () { return { 'width': 250, 'wrapperAttr': { 'class': 'dxd-menu-back-color dxd-back-primary2' }, 'height': '100%', 'position': $context.$data.rtl ? { 'my': 'right top', 'at': 'left top', 'offset': '-10 0' } : { 'my': 'left top', 'at': 'right top', 'offset': '10 0' }, 'showTitle': false, 'showCloseButton': false, 'container': $context.$data.getMenuPopupContainer($element), 'target': $context.$data.getMenuPopupTarget($element), 'animation': {}, 'hideOnOutsideClick': function (e) { var buttonClassName = 'dxrd-menu-button-image'; var parentClassList = e.target.parentNode && e.target.parentNode.parentNode && e.target.parentNode.parentNode.classList; $context.$data.stopPropagation = (e.target.classList && e.target.classList.contains(buttonClassName)) || (parentClassList && parentClassList.contains(buttonClassName)); return true; }, 'shading': false, 'focusStateEnabled': false, 'visible': $context.$data.appMenuVisible }; } }; });\naddToBindingsCache('dxclick: function(e) { if(disabled && !disabled() || !disabled) { $root.toggleAppMenu(); clickAction($root.model(), e); }}, css: { \\'dxrd-disabled-button\\': disabled }, visible: visible', function ($context, $element) { return { 'dxclick': function () { return function (e) { if ($context.$data.disabled && !$context.$data.disabled() || !$context.$data.disabled) {\n $context.$root.toggleAppMenu();\n $context.$data.clickAction($context.$root.model(), e);\n } }; }, 'css': function () { return { 'dxrd-disabled-button': $context.$data.disabled }; }, 'visible': function () { return $context.$data.visible; } }; });\naddToBindingsCache('text: $data.displayText && $data.displayText() || text, attr: { title: $data.displayText && $data.displayText() || text}', function ($context, $element) { return { 'text': function () { return $context.$data.displayText && $context.$data.displayText() || $context.$data.text; }, 'attr': function () { return { 'title': $context.$data.displayText && $context.$data.displayText() || $context.$data.text }; } }; });\naddToBindingsCache('visible: $data.hasSeparator', function ($context, $element) { return { 'visible': function () { return $context.$data.hasSeparator; } }; });\naddToBindingsCache('foreach: actionLists.menuItems', function ($context, $element) { return { 'foreach': function () { return $context.$data.actionLists.menuItems; } }; });\naddToBindingsCache('dxdAccordion: { collapsed: collapsed }', function ($context, $element) { return { 'dxdAccordion': function () { return { 'collapsed': $context.$data.collapsed }; } }; });\naddToBindingsCache('css: { \\'dxrd-group-header-collapsed\\': collapsed() }', function ($context, $element) { return { 'css': function () { return { 'dxrd-group-header-collapsed': $context.$data.collapsed() }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-collapsed\\', css: { \\'dx-image-expanded\\': !collapsed() }', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-collapsed'; }, 'css': function () { return { 'dx-image-expanded': !$context.$data.collapsed() }; } }; });\naddToBindingsCache('text: $root.actionsGroupTitle()', function ($context, $element) { return { 'text': function () { return $context.$root.actionsGroupTitle(); } }; });\naddToBindingsCache('dxclick: function() { if($data.disabled && !$data.disabled() || !$data.disabled) { clickAction($root.editableObject()); } }, css: { \\'dxrd-disabled-button\\': $data.disabled && $data.disabled() }, visible: (ko.unwrap($data.visible) == undefined) || ko.unwrap($data.visible)', function ($context, $element) { return { 'dxclick': function () { return function () { if ($context.$data.disabled && !$context.$data.disabled() || !$context.$data.disabled) {\n $context.$data.clickAction($context.$root.editableObject());\n } }; }, 'css': function () { return { 'dxrd-disabled-button': $context.$data.disabled && $context.$data.disabled() }; }, 'visible': function () { return ($context.ko.unwrap($context.$data.visible) == undefined) || $context.ko.unwrap($context.$data.visible); } }; });\naddToBindingsCache('css: $data.imageClassName, template: {name: $data.imageTemplateName, if: !!ko.unwrap($data.imageTemplateName)}, attr: { title: $data.displayText && $data.displayText() || text }', function ($context, $element) { return { 'css': function () { return $context.$data.imageClassName; }, 'template': function () { return { 'name': $context.$data.imageTemplateName, 'if': !!$context.ko.unwrap($context.$data.imageTemplateName) }; }, 'attr': function () { return { 'title': $context.$data.displayText && $context.$data.displayText() || $context.$data.text }; } }; });\naddToBindingsCache('template: { name: \\'dx-propertieseditor\\', data: $data }', function ($context, $element) { return { 'template': function () { return { 'name': 'dx-propertieseditor', 'data': $context.$data }; } }; });\naddToBindingsCache('visible: items.some(x => !x.visible || ko.unwrap(x.visible))', function ($context, $element) { return { 'visible': function () { return $context.$data.items.some(x => !x.visible || $context.ko.unwrap(x.visible)); } }; });\naddToBindingsCache('text: group', function ($context, $element) { return { 'text': function () { return $context.$data.group; } }; });\naddToBindingsCache('if: popularVisible', function ($context, $element) { return { 'if': function () { return $context.$data.popularVisible; } }; });\naddToBindingsCache('foreach: (contextActions || [])', function ($context, $element) { return { 'foreach': function () { return ($context.$data.contextActions || []); } }; });\naddToBindingsCache('if: $data.templateName', function ($context, $element) { return { 'if': function () { return $context.$data.templateName; } }; });\naddToBindingsCache('template: templateName', function ($context, $element) { return { 'template': function () { return $context.$data.templateName; } }; });\naddToBindingsCache('if: !$data.templateName', function ($context, $element) { return { 'if': function () { return !$context.$data.templateName; } }; });\naddToBindingsCache('with: popularProperties', function ($context, $element) { return { 'with': function () { return $context.$data.popularProperties; } }; });\naddToBindingsCache('foreach: (groupActions || [])', function ($context, $element) { return { 'foreach': function () { return ($context.$data.groupActions || []); } }; });\naddToBindingsCache('foreach: (items || [])', function ($context, $element) { return { 'foreach': function () { return ($context.$data.items || []); } }; });\naddToBindingsCache('template: { name: $data.templateName, if: $data.templateName }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.templateName, 'if': $context.$data.templateName }; } }; });\naddToBindingsCache('css: { \\'dx-property-grid-search-collapsed\\': !isSearching() }', function ($context, $element) { return { 'css': function () { return { 'dx-property-grid-search-collapsed': !$context.$data.isSearching() }; } }; });\naddToBindingsCache('css: { \\'dxd-state-active\\': isSearching }, dxButtonWithTemplate: { onClick: switchSearchBox, icon: \\'dxrd-svg-properties-search\\', iconClass: \\'image-search\\' }, attr: { title: $root.getLocalization(\\'Search\\', \\'ASPxReportsStringId.SearchDialog_Header\\') }', function ($context, $element) { return { 'css': function () { return { 'dxd-state-active': $context.$data.isSearching }; }, 'dxButtonWithTemplate': function () { return { 'onClick': $context.$data.switchSearchBox, 'icon': 'dxrd-svg-properties-search', 'iconClass': 'image-search' }; }, 'attr': function () { return { 'title': $context.$root.getLocalization('Search', 'ASPxReportsStringId.SearchDialog_Header') }; } }; });\naddToBindingsCache('dxTextBox: { value: textToSearch, valueChangeEvent: \\'keyup\\', placeholder: searchPlaceholder(), showClearButton: true }, cacheElement: { action: function(element) { searchBox(element); } }', function ($context, $element) { return { 'dxTextBox': function () { return { 'value': $context.$data.textToSearch, 'valueChangeEvent': 'keyup', 'placeholder': $context.$data.searchPlaceholder(), 'showClearButton': true }; }, 'cacheElement': function () { return { 'action': function (element) { $context.$data.searchBox(element); } }; } }; });\naddToBindingsCache('visible: active() && visible()', function ($context, $element) { return { 'visible': function () { return $context.$data.active() && $context.$data.visible(); } }; });\naddToBindingsCache('text: text', function ($context, $element) { return { 'text': function () { return $context.$data.text; } }; });\naddToBindingsCache('css: { \\'dx-property-grid-search-collapsed\\': isSearching }', function ($context, $element) { return { 'css': function () { return { 'dx-property-grid-search-collapsed': $context.$data.isSearching }; } }; });\naddToBindingsCache('dxSelectBox: { dataSource: $root.controlsStore.dataSource, value: focusedItem, displayExpr: displayExpr, dropDownOptions: { container: $root.getPopupContainer($element) }, useItemTextAsTitle: true }', function ($context, $element) { return { 'dxSelectBox': function () { return { 'dataSource': $context.$root.controlsStore.dataSource, 'value': $context.$data.focusedItem, 'displayExpr': $context.$data.displayExpr, 'dropDownOptions': { 'container': $context.$root.getPopupContainer($element) }, 'useItemTextAsTitle': true }; } }; });\naddToBindingsCache('css: { \\'dxd-state-active dxd-state-no-hover\\': !isSortingByGroups() }, dxButtonWithTemplate: { onClick: function() { $data.isSortingByGroups(false); }, icon: \\'dxrd-svg-properties-sortingbyalphabet\\', iconClass: \\'image-sortingbyalphabet\\' }', function ($context, $element) { return { 'css': function () { return { 'dxd-state-active dxd-state-no-hover': !$context.$data.isSortingByGroups() }; }, 'dxButtonWithTemplate': function () { return { 'onClick': function () { $context.$data.isSortingByGroups(false); }, 'icon': 'dxrd-svg-properties-sortingbyalphabet', 'iconClass': 'image-sortingbyalphabet' }; } }; });\naddToBindingsCache('css: { \\'dxd-state-active dxd-state-no-hover\\': isSortingByGroups }, dxButtonWithTemplate: { onClick: function() { $data.isSortingByGroups(true); }, icon: \\'dxrd-svg-properties-sortingbygroups\\', iconClass: \\'image-sortingbygroups\\' }', function ($context, $element) { return { 'css': function () { return { 'dxd-state-active dxd-state-no-hover': $context.$data.isSortingByGroups }; }, 'dxButtonWithTemplate': function () { return { 'onClick': function () { $context.$data.isSortingByGroups(true); }, 'icon': 'dxrd-svg-properties-sortingbygroups', 'iconClass': 'image-sortingbygroups' }; } }; });\naddToBindingsCache('dxScrollView: { showScrollbar: \\'onHover\\', useNative: false, scrollByThumb: true }', function ($context, $element) { return { 'dxScrollView': function () { return { 'showScrollbar': 'onHover', 'useNative': false, 'scrollByThumb': true }; } }; });\naddToBindingsCache('visible: isSortingByGroups', function ($context, $element) { return { 'visible': function () { return $context.$data.isSortingByGroups; } }; });\naddToBindingsCache('visible: visible', function ($context, $element) { return { 'visible': function () { return $context.$data.visible; } }; });\naddToBindingsCache('text: displayName()', function ($context, $element) { return { 'text': function () { return $context.$data.displayName(); } }; });\naddToBindingsCache('dxLoadIndicator: { visible: !editorsCreated() }', function ($context, $element) { return { 'dxLoadIndicator': function () { return { 'visible': !$context.$data.editorsCreated() }; } }; });\naddToBindingsCache('visible: editorsCreated', function ($context, $element) { return { 'visible': function () { return $context.$data.editorsCreated; } }; });\naddToBindingsCache('visible: !isSortingByGroups()', function ($context, $element) { return { 'visible': function () { return !$context.$data.isSortingByGroups(); } }; });\naddToBindingsCache('dxLoadIndicator: { visible: !allEditorsCreated() }', function ($context, $element) { return { 'dxLoadIndicator': function () { return { 'visible': !$context.$data.allEditorsCreated() }; } }; });\naddToBindingsCache('visible: allEditorsCreated', function ($context, $element) { return { 'visible': function () { return $context.$data.allEditorsCreated; } }; });\naddToBindingsCache('dxPopup: { width: 250, height: \\'auto\\', position: $data.rtl ? { my: \\'left top\\', at: \\'right top\\', of: popupService.target, collision: \\'flipfit\\' } : { my: \\'right top\\', at: \\'left top\\', of: popupService.target, collision: \\'flipfit\\' }, container: $root.getPopupContainer($element), target: popupService.target, showTitle: false, showCloseButton: false, animation: {}, hideOnOutsideClick: true, shading: false, visible: popupService.visible }', function ($context, $element) { return { 'dxPopup': function () { return { 'width': 250, 'height': 'auto', 'position': $context.$data.rtl ? { 'my': 'left top', 'at': 'right top', 'of': $context.$data.popupService.target, 'collision': 'flipfit' } : { 'my': 'right top', 'at': 'left top', 'of': $context.$data.popupService.target, 'collision': 'flipfit' }, 'container': $context.$root.getPopupContainer($element), 'target': $context.$data.popupService.target, 'showTitle': false, 'showCloseButton': false, 'animation': {}, 'hideOnOutsideClick': true, 'shading': false, 'visible': $context.$data.popupService.visible }; } }; });\naddToBindingsCache('text: popupService.title, visible: popupService.title', function ($context, $element) { return { 'text': function () { return $context.$data.popupService.title; }, 'visible': function () { return $context.$data.popupService.title; } }; });\naddToBindingsCache('dxMenu: { wrapperAttr: { class: \\'dxd-button-back-color\\' }, disabled: popupService.disabled, dataSource: popupService.actions, displayExpr: \\'title\\', cssClass: \\'dxrd-editor-menu\\', orientation: \\'vertical\\', showFirstSubmenuMode: \\'onHover\\', onSubmenuShowing: function(e) { e.submenu._overlay.option(\\'container\\', $root.getPopupContainer($element)) } }', function ($context, $element) { return { 'dxMenu': function () { return { 'wrapperAttr': { 'class': 'dxd-button-back-color' }, 'disabled': $context.$data.popupService.disabled, 'dataSource': $context.$data.popupService.actions, 'displayExpr': 'title', 'cssClass': 'dxrd-editor-menu', 'orientation': 'vertical', 'showFirstSubmenuMode': 'onHover', 'onSubmenuShowing': function (e) { e.submenu._overlay.option('container', $context.$root.getPopupContainer($element)); } }; } }; });\naddToBindingsCache('dxclick: action', function ($context, $element) { return { 'dxclick': function () { return $context.$data.action; } }; });\naddToBindingsCache('attr: { title: title }, text: title', function ($context, $element) { return { 'attr': function () { return { 'title': $context.$data.title }; }, 'text': function () { return $context.$data.title; } }; });\naddToBindingsCache('visible: $data.items && $data.items.length', function ($context, $element) { return { 'visible': function () { return $context.$data.items && $context.$data.items.length; } }; });\naddToBindingsCache('if: $data.innerTemplate', function ($context, $element) { return { 'if': function () { return $context.$data.innerTemplate; } }; });\naddToBindingsCache('template: $data.innerTemplate', function ($context, $element) { return { 'template': function () { return $context.$data.innerTemplate; } }; });\naddToBindingsCache('with: model', function ($context, $element) { return { 'with': function () { return $context.$data.model; } }; });\naddToBindingsCache('if: $root.controlsStore.visible()', function ($context, $element) { return { 'if': function () { return $context.$root.controlsStore.visible(); } }; });\naddToBindingsCache('template: \\'dx-propertygrid-searchbox\\'', function ($context, $element) { return { 'template': function () { return 'dx-propertygrid-searchbox'; } }; });\naddToBindingsCache('template: { name: \\'dxrd-group-actions\\', data: { groupActions: $root.contextGroupActions } }', function ($context, $element) { return { 'template': function () { return { 'name': 'dxrd-group-actions', 'data': { 'groupActions': $context.$root.contextGroupActions } }; } }; });\naddToBindingsCache('template: { name: \\'dxrd-top-grid\\', data: { contextActions: $root.contextActions, popularProperties: $root.popularProperties, collapsed: ko.observable(false), popularVisible: $root.popularVisible() && isSortingByGroups(), actionsGroupTitle: $root.actionsGroupTitle } }', function ($context, $element) { return { 'template': function () { return { 'name': 'dxrd-top-grid', 'data': { 'contextActions': $context.$root.contextActions, 'popularProperties': $context.$root.popularProperties, 'collapsed': $context.ko.observable(false), 'popularVisible': $context.$root.popularVisible() && $context.$data.isSortingByGroups(), 'actionsGroupTitle': $context.$root.actionsGroupTitle } }; } }; });\naddToBindingsCache('foreach: groups', function ($context, $element) { return { 'foreach': function () { return $context.$data.groups; } }; });\naddToBindingsCache('ifnot: editorsCreated', function ($context, $element) { return { 'ifnot': function () { return $context.$data.editorsCreated; } }; });\naddToBindingsCache('if: $data.editorsRendered()', function ($context, $element) { return { 'if': function () { return $context.$data.editorsRendered(); } }; });\naddToBindingsCache('foreach: editors', function ($context, $element) { return { 'foreach': function () { return $context.$data.editors; } }; });\naddToBindingsCache('template: editorTemplate', function ($context, $element) { return { 'template': function () { return $context.$data.editorTemplate; } }; });\naddToBindingsCache('if: ($index() === $parent.editors().length - 1 && $parent.editorsCreated(true))', function ($context, $element) { return { 'if': function () { return ($context.$index() === $context.$parent.editors().length - 1 && $context.$parent.editorsCreated(true)); } }; });\naddToBindingsCache('foreach: $data.getEditors()', function ($context, $element) { return { 'foreach': function () { return $context.$data.getEditors(); } }; });\naddToBindingsCache('if: ($index() === $parent._editors().length - 1 && $parent.allEditorsCreated(true))', function ($context, $element) { return { 'if': function () { return ($context.$index() === $context.$parent._editors().length - 1 && $context.$parent.allEditorsCreated(true)); } }; });\naddToBindingsCache('template: \\'dx-propertygrid-popupservice\\'', function ($context, $element) { return { 'template': function () { return 'dx-propertygrid-popupservice'; } }; });\naddToBindingsCache('if: $data.itemTemplate', function ($context, $element) { return { 'if': function () { return $context.$data.itemTemplate; } }; });\naddToBindingsCache('template: $data.itemTemplate', function ($context, $element) { return { 'template': function () { return $context.$data.itemTemplate; } }; });\naddToBindingsCache('ifnot: $data.itemTemplate', function ($context, $element) { return { 'ifnot': function () { return $context.$data.itemTemplate; } }; });\naddToBindingsCache('dxTemplate: { name: \\'content\\' }', function () { return { dxTemplate: { name: 'content' } }; });\naddToBindingsCache('dxTemplate: { name: \\'item\\' }', function () { return { dxTemplate: { name: 'item' } }; });\naddToBindingsCache('styleunit: { width: tabPanel.width }, css: tabPanel.cssClasses(), resizable: tabPanel.getResizableOptions($element, 1, $root.calculateWithZoomFactor(325))', function ($context, $element) { return { 'styleunit': function () { return { 'width': $context.$data.tabPanel.width }; }, 'css': function () { return $context.$data.tabPanel.cssClasses(); }, 'resizable': function () { return $context.$data.tabPanel.getResizableOptions($element, 1, $context.$root.calculateWithZoomFactor(325)); } }; });\naddToBindingsCache('styleunit: { width: $data.headerWidth }, css: $data.cssClasses({\\'dx-tab-panel-collapsed\\':$data.collapsed }), accessibilityKeyboardHelper: $data.keyboardHelper', function ($context, $element) { return { 'styleunit': function () { return { 'width': $context.$data.headerWidth }; }, 'css': function () { return $context.$data.cssClasses({ 'dx-tab-panel-collapsed': $context.$data.collapsed }); }, 'accessibilityKeyboardHelper': function () { return $context.$data.keyboardHelper; } }; });\naddToBindingsCache('css: $data.cssClasses()', function ($context, $element) { return { 'css': function () { return $context.$data.cssClasses(); } }; });\naddToBindingsCache('dxAction: { model: $data, action: function(s) { $parent.toggleTabVisibility({ model: s }); }}, css: { \\'dxd-state-active dxd-state-no-hover\\': active, \\'dxrd-tab-item-disabled\\': disabled }, attr: { title: $data.text, \\'aria-label\\': $data.text, \\'aria-expanded\\': $data.active }, visible: visible', function ($context, $element) { return { 'dxAction': function () { return { 'model': $context.$data, 'action': function (s) { $context.$parent.toggleTabVisibility({ 'model': s }); } }; }, 'css': function () { return { 'dxd-state-active dxd-state-no-hover': $context.$data.active, 'dxrd-tab-item-disabled': $context.$data.disabled }; }, 'attr': function () { return { 'title': $context.$data.text, 'aria-label': $context.$data.text, 'aria-expanded': $context.$data.active }; }, 'visible': function () { return $context.$data.visible; } }; });\naddToBindingsCache('styleunit: { width: $data.width }, css: $data.cssClasses(), resizable: $data.getResizableOptions($element, 50, 396)', function ($context, $element) { return { 'styleunit': function () { return { 'width': $context.$data.width }; }, 'css': function () { return $context.$data.cssClasses(); }, 'resizable': function () { return $context.$data.getResizableOptions($element, 50, 396); } }; });\naddToBindingsCache('foreach: tabPanel.tabs', function ($context, $element) { return { 'foreach': function () { return $context.$data.tabPanel.tabs; } }; });\naddToBindingsCache('lazy: { template: $data.template }', function ($context, $element) { return { 'lazy': function () { return { 'template': $context.$data.template }; } }; });\naddToBindingsCache('with: tabPanel', function ($context, $element) { return { 'with': function () { return $context.$data.tabPanel; } }; });\naddToBindingsCache('foreach: $data.tabs', function ($context, $element) { return { 'foreach': function () { return $context.$data.tabs; } }; });\naddToBindingsCache('dxButtonWithTemplate: { icon: \\'dxrd-svg-operations-edit\\', iconClass: \\'dx-image-edit\\', disabled: disabled, onClick: toogle, hint: title }', function ($context, $element) { return { 'dxButtonWithTemplate': function () { return { 'icon': 'dxrd-svg-operations-edit', 'iconClass': 'dx-image-edit', 'disabled': $context.$data.disabled, 'onClick': $context.$data.toogle, 'hint': $context.$data.title }; } }; });\naddToBindingsCache('template: {name: \\'dxrd-toolbar-tmplt\\', data: actionLists.toolbarItems }', function ($context, $element) { return { 'template': function () { return { 'name': 'dxrd-toolbar-tmplt', 'data': $context.$data.actionLists.toolbarItems }; } }; });\naddToBindingsCache('visible: visible, class: \\'dxrd-toolbar-item-\\' + $index(), css: {\\'dxrd-toolbar-item-with-separator dxd-border-primary\\': $data.hasSeparator }', function ($context, $element) { return { 'visible': function () { return $context.$data.visible; }, 'class': function () { return 'dxrd-toolbar-item-' + $context.$index(); }, 'css': function () { return { 'dxrd-toolbar-item-with-separator dxd-border-primary': $context.$data.hasSeparator }; } }; });\naddToBindingsCache('attr: { \\'aria-label\\': $data.displayText && $data.displayText() || text, \\'aria-disabled\\': ko.unwrap($data.disabled) ? \\'true\\' : \\'false\\', \\'aria-pressed\\': $data.selected ? ($data.selected() ? \\'true\\' : \\'false\\') : null }', function ($context, $element) { return { 'attr': function () { return { 'aria-label': $context.$data.displayText && $context.$data.displayText() || $context.$data.text, 'aria-disabled': $context.ko.unwrap($context.$data.disabled) ? 'true' : 'false', 'aria-pressed': $context.$data.selected ? ($context.$data.selected() ? 'true' : 'false') : null }; } }; });\naddToBindingsCache('template: { name: ko.unwrap($data.imageTemplateName), if: !!ko.unwrap($data.imageTemplateName)}, attr: { class: \\'dxrd-toolbar-item-image dxd-state-normal dxd-icon-highlighted \\' + (ko.unwrap($data.imageClassName) || \\'\\'), title: $data.displayText && $data.displayText() || text }, }, dxclick: function() { if((typeof $data.disabled === \\'function\\') && !disabled() || !disabled) { clickAction($root.model && $root.model()); } }, css: {\\'dxrd-disabled-button\\': disabled, \\'dxd-button-back-color dxd-back-highlighted dxd-state-active\\': $data.selected }', function ($context, $element) { return { 'template': function () { return { 'name': $context.ko.unwrap($context.$data.imageTemplateName), 'if': !!$context.ko.unwrap($context.$data.imageTemplateName) }; }, 'attr': function () { return { 'class': 'dxrd-toolbar-item-image dxd-state-normal dxd-icon-highlighted ' + ($context.ko.unwrap($context.$data.imageClassName) || ''), 'title': $context.$data.displayText && $context.$data.displayText() || $context.$data.text }; }, '}': function () { return undefined; }, 'dxclick': function () { return function () { if ((typeof $context.$data.disabled === 'function') && !$context.$data.disabled() || !$context.$data.disabled) {\n $context.$data.clickAction($context.$root.model && $context.$root.model());\n } }; }, 'css': function () { return { 'dxrd-disabled-button': $context.$data.disabled, 'dxd-button-back-color dxd-back-highlighted dxd-state-active': $context.$data.selected }; } }; });\naddToBindingsCache('foreach: $data', function ($context, $element) { return { 'foreach': function () { return $context.$data; } }; });\naddToBindingsCache('template: { name: $data.templateName, data: $data.contentData || $data }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.templateName, 'data': $context.$data.contentData || $context.$data }; } }; });\naddToBindingsCache('dxScrollView: { showScrollbar: \\'onHover\\', scrollByContent: false, bounceEnabled: false, useNative: false, scrollByThumb: true }', function ($context, $element) { return { 'dxScrollView': function () { return { 'showScrollbar': 'onHover', 'scrollByContent': false, 'bounceEnabled': false, 'useNative': false, 'scrollByThumb': true }; } }; });\naddToBindingsCache('attr: { title: displayName }', function ($context, $element) { return { 'attr': function () { return { 'title': $context.$data.displayName }; } }; });\naddToBindingsCache('template: {name: $data.imageTemplateName, if: !!ko.unwrap($data.imageTemplateName)}, css: $data.imageClassName, draggable: $root.toolboxDragHandler', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.imageTemplateName, 'if': !!$context.ko.unwrap($context.$data.imageTemplateName) }; }, 'css': function () { return $context.$data.imageClassName; }, 'draggable': function () { return $context.$root.toolboxDragHandler; } }; });\naddToBindingsCache('foreach: toolboxItems', function ($context, $element) { return { 'foreach': function () { return $context.$data.toolboxItems; } }; });\naddToBindingsCache('foreach: groupedToolboxItems', function ($context, $element) { return { 'foreach': function () { return $context.$data.groupedToolboxItems; } }; });\naddToBindingsCache('foreach: items', function ($context, $element) { return { 'foreach': function () { return $context.$data.items; } }; });\naddToBindingsCache('dxSelectBox: { items: zoomLevels, value: $data.zoom, displayExpr: function(val) { return Math.round((val || this.option(\\'value\\')) * 100) + \\'%\\'; }, displayCustomValue: true, acceptCustomValue: true, onCustomItemCreating: onCustomItemCreating, disabled: disabled, dropDownOptions: { container: $root.getPopupContainer($element) }, useItemTextAsTitle: true }', function ($context, $element) { return { 'dxSelectBox': function () { return { 'items': $context.$data.zoomLevels, 'value': $context.$data.zoom, 'displayExpr': function (val) { return Math.round((val || this.option('value')) * 100) + '%'; }, 'displayCustomValue': true, 'acceptCustomValue': true, 'onCustomItemCreating': $context.$data.onCustomItemCreating, 'disabled': $context.$data.disabled, 'dropDownOptions': { 'container': $context.$root.getPopupContainer($element) }, 'useItemTextAsTitle': true }; } }; });\naddToBindingsCache('dxclick: function(_, element) { showPopup(_, element) }, css: editorMenuButtonCss, attr: { title: hint }', function ($context, $element) { return { 'dxclick': function () { return function (_, element) { $context.$data.showPopup(_, element); }; }, 'css': function () { return $context.$data.editorMenuButtonCss; }, 'attr': function () { return { 'title': $context.$data.hint }; } }; });\naddToBindingsCache('dxclick: function(_, element) { showPopup(_, element) }, attr: { title: hint }, css: editorMenuButtonCss', function ($context, $element) { return { 'dxclick': function () { return function (_, element) { $context.$data.showPopup(_, element); }; }, 'attr': function () { return { 'title': $context.$data.hint }; }, 'css': function () { return $context.$data.editorMenuButtonCss; } }; });\naddToBindingsCache('template: { name: $data.imageTemplateName, if: ko.unwrap($data.imageTemplateName) }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.imageTemplateName, 'if': $context.ko.unwrap($context.$data.imageTemplateName) }; } }; });\naddToBindingsCache('if: $data.visible', function ($context, $element) { return { 'if': function () { return $context.$data.visible; } }; });\naddToBindingsCache('template: $data.templateName', function ($context, $element) { return { 'template': function () { return $context.$data.templateName; } }; });\naddToBindingsCache('ifnot: $data.templateName', function ($context, $element) { return { 'ifnot': function () { return $context.$data.templateName; } }; });\naddToBindingsCache('if: !ko.unwrap($data.imageTemplateName)', function ($context, $element) { return { 'if': function () { return !$context.ko.unwrap($context.$data.imageTemplateName); } }; });\naddToBindingsCache('if: ko.unwrap($data.imageTemplateName)', function ($context, $element) { return { 'if': function () { return $context.ko.unwrap($context.$data.imageTemplateName); } }; });\naddToBindingsCache('dxdAccordion: { collapsed: collapsed, alwaysShow: alwaysShow }', function ($context, $element) { return { 'dxdAccordion': function () { return { 'collapsed': $context.$data.collapsed, 'alwaysShow': $context.$data.alwaysShow }; } }; });\naddToBindingsCache('attr: { \\'aria-expanded\\': alwaysShow() || !collapsed() ? \\'true\\' : \\'false\\', \\'aria-owns\\': contentId, \\'id\\': headerId, }', function ($context, $element) { return { 'attr': function () { return { 'aria-expanded': $context.$data.alwaysShow() || !$context.$data.collapsed() ? 'true' : 'false', 'aria-owns': $context.$data.contentId, 'id': $context.$data.headerId }; } }; });\naddToBindingsCache('dxButtonWithTemplate: { onClick: up, disabled: isDisabledButton(\\'up\\'), icon: \\'dxrd-svg-operations-moveup\\', iconClass: \\'dx-image-moveup\\' }, attr: { title: getDisplayTextButton(\\'up\\') }', function ($context, $element) { return { 'dxButtonWithTemplate': function () { return { 'onClick': $context.$data.up, 'disabled': $context.$data.isDisabledButton('up'), 'icon': 'dxrd-svg-operations-moveup', 'iconClass': 'dx-image-moveup' }; }, 'attr': function () { return { 'title': $context.$data.getDisplayTextButton('up') }; } }; });\naddToBindingsCache('dxButtonWithTemplate: { onClick: down, disabled: isDisabledButton(\\'down\\'), icon: \\'dxrd-svg-operations-movedown\\', iconClass: \\'dx-image-movedown\\' }, attr: { title: getDisplayTextButton(\\'down\\') }', function ($context, $element) { return { 'dxButtonWithTemplate': function () { return { 'onClick': $context.$data.down, 'disabled': $context.$data.isDisabledButton('down'), 'icon': 'dxrd-svg-operations-movedown', 'iconClass': 'dx-image-movedown' }; }, 'attr': function () { return { 'title': $context.$data.getDisplayTextButton('down') }; } }; });\naddToBindingsCache('dxButtonWithTemplate: { onClick: add, disabled: isDisabledButton(\\'add\\'), icon: \\'dxrd-svg-operations-add\\', iconClass: \\'dx-image-add\\' }, attr: { title: getDisplayTextButton(\\'add\\') }', function ($context, $element) { return { 'dxButtonWithTemplate': function () { return { 'onClick': $context.$data.add, 'disabled': $context.$data.isDisabledButton('add'), 'icon': 'dxrd-svg-operations-add', 'iconClass': 'dx-image-add' }; }, 'attr': function () { return { 'title': $context.$data.getDisplayTextButton('add') }; } }; });\naddToBindingsCache('dxButtonWithTemplate: { onClick: remove, disabled: isDisabledButton(\\'delete\\'), icon: \\'dxrd-svg-operations-remove\\', iconClass: \\'dx-image-remove\\' }, attr: { title: getDisplayTextButton(\\'delete\\') }', function ($context, $element) { return { 'dxButtonWithTemplate': function () { return { 'onClick': $context.$data.remove, 'disabled': $context.$data.isDisabledButton('delete'), 'icon': 'dxrd-svg-operations-remove', 'iconClass': 'dx-image-remove' }; }, 'attr': function () { return { 'title': $context.$data.getDisplayTextButton('delete') }; } }; });\naddToBindingsCache('styleunit: { \\'paddingLeft\\': padding }', function ($context, $element) { return { 'styleunit': function () { return { 'paddingLeft': $context.$data.padding }; } }; });\naddToBindingsCache('text: displayName, attr: { title: displayName }', function ($context, $element) { return { 'text': function () { return $context.$data.displayName; }, 'attr': function () { return { 'title': $context.$data.displayName }; } }; });\naddToBindingsCache('attr: { \\'aria-hidden\\': !alwaysShow() && collapsed() ? \\'true\\' : \\'false\\', \\'aria-labelledby\\': headerId, \\'id\\': contentId }', function ($context, $element) { return { 'attr': function () { return { 'aria-hidden': !$context.$data.alwaysShow() && $context.$data.collapsed() ? 'true' : 'false', 'aria-labelledby': $context.$data.headerId, 'id': $context.$data.contentId }; } }; });\naddToBindingsCache('visible: !disabled(), dxScrollView: { showScrollbar: \\'onHover\\', disabled: !showScroll, useNative: false, scrollByThumb: true, onInitialized: function(e) { e.component.option(\\'useKeyboard\\', false); } }', function ($context, $element) { return { 'visible': function () { return !$context.$data.disabled(); }, 'dxScrollView': function () { return { 'showScrollbar': 'onHover', 'disabled': !$context.$data.showScroll, 'useNative': false, 'scrollByThumb': true, 'onInitialized': function (e) { e.component.option('useKeyboard', false); } }; } }; });\naddToBindingsCache('text: getDisplayTextEmptyArray()', function ($context, $element) { return { 'text': function () { return $context.$data.getDisplayTextEmptyArray(); } }; });\naddToBindingsCache('foreach: values', function ($context, $element) { return { 'foreach': function () { return $context.$data.values; } }; });\naddToBindingsCache('with: $parent.createCollectionItemWrapper($parents[1], $index, $element)', function ($context, $element) { return { 'with': function () { return $context.$parent.createCollectionItemWrapper($context.$parents[1], $context.$index, $element); } }; });\naddToBindingsCache('attr: { \\'aria-selected\\': $parents[1].selectedIndex() === $index() }, dxAction: { model: $data, action: $parents[1].select }, css: { \\'dxd-state-selected\\' : $parents[1].selectedIndex() === $index() }', function ($context, $element) { return { 'attr': function () { return { 'aria-selected': $context.$parents[1].selectedIndex() === $context.$index() }; }, 'dxAction': function () { return { 'model': $context.$data, 'action': $context.$parents[1].select }; }, 'css': function () { return { 'dxd-state-selected': $context.$parents[1].selectedIndex() === $context.$index() }; } }; });\naddToBindingsCache('if: showButtons', function ($context, $element) { return { 'if': function () { return $context.$data.showButtons; } }; });\naddToBindingsCache('if: isVisibleButton(\\'up\\')', function ($context, $element) { return { 'if': function () { return $context.$data.isVisibleButton('up'); } }; });\naddToBindingsCache('if: isVisibleButton(\\'down\\')', function ($context, $element) { return { 'if': function () { return $context.$data.isVisibleButton('down'); } }; });\naddToBindingsCache('if: isVisibleButton(\\'add\\')', function ($context, $element) { return { 'if': function () { return $context.$data.isVisibleButton('add'); } }; });\naddToBindingsCache('if: isVisibleButton(\\'delete\\')', function ($context, $element) { return { 'if': function () { return $context.$data.isVisibleButton('delete'); } }; });\naddToBindingsCache('if: displayName', function ($context, $element) { return { 'if': function () { return $context.$data.displayName; } }; });\naddToBindingsCache('if: values().length === 0 && showButtons', function ($context, $element) { return { 'if': function () { return $context.$data.values().length === 0 && $context.$data.showButtons; } }; });\naddToBindingsCache('if: values().length !== 0', function ($context, $element) { return { 'if': function () { return $context.$data.values().length !== 0; } }; });\naddToBindingsCache('dxCheckBox: getOptions({ value: value, disabled: disabled, elementAttr: { \\'aria-label\\': displayName } }), dxValidator: { validationRules: validationRules || [] }', function ($context, $element) { return { 'dxCheckBox': function () { return $context.$data.getOptions({ 'value': $context.$data.value, 'disabled': $context.$data.disabled, 'elementAttr': { 'aria-label': $context.$data.displayName } }); }, 'dxValidator': function () { return { 'validationRules': $context.$data.validationRules || [] }; } }; });\naddToBindingsCache('dxLocalizedSelectBox: { dataSource: [ { val: true, text: $root.getLocalization(\\'Yes\\', \\'AnalyticsCoreStringId.ParametersPanel_True\\') }, { val: false, text: $root.getLocalization(\\'No\\', \\'AnalyticsCoreStringId.ParametersPanel_False\\') }], inputAttr: { \\'aria-label\\': displayName, id: editorInputId }, valueExpr: \\'val\\', displayExpr: \\'text\\', value: value, disabled: disabled, dropDownOptions: { container: $root.getPopupContainer($element) } }, dxValidator: { validationRules: validationRules || [] }', function ($context, $element) { return { 'dxLocalizedSelectBox': function () { return { 'dataSource': [{ 'val': true, 'text': $context.$root.getLocalization('Yes', 'AnalyticsCoreStringId.ParametersPanel_True') }, { 'val': false, 'text': $context.$root.getLocalization('No', 'AnalyticsCoreStringId.ParametersPanel_False') }], 'inputAttr': { 'aria-label': $context.$data.displayName, 'id': $context.$data.editorInputId }, 'valueExpr': 'val', 'displayExpr': 'text', 'value': $context.$data.value, 'disabled': $context.$data.disabled, 'dropDownOptions': { 'container': $context.$root.getPopupContainer($element) } }; }, 'dxValidator': function () { return { 'validationRules': $context.$data.validationRules || [] }; } }; });\naddToBindingsCache('dxCollectionEditor: { values: value, displayName: displayName, level: level, info: info }', function ($context, $element) { return { 'dxCollectionEditor': function () { return { 'values': $context.$data.value, 'displayName': $context.$data.displayName, 'level': $context.$data.level, 'info': $context.$data.info }; } }; });\naddToBindingsCache('text: $data.display, attr: { title: $data.display }', function ($context, $element) { return { 'text': function () { return $context.$data.display; }, 'attr': function () { return { 'title': $context.$data.display }; } }; });\naddToBindingsCache('dxLocalizedSelectBox: { dataSource: values, value: value, valueExpr: \\'value\\', displayExpr: \\'displayValue\\', displayCustomValue: true, disabled: disabled, dropDownOptions: { container: $root.getPopupContainer($element) }, popupPosition: { boundary: $root.getPopupContainer($element) }, inputAttr: { \\'aria-label\\': displayName, id: editorInputId }}, dxValidator: getValidatorOptions($data.validatorOptions || { validationRules: $data.validationRules || [] })', function ($context, $element) { return { 'dxLocalizedSelectBox': function () { return { 'dataSource': $context.$data.values, 'value': $context.$data.value, 'valueExpr': 'value', 'displayExpr': 'displayValue', 'displayCustomValue': true, 'disabled': $context.$data.disabled, 'dropDownOptions': { 'container': $context.$root.getPopupContainer($element) }, 'popupPosition': { 'boundary': $context.$root.getPopupContainer($element) }, 'inputAttr': { 'aria-label': $context.$data.displayName, 'id': $context.$data.editorInputId } }; }, 'dxValidator': function () { return $context.$data.getValidatorOptions($context.$data.validatorOptions || { 'validationRules': $context.$data.validationRules || [] }); } }; });\naddToBindingsCache('dxLocalizedSelectBox: { items: values, value: value, valueExpr: \\'value\\', displayExpr: \\'displayValue\\', disabled: disabled, acceptCustomValue: true, onCustomItemCreating: function(arg) { return { value: arg.text, displayValue: arg.text }; }, dropDownOptions: { container: $root.getPopupContainer($element) }, popupPosition: { boundary: $root.getPopupContainer($element) }, inputAttr: { \\'aria-label\\': displayName, id: editorInputId }, useLocalizedTextAsValue: true }', function ($context, $element) { return { 'dxLocalizedSelectBox': function () { return { 'items': $context.$data.values, 'value': $context.$data.value, 'valueExpr': 'value', 'displayExpr': 'displayValue', 'disabled': $context.$data.disabled, 'acceptCustomValue': true, 'onCustomItemCreating': function (arg) { return { 'value': arg.text, 'displayValue': arg.text }; }, 'dropDownOptions': { 'container': $context.$root.getPopupContainer($element) }, 'popupPosition': { 'boundary': $context.$root.getPopupContainer($element) }, 'inputAttr': { 'aria-label': $context.$data.displayName, 'id': $context.$data.editorInputId }, 'useLocalizedTextAsValue': true }; } }; });\naddToBindingsCache('dxLocalizedSelectBox: { dataSource: values, value: generateValue($root.undoEngine), valueExpr: \\'value\\', displayExpr: \\'displayValue\\', displayCustomValue: true, disabled: disabled, dropDownOptions: { container: $root.getPopupContainer($element) }, inputAttr: { id: editorInputId } }, dxValidator: getValidatorOptions($data.validatorOptions || { validationRules: validationRules || [] })', function ($context, $element) { return { 'dxLocalizedSelectBox': function () { return { 'dataSource': $context.$data.values, 'value': $context.$data.generateValue($context.$root.undoEngine), 'valueExpr': 'value', 'displayExpr': 'displayValue', 'displayCustomValue': true, 'disabled': $context.$data.disabled, 'dropDownOptions': { 'container': $context.$root.getPopupContainer($element) }, 'inputAttr': { 'id': $context.$data.editorInputId } }; }, 'dxValidator': function () { return $context.$data.getValidatorOptions($context.$data.validatorOptions || { 'validationRules': $context.$data.validationRules || [] }); } }; });\naddToBindingsCache('attr: { role: \\'treeitem\\', \\'id\\': isComplexEditor && headerId, \\'aria-owns\\': isComplexEditor && contentId, \\'aria-expanded\\': isComplexEditor && (alwaysShow() || !collapsed() ? \\'true\\' : \\'false\\') }, css: {\\'dxrd-accessibility-accordion-trigger dx-accessibility-focus-border-accented\\': isComplexEditor}', function ($context, $element) { return { 'attr': function () { return { 'role': 'treeitem', 'id': $context.$data.isComplexEditor && $context.$data.headerId, 'aria-owns': $context.$data.isComplexEditor && $context.$data.contentId, 'aria-expanded': $context.$data.isComplexEditor && ($context.$data.alwaysShow() || !$context.$data.collapsed() ? 'true' : 'false') }; }, 'css': function () { return { 'dxrd-accessibility-accordion-trigger dx-accessibility-focus-border-accented': $context.$data.isComplexEditor }; } }; });\naddToBindingsCache('styleunit: padding, css: { \\'dx-accordion-empty\\': templateName === \\'dx-emptyHeader\\' }', function ($context, $element) { return { 'styleunit': function () { return $context.$data.padding; }, 'css': function () { return { 'dx-accordion-empty': $context.$data.templateName === 'dx-emptyHeader' }; } }; });\naddToBindingsCache('enable: templateName === \\'dx-emptyHeader\\'', function ($context, $element) { return { 'enable': function () { return $context.$data.templateName === 'dx-emptyHeader'; } }; });\naddToBindingsCache('searchHighlighting: { text: displayName, textToSearch: textToSearch }, attr: { \\'title\\': displayName }', function ($context, $element) { return { 'searchHighlighting': function () { return { 'text': $context.$data.displayName, 'textToSearch': $context.$data.textToSearch }; }, 'attr': function () { return { 'title': $context.$data.displayName }; } }; });\naddToBindingsCache('text: displayName, attr: { \\'title\\': displayName }', function ($context, $element) { return { 'text': function () { return $context.$data.displayName; }, 'attr': function () { return { 'title': $context.$data.displayName }; } }; });\naddToBindingsCache('searchHighlighting: { text: displayName, textToSearch: textToSearch }, attr: { \\'title\\': displayName, \\'for\\': editorInputId }, css: { \\'dx-field-label-required\\': isRequired }, style: { fontWeight: isPropertyModified() ? \\'Bold\\' : \\'\\'}', function ($context, $element) { return { 'searchHighlighting': function () { return { 'text': $context.$data.displayName, 'textToSearch': $context.$data.textToSearch }; }, 'attr': function () { return { 'title': $context.$data.displayName, 'for': $context.$data.editorInputId }; }, 'css': function () { return { 'dx-field-label-required': $context.$data.isRequired }; }, 'style': function () { return { 'fontWeight': $context.$data.isPropertyModified() ? 'Bold' : '' }; } }; });\naddToBindingsCache('text: displayName, attr: { \\'title\\': displayName, \\'for\\': editorInputId }, css: { \\'dx-property-required\\': isRequired }, style: { fontWeight: isPropertyModified() ? \\'Bold\\' : \\'\\'}', function ($context, $element) { return { 'text': function () { return $context.$data.displayName; }, 'attr': function () { return { 'title': $context.$data.displayName, 'for': $context.$data.editorInputId }; }, 'css': function () { return { 'dx-property-required': $context.$data.isRequired }; }, 'style': function () { return { 'fontWeight': $context.$data.isPropertyModified() ? 'Bold' : '' }; } }; });\naddToBindingsCache('css: { \\'dxd-border-accented\\': $data.isPropertyHighlighted }', function ($context, $element) { return { 'css': function () { return { 'dxd-border-accented': $context.$data.isPropertyHighlighted }; } }; });\naddToBindingsCache('service: { name: \\'createEditorAddOn\\' }', function ($context, $element) { return { 'service': function () { return { 'name': 'createEditorAddOn' }; } }; });\naddToBindingsCache('attr: { \\'aria-labelledby\\': headerId, \\'id\\': contentId, \\'aria-hidden\\': !alwaysShow() && collapsed() ? \\'true\\' : \\'false\\' }', function ($context, $element) { return { 'attr': function () { return { 'aria-labelledby': $context.$data.headerId, 'id': $context.$data.contentId, 'aria-hidden': !$context.$data.alwaysShow() && $context.$data.collapsed() ? 'true' : 'false' }; } }; });\naddToBindingsCache('if: isComplexEditor', function ($context, $element) { return { 'if': function () { return $context.$data.isComplexEditor; } }; });\naddToBindingsCache('if: !!$data.textToSearch', function ($context, $element) { return { 'if': function () { return !!$context.$data.textToSearch; } }; });\naddToBindingsCache('ifnot: !!$data.textToSearch', function ($context, $element) { return { 'ifnot': function () { return !!$context.$data.textToSearch; } }; });\naddToBindingsCache('if: !isComplexEditor', function ($context, $element) { return { 'if': function () { return !$context.$data.isComplexEditor; } }; });\naddToBindingsCache('if: templateName !== \\'dx-emptyHeader\\'', function ($context, $element) { return { 'if': function () { return $context.$data.templateName !== 'dx-emptyHeader'; } }; });\naddToBindingsCache('lazy: { innerBindings: { template: templateName }, isResolved: $data.isRendered }', function ($context, $element) { return { 'lazy': function () { return { 'innerBindings': { 'template': $context.$data.templateName }, 'isResolved': $context.$data.isRendered }; } }; });\naddToBindingsCache('if: (!$data.editorCreated || editorCreated)', function ($context, $element) { return { 'if': function () { return (!$context.$data.editorCreated || $context.$data.editorCreated); } }; });\naddToBindingsCache('template: contentTemplateName', function ($context, $element) { return { 'template': function () { return $context.$data.contentTemplateName; } }; });\naddToBindingsCache('dxDateBox: getOptions({ value: value, closeOnValueChange: true, type: \\'datetime\\', disabled: disabled, inputAttr: { \\'aria-label\\': displayName, id: editorInputId }, dropDownOptions: { container: $root.getPopupContainer($element), position: { at: \\'left bottom\\', collision: \\'flipfit flip\\', my: \\'left top\\', boundary: $root.getPopupContainer($element), of: $element } } }), dxValidator: { validationRules: validationRules || [] }', function ($context, $element) { return { 'dxDateBox': function () { return $context.$data.getOptions({ 'value': $context.$data.value, 'closeOnValueChange': true, 'type': 'datetime', 'disabled': $context.$data.disabled, 'inputAttr': { 'aria-label': $context.$data.displayName, 'id': $context.$data.editorInputId }, 'dropDownOptions': { 'container': $context.$root.getPopupContainer($element), 'position': { 'at': 'left bottom', 'collision': 'flipfit flip', 'my': 'left top', 'boundary': $context.$root.getPopupContainer($element), 'of': $element } } }); }, 'dxValidator': function () { return { 'validationRules': $context.$data.validationRules || [] }; } }; });\naddToBindingsCache('dxFileImagePicker: { value: value, placeholderId: \\'File\\', disabled: disabled }', function ($context, $element) { return { 'dxFileImagePicker': function () { return { 'value': $context.$data.value, 'placeholderId': 'File', 'disabled': $context.$data.disabled }; } }; });\naddToBindingsCache('css: { \\'dxd-state-active\\': bold(), \\'dx-disabled-button\\': $parent.disabled }, click: function() { if(!$parent.disabled()) { bold(!bold()); } }', function ($context, $element) { return { 'css': function () { return { 'dxd-state-active': $context.$data.bold(), 'dx-disabled-button': $context.$parent.disabled }; }, 'click': function () { return function () { if (!$context.$parent.disabled()) {\n $context.$data.bold(!$context.$data.bold());\n } }; } }; });\naddToBindingsCache('css: { \\'dxd-state-active\\': italic(), \\'dx-disabled-button\\': $parent.disabled }, click: function() { if(!$parent.disabled()) { italic(!italic()); } }', function ($context, $element) { return { 'css': function () { return { 'dxd-state-active': $context.$data.italic(), 'dx-disabled-button': $context.$parent.disabled }; }, 'click': function () { return function () { if (!$context.$parent.disabled()) {\n $context.$data.italic(!$context.$data.italic());\n } }; } }; });\naddToBindingsCache('css: { \\'dxd-state-active\\': underline(), \\'dx-disabled-button\\': $parent.disabled }, click: function() { if(!$parent.disabled()) { underline(!underline()); } }', function ($context, $element) { return { 'css': function () { return { 'dxd-state-active': $context.$data.underline(), 'dx-disabled-button': $context.$parent.disabled }; }, 'click': function () { return function () { if (!$context.$parent.disabled()) {\n $context.$data.underline(!$context.$data.underline());\n } }; } }; });\naddToBindingsCache('css: { \\'dxd-state-active\\': strikeout(), \\'dx-disabled-button\\': $parent.disabled }, click: function() { if(!$parent.disabled()) { strikeout(!strikeout()); } }', function ($context, $element) { return { 'css': function () { return { 'dxd-state-active': $context.$data.strikeout(), 'dx-disabled-button': $context.$parent.disabled }; }, 'click': function () { return function () { if (!$context.$parent.disabled()) {\n $context.$data.strikeout(!$context.$data.strikeout());\n } }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fontstyle-bold\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fontstyle-bold'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fontstyle-italic\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fontstyle-italic'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fontstyle-underline\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fontstyle-underline'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fontstyle-strikeout\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fontstyle-strikeout'; } }; });\naddToBindingsCache('dxFileImagePicker: { value: value, placeholderId: \\'Image\\', accept: \\'image/*\\', type: \\'img\\', disabled: disabled }', function ($context, $element) { return { 'dxFileImagePicker': function () { return { 'value': $context.$data.value, 'placeholderId': 'Image', 'accept': 'image/*', 'type': 'img', 'disabled': $context.$data.disabled }; } }; });\naddToBindingsCache('dxNumberBox: getOptions({ value:value, showSpinButtons:true, disabled:disabled, inputAttr: { \\'aria-label\\': displayName, id: editorInputId } }), dxValidator: { validationRules: validationRules || [] }', function ($context, $element) { return { 'dxNumberBox': function () { return $context.$data.getOptions({ 'value': $context.$data.value, 'showSpinButtons': true, 'disabled': $context.$data.disabled, 'inputAttr': { 'aria-label': $context.$data.displayName, 'id': $context.$data.editorInputId } }); }, 'dxValidator': function () { return { 'validationRules': $context.$data.validationRules || [] }; } }; });\naddToBindingsCache('dxTextBox: getOptions({ value: value, disabled: disabled, inputAttr: { \\'aria-label\\': displayName, id: editorInputId } }), dxValidator: { validationRules: validationRules || [] }', function ($context, $element) { return { 'dxTextBox': function () { return $context.$data.getOptions({ 'value': $context.$data.value, 'disabled': $context.$data.disabled, 'inputAttr': { 'aria-label': $context.$data.displayName, 'id': $context.$data.editorInputId } }); }, 'dxValidator': function () { return { 'validationRules': $context.$data.validationRules || [] }; } }; });\naddToBindingsCache('dxTextBox: getOptions({ value: value, disabled: disabled, inputAttr: { \\'aria-label\\': displayName, \\'id\\': editorInputId }}), dxValidator: getValidatorOptions($data.validatorOptions || { validationRules: validationRules || [] })', function ($context, $element) { return { 'dxTextBox': function () { return $context.$data.getOptions({ 'value': $context.$data.value, 'disabled': $context.$data.disabled, 'inputAttr': { 'aria-label': $context.$data.displayName, 'id': $context.$data.editorInputId } }); }, 'dxValidator': function () { return $context.$data.getValidatorOptions($context.$data.validatorOptions || { 'validationRules': $context.$data.validationRules || [] }); } }; });\naddToBindingsCache('dxTextBox: getOptions({ value: value, disabled: disabled, inputAttr: { \\'aria-label\\': displayName, \\'id\\': editorInputId }})', function ($context, $element) { return { 'dxTextBox': function () { return $context.$data.getOptions({ 'value': $context.$data.value, 'disabled': $context.$data.disabled, 'inputAttr': { 'aria-label': $context.$data.displayName, 'id': $context.$data.editorInputId } }); } }; });\naddToBindingsCache('value: value, disable: disabled', function ($context, $element) { return { 'value': function () { return $context.$data.value; }, 'disable': function () { return $context.$data.disabled; }, '_ko_property_writers': function () { return { 'value': function (_z) { $context.$data.value = _z; } }; } }; });\naddToBindingsCache('if: $data.validationRules', function ($context, $element) { return { 'if': function () { return $context.$data.validationRules; } }; });\naddToBindingsCache('if: !$data.validationRules', function ($context, $element) { return { 'if': function () { return !$context.$data.validationRules; } }; });\naddToBindingsCache('css: { \\'dx-rtl\\' : rtl }', function ($context, $element) { return { 'css': function () { return { 'dx-rtl': $context.$data.rtl }; } }; });\naddToBindingsCache('foreach: getEditors()', function ($context, $element) { return { 'foreach': function () { return $context.$data.getEditors(); } }; });\naddToBindingsCache('dxPopup: { showTitle: true, width: \\'750px\\', height: \\'475px\\', title: title(), rtlEnabled: rtl, visible: popupVisible, wrapperAttr: { class: className }, toolbarItems: buttonItems, showCloseButton: true, container: $root.getPopupContainer($element), position: { of: $root.getPopupContainer($element) }, }', function ($context, $element) { return { 'dxPopup': function () { return { 'showTitle': true, 'width': '750px', 'height': '475px', 'title': $context.$data.title(), 'rtlEnabled': $context.$data.rtl, 'visible': $context.$data.popupVisible, 'wrapperAttr': { 'class': $context.$data.className }, 'toolbarItems': $context.$data.buttonItems, 'showCloseButton': true, 'container': $context.$root.getPopupContainer($element), 'position': { 'of': $context.$root.getPopupContainer($element) } }; } }; });\naddToBindingsCache('dxDataGrid: queriesGrid', function ($context, $element) { return { 'dxDataGrid': function () { return $context.$data.queriesGrid; } }; });\naddToBindingsCache('dxDropDownButton: $data', function ($context, $element) { return { 'dxDropDownButton': function () { return $context.$data; } }; });\naddToBindingsCache('if: $data', function ($context, $element) { return { 'if': function () { return $context.$data; } }; });\naddToBindingsCache('template: { name: $data._queriesPopupHelper.template, data: _queriesPopupHelper }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data._queriesPopupHelper.template, 'data': $context.$data._queriesPopupHelper }; } }; });\naddToBindingsCache('foreach: $data.popupItems', function ($context, $element) { return { 'foreach': function () { return $context.$data.popupItems; } }; });\naddToBindingsCache('template: { name: template, data: model }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.template, 'data': $context.$data.model }; } }; });\naddToBindingsCache('with: options', function ($context, $element) { return { 'with': function () { return $context.$data.options; } }; });\naddToBindingsCache('dxTextArea: { value: textAreaValue, isValid: isValid, spellcheck: false, onKeyUp: function() { isValid(true); } }, resizable: resizeHelper.resizable($root.resizeHandler, \\'s\\', $element)', function ($context, $element) { return { 'dxTextArea': function () { return { 'value': $context.$data.textAreaValue, 'isValid': $context.$data.isValid, 'spellcheck': false, 'onKeyUp': function () { $context.$data.isValid(true); } }; }, 'resizable': function () { return $context.$data.resizeHelper.resizable($context.$root.resizeHandler, 's', $element); } }; });\naddToBindingsCache('dxAceEditor: { value: textAreaValue, editorContainer: editorContainer, theme: theme, options: aceOptions, additionalOptions: additionalOptions, callbacks: callbacks }, resizable: resizeHelper.resizable($root.resizeHandler, \\'s\\', $element)', function ($context, $element) { return { 'dxAceEditor': function () { return { 'value': $context.$data.textAreaValue, 'editorContainer': $context.$data.editorContainer, 'theme': $context.$data.theme, 'options': $context.$data.aceOptions, 'additionalOptions': $context.$data.additionalOptions, 'callbacks': $context.$data.callbacks }; }, 'resizable': function () { return $context.$data.resizeHelper.resizable($context.$root.resizeHandler, 's', $element); } }; });\naddToBindingsCache('visible: visible, attr: { class: \\'dx-expressioneditor-tools-tab dxd-back-primary2 \\'+ ($data.templateName ? $data.templateName : \\'\\')}', function ($context, $element) { return { 'visible': function () { return $context.$data.visible; }, 'attr': function () { return { 'class': 'dx-expressioneditor-tools-tab dxd-back-primary2 ' + ($context.$data.templateName ? $context.$data.templateName : '') }; } }; });\naddToBindingsCache('dxEllipsisEditor: { value: displayValue, buttonAction: function() { popupVisible(true); }, disabled: disabled, isValid: modelValueValid, warningMessage: modelValueWarning, inputAttr: { id: editorInputId } }', function ($context, $element) { return { 'dxEllipsisEditor': function () { return { 'value': $context.$data.displayValue, 'buttonAction': function () { $context.$data.popupVisible(true); }, 'disabled': $context.$data.disabled, 'isValid': $context.$data.modelValueValid, 'warningMessage': $context.$data.modelValueWarning, 'inputAttr': { 'id': $context.$data.editorInputId } }; } }; });\naddToBindingsCache('dxPopup: { animation: { show: { type: \\'fadeIn\\', duration: 700 }, hide: { type: \\'fadeOut\\', duration: 700 } }, showTitle: true, wrapperAttr: { class: \\'dx-expressioneditor dx-popup-general\\' }, title: title(), visible: popupVisible, toolbarItems: buttonItems, showCloseButton: true, fullScreen: false, height: \\'615px\\', maxHeight: \\'90%\\', maxWidth: \\'90%\\', minHeight: 400, minWidth: 500, width: \\'645px\\', container: getPopupContainer($element), position: { of: getPopupContainer($element)}, onContentReady: onContentReady, onShowing: onShowing, onHiding: onHiding, onShown: onShown, resizeEnabled: true, onResize: function() { $data.resizeAceEditor() } }', function ($context, $element) { return { 'dxPopup': function () { return { 'animation': { 'show': { 'type': 'fadeIn', 'duration': 700 }, 'hide': { 'type': 'fadeOut', 'duration': 700 } }, 'showTitle': true, 'wrapperAttr': { 'class': 'dx-expressioneditor dx-popup-general' }, 'title': $context.$data.title(), 'visible': $context.$data.popupVisible, 'toolbarItems': $context.$data.buttonItems, 'showCloseButton': true, 'fullScreen': false, 'height': '615px', 'maxHeight': '90%', 'maxWidth': '90%', 'minHeight': 400, 'minWidth': 500, 'width': '645px', 'container': $context.$data.getPopupContainer($element), 'position': { 'of': $context.$data.getPopupContainer($element) }, 'onContentReady': $context.$data.onContentReady, 'onShowing': $context.$data.onShowing, 'onHiding': $context.$data.onHiding, 'onShown': $context.$data.onShown, 'resizeEnabled': true, 'onResize': function () { $context.$data.resizeAceEditor(); } }; } }; });\naddToBindingsCache('if: !aceAvailable', function ($context, $element) { return { 'if': function () { return !$context.$data.aceAvailable; } }; });\naddToBindingsCache('if: aceAvailable', function ($context, $element) { return { 'if': function () { return $context.$data.aceAvailable; } }; });\naddToBindingsCache('with: tools', function ($context, $element) { return { 'with': function () { return $context.$data.tools; } }; });\naddToBindingsCache('foreach: toolBox', function ($context, $element) { return { 'foreach': function () { return $context.$data.toolBox; } }; });\naddToBindingsCache('template: { name: $data.templateName }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.templateName }; } }; });\naddToBindingsCache('template: \\'dx-expressioneditor-popup\\'', function ($context, $element) { return { 'template': function () { return 'dx-expressioneditor-popup'; } }; });\naddToBindingsCache('if: popupVisible', function ($context, $element) { return { 'if': function () { return $context.$data.popupVisible; } }; });\naddToBindingsCache('template: \"dx-expressioneditor-main\"', function ($context, $element) { return { 'template': function () { return 'dx-expressioneditor-main'; } }; });\naddToBindingsCache('dxScrollView: { showScrollbar: \\'onHover\\' }, resizable: $parents[1].resizeHelper.resizable($root.resizeHandler, \\'e\\')', function ($context, $element) { return { 'dxScrollView': function () { return { 'showScrollbar': 'onHover' }; }, 'resizable': function () { return $context.$parents[1].resizeHelper.resizable($context.$root.resizeHandler, 'e'); } }; });\naddToBindingsCache('css: {\\'dxd-state-selected\\': content.isSelected }, text: displayName, dxclick: function() { $parent.click($data.content) }', function ($context, $element) { return { 'css': function () { return { 'dxd-state-selected': $context.$data.content.isSelected }; }, 'text': function () { return $context.$data.displayName; }, 'dxclick': function () { return function () { $context.$parent.click($context.$data.content); }; } }; });\naddToBindingsCache('css: {\\'dxd-state-selected\\': $data.isSelected }, dxclick: function() { $data.updateContent($data.allItems(), $data.isSelected); $parent.click($data.content) }', function ($context, $element) { return { 'css': function () { return { 'dxd-state-selected': $context.$data.isSelected }; }, 'dxclick': function () { return function () { $context.$data.updateContent($context.$data.allItems(), $context.$data.isSelected); $context.$parent.click($context.$data.content); }; } }; });\naddToBindingsCache('text: displayName', function ($context, $element) { return { 'text': function () { return $context.$data.displayName; } }; });\naddToBindingsCache('css: {\\'dxd-state-selected\\': isSelected }, text: $data.display, dxclick: function() { $parent.updateContent($data.data, $data.isSelected); $parents[1].click($parent.content); }', function ($context, $element) { return { 'css': function () { return { 'dxd-state-selected': $context.$data.isSelected }; }, 'text': function () { return $context.$data.display; }, 'dxclick': function () { return function () { $context.$parent.updateContent($context.$data.data, $context.$data.isSelected); $context.$parents[1].click($context.$parent.content); }; } }; });\naddToBindingsCache('foreach: content', function ($context, $element) { return { 'foreach': function () { return $context.$data.content; } }; });\naddToBindingsCache('dxScrollView: { showScrollbar: \\'onHover\\' }', function ($context, $element) { return { 'dxScrollView': function () { return { 'showScrollbar': 'onHover' }; } }; });\naddToBindingsCache('text: content', function ($context, $element) { return { 'text': function () { return $context.$data.content; } }; });\naddToBindingsCache('treeListSearchPanel: { controllers: [ ko.unwrap($data.parameters) ? ko.unwrap($data.parameters).treeListController : ko.unwrap($data.parameters), ko.unwrap($data.fields) ? ko.unwrap($data.fields).treeListController : ko.unwrap($data.fields) ] }', function ($context, $element) { return { 'treeListSearchPanel': function () { return { 'controllers': [$context.ko.unwrap($context.$data.parameters) ? $context.ko.unwrap($context.$data.parameters).treeListController : $context.ko.unwrap($context.$data.parameters), $context.ko.unwrap($context.$data.fields) ? $context.ko.unwrap($context.$data.fields).treeListController : $context.ko.unwrap($context.$data.fields)] }; } }; });\naddToBindingsCache('treelist: fields', function ($context, $element) { return { 'treelist': function () { return $context.$data.fields; } }; });\naddToBindingsCache('treelist: parameters', function ($context, $element) { return { 'treelist': function () { return $context.$data.parameters; } }; });\naddToBindingsCache('visible: visible, event: { dblclick: function() { actions[0].clickAction($element); }}, styleunit: padding, css: { \\'dx-treelist-item-selected dxd-state-selected\\': isSelected }', function ($context, $element) { return { 'visible': function () { return $context.$data.visible; }, 'event': function () { return { 'dblclick': function () { $context.$data.actions[0].clickAction($element); } }; }, 'styleunit': function () { return $context.$data.padding; }, 'css': function () { return { 'dx-treelist-item-selected dxd-state-selected': $context.$data.isSelected }; } }; });\naddToBindingsCache('css: nodeImageClass, template: \\'dxrd-svg-collapsed\\', click: toggleCollapsed', function ($context, $element) { return { 'css': function () { return $context.$data.nodeImageClass; }, 'template': function () { return 'dxrd-svg-collapsed'; }, 'click': function () { return $context.$data.toggleCollapsed; } }; });\naddToBindingsCache('css: $data.imageClassName, template: {name: $data.imageTemplateName, if: !!ko.unwrap($data.imageTemplateName)}, attr: { title: text }', function ($context, $element) { return { 'css': function () { return $context.$data.imageClassName; }, 'template': function () { return { 'name': $context.$data.imageTemplateName, 'if': !!$context.ko.unwrap($context.$data.imageTemplateName) }; }, 'attr': function () { return { 'title': $context.$data.text }; } }; });\naddToBindingsCache('click: toggleSelected', function ($context, $element) { return { 'click': function () { return $context.$data.toggleSelected; } }; });\naddToBindingsCache('if: fields', function ($context, $element) { return { 'if': function () { return $context.$data.fields; } }; });\naddToBindingsCache('if: $data.parameters', function ($context, $element) { return { 'if': function () { return $context.$data.parameters; } }; });\naddToBindingsCache('if: hasItems', function ($context, $element) { return { 'if': function () { return $context.$data.hasItems; } }; });\naddToBindingsCache('ifnot: hasItems', function ($context, $element) { return { 'ifnot': function () { return $context.$data.hasItems; } }; });\naddToBindingsCache('template: { name: \\'dx-treelist-item-text-content\\' }', function ($context, $element) { return { 'template': function () { return { 'name': 'dx-treelist-item-text-content' }; } }; });\naddToBindingsCache('attr: { class: \\'dx-expressioneditor-tools-tab-item dxd-list-item-back-color dxd-text-primary dxd-back-highlighted \\' + ($data.class ? $data.class : \\'\\') }, text: $data.displayName || $data.text, css: { \\'dx-expressioneditor-state-selected dxd-state-selected\\': $parent.selectedItem() === $data }, dxclick: function() { $parent.selectedItem($data); $parents[2].click($data); }, event: { dblclick: function() { $parents[2].dblclick($data, $element); } }', function ($context, $element) { return { 'attr': function () { return { 'class': 'dx-expressioneditor-tools-tab-item dxd-list-item-back-color dxd-text-primary dxd-back-highlighted ' + ($context.$data.class ? $context.$data.class : '') }; }, 'text': function () { return $context.$data.displayName || $context.$data.text; }, 'css': function () { return { 'dx-expressioneditor-state-selected dxd-state-selected': $context.$parent.selectedItem() === $context.$data }; }, 'dxclick': function () { return function () { $context.$parent.selectedItem($context.$data); $context.$parents[2].click($context.$data); }; }, 'event': function () { return { 'dblclick': function () { $context.$parents[2].dblclick($context.$data, $element); } }; } }; });\naddToBindingsCache('dxTextBox: { value: textToSearch, showClearButton: true, valueChangeEvent: \\'keyup\\', placeholder: $parents[2].searchPlaceholder() }', function ($context, $element) { return { 'dxTextBox': function () { return { 'value': $context.$data.textToSearch, 'showClearButton': true, 'valueChangeEvent': 'keyup', 'placeholder': $context.$parents[2].searchPlaceholder() }; } }; });\naddToBindingsCache('css: { \\'dx-expressioneditor-state-selected dxd-state-selected\\': $parent.selectedItem() === $data }, dxclick: function() { $parent.selectedItem($data); $parents[2].click($data); }, event: { dblclick: function() { $parents[2].dblclick($data, $element); } }, searchHighlighting: { text: $data.displayName || $data.text, textToSearch: $parent.textToSearch }', function ($context, $element) { return { 'css': function () { return { 'dx-expressioneditor-state-selected dxd-state-selected': $context.$parent.selectedItem() === $context.$data }; }, 'dxclick': function () { return function () { $context.$parent.selectedItem($context.$data); $context.$parents[2].click($context.$data); }; }, 'event': function () { return { 'dblclick': function () { $context.$parents[2].dblclick($context.$data, $element); } }; }, 'searchHighlighting': function () { return { 'text': $context.$data.displayName || $context.$data.text, 'textToSearch': $context.$parent.textToSearch }; } }; });\naddToBindingsCache('with: content', function ($context, $element) { return { 'with': function () { return $context.$data.content; } }; });\naddToBindingsCache('template: $data', function ($context, $element) { return { 'template': function () { return $context.$data; } }; });\naddToBindingsCache('foreach: availableItems', function ($context, $element) { return { 'foreach': function () { return $context.$data.availableItems; } }; });\naddToBindingsCache('css: { \\'advanced\\': advancedMode }', function ($context, $element) { return { 'css': function () { return { 'advanced': $context.$data.advancedMode }; } }; });\naddToBindingsCache('css: { \\'advanced\\': advancedMode }, visible: textVisible', function ($context, $element) { return { 'css': function () { return { 'advanced': $context.$data.advancedMode }; }, 'visible': function () { return $context.$data.textVisible; } }; });\naddToBindingsCache('css: $data.getTextCssClasses(), style: { height: textContentHeightPerc }', function ($context, $element) { return { 'css': function () { return $context.$data.getTextCssClasses(); }, 'style': function () { return { 'height': $context.$data.textContentHeightPerc }; } }; });\naddToBindingsCache('dxCheckBox: { value: advancedMode, text: advancedModeText }, style: $data.getCheckBoxStyles()', function ($context, $element) { return { 'dxCheckBox': function () { return { 'value': $context.$data.advancedMode, 'text': $context.$data.advancedModeText }; }, 'style': function () { return $context.$data.getCheckBoxStyles(); } }; });\naddToBindingsCache('style: $data.getContentStyles()', function ($context, $element) { return { 'style': function () { return $context.$data.getContentStyles(); } }; });\naddToBindingsCache('visible: $data.options().disabled()', function ($context, $element) { return { 'visible': function () { return $context.$data.options().disabled(); } }; });\naddToBindingsCache('dxTextArea: { value: displayValue, isValid: isValid, onInput: onInput, spellcheck: false }, cacheElement: { action: function(element) { cacheElement(element) } }', function ($context, $element) { return { 'dxTextArea': function () { return { 'value': $context.$data.displayValue, 'isValid': $context.$data.isValid, 'onInput': $context.$data.onInput, 'spellcheck': false }; }, 'cacheElement': function () { return { 'action': function (element) { $context.$data.cacheElement(element); } }; } }; });\naddToBindingsCache('css: {\\'dx-invalid\\': !$data.isValid(), \\'dx-state-focused\\': textFocused }', function ($context, $element) { return { 'css': function () { return { 'dx-invalid': !$context.$data.isValid(), 'dx-state-focused': $context.$data.textFocused }; } }; });\naddToBindingsCache('dxAceEditor: { value: $data.displayValue, theme: helper.aceTheme, editorContainer: editorContainer, options: aceOptions, additionalOptions: additionalOptions }', function ($context, $element) { return { 'dxAceEditor': function () { return { 'value': $context.$data.displayValue, 'theme': $context.$data.helper.aceTheme, 'editorContainer': $context.$data.editorContainer, 'options': $context.$data.aceOptions, 'additionalOptions': $context.$data.additionalOptions }; } }; });\naddToBindingsCache('dxScrollView: { showScrollbar: \\'onHover\\', direction: \\'both\\' }', function ($context, $element) { return { 'dxScrollView': function () { return { 'showScrollbar': 'onHover', 'direction': 'both' }; } }; });\naddToBindingsCache('dxclick: function() { $data.advancedMode(true); }', function ($context, $element) { return { 'dxclick': function () { return function () { $context.$data.advancedMode(true); }; } }; });\naddToBindingsCache('text: invalidMessage()', function ($context, $element) { return { 'text': function () { return $context.$data.invalidMessage(); } }; });\naddToBindingsCache('template: \\'dx-filtereditor-content-tree\\'', function ($context, $element) { return { 'template': function () { return 'dx-filtereditor-content-tree'; } }; });\naddToBindingsCache('template: \\'dx-filtereditor-content-text\\'', function ($context, $element) { return { 'template': function () { return 'dx-filtereditor-content-text'; } }; });\naddToBindingsCache('if: $data.advancedModeTop()', function ($context, $element) { return { 'if': function () { return $context.$data.advancedModeTop(); } }; });\naddToBindingsCache('template: \\'dx-filtereditor-plain-content-text\\'', function ($context, $element) { return { 'template': function () { return 'dx-filtereditor-plain-content-text'; } }; });\naddToBindingsCache('ifnot: $data.advancedModeTop()', function ($context, $element) { return { 'ifnot': function () { return $context.$data.advancedModeTop(); } }; });\naddToBindingsCache('with: operandSurface', function ($context, $element) { return { 'with': function () { return $context.$data.operandSurface; } }; });\naddToBindingsCache('template: { name: $data.templateName, data: $data, if: $parent.isSurfaceValid }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.templateName, 'data': $context.$data, 'if': $context.$parent.isSurfaceValid }; } }; });\naddToBindingsCache('ifnot: isSurfaceValid', function ($context, $element) { return { 'ifnot': function () { return $context.$data.isSurfaceValid; } }; });\naddToBindingsCache('dxEllipsisEditor: { value: modelDisplayValue, isValid: modelValueIsValid, disabled: disabled, buttonAction: function() { popupVisible(true); }, inputAttr: { id: editorInputId } }', function ($context, $element) { return { 'dxEllipsisEditor': function () { return { 'value': $context.$data.modelDisplayValue, 'isValid': $context.$data.modelValueIsValid, 'disabled': $context.$data.disabled, 'buttonAction': function () { $context.$data.popupVisible(true); }, 'inputAttr': { 'id': $context.$data.editorInputId } }; } }; });\naddToBindingsCache('style: { pointerEvents: $data.options().disabled() ? \\'none\\' : \\'\\' }', function ($context, $element) { return { 'style': function () { return { 'pointerEvents': $context.$data.options().disabled() ? 'none' : '' }; } }; });\naddToBindingsCache('template: \\'dx-filtereditor-popup\\'', function ($context, $element) { return { 'template': function () { return 'dx-filtereditor-popup'; } }; });\naddToBindingsCache('template: \\'dx-filtereditor-content\\'', function ($context, $element) { return { 'template': function () { return 'dx-filtereditor-content'; } }; });\naddToBindingsCache('template: \\'dx-filtereditor-content-popups\\'', function ($context, $element) { return { 'template': function () { return 'dx-filtereditor-content-popups'; } }; });\naddToBindingsCache('template: \\'dx-filtereditor-content-plain\\'', function ($context, $element) { return { 'template': function () { return 'dx-filtereditor-content-plain'; } }; });\naddToBindingsCache('service: { name: \\'createChangeType\\' }', function ($context, $element) { return { 'service': function () { return { 'name': 'createChangeType' }; } }; });\naddToBindingsCache('dxclick: function() { $data.remove && $data.remove(); }', function ($context, $element) { return { 'dxclick': function () { return function () { $context.$data.remove && $context.$data.remove(); }; } }; });\naddToBindingsCache('visible: !!$data.canRemove', function ($context, $element) { return { 'visible': function () { return !!$context.$data.canRemove; } }; });\naddToBindingsCache('with: property', function ($context, $element) { return { 'with': function () { return $context.$data.property; } }; });\naddToBindingsCache('template: { name: templateName, data: $data }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.templateName, 'data': $context.$data }; } }; });\naddToBindingsCache('if: $data.aggregatedExpression()', function ($context, $element) { return { 'if': function () { return $context.$data.aggregatedExpression(); } }; });\naddToBindingsCache('with: aggregatedExpression', function ($context, $element) { return { 'with': function () { return $context.$data.aggregatedExpression; } }; });\naddToBindingsCache('template: \\'dxrd-svg-filtereditor-remove\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-filtereditor-remove'; } }; });\naddToBindingsCache('template: { name: \\'dx-filtereditor-aggregate-common\\' }', function ($context, $element) { return { 'template': function () { return { 'name': 'dx-filtereditor-aggregate-common' }; } }; });\naddToBindingsCache('with: condition', function ($context, $element) { return { 'with': function () { return $context.$data.condition; } }; });\naddToBindingsCache('with: begin', function ($context, $element) { return { 'with': function () { return $context.$data.begin; } }; });\naddToBindingsCache('with: end', function ($context, $element) { return { 'with': function () { return $context.$data.end; } }; });\naddToBindingsCache('with: leftOperand', function ($context, $element) { return { 'with': function () { return $context.$data.leftOperand; } }; });\naddToBindingsCache('with: rightOperand', function ($context, $element) { return { 'with': function () { return $context.$data.rightOperand; } }; });\naddToBindingsCache('if: $data.leftPart && $data.leftPart.condition', function ($context, $element) { return { 'if': function () { return $context.$data.leftPart && $context.$data.leftPart.condition; } }; });\naddToBindingsCache('with: leftPart', function ($context, $element) { return { 'with': function () { return $context.$data.leftPart; } }; });\naddToBindingsCache('css: css', function ($context, $element) { return { 'css': function () { return $context.$data.css; } }; });\naddToBindingsCache('text: displayType', function ($context, $element) { return { 'text': function () { return $context.$data.displayType; } }; });\naddToBindingsCache('service: { name: \\'createChangeValueType\\' }', function ($context, $element) { return { 'service': function () { return { 'name': 'createChangeValueType' }; } }; });\naddToBindingsCache('template: { name: $data.leftPart.templateName, data: $data.leftPart }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.leftPart.templateName, 'data': $context.$data.leftPart }; } }; });\naddToBindingsCache('foreach: rightPart', function ($context, $element) { return { 'foreach': function () { return $context.$data.rightPart; } }; });\naddToBindingsCache('template: { name: $data.templateName, data: $data }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.templateName, 'data': $context.$data }; } }; });\naddToBindingsCache('service: { name: \\'createAddButton\\' }', function ($context, $element) { return { 'service': function () { return { 'name': 'createAddButton' }; } }; });\naddToBindingsCache('foreach: operands', function ($context, $element) { return { 'foreach': function () { return $context.$data.operands; } }; });\naddToBindingsCache('dxclick: addValue', function ($context, $element) { return { 'dxclick': function () { return $context.$data.addValue; } }; });\naddToBindingsCache('with: criteriaOperator', function ($context, $element) { return { 'with': function () { return $context.$data.criteriaOperator; } }; });\naddToBindingsCache('if: $data.operands().length > 1', function ($context, $element) { return { 'if': function () { return $context.$data.operands().length > 1; } }; });\naddToBindingsCache('foreach: $data.operands()', function ($context, $element) { return { 'foreach': function () { return $context.$data.operands(); } }; });\naddToBindingsCache('if: $data.operands().length == 1', function ($context, $element) { return { 'if': function () { return $context.$data.operands().length == 1; } }; });\naddToBindingsCache('template: { name: $data.operands()[0].templateName, data: $data.operands()[0] }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.operands()[0].templateName, 'data': $context.$data.operands()[0] }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-filtereditor-add\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-filtereditor-add'; } }; });\naddToBindingsCache('service: { name: \\'createChangeParameter\\' }', function ($context, $element) { return { 'service': function () { return { 'name': 'createChangeParameter' }; } }; });\naddToBindingsCache('if: $data.canChange', function ($context, $element) { return { 'if': function () { return $context.$data.canChange; } }; });\naddToBindingsCache('service: { name: \\'createChangeProperty\\' }', function ($context, $element) { return { 'service': function () { return { 'name': 'createChangeProperty' }; } }; });\naddToBindingsCache('if: $data.operand().reverse', function ($context, $element) { return { 'if': function () { return $context.$data.operand().reverse; } }; });\naddToBindingsCache('template: {name: $data.operand().templateName, data: $data.operand() }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.operand().templateName, 'data': $context.$data.operand() }; } }; });\naddToBindingsCache('ifnot: $data.operand().reverse', function ($context, $element) { return { 'ifnot': function () { return $context.$data.operand().reverse; } }; });\naddToBindingsCache('with: operand', function ($context, $element) { return { 'with': function () { return $context.$data.operand; } }; });\naddToBindingsCache('visible: isEditable', function ($context, $element) { return { 'visible': function () { return $context.$data.isEditable; } }; });\naddToBindingsCache('dxTextBox: getStringEditorOptions($element), focus: { on: isEditable }', function ($context, $element) { return { 'dxTextBox': function () { return $context.$data.getStringEditorOptions($element); }, 'focus': function () { return { 'on': $context.$data.isEditable }; } }; });\naddToBindingsCache('focus: isEditable, dxLocalizedSelectBox: getBoolEditorOptions($element, $root)', function ($context, $element) { return { 'focus': function () { return $context.$data.isEditable; }, 'dxLocalizedSelectBox': function () { return $context.$data.getBoolEditorOptions($element, $context.$root); } }; });\naddToBindingsCache('focus: isEditable, dxDateBox: getDateEditorOptions($element, $root)', function ($context, $element) { return { 'focus': function () { return $context.$data.isEditable; }, 'dxDateBox': function () { return $context.$data.getDateEditorOptions($element, $context.$root); } }; });\naddToBindingsCache('dxTextBox: getNumberEditorOptions($element), focus: { on: isEditable }', function ($context, $element) { return { 'dxTextBox': function () { return $context.$data.getNumberEditorOptions($element); }, 'focus': function () { return { 'on': $context.$data.isEditable }; } }; });\naddToBindingsCache('focus: isEditable, dxSelectBox: getListEditOptions($element, $root)', function ($context, $element) { return { 'focus': function () { return $context.$data.isEditable; }, 'dxSelectBox': function () { return $context.$data.getListEditOptions($element, $context.$root); } }; });\naddToBindingsCache('visible: !isEditable()', function ($context, $element) { return { 'visible': function () { return !$context.$data.isEditable(); } }; });\naddToBindingsCache('text: value, click: function() { isEditable(true); }, css: { \\'default\\': $data.isDefaultDisplay() }', function ($context, $element) { return { 'text': function () { return $context.$data.value; }, 'click': function () { return function () { $context.$data.isEditable(true); }; }, 'css': function () { return { 'default': $context.$data.isDefaultDisplay() }; } }; });\naddToBindingsCache('if: $data.items.length === 0', function ($context, $element) { return { 'if': function () { return $context.$data.items.length === 0; } }; });\naddToBindingsCache('if: $data.specifics() === \"string\" || $data.specifics() === \"guid\"', function ($context, $element) { return { 'if': function () { return $context.$data.specifics() === 'string' || $context.$data.specifics() === 'guid'; } }; });\naddToBindingsCache('if: $data.specifics() === \"bool\"', function ($context, $element) { return { 'if': function () { return $context.$data.specifics() === 'bool'; } }; });\naddToBindingsCache('if: $data.specifics() === \"date\"', function ($context, $element) { return { 'if': function () { return $context.$data.specifics() === 'date'; } }; });\naddToBindingsCache('if: $data.specifics() !== \"string\" && $data.specifics() !== \"bool\" && $data.specifics() !== \"date\" && $data.specifics() !== \"guid\"', function ($context, $element) { return { 'if': function () { return $context.$data.specifics() !== 'string' && $context.$data.specifics() !== 'bool' && $context.$data.specifics() !== 'date' && $context.$data.specifics() !== 'guid'; } }; });\naddToBindingsCache('if: $data.items.length > 0', function ($context, $element) { return { 'if': function () { return $context.$data.items.length > 0; } }; });\naddToBindingsCache('dxPopup: { animation: { show: { type: \\'fadeIn\\', duration: 700 }, hide: { type: \\'fadeOut\\', duration: 700 } }, showTitle: true, wrapperAttr: { class: \\'dx-filtereditor dx-popup-general\\' }, resizeEnabled: true, onResize: function() { $data.resizeAceEditor() }, width: 700, height: 500, maxHeight: \\'95%\\', maxWidth: \\'95%\\', minHeight: 300, minWidth: 400, title: options() && options().title(), visible: popupVisible, onShown: function() { $data.focusText() }, toolbarItems: buttonItems, showCloseButton: true, container: getPopupContainer($element), position: { of: getPopupContainer($element) } }', function ($context, $element) { return { 'dxPopup': function () { return { 'animation': { 'show': { 'type': 'fadeIn', 'duration': 700 }, 'hide': { 'type': 'fadeOut', 'duration': 700 } }, 'showTitle': true, 'wrapperAttr': { 'class': 'dx-filtereditor dx-popup-general' }, 'resizeEnabled': true, 'onResize': function () { $context.$data.resizeAceEditor(); }, 'width': 700, 'height': 500, 'maxHeight': '95%', 'maxWidth': '95%', 'minHeight': 300, 'minWidth': 400, 'title': $context.$data.options() && $context.$data.options().title(), 'visible': $context.$data.popupVisible, 'onShown': function () { $context.$data.focusText(); }, 'toolbarItems': $context.$data.buttonItems, 'showCloseButton': true, 'container': $context.$data.getPopupContainer($element), 'position': { 'of': $context.$data.getPopupContainer($element) } }; } }; });\naddToBindingsCache('dxclick: showPopup', function ($context, $element) { return { 'dxclick': function () { return $context.$data.showPopup; } }; });\naddToBindingsCache('text: target.displayType, dxclick: showPopup, css: target.css', function ($context, $element) { return { 'text': function () { return $context.$data.target.displayType; }, 'dxclick': function () { return $context.$data.showPopup; }, 'css': function () { return $context.$data.target.css; } }; });\naddToBindingsCache('text: target.parameterName(), dxclick: showPopup, css: { \\'dxd-state-selected\\': target.isSelected }', function ($context, $element) { return { 'text': function () { return $context.$data.target.parameterName(); }, 'dxclick': function () { return $context.$data.showPopup; }, 'css': function () { return { 'dxd-state-selected': $context.$data.target.isSelected }; } }; });\naddToBindingsCache('text: target.displayName, dxclick: showPopup, css: { \\'dxd-state-selected\\': target.isSelected }', function ($context, $element) { return { 'text': function () { return $context.$data.target.displayName; }, 'dxclick': function () { return $context.$data.showPopup; }, 'css': function () { return { 'dxd-state-selected': $context.$data.target.isSelected }; } }; });\naddToBindingsCache('template: \\'dxrd-svg-filtereditor-edit\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-filtereditor-edit'; } }; });\naddToBindingsCache('dxPopupWithAutoHeight: { minWidth:\\'170px\\', maxWidth:\\'500px\\', width: \\'auto\\', height: \\'300px\\', wrapperAttr: { class: \\'dx-selectbox-popup-wrapper dx-dropdownlist-popup-wrapper dx-filtereditor-criteriaoperator-popup dx-dropdowneditor-overlay\\' }, focusStateEnabled: false, position: $data.rtl ? { my: \\'right top\\', at: \\'right bottom\\', of: popupService.target} : { my: \\'left top\\', at: \\'left bottom\\', of: popupService.target }, container: $data.getPopupContainer($element), target: popupService.target, showTitle: false, showCloseButton: false, animation: {}, hideOnOutsideClick: true, shading: false, visible: popupService.visible }', function ($context, $element) { return { 'dxPopupWithAutoHeight': function () { return { 'minWidth': '170px', 'maxWidth': '500px', 'width': 'auto', 'height': '300px', 'wrapperAttr': { 'class': 'dx-selectbox-popup-wrapper dx-dropdownlist-popup-wrapper dx-filtereditor-criteriaoperator-popup dx-dropdowneditor-overlay' }, 'focusStateEnabled': false, 'position': $context.$data.rtl ? { 'my': 'right top', 'at': 'right bottom', 'of': $context.$data.popupService.target } : { 'my': 'left top', 'at': 'left bottom', 'of': $context.$data.popupService.target }, 'container': $context.$data.getPopupContainer($element), 'target': $context.$data.popupService.target, 'showTitle': false, 'showCloseButton': false, 'animation': {}, 'hideOnOutsideClick': true, 'shading': false, 'visible': $context.$data.popupService.visible }; } }; });\naddToBindingsCache('dxTextBox: { placeholder: searchPlaceholder(), value: ($data.value || $data.filterString), height: \\'100%\\', width: \\'100%\\', stylingMode: \\'underlined\\', valueChangeEvent: \\'keyup\\' }', function ($context, $element) { return { 'dxTextBox': function () { return { 'placeholder': $context.$data.searchPlaceholder(), 'value': ($context.$data.value || $context.$data.filterString), 'height': '100%', 'width': '100%', 'stylingMode': 'underlined', 'valueChangeEvent': 'keyup' }; } }; });\naddToBindingsCache('template: { name: \\'dx-filtereditor-search-panel\\', data: $data }', function ($context, $element) { return { 'template': function () { return { 'name': 'dx-filtereditor-search-panel', 'data': $context.$data }; } }; });\naddToBindingsCache('dxScrollView: { showScrollbar: \\'onHover\\' }, css: { \\'dx-filtereditor-filtered\\': isFiltered }', function ($context, $element) { return { 'dxScrollView': function () { return { 'showScrollbar': 'onHover' }; }, 'css': function () { return { 'dx-filtereditor-filtered': $context.$data.isFiltered }; } }; });\naddToBindingsCache('text: $data.displayText || $data.name, click: function() { $parent.click($data); }, attr: {\\'title\\': $data.displayText || $data.name }', function ($context, $element) { return { 'text': function () { return $context.$data.displayText || $context.$data.name; }, 'click': function () { return function () { $context.$parent.click($context.$data); }; }, 'attr': function () { return { 'title': $context.$data.displayText || $context.$data.name }; } }; });\naddToBindingsCache('searchHighlighting: { text: $data.displayText || $data.name, textToSearch: $parent.filterString }, click: function() { $parent.click($data); }, attr: {\\'title\\': $data.displayText || $data.name }', function ($context, $element) { return { 'searchHighlighting': function () { return { 'text': $context.$data.displayText || $context.$data.name, 'textToSearch': $context.$parent.filterString }; }, 'click': function () { return function () { $context.$parent.click($context.$data); }; }, 'attr': function () { return { 'title': $context.$data.displayText || $context.$data.name }; } }; });\naddToBindingsCache('treeListSearchPanel: { controllers: data().treeListController, template: \\'dx-filtereditor-search-panel\\' }', function ($context, $element) { return { 'treeListSearchPanel': function () { return { 'controllers': $context.$data.data().treeListController, 'template': 'dx-filtereditor-search-panel' }; } }; });\naddToBindingsCache('treelist: data', function ($context, $element) { return { 'treelist': function () { return $context.$data.data; } }; });\naddToBindingsCache('with: popupService', function ($context, $element) { return { 'with': function () { return $context.$data.popupService; } }; });\naddToBindingsCache('with: data', function ($context, $element) { return { 'with': function () { return $context.$data.data; } }; });\naddToBindingsCache('template: template', function ($context, $element) { return { 'template': function () { return $context.$data.template; } }; });\naddToBindingsCache('if: $data.isFiltered', function ($context, $element) { return { 'if': function () { return $context.$data.isFiltered; } }; });\naddToBindingsCache('foreach: data', function ($context, $element) { return { 'foreach': function () { return $context.$data.data; } }; });\naddToBindingsCache('if: !$data.hidden', function ($context, $element) { return { 'if': function () { return !$context.$data.hidden; } }; });\naddToBindingsCache('ifnot: $parent.isFiltered', function ($context, $element) { return { 'ifnot': function () { return $context.$parent.isFiltered; } }; });\naddToBindingsCache('if: $parent.isFiltered', function ($context, $element) { return { 'if': function () { return $context.$parent.isFiltered; } }; });\naddToBindingsCache('dxList: { items: $data.items, selectedItems: $data.selectedItems, onItemClick: $data.action, selectionMode: \\'single\\', activeStateEnabled: false }', function ($context, $element) { return { 'dxList': function () { return { 'items': $context.$data.items, 'selectedItems': $context.$data.selectedItems, 'onItemClick': $context.$data.action, 'selectionMode': 'single', 'activeStateEnabled': false }; } }; });\naddToBindingsCache('click: $parent.removeItem, visible: $data.canRemove', function ($context, $element) { return { 'click': function () { return $context.$parent.removeItem; }, 'visible': function () { return $context.$data.canRemove; } }; });\naddToBindingsCache('text: $data.displayName', function ($context, $element) { return { 'text': function () { return $context.$data.displayName; } }; });\naddToBindingsCache('text: getDisplayText(\\'types\\')', function ($context, $element) { return { 'text': function () { return $context.$data.getDisplayText('types'); } }; });\naddToBindingsCache('dxButton:{ onClick: addCustomFormat, text: getDisplayText(\\'add\\'), disabled: !canAddCustomFormat() }', function ($context, $element) { return { 'dxButton': function () { return { 'onClick': $context.$data.addCustomFormat, 'text': $context.$data.getDisplayText('add'), 'disabled': !$context.$data.canAddCustomFormat() }; } }; });\naddToBindingsCache('dxTextBox: { value: formatResult, onInput: function(e) { updateInputText(\\'formatResult\\', e.component); } }', function ($context, $element) { return { 'dxTextBox': function () { return { 'value': $context.$data.formatResult, 'onInput': function (e) { $context.$data.updateInputText('formatResult', e.component); } }; } }; });\naddToBindingsCache('text: getDisplayText(\\'prefix\\')', function ($context, $element) { return { 'text': function () { return $context.$data.getDisplayText('prefix'); } }; });\naddToBindingsCache('dxTextBox: { value: formatPrefix, onInput: function(e) { updateInputText(\\'formatPrefix\\', e.component); } }', function ($context, $element) { return { 'dxTextBox': function () { return { 'value': $context.$data.formatPrefix, 'onInput': function (e) { $context.$data.updateInputText('formatPrefix', e.component); } }; } }; });\naddToBindingsCache('text: getDisplayText(\\'suffix\\')', function ($context, $element) { return { 'text': function () { return $context.$data.getDisplayText('suffix'); } }; });\naddToBindingsCache('dxTextBox: { value: formatSuffix, onInput: function(e) { updateInputText(\\'formatSuffix\\', e.component); } }', function ($context, $element) { return { 'dxTextBox': function () { return { 'value': $context.$data.formatSuffix, 'onInput': function (e) { $context.$data.updateInputText('formatSuffix', e.component); } }; } }; });\naddToBindingsCache('template: { name: \\'dx-format-string-list\\', data: { items: patternList, action: setFormat, removeItem: removeCustomFormat, selectedItems: selectedFormats } }', function ($context, $element) { return { 'template': function () { return { 'name': 'dx-format-string-list', 'data': { 'items': $context.$data.patternList, 'action': $context.$data.setFormat, 'removeItem': $context.$data.removeCustomFormat, 'selectedItems': $context.$data.selectedFormats } }; } }; });\naddToBindingsCache('dxEllipsisEditor: { value: value, disabled: disabled, buttonAction: function() { popupVisible(true); } }', function ($context, $element) { return { 'dxEllipsisEditor': function () { return { 'value': $context.$data.value, 'disabled': $context.$data.disabled, 'buttonAction': function () { $context.$data.popupVisible(true); } }; } }; });\naddToBindingsCache('dxPopup: { wrapperAttr: { class: \\'dx-format-string dx-popup-general\\' }, showTitle: true, width: \\'95%\\', height: \\'95%\\', minWidth: 650, title: getDisplayText(\\'title\\'), visible: popupVisible, toolbarItems: buttonItems, showCloseButton: true, container: getPopupContainer($element), position: { of: getPopupContainer($element) } }', function ($context, $element) { return { 'dxPopup': function () { return { 'wrapperAttr': { 'class': 'dx-format-string dx-popup-general' }, 'showTitle': true, 'width': '95%', 'height': '95%', 'minWidth': 650, 'title': $context.$data.getDisplayText('title'), 'visible': $context.$data.popupVisible, 'toolbarItems': $context.$data.buttonItems, 'showCloseButton': true, 'container': $context.$data.getPopupContainer($element), 'position': { 'of': $context.$data.getPopupContainer($element) } }; } }; });\naddToBindingsCache('text: getDisplayText(\\'category\\')', function ($context, $element) { return { 'text': function () { return $context.$data.getDisplayText('category'); } }; });\naddToBindingsCache('css: { \\'dx-format-general\\': isGeneralType }', function ($context, $element) { return { 'css': function () { return { 'dx-format-general': $context.$data.isGeneralType }; } }; });\naddToBindingsCache('text: getDisplayText(\\'preview\\')', function ($context, $element) { return { 'text': function () { return $context.$data.getDisplayText('preview'); } }; });\naddToBindingsCache('text: previewString', function ($context, $element) { return { 'text': function () { return $context.$data.previewString; } }; });\naddToBindingsCache('template: { name: \\'dx-format-string-list\\', data: { items: types, action: setType, selectedItems: selectedTypes } }', function ($context, $element) { return { 'template': function () { return { 'name': 'dx-format-string-list', 'data': { 'items': $context.$data.types, 'action': $context.$data.setType, 'selectedItems': $context.$data.selectedTypes } }; } }; });\naddToBindingsCache('if: !isGeneralType', function ($context, $element) { return { 'if': function () { return !$context.$data.isGeneralType; } }; });\naddToBindingsCache('template: \\'dx-format-string-edit-area\\'', function ($context, $element) { return { 'template': function () { return 'dx-format-string-edit-area'; } }; });\naddToBindingsCache('if: isGeneralType', function ($context, $element) { return { 'if': function () { return $context.$data.isGeneralType; } }; });\naddToBindingsCache('template: \\'dx-format-string-edit-area-general\\'', function ($context, $element) { return { 'template': function () { return 'dx-format-string-edit-area-general'; } }; });\naddToBindingsCache('dxButtonWithTemplate: { onClick: function() { clickAction($parent); }, icon: ko.unwrap($data.imageTemplateName), iconClass: $data.imageClassName, visible: (ko.unwrap($data.visible) == undefined) || ko.unwrap($data.visible), disabled: $data.disabled && $data.disabled() }, attr: { title: $data.displayText && $data.displayText() || text }', function ($context, $element) { return { 'dxButtonWithTemplate': function () { return { 'onClick': function () { $context.$data.clickAction($context.$parent); }, 'icon': $context.ko.unwrap($context.$data.imageTemplateName), 'iconClass': $context.$data.imageClassName, 'visible': ($context.ko.unwrap($context.$data.visible) == undefined) || $context.ko.unwrap($context.$data.visible), 'disabled': $context.$data.disabled && $context.$data.disabled() }; }, 'attr': function () { return { 'title': $context.$data.displayText && $context.$data.displayText() || $context.$data.text }; } }; });\naddToBindingsCache('dxButtonWithTemplate: { icon: \\'dxrd-svg-operations-edit\\', iconClass: \\'dx-image-edit\\', onClick: function() { $parent.collapsed(!$parent.collapsed()); } }, visible: $parent.hasContent, attr: { title: $data.displayText() }', function ($context, $element) { return { 'dxButtonWithTemplate': function () { return { 'icon': 'dxrd-svg-operations-edit', 'iconClass': 'dx-image-edit', 'onClick': function () { $context.$parent.collapsed(!$context.$parent.collapsed()); } }; }, 'visible': function () { return $context.$parent.hasContent; }, 'attr': function () { return { 'title': $context.$data.displayText() }; } }; });\naddToBindingsCache('template: { name: \\'dx-treelist-edit-action\\', data: treeListEditAction() }', function ($context, $element) { return { 'template': function () { return { 'name': 'dx-treelist-edit-action', 'data': $context.$data.treeListEditAction() }; } }; });\naddToBindingsCache('template: \\'dx-treelist-item-actions\\'', function ($context, $element) { return { 'template': function () { return 'dx-treelist-item-actions'; } }; });\naddToBindingsCache('styleunit: padding, click: renderNext', function ($context, $element) { return { 'styleunit': function () { return $context.$data.padding; }, 'click': function () { return $context.$data.renderNext; } }; });\naddToBindingsCache('text: $data.text()', function ($context, $element) { return { 'text': function () { return $context.$data.text(); } }; });\naddToBindingsCache('dxdAccordionExt: { collapsed: collapsed, lazyContentRendering: true }', function ($context, $element) { return { 'dxdAccordionExt': function () { return { 'collapsed': $context.$data.collapsed, 'lazyContentRendering': true }; } }; });\naddToBindingsCache('visible: isSelected() || isHovered()', function ($context, $element) { return { 'visible': function () { return $context.$data.isSelected() || $context.$data.isHovered(); } }; });\naddToBindingsCache('event: { dblclick: function() { $data.dblClickHandler ? $data.dblClickHandler($data) : $data.toggleCollapsed() }, mouseenter: mouseenter, mouseleave: mouseleave }, styleunit: padding, css: $data.getCssRules(), attr: { \\'aria-expanded\\': (hasItems && (!collapsed() ? \\'true\\' : \\'false\\')), \\'aria-selected\\': (isSelected() || isMultiSelected()) ? \\'true\\' : \\'false\\', \\'aria-level\\':level + 1, \\'aria-label\\': text, \\'aria-setsize\\': parent ? parent.items().length : 0, \\'aria-posinset\\': parent ? parent.items.indexOf($data) + 1 : 0 }', function ($context, $element) { return { 'event': function () { return { 'dblclick': function () { $context.$data.dblClickHandler ? $context.$data.dblClickHandler($context.$data) : $context.$data.toggleCollapsed(); }, 'mouseenter': $context.$data.mouseenter, 'mouseleave': $context.$data.mouseleave }; }, 'styleunit': function () { return $context.$data.padding; }, 'css': function () { return $context.$data.getCssRules(); }, 'attr': function () { return { 'aria-expanded': ($context.$data.hasItems && (!$context.$data.collapsed() ? 'true' : 'false')), 'aria-selected': ($context.$data.isSelected() || $context.$data.isMultiSelected()) ? 'true' : 'false', 'aria-level': $context.$data.level + 1, 'aria-label': $context.$data.text, 'aria-setsize': $context.$data.parent ? $context.$data.parent.items().length : 0, 'aria-posinset': $context.$data.parent ? $context.$data.parent.items.indexOf($context.$data) + 1 : 0 }; } }; });\naddToBindingsCache('style: { \\'padding-left\\': $data.hasItems ? \\'0px\\': \\'18px\\' }', function ($context, $element) { return { 'style': function () { return { 'padding-left': $context.$data.hasItems ? '0px' : '18px' }; } }; });\naddToBindingsCache('click: toggleSelected, draggable: dragDropHandler', function ($context, $element) { return { 'click': function () { return $context.$data.toggleSelected; }, 'draggable': function () { return $context.$data.dragDropHandler; } }; });\naddToBindingsCache('searchHighlighting: { text: text, textToSearch: treeListController.textToSearch, searchOptions: treeListController.searchOptions }, attr: { title: text }', function ($context, $element) { return { 'searchHighlighting': function () { return { 'text': $context.$data.text, 'textToSearch': $context.$data.treeListController.textToSearch, 'searchOptions': $context.$data.treeListController.searchOptions }; }, 'attr': function () { return { 'title': $context.$data.text }; } }; });\naddToBindingsCache('if: treeListController.searchEnabled', function ($context, $element) { return { 'if': function () { return $context.$data.treeListController.searchEnabled; } }; });\naddToBindingsCache('ifnot: treeListController.searchEnabled', function ($context, $element) { return { 'ifnot': function () { return $context.$data.treeListController.searchEnabled; } }; });\naddToBindingsCache('if: hasContent', function ($context, $element) { return { 'if': function () { return $context.$data.hasContent; } }; });\naddToBindingsCache('template: templates.accordionItem', function ($context, $element) { return { 'template': function () { return $context.$data.templates.accordionItem; } }; });\naddToBindingsCache('ifnot: hasContent', function ($context, $element) { return { 'ifnot': function () { return $context.$data.hasContent; } }; });\naddToBindingsCache('template: templates.headerItem', function ($context, $element) { return { 'template': function () { return $context.$data.templates.headerItem; } }; });\naddToBindingsCache('template: { name: contenttemplate }', function ($context, $element) { return { 'template': function () { return { 'name': $context.$data.contenttemplate }; } }; });\naddToBindingsCache('template: actionsTemplate()', function ($context, $element) { return { 'template': function () { return $context.$data.actionsTemplate(); } }; });\naddToBindingsCache('if: $data.hasItems', function ($context, $element) { return { 'if': function () { return $context.$data.hasItems; } }; });\naddToBindingsCache('if: actions && actions.length > 0', function ($context, $element) { return { 'if': function () { return $context.$data.actions && $context.$data.actions.length > 0; } }; });\naddToBindingsCache('template: templates.actionsContainer', function ($context, $element) { return { 'template': function () { return $context.$data.templates.actionsContainer; } }; });\naddToBindingsCache('if: isDraggable', function ($context, $element) { return { 'if': function () { return $context.$data.isDraggable; } }; });\naddToBindingsCache('template: templates.headerItemContent', function ($context, $element) { return { 'template': function () { return $context.$data.templates.headerItemContent; } }; });\naddToBindingsCache('ifnot: isDraggable', function ($context, $element) { return { 'ifnot': function () { return $context.$data.isDraggable; } }; });\naddToBindingsCache('template: templates.itemTextContent', function ($context, $element) { return { 'template': function () { return $context.$data.templates.itemTextContent; } }; });\naddToBindingsCache('event: { dblclick: function() { $data.dblClickHandler ? $data.dblClickHandler($data) : $data.toggleCollapsed() }, mouseenter: mouseenter, mouseleave: mouseleave }, styleunit: padding, css: { \\'dx-treelist-item-selected dxd-state-selected dxd-back-secondary\\': isSelected() || isMultiSelected() }', function ($context, $element) { return { 'event': function () { return { 'dblclick': function () { $context.$data.dblClickHandler ? $context.$data.dblClickHandler($context.$data) : $context.$data.toggleCollapsed(); }, 'mouseenter': $context.$data.mouseenter, 'mouseleave': $context.$data.mouseleave }; }, 'styleunit': function () { return $context.$data.padding; }, 'css': function () { return { 'dx-treelist-item-selected dxd-state-selected dxd-back-secondary': $context.$data.isSelected() || $context.$data.isMultiSelected() }; } }; });\naddToBindingsCache('css: nodeImageClass, template: \\'dxrd-svg-collapsed\\', click: toggleCollapsed, style: { \\'visibility\\': hasItems ? \\'visible\\' : \\'hidden\\' }', function ($context, $element) { return { 'css': function () { return $context.$data.nodeImageClass; }, 'template': function () { return 'dxrd-svg-collapsed'; }, 'click': function () { return $context.$data.toggleCollapsed; }, 'style': function () { return { 'visibility': $context.$data.hasItems ? 'visible' : 'hidden' }; } }; });\naddToBindingsCache('visible: $data.isSelected() || $data.isHovered()', function ($context, $element) { return { 'visible': function () { return $context.$data.isSelected() || $context.$data.isHovered(); } }; });\naddToBindingsCache('click: toggleSelected, draggable: isDraggable ? dragDropHandler : null', function ($context, $element) { return { 'click': function () { return $context.$data.toggleSelected; }, 'draggable': function () { return $context.$data.isDraggable ? $context.$data.dragDropHandler : null; } }; });\naddToBindingsCache('template: \"dx-treelist-accordion-item-with-hover\"', function ($context, $element) { return { 'template': function () { return 'dx-treelist-accordion-item-with-hover'; } }; });\naddToBindingsCache('template: \"dx-treelist-header-item-with-hover\"', function ($context, $element) { return { 'template': function () { return 'dx-treelist-header-item-with-hover'; } }; });\naddToBindingsCache('dxTextBox: { mode: \\'search\\', value:value, valueChangeEvent: \\'keyup\\', showClearButton: true, placeholder: searchPlaceholder()}', function ($context, $element) { return { 'dxTextBox': function () { return { 'mode': 'search', 'value': $context.$data.value, 'valueChangeEvent': 'keyup', 'showClearButton': true, 'placeholder': $context.$data.searchPlaceholder() }; } }; });\naddToBindingsCache('template: $data.visibleItems !== undefined ? \\'dx-treelist-paginate\\' : \\'dx-treelist-common\\'', function ($context, $element) { return { 'template': function () { return $context.$data.visibleItems !== undefined ? 'dx-treelist-paginate' : 'dx-treelist-common'; } }; });\naddToBindingsCache('lazy: { resolver: resolver, innerBindings: { template: templateName } }', function ($context, $element) { return { 'lazy': function () { return { 'resolver': $context.$data.resolver, 'innerBindings': { 'template': $context.$data.templateName } }; } }; });\naddToBindingsCache('if: !$data.collapsed()', function ($context, $element) { return { 'if': function () { return !$context.$data.collapsed(); } }; });\naddToBindingsCache('template: { name: \\'dx-treelist\\', data: $data }', function ($context, $element) { return { 'template': function () { return { 'name': 'dx-treelist', 'data': $context.$data }; } }; });\naddToBindingsCache('foreach: visibleItems', function ($context, $element) { return { 'foreach': function () { return $context.$data.visibleItems; } }; });\n","/**\r\n* DevExpress Analytics (dx-analytics-core-svg-bindings.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { addToBindingsCache } from './property-grid/widgets/internal/_bindingsCache';\naddToBindingsCache('template: \\'dxrd-svg-collapsed\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-collapsed'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-ellipsis\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-ellipsis'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-error\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-error'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-addition\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-addition'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-and\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-and'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-division\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-division'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-edit\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-edit'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-equal\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-equal'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-greater\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-greater'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-greater_or_equal\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-greater_or_equal'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-less\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-less'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-less_or_equal\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-less_or_equal'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-modulus\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-modulus'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-multiplication\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-multiplication'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-not\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-not'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-not_equal\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-not_equal'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-or\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-or'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-parenthesis\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-parenthesis'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-expressioneditor-subtraction\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-expressioneditor-subtraction'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-array\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-array'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-bitearray\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-bitearray'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-bool\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-bool'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-booleanfield\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-booleanfield'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-column\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-column'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-datasource\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-datasource'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-date\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-date'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-datetimefield\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-datetimefield'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-doublefield\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-doublefield'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-enum\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-enum'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-float\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-float'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-guid\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-guid'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-integer\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-integer'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-integerfield\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-integerfield'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-listsource\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-listsource'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-none\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-none'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-parameters\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-parameters'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-range\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-range'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-string\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-string'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-stringfield\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-stringfield'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-table\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-table'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fieldlist-view\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fieldlist-view'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-filtereditor-add\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-filtereditor-add'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-filtereditor-edit\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-filtereditor-edit'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-filtereditor-remove\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-filtereditor-remove'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fontstyle-bold\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fontstyle-bold'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fontstyle-italic\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fontstyle-italic'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fontstyle-strikeout\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fontstyle-strikeout'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-fontstyle-underline\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-fontstyle-underline'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-menu-menu\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-menu-menu'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-menu-open\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-menu-open'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-menu-save\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-menu-save'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-menu-saveas\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-menu-saveas'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-add\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-add'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-add_calcfield\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-add_calcfield'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-add_datasource\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-add_datasource'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-add_query\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-add_query'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-arrowdown\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-arrowdown'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-arrowup\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-arrowup'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-ascending\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-ascending'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-descending\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-descending'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-edit\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-edit'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-movedown\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-movedown'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-moveleft\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-moveleft'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-moveleft_all\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-moveleft_all'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-moveright\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-moveright'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-moveright_all\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-moveright_all'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-moveup\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-moveup'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-rebuild_schema\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-rebuild_schema'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-recycle_bin\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-recycle_bin'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-recycle_bin_xl\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-recycle_bin_xl'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-remove\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-remove'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-rename\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-rename'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-operations-unsorted\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-operations-unsorted'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-all\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-all'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-bottom\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-bottom'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-left\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-left'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-none\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-none'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-right\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-right'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-borders-top\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-borders-top'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-propertyexpression\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-propertyexpression'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-search\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-search'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-sortingbyalphabet\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-sortingbyalphabet'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-sortingbygroups\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-sortingbygroups'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-bottom\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-bottom'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-center\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-center'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-justify\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-justify'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-left\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-left'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-middle\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-middle'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-right\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-right'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-properties-textAlignment-top\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-properties-textAlignment-top'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-queryBuilder-aggregate\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-queryBuilder-aggregate'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-queryBuilder-data_preview\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-queryBuilder-data_preview'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-queryBuilder-group_by\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-queryBuilder-group_by'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-queryBuilder-select_statment\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-queryBuilder-select_statment'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-queryBuilder-sorting_asc\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-queryBuilder-sorting_asc'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-queryBuilder-sorting_desc\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-queryBuilder-sorting_desc'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-tabs-properties\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-tabs-properties'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-toolbar-copy\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-toolbar-copy'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-toolbar-cut\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-toolbar-cut'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-toolbar-delete\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-toolbar-delete'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-toolbar-paste\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-toolbar-paste'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-toolbar-redo\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-toolbar-redo'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-toolbar-undo\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-toolbar-undo'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-toolbar-validate\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-toolbar-validate'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-toolbar-zoomin\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-toolbar-zoomin'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-toolbar-zoomout\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-toolbar-zoomout'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-wizard-Download\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-wizard-Download'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-wizard-expressions\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-wizard-expressions'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-wizard-FederationDataSource\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-wizard-FederationDataSource'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-wizard-JsonDataSource\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-wizard-JsonDataSource'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-wizard-NoDataSource\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-wizard-NoDataSource'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-wizard-ObjectDataSource\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-wizard-ObjectDataSource'; } }; });\naddToBindingsCache('template: \\'dxrd-svg-wizard-SqlDataSource\\'', function ($context, $element) { return { 'template': function () { return 'dxrd-svg-wizard-SqlDataSource'; } }; });\n","/**\r\n* DevExpress Analytics (dx-analytics-core-svg-templates.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { SvgTemplatesEngine } from './property-grid/widgets/internal/_svgTemplateEngine';\nSvgTemplatesEngine.addTemplates({\n 'dxrd-svg-collapsed': '
',\n 'dxrd-svg-ellipsis': '
',\n 'dxrd-svg-error': '
',\n 'dxrd-svg-expressioneditor-addition': '
',\n 'dxrd-svg-expressioneditor-and': '
',\n 'dxrd-svg-expressioneditor-division': '
',\n 'dxrd-svg-expressioneditor-edit': '
',\n 'dxrd-svg-expressioneditor-equal': '
',\n 'dxrd-svg-expressioneditor-greater': '
',\n 'dxrd-svg-expressioneditor-greater_or_equal': '
',\n 'dxrd-svg-expressioneditor-less': '
',\n 'dxrd-svg-expressioneditor-less_or_equal': '
',\n 'dxrd-svg-expressioneditor-modulus': '
',\n 'dxrd-svg-expressioneditor-multiplication': '
',\n 'dxrd-svg-expressioneditor-not': '
',\n 'dxrd-svg-expressioneditor-not_equal': '
',\n 'dxrd-svg-expressioneditor-or': '
',\n 'dxrd-svg-expressioneditor-parenthesis': '
',\n 'dxrd-svg-expressioneditor-subtraction': '
',\n 'dxrd-svg-fieldlist-array': '
',\n 'dxrd-svg-fieldlist-bitearray': '
',\n 'dxrd-svg-fieldlist-bool': '
',\n 'dxrd-svg-fieldlist-booleanfield': '
',\n 'dxrd-svg-fieldlist-column': '
',\n 'dxrd-svg-fieldlist-datasource': '
',\n 'dxrd-svg-fieldlist-date': '
',\n 'dxrd-svg-fieldlist-datetimefield': '
',\n 'dxrd-svg-fieldlist-doublefield': '
',\n 'dxrd-svg-fieldlist-enum': '
',\n 'dxrd-svg-fieldlist-float': '
',\n 'dxrd-svg-fieldlist-guid': '
',\n 'dxrd-svg-fieldlist-integer': '
',\n 'dxrd-svg-fieldlist-integerfield': '
',\n 'dxrd-svg-fieldlist-listsource': '
',\n 'dxrd-svg-fieldlist-none': '
',\n 'dxrd-svg-fieldlist-parameters': '
',\n 'dxrd-svg-fieldlist-range': '
',\n 'dxrd-svg-fieldlist-string': '
',\n 'dxrd-svg-fieldlist-stringfield': '
',\n 'dxrd-svg-fieldlist-table': '
',\n 'dxrd-svg-fieldlist-view': '
',\n 'dxrd-svg-filtereditor-add': '
',\n 'dxrd-svg-filtereditor-edit': '
',\n 'dxrd-svg-filtereditor-remove': '
',\n 'dxrd-svg-fontstyle-bold': '
',\n 'dxrd-svg-fontstyle-italic': '
',\n 'dxrd-svg-fontstyle-strikeout': '
',\n 'dxrd-svg-fontstyle-underline': '
',\n 'dxrd-svg-menu-menu': '
',\n 'dxrd-svg-menu-open': '
',\n 'dxrd-svg-menu-save': '
',\n 'dxrd-svg-menu-saveas': '
',\n 'dxrd-svg-operations-add': '
',\n 'dxrd-svg-operations-add_calcfield': '
',\n 'dxrd-svg-operations-add_datasource': '
',\n 'dxrd-svg-operations-add_query': '
',\n 'dxrd-svg-operations-arrowdown': '
',\n 'dxrd-svg-operations-arrowup': '
',\n 'dxrd-svg-operations-ascending': '
',\n 'dxrd-svg-operations-descending': '
',\n 'dxrd-svg-operations-edit': '
',\n 'dxrd-svg-operations-movedown': '
',\n 'dxrd-svg-operations-moveleft': '
',\n 'dxrd-svg-operations-moveleft_all': '
',\n 'dxrd-svg-operations-moveright': '
',\n 'dxrd-svg-operations-moveright_all': '
',\n 'dxrd-svg-operations-moveup': '
',\n 'dxrd-svg-operations-rebuild_schema': '
',\n 'dxrd-svg-operations-recycle_bin': '
',\n 'dxrd-svg-operations-recycle_bin_xl': '
',\n 'dxrd-svg-operations-remove': '
',\n 'dxrd-svg-operations-rename': '
',\n 'dxrd-svg-operations-unsorted': '
',\n 'dxrd-svg-properties-borders-all': '
',\n 'dxrd-svg-properties-borders-bottom': '
',\n 'dxrd-svg-properties-borders-left': '
',\n 'dxrd-svg-properties-borders-none': '
',\n 'dxrd-svg-properties-borders-right': '
',\n 'dxrd-svg-properties-borders-top': '
',\n 'dxrd-svg-properties-propertyexpression': '
',\n 'dxrd-svg-properties-search': '
',\n 'dxrd-svg-properties-sortingbyalphabet': '
',\n 'dxrd-svg-properties-sortingbygroups': '
',\n 'dxrd-svg-properties-textAlignment-bottom': '
',\n 'dxrd-svg-properties-textAlignment-center': '
',\n 'dxrd-svg-properties-textAlignment-justify': '
',\n 'dxrd-svg-properties-textAlignment-left': '
',\n 'dxrd-svg-properties-textAlignment-middle': '
',\n 'dxrd-svg-properties-textAlignment-right': '
',\n 'dxrd-svg-properties-textAlignment-top': '
',\n 'dxrd-svg-queryBuilder-aggregate': '
',\n 'dxrd-svg-queryBuilder-data_preview': '
',\n 'dxrd-svg-queryBuilder-group_by': '
',\n 'dxrd-svg-queryBuilder-select_statment': '
',\n 'dxrd-svg-queryBuilder-sorting_asc': '
',\n 'dxrd-svg-queryBuilder-sorting_desc': '
',\n 'dxrd-svg-tabs-properties': '
',\n 'dxrd-svg-toolbar-copy': '
',\n 'dxrd-svg-toolbar-cut': '
',\n 'dxrd-svg-toolbar-delete': '
',\n 'dxrd-svg-toolbar-paste': '
',\n 'dxrd-svg-toolbar-redo': '
',\n 'dxrd-svg-toolbar-undo': '
',\n 'dxrd-svg-toolbar-validate': '
',\n 'dxrd-svg-toolbar-zoomin': '
',\n 'dxrd-svg-toolbar-zoomout': '
',\n 'dxrd-svg-wizard-Download': '
',\n 'dxrd-svg-wizard-expressions': '
',\n 'dxrd-svg-wizard-FederationDataSource': '
',\n 'dxrd-svg-wizard-JsonDataSource': '
',\n 'dxrd-svg-wizard-NoDataSource': '
',\n 'dxrd-svg-wizard-ObjectDataSource': '
',\n 'dxrd-svg-wizard-SqlDataSource': '
',\n});\n","/**\r\n* DevExpress Analytics (dx-analytics-core-templates.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { SvgTemplatesEngine } from './property-grid/widgets/internal/_svgTemplateEngine';\nSvgTemplatesEngine.addTemplates({\n 'dxrd-bordereditor': '
',\n 'dxrd-borders': '
',\n 'dxrd-colorpicker': '
',\n 'dxrd-expressionstring': '
',\n 'dxrd-field': '
',\n 'dxrd-filterstring': '
',\n 'dxrd-filterstringgroup': '
',\n 'dxrd-formatstring': '
',\n 'dxrd-guid': '
',\n 'dxrd-emptyHeader': '',\n 'dxrd-objectEditorContent': '
',\n 'dxrd-objectEditor': '
',\n 'dxrd-commonCollectionItem': '
',\n 'dxrd-textalignment': '
',\n 'dxrd-objectVisitor': '
',\n 'dxd-snap-lines-holder': '
',\n 'dxrd-surface-template-base': '
',\n 'dxrd-designer': '
',\n 'dxrd-textalignment-editor': '
',\n 'dxrd-collectionactions-template': '
',\n 'dxrd-drag-helper-source': '
',\n 'dxrd-drag-helper-source-reorder-treelist': '
',\n 'dxrd-menubutton-template-base': ' ',\n 'dxrd-top-grid': '
',\n 'dxrd-group-actions': '
!x.visible || ko.unwrap(x.visible))\">
',\n 'dx-propertygrid-searchbox': '
',\n 'dxrd-propertiestab': '
',\n 'dx-propertygrid-popupservice': '
',\n 'dx-right-panel-lightweight': '
',\n 'dxrd-right-panel-template-base': '
',\n 'dx-right-panel-switcher': '
',\n 'dxrd-toolbar-template-base': '
',\n 'dxrd-toolbar-tmplt': '
',\n 'dxrd-toolbox-template-base': '
',\n 'dxrd-grouped-toolbox-template-base': '
',\n 'dxrd-zoom-select-template': '
',\n 'dx-editor-addons': '',\n 'dx-collectioneditor': '
',\n 'dx-boolean': '
',\n 'dx-boolean-select': '
',\n 'dx-commonCollection': '
',\n 'dx-commonCollectionItem': '
',\n 'item-with-title': '
',\n 'dx-combobox': '
',\n 'dx-combobox-editable': '
',\n 'dx-combobox-undo': '
',\n 'dx-property-editor': '
',\n 'dx-emptyHeader': '',\n 'dx-date': '
',\n 'dx-file': '
',\n 'dx-modificators': '
',\n 'dx-image': '
',\n 'dx-numeric': '
',\n 'dx-number-editor': '
',\n 'dx-text': '
',\n 'dx-string-array': '
',\n 'dx-propertieseditor': '
',\n 'dx-objectEditorContent': '
',\n 'dxrd-federated-manageQueries-editor': '
',\n 'dx-querybuilder-federation-popup-templates': ' ',\n 'dxrd-managequeries-selectbox': '
',\n 'dx-expressioneditor-main': '
',\n 'dx-expressioneditor': '
',\n 'dx-expressioneditor-popup': '
',\n 'dx-expressioneditor-categories': '
',\n 'dx-expressioneditor-category-accordion': '
',\n 'dx-expressioneditor-description': '
',\n 'dx-expressioneditor-fields': '
',\n 'dx-ee-treelist-item': '
',\n 'dx-expressioneditor-selectedcontent': ' ',\n 'dx-expressioneditor-collection': '
',\n 'dx-expressioneditor-collection-function': '
',\n 'dx-filtereditor-content': '
',\n 'dx-filtereditor-plain-content-text': '
',\n 'dx-filtereditor-content-plain': '
',\n 'dx-filtereditor-content-text': '
',\n 'dx-filtereditor-content-tree': '
',\n 'dx-filtereditor': '
',\n 'dx-filtereditor-advanced': '
',\n 'dx-filtereditor-plain': '
',\n 'dx-filtereditor-aggregate-common': '
(
)
',\n 'dx-filtereditor-aggregate': '
',\n 'dx-filtereditor-between': '
',\n 'dx-filtereditor-binary': '
',\n 'dx-filtereditor-common': '
',\n 'dx-filtereditor-function-lightweight': '
',\n 'dx-filtereditor-function': '
',\n 'dx-filtereditor-group': '
',\n 'dx-filtereditor-in': '
',\n 'dx-filtereditor-parameter': '
',\n 'dx-filtereditor-property': '
',\n 'dx-filtereditor-unary': '
',\n 'dx-filtereditor-not': ' ',\n 'dx-filtereditor-value': '
',\n 'dx-filtereditor-popup': '
',\n 'dx-filtereditor-create': '
',\n 'dx-filtereditor-change': '
',\n 'dx-filtereditor-changeParameter': '
',\n 'dx-filtereditor-changeProperty': '
',\n 'dx-filtereditor-changeValueType': '
',\n 'dx-filtereditor-content-popups': '',\n 'dx-filtereditor-search-panel': '',\n 'dx-filtereditor-popup-common': '
',\n 'dx-filtereditor-popup-treelist': '
',\n 'dx-format-string-list': '
',\n 'dx-format-string-edit-area': '
',\n 'dx-format-string-edit-area-general': '
',\n 'dx-format-string': '
',\n 'dx-treelist-item-actions': '
',\n 'dx-treelist-edit-action': '
',\n 'dx-treelist-item-actions-with-edit': ' ',\n 'dx-treelist-item-ellipsis': '
',\n 'dx-treelist-item': ' ',\n 'dx-treelist-accordion-item': '
',\n 'dx-treelist-item-actions-container': '
',\n 'dx-treelist-header-item': '
',\n 'dx-treelist-item-text-content': '
',\n 'dx-treelist-header-item-caption-content': '
',\n 'dx-treelist-item-with-hover': '
',\n 'dx-treelist-accordion-item-with-hover': '
',\n 'dx-treelist-header-item-with-hover': '
',\n 'dx-treelist': '
',\n 'dx-treelist-search-panel': '
',\n 'dx-treelist-common': ' ',\n 'dx-treelist-paginate': ' '\n});\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\ellipsiseditor\\_editor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport registerComponent from 'devextreme/core/component_registrator';\nimport 'devextreme/ui/text_box';\nimport dxTextBox from 'devextreme/ui/text_box';\nimport * as $ from 'jquery';\nimport * as ko from 'knockout';\nimport { addDisposeCallback } from '../../../serializer/_internal';\nimport { SvgTemplatesEngine } from '../internal/_svgTemplateEngine';\nimport { KeyboardEnum } from '../internal/_utils';\nvar editor_prefix = 'dx-ellipsiseditor', EDITOR_CLASS = editor_prefix + ' dx-dropdowneditor', EDITOR_BUTTON_CLASS = editor_prefix + '-button dx-widget dx-button-normal dx-dropdowneditor-button dx-ellipsis-button', EDITOR_BUTTON_ICON_CLASS = editor_prefix + '-icon dx-ellipsis-image dx-dropdowneditor-icon', EDITOR_BUTTON_ICON_TEMPLATE = 'dxrd-svg-ellipsis', EDITOR_WARNING_STATE_CLASS = 'dx-ellipsiseditor-warning';\nexport class dxEllipsisEditor extends dxTextBox {\n constructor(element, options) {\n super(element, options);\n }\n _init() {\n super['_init'].apply(this);\n if (!this._$element) {\n this._$element = $.fn.constructor(this.element());\n }\n this._$element.addClass(EDITOR_CLASS);\n this._koContext = ko.contextFor(this._$element.get(0));\n }\n _render() {\n super['_render'].apply(this);\n this._renderButton();\n this._updateWarningState();\n this._attachInputEvents();\n }\n _updateWarningState(value = this.option('warningMessage')) {\n if (value) {\n this._$element.attr('title', value.toString());\n this._$element.addClass(EDITOR_WARNING_STATE_CLASS);\n }\n else {\n this._$element.removeAttr('title');\n this._$element.removeClass(EDITOR_WARNING_STATE_CLASS);\n }\n }\n _renderButton() {\n this._$button = $.fn.constructor('
').addClass(EDITOR_BUTTON_CLASS);\n this._attachButtonEvents();\n this._$buttonIcon = $.fn.constructor('
').addClass(EDITOR_BUTTON_ICON_CLASS).height('100%').append(SvgTemplatesEngine.templates[EDITOR_BUTTON_ICON_TEMPLATE]).appendTo(this._$button);\n ko.applyBindingsToDescendants(this._koContext, this._$buttonIcon[0]);\n var buttonsContainer = this['_buttonsContainer']();\n this._$button.appendTo(buttonsContainer);\n }\n _updateButtonSize() {\n this._$buttonIcon.height($.fn.constructor(this.element()).height());\n }\n _attachButtonEvents() {\n var subscribeElements = [];\n if (!this._$input)\n this._$input = $.fn.constructor(this['_input']());\n this._$button.off('click');\n this._$input.off('click');\n if (!this.option('disabled'))\n subscribeElements.push(this._$button);\n if (this.option('openOnFieldClick'))\n subscribeElements.push(this._$input);\n subscribeElements.forEach(($element) => {\n $element.on('click', this.buttonAction.bind(this));\n });\n }\n _attachInputEvents() {\n var input = this['_input']()[0];\n if (!input)\n return;\n var handler = (e) => {\n if (e.key == KeyboardEnum.Enter || (e.key == KeyboardEnum.ArrowDown && e.altKey)) {\n this.buttonAction(e);\n }\n };\n input.addEventListener('keydown', handler);\n addDisposeCallback(input, function () {\n input.removeEventListener('keydown', handler);\n });\n }\n _optionChanged(args) {\n switch (args.name) {\n case 'disabled':\n this._attachButtonEvents();\n break;\n case 'warningMessage':\n this._updateWarningState(args.value);\n break;\n }\n super['_optionChanged'].apply(this, arguments);\n }\n buttonAction(e) {\n if (this.option('buttonAction')) {\n this.option('buttonAction')();\n e.stopPropagation();\n }\n }\n}\nregisterComponent('dxEllipsisEditor', dxEllipsisEditor);\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\fileimageeditor\\_editor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport registerComponent from 'devextreme/core/component_registrator';\nimport * as $ from 'jquery';\nimport { getLocalization } from '../../localization/localization_utils';\nimport { dxEllipsisEditor } from '../ellipsiseditor/_editor';\nimport { uploadFile } from '../internal/_utils';\nvar editor_prefix = 'dx-fileimage', EDITOR_INPUT_WRAPPER_CLASS = editor_prefix + '-input-wrapper';\nexport class dxFileImagePicker extends dxEllipsisEditor {\n constructor(element, options) {\n options.placeholder = options.placeholder || getLocalization('(none)', 'DxDesignerStringId.None');\n super(element, options);\n }\n _getDisplayValue() {\n var knownPlaceholders = {\n 'Image': 'AnalyticsCoreStringId.ImagePicker_Placeholder',\n 'File': 'AnalyticsCoreStringId.FilePicker_Placeholder'\n };\n var placeholderId = this.option('placeholderId');\n if (this.option('value') && placeholderId)\n return getLocalization(placeholderId, knownPlaceholders[placeholderId]);\n else\n return this.option('value');\n }\n _handleResult(result) {\n if (this.option('useFormat')) {\n this.option('format', result.format);\n }\n this.option('value', result.content);\n }\n _renderInput(inputContainer) {\n var $inputContainer = inputContainer && $.fn.constructor(inputContainer) || $.fn.constructor('
');\n $inputContainer.addClass(EDITOR_INPUT_WRAPPER_CLASS);\n this['_inputContainer'] = $inputContainer.get(0);\n $.fn.constructor(this.element()).append(this['_inputContainer']);\n super['_renderInput'].apply(this, [inputContainer]);\n }\n _attachButtonEvents() {\n this._$button.off('click');\n if (!this.option('disabled')) {\n this._$button.on('click', (e) => {\n var _a, _b;\n e.stopPropagation();\n e.preventDefault();\n uploadFile({\n accept: ((_a = this.option('accept')) === null || _a === void 0 ? void 0 : _a.toString()) || 'image/*',\n readMode: (_b = this.option('readMode')) === null || _b === void 0 ? void 0 : _b.toString()\n }).done((result) => {\n this._handleResult(result);\n });\n });\n }\n }\n _renderValue() {\n this.option('text', this._getDisplayValue());\n super['_renderValue'].apply(this);\n }\n}\nregisterComponent('dxFileImagePicker', dxFileImagePicker);\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\internal\\_extendedSvgTemplates.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { SvgTemplatesEngine } from './_svgTemplateEngine';\nexport var extendedTemplates = (templates) => ({\n 'dxrd-svg-fieldlist-list': templates['dxrd-svg-fieldlist-table'],\n 'dxrd-svg-fieldlist-default': templates['dxrd-svg-fieldlist-column']\n});\nSvgTemplatesEngine.addTemplates(extendedTemplates(SvgTemplatesEngine.templates));\n","/**\r\n* DevExpress Analytics (widgets\\internal\\_popupComponentBase.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../serializer/utils';\nexport class PopupComponentBase extends Disposable {\n constructor() {\n super(...arguments);\n this._component = ko.observable();\n this.onContentReady = (e) => {\n this._component(e.component);\n };\n this.hideOnOutsideClick = (e) => {\n var component = this.getComponent();\n var $content = component && $.fn.constructor(component.content());\n return !$content || !($content.has(e.target).length || $content.is(e.target));\n };\n }\n getComponent() {\n return ko.unwrap(this._component);\n }\n dispose() {\n super.dispose();\n var component = this._component();\n component && component.dispose();\n this._component(null);\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\internal\\_popupwithautoheight.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport registerComponent from 'devextreme/core/component_registrator';\nimport dxPopup from 'devextreme/ui/popup';\nexport class dxPopupWithAutoHeight extends dxPopup {\n _setContentHeight() {\n this['_$popupContent'].css({\n height: '100%'\n });\n }\n}\nregisterComponent('dxPopupWithAutoHeight', dxPopupWithAutoHeight);\n","/**\r\n* DevExpress Analytics (widgets\\treelist\\_reorderTreeListDragDropHelper.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { Rectangle } from '../../core/elements/rectangle';\nimport { find } from '../../core/utils/_arrayutils';\nimport { Disposable } from '../../serializer/utils';\nimport * as $ from 'jquery';\nexport class ReorderTreeListDragDropHelper extends Disposable {\n constructor(dragHelperContent) {\n super();\n this.dragHelperContent = dragHelperContent;\n this.droppableClassName = 'dxrd-treelist-droppable';\n this.approveClassName = 'dxrd-drop-approve';\n this.classDropBefore = 'drop-before';\n this.classDropAfter = 'drop-after';\n this.started = false;\n }\n _getElementViewModel(item) {\n return item && item.data && item.data['data'];\n }\n dispose() {\n super.dispose();\n this._targetElement = null;\n this._target = null;\n this._draggable = null;\n }\n isDragToBottom() {\n return find(this._draggable.parent.items(), item => item === this._draggable || item === this._target) === this._draggable;\n }\n start(draggable) {\n this.started = true;\n this._draggable = draggable;\n this._draggableModel = this._getElementViewModel(draggable);\n }\n canDrop() {\n return this._draggable !== this._target && this._draggable.parent === this._target.parent;\n }\n reorderSiblings(isDragToBottom = this.isDragToBottom()) {\n var siblings = this.getSiblings();\n if (siblings) {\n var _siblings = siblings.peek();\n var index = _siblings.indexOf(this._draggableModel);\n if (index > -1)\n _siblings.splice(index, 1);\n _siblings.splice(_siblings.indexOf(this._targetModel) + (isDragToBottom ? 1 : 0), 0, this._draggableModel);\n siblings.valueHasMutated();\n }\n }\n clearDroppableClasses() {\n this._removeClass(this._targetElement);\n }\n getDroppablePosition() {\n return this.isDragToBottom() ? this.classDropAfter : this.classDropBefore;\n }\n drag(elementModel, element) {\n this.clearDroppableClasses();\n this._target = elementModel;\n this._targetElement = $.fn.constructor(element).closest('.dx-treelist-item').get(0);\n this._targetModel = this._getElementViewModel(this._target);\n }\n stop() {\n this.clearDroppableClasses();\n this.started = false;\n }\n helper(draggable, event) {\n var item = draggable;\n var target = $.fn.constructor(event.target).closest('.ui-draggable');\n var rect = new Rectangle(6, 6, null, target.height());\n rect.className = 'dxrd-image-ghost-report';\n this.dragHelperContent.reset();\n this.dragHelperContent.setContent(rect, {\n template: 'dxrd-drag-helper-source-reorder-treelist',\n data: {\n imageClassName: item.imageClassName,\n imageTemplateName: item.imageTemplateName,\n text: item.text\n }\n });\n }\n addDroppableClass() {\n var className = this.droppableClassName;\n if (this.canDrop()) {\n className = className + ' ' + this.approveClassName + ' ' + this.getDroppablePosition();\n }\n $.fn.constructor(this._targetElement).addClass(className);\n }\n _removeClass(target) {\n $.fn.constructor(target).removeClass(this.droppableClassName + ' ' + this.approveClassName + ' ' + this.classDropBefore + ' ' + this.classDropAfter);\n }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\guideditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { Editor } from './editor';\nimport { guidValidationRules, guidRequiredValidationRules } from './internal/_internal';\nexport class GuidEditor extends Editor {\n _getEditorValidationRules() {\n var _a;\n return (super._getEditorValidationRules() || []).concat(guidValidationRules).concat(((_a = this.editorOptions) === null || _a === void 0 ? void 0 : _a.isNullable) ? [] : guidRequiredValidationRules);\n }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\fonteditor\\editor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { FontModel } from './_model';\nimport { ObjectProperties, PropertyGridEditor } from '../../propertygrid';\nimport { fontInfo } from './metadata';\nexport class FontEditor extends PropertyGridEditor {\n constructor(info, level, parentDisabled, textToSearch) {\n super(info, level, parentDisabled, textToSearch);\n }\n createObjectProperties() {\n var model = new FontModel(this.value);\n this._disposables.push(model);\n return new ObjectProperties(ko.observable(model), { editors: fontInfo }, this.level + 1, this.disabled, undefined, this.textToSearch);\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\filtereditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nimport { UnaryOperator } from '../criteria/operators/unary';\nimport { UnaryOperandSurface } from './operators/unaryOperandSurface';\nimport { PopupService } from '../../property-grid/internal/_popupService';\nimport { DisplayExpressionConverter } from '../common/_displayNameProvider';\nimport { wrapExpressionValue } from '../expressioneditor/_expressioneditor';\nimport { FilterEditorCodeCompletor } from './helpers/_codeCompletor';\nimport { getParentContainer } from '../_utils';\nimport { addDisposeCallback } from '../../serializer/_internal';\nimport dxTextArea from 'devextreme/ui/text_area';\nimport { aceAvailable } from '../ace/_ace-available';\nimport { getTemplate } from '../../property-grid/widgets/templateUtils';\nimport { GroupOperator } from '../criteria/operators/group';\nimport { PopupEditorBase } from '../../core/widgets/_popupEditorBase';\nimport { GroupOperatorType } from '../criteria/operators/options/group';\nimport { criteriaCreator } from '../criteria/utils/criteriaOperatorPreprocessor';\nexport class FilterEditor extends PopupEditorBase {\n constructor(options, fieldListProvider, rtl = false, _displayNameProvider, editorInputId) {\n super();\n this.options = options;\n this._displayNameProvider = _displayNameProvider;\n this._advancedMode = ko.observable(false);\n this.textFocused = ko.observable(false);\n this.aceAvailable = aceAvailable();\n this.languageHelper = {\n getLanguageMode: () => 'ace/mode/criteria',\n createCompleters: (editor, bindingContext, viewModel) => {\n var path = ko.computed(() => { return this.path && this.path(); }), completor = new FilterEditorCodeCompletor({\n editor,\n bindingContext,\n fieldListProvider: viewModel.fieldListProvider(),\n path,\n getRealExpression: (path, expression) => {\n return this.displayExpressionConverter && this.displayExpressionConverter.toRealExpression(path, expression) || $.Deferred().resolve(expression).promise();\n }\n });\n completor._disposables.push(path);\n return [completor];\n }\n };\n this.aceOptions = {\n showLineNumbers: false,\n showPrintMargin: false,\n enableBasicAutocompletion: true,\n enableLiveAutocompletion: true,\n showGutter: false\n };\n this.additionalOptions = {\n onChange: session => this.onValueChange(session.getValue()),\n changeTimeout: 200,\n onFocus: _ => this.onFocus(),\n onBlur: _ => this.onBlur()\n };\n this.editorContainer = ko.observable();\n this.textVisible = ko.observable(false);\n this.getPopupContainer = (el) => {\n return getParentContainer(el, this.options()['popupContainer']);\n };\n this.timeout = null;\n this.animationTimeout = null;\n this.advancedMode = ko.computed({\n read: () => {\n return this._advancedMode();\n },\n write: (newVal) => {\n this.timeout && clearTimeout(this.timeout);\n this.animationTimeout && clearTimeout(this.animationTimeout);\n if (newVal) {\n this.textVisible(true);\n this.timeout = setTimeout(() => {\n this._advancedMode(true);\n if (!this.options().disabled())\n this.focusText();\n }, 1);\n this.animationTimeout = setTimeout(() => {\n this.editorContainer() && this.editorContainer().resize && this.editorContainer().resize();\n }, 210);\n }\n else {\n this._advancedMode(false);\n this.timeout = setTimeout(() => {\n this.textVisible(false);\n }, 200);\n }\n },\n });\n this.invalidMessage = () => getLocalization('Cannot create a tree for this expression', 'AnalyticsCoreStringId.FilterEditor_TreeCreationError');\n this.advancedModeText = ko.observable(getLocalization('Advanced Mode', 'AnalyticsCoreStringId.FilterEditor_AdvancedMode'));\n this.operandSurface = ko.observable(null);\n this.operand = null;\n this.popupService = new PopupService();\n this.rtl = rtl;\n this.initializeInnerValue();\n options() && options().helper && (options().helper.rtl = rtl);\n this._disposables.push(this.disabled = ko.computed(() => {\n return ko.unwrap(this.options() && this.options().disabled());\n }));\n this.displayExpressionConverter = _displayNameProvider && new DisplayExpressionConverter(_displayNameProvider);\n this.save = () => {\n this.helper.onSave(this.value());\n if (this.operandSurface() && this.isSurfaceValid()) {\n var value = options().helper.serializer.serialize(this.operand, false);\n this.options().value(value);\n }\n else {\n this.options().value(this.value());\n }\n this.popupVisible(false);\n };\n this.displayValue = wrapExpressionValue(this.path, this.value, this.displayExpressionConverter, this._disposables);\n var modelValue = ko.computed({\n read: () => {\n var options = this.options();\n return options && options.value();\n },\n write: (newVal) => {\n var options = this.options();\n options && options.value(newVal);\n }\n });\n this.modelDisplayValue = wrapExpressionValue(this.path, modelValue, this.displayExpressionConverter, this._disposables);\n this.fieldListProvider = fieldListProvider;\n this.modelValueIsValid = ko.computed(() => {\n return options() && this._validateValue(options().value());\n });\n this.isValid = ko.computed(() => {\n return this._validateValue(this.value());\n });\n this.isSurfaceValid = ko.computed(() => {\n try {\n return this.options() && this.isValid() && this.options().helper.criteriaTreeValidator.validateModel(this.options().helper.serializer.deserialize(this.value()));\n }\n catch (e) {\n return false;\n }\n });\n this._disposables.push(modelValue);\n this._disposables.push(this.modelValueIsValid);\n this._disposables.push(this.isValid);\n this._disposables.push(this.isSurfaceValid);\n this._disposables.push(this.popupVisible.subscribe((newVal) => {\n if (newVal) {\n this.value(this.options().value());\n if (this.isSurfaceValid()) {\n this.operand = this._generateOperand(this.value());\n this.operandSurface(this._generateSurface(this.operand));\n }\n else {\n this.textVisible(true);\n this._advancedMode(true);\n this.editorContainer() && this.focusText();\n }\n options().helper.onChange = () => {\n this.value(options().helper.serializer.serialize(this.operand, false));\n };\n }\n else {\n this.helper.onClosing();\n this.value(null);\n this.operandSurface() && this.operandSurface().dispose();\n this.operandSurface(null);\n this.operand = null;\n }\n }));\n this.createAddButton = (criteria) => { return options().helper.handlers.create(criteria, this.popupService); };\n this.createChangeType = (criteria) => { return options().helper.handlers.change(criteria, this.popupService); };\n this.createChangeProperty = (criteria) => { return options().helper.handlers.changeProperty(criteria, this.popupService); };\n this.createChangeParameter = (criteria) => { return options().helper.handlers.changeParameter(criteria, this.popupService); };\n this.createChangeValueType = (criteria) => { return options().helper.handlers.changeValueType(criteria, this.popupService); };\n this._disposables.push(this.advancedMode);\n this.buttonItems.push({ toolbar: 'bottom', location: 'before', widget: 'dxCheckBox', options: { value: this.advancedMode, text: this.advancedModeText() } });\n this.editorInputId = editorInputId;\n }\n _generateOperand(value) {\n return this.options().helper.serializer.deserialize(value);\n }\n _generateSurface(operand) {\n var type = null;\n if (operand instanceof UnaryOperator) {\n type = this.options().helper.mapper.unary;\n }\n else {\n type = this.options().helper.mapper.group;\n }\n var surface = new type(operand, this, this.fieldListProvider, this.path);\n if (surface instanceof UnaryOperandSurface) {\n if (!(surface.model.operand instanceof GroupOperator)) {\n this.operand = new GroupOperator(GroupOperatorType.And, [this.operand]);\n surface.dispose();\n return this._generateSurface(this.operand);\n }\n surface.operand().canRemove = false;\n }\n surface.canRemove = false;\n return surface;\n }\n _validateValue(value) {\n try {\n if (this.options() && this.options().helper) {\n this.options().helper.serializer.deserialize(value);\n return true;\n }\n else {\n return false;\n }\n }\n catch (e) {\n return false;\n }\n }\n canSave() {\n return this.isValid();\n }\n initializeInnerValue() {\n this.value = ko.observable('');\n }\n change(type, surface) {\n this.operand = criteriaCreator.changeByType(type);\n this.operand.assignFrom(surface.model);\n var type = null;\n if (this.operand instanceof UnaryOperator) {\n type = this.options().helper.mapper.unary;\n }\n else {\n type = this.options().helper.mapper.group;\n }\n var surface = new type(this.operand, this, this.fieldListProvider, this.path);\n surface.canRemove = false;\n if (surface instanceof UnaryOperandSurface) {\n surface.operand().canRemove = false;\n }\n this.operandSurface(surface);\n }\n get helper() {\n return this.options() && this.options().helper;\n }\n get path() {\n return this.options() && this.options().path;\n }\n dispose() {\n super.dispose();\n this.editorContainer(null);\n this.operandSurface() && this.operandSurface().dispose();\n }\n onInput(s, e) {\n var self = this;\n this.timeout && clearTimeout(this.timeout);\n this.timeout = setTimeout(() => {\n self.onValueChange(s.component.option('text'));\n }, 200);\n }\n onFocus() {\n this.textFocused(true);\n }\n onBlur() {\n this.textFocused(false);\n this.helper.onEditorFocusOut(this.operand);\n }\n cacheElement($element) {\n this.editorContainer(dxTextArea.getInstance($element.get(0)));\n }\n updateCriteria() {\n if (this.isSurfaceValid()) {\n var currentValue = this.operand && this.options().helper.serializer.serialize(this.operand, false);\n if (currentValue !== this.value()) {\n this.operand = this._generateOperand(this.value());\n this.operandSurface() && this.operandSurface().dispose();\n this.operandSurface(this._generateSurface(this.operand));\n }\n }\n }\n onValueChange(value) {\n if (this.displayValue() === value.trim())\n return;\n this.displayValue(value);\n if (this.displayExpressionConverter) {\n this.displayExpressionConverter.toRealExpression(this.path(), value).done((result) => {\n this.value(result);\n this.updateCriteria();\n }).fail(() => {\n this.value(value);\n this.updateCriteria();\n });\n }\n else {\n this.updateCriteria();\n }\n }\n focusText() {\n var focusFn = (editor) => {\n setTimeout(_ => {\n if (editor.renderer)\n editor.renderer.updateText();\n editor.focus();\n }, 1);\n };\n if (!this.editorContainer())\n var subscription = this.editorContainer.subscribe((editor) => {\n subscription.dispose();\n focusFn(editor);\n });\n else\n focusFn(this.editorContainer());\n }\n resizeAceEditor() {\n if (this.aceAvailable && this.editorContainer()) {\n this.editorContainer().resize();\n }\n }\n get cancelLocalization() {\n return getLocalization('Cancel', 'StringId.Cancel');\n }\n get saveLocalization() {\n return getLocalization('OK', 'StringId.OK');\n }\n}\nko.bindingHandlers['dxFilterEditor'] = {\n init: function (element, valueAccessor, bindings, viewModel) {\n $.fn.constructor(element).children().remove();\n $.fn.constructor(element).addClass('dx-popup-general');\n var templateHtml = getTemplate('dx-filtereditor'), $element = $.fn.constructor(element).append(templateHtml), values = valueAccessor();\n var itemsProvider = ko.observable(ko.unwrap(values.fieldListProvider));\n var computedFunctions = [];\n computedFunctions.push(ko.computed(() => {\n if (values.options() && values.options().itemsProvider) {\n itemsProvider(ko.unwrap(values.options().itemsProvider));\n }\n else {\n itemsProvider(ko.unwrap(values.fieldListProvider));\n }\n }));\n computedFunctions.push(ko.computed(() => {\n if (values.getDisplayNameByPath && values.options() && values.options().helper && !values.options().helper.getDisplayPropertyName) {\n values.options().helper.getDisplayPropertyName = values.getDisplayNameByPath;\n }\n }));\n var editor = new FilterEditor(values.options, itemsProvider, $.fn.constructor(element).closest('.dx-rtl').length > 0, values.displayNameProvider, viewModel.editorInputId);\n ko.applyBindingsToDescendants(editor, $element.children()[0]);\n addDisposeCallback($element.children()[0], () => {\n computedFunctions.forEach(x => x.dispose());\n editor.dispose();\n });\n return { controlsDescendantBindings: true };\n }\n};\nexport class FilterEditorPlain extends FilterEditor {\n constructor(element, options, fieldListProvider, rtl = false, _displayNameProvider) {\n super(options, fieldListProvider, rtl, _displayNameProvider);\n this.element = element;\n this.advancedModeTop = () => this.advancedModePosition.indexOf('Top') !== -1;\n this.advancedModeLeft = () => this.advancedModePosition.indexOf('Left') !== -1;\n this.advancedModePosition = 'TopRight';\n this.advancedModePosition = options().advancedModePosition;\n }\n initializeInnerValue() {\n if (this.options().realTimeUpdate) {\n this.value = this.options().value;\n var valueUpdateTimeout = null;\n this._disposables.push(this.value.subscribe(() => {\n valueUpdateTimeout && clearTimeout(valueUpdateTimeout);\n valueUpdateTimeout = setTimeout(() => {\n this.updateCriteria();\n }, 100);\n }));\n }\n else {\n super.initializeInnerValue();\n }\n }\n getCheckBoxStyles() {\n var position = {};\n if (this.advancedModeTop())\n position['top'] = '0px';\n else\n position['bottom'] = '0px';\n if (this.advancedModeLeft())\n position['left'] = '0px';\n else\n position['right'] = '0px';\n return position;\n }\n getContentStyles() {\n var styles = {\n pointerEvents: this.options().disabled() ? 'none' : ''\n };\n if (!this.advancedModeTop())\n styles['top'] = '0px';\n return styles;\n }\n getTextCssClasses() {\n return {\n 'advanced': this.advancedMode(),\n 'dx-filtereditor-text-container-bottom': !this.advancedModeTop(),\n 'dx-filtereditor-text-container-top': this.advancedModeTop()\n };\n }\n}\nko.components.register('dx-filtereditor-plain', {\n viewModel: {\n createViewModel: (params, componentInfo) => {\n var viewModel = new FilterEditorPlain(componentInfo.element, params.options, ko.observable(params.fieldListProvider), undefined, params.displayNameProvider);\n viewModel.popupVisible(true);\n return viewModel;\n }\n },\n template: getTemplate('dx-filtereditor-plain')\n});\nko.components.register('dx-filtereditor-advanced', {\n viewModel: {\n createViewModel: (params, componentInfo) => {\n var viewModel = new FilterEditor(params.options, ko.observable(params.fieldListProvider), undefined, params.displayNameProvider);\n viewModel.advancedMode(true);\n viewModel.popupVisible(true);\n params.options().value.subscribe(() => {\n viewModel.popupVisible(false);\n viewModel.popupVisible(true);\n });\n return viewModel;\n }\n },\n template: getTemplate('dx-filtereditor-advanced')\n});\nko.bindingHandlers['cacheElement'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var value = valueAccessor();\n value.action($.fn.constructor(element));\n }\n};\n","/**\r\n* DevExpress Analytics (core\\widgets\\booleanEditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { Editor } from '../../property-grid/widgets/editor';\nimport { addDisposeCallback } from '../../serializer/_internal';\nimport { extend } from 'jquery';\nexport class BooleanEditor extends Editor {\n constructor(info, level, parentDisabled, textToSearch) {\n super(info, level, parentDisabled, textToSearch);\n }\n _checkBoxInitializedHandler(element) {\n var _a;\n const checkBoxElement = (element.jquery || element.dxRenderer) ? element[0] : element;\n const labels = (_a = checkBoxElement === null || checkBoxElement === void 0 ? void 0 : checkBoxElement.closest('.dx-field')) === null || _a === void 0 ? void 0 : _a.getElementsByTagName('label');\n const labelElement = Array.from(labels).filter(elt => elt.getAttribute('for') === this.editorInputId)[0];\n if (labelElement) {\n const eventType = 'click';\n const eventListener = () => checkBoxElement.dispatchEvent(new Event(eventType));\n labelElement.addEventListener(eventType, eventListener);\n addDisposeCallback(labelElement, () => labelElement.removeEventListener(eventType, eventListener));\n }\n }\n getOptions(templateOptions) {\n const extendedOptions = this.info.peek().editor.extendedOptions;\n const editorCustomization = { onInitialized: e => this._checkBoxInitializedHandler(e.element) };\n return extend(true, {}, templateOptions, this.editorOptions, extendedOptions, editorCustomization);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\widgets\\colorPickerEditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Editor } from '../../property-grid/widgets/editor';\nexport class ColorPickerEditor extends Editor {\n constructor(info, level, parentDisabled, textToSearch) {\n super(info, level, parentDisabled, textToSearch);\n this._disposables.push(this.displayValue = ko.pureComputed({\n read: () => {\n var value = ko.unwrap(this.value);\n if (!value)\n return undefined;\n if (value && value.toLowerCase() === 'transparent') {\n return 'rgba(0,0,0,0)';\n }\n if ((/^rgba\\s*\\((\\s*[a-f\\d]+\\s*,){3}\\s*[a-f\\d]+\\s*\\)$/i).test(value))\n return value;\n var div = document.createElement('div');\n div.style.backgroundColor = value;\n return div.style.backgroundColor || 'rgba(0,0,0,1)';\n },\n write: (val) => {\n this.value(val);\n }\n }));\n }\n}\n","/**\r\n* DevExpress Analytics (core\\widgets\\fieldListEditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Editor } from '../../property-grid/widgets/editor';\nimport { TreeListController } from '../../widgets/treelist/_treelistController';\nexport class FieldListEditor extends Editor {\n constructor(modelPropertyInfo, level, parentDisabled, textToSearch) {\n super(modelPropertyInfo, level, parentDisabled, textToSearch);\n this.path = ko.pureComputed(() => {\n return this._model() && this._model()['getPath'] && this._model()['getPath'](this.name) || '';\n });\n this.treeListController = new TreeListController();\n this._disposables.push(this.path);\n this._disposables.push(this.treeListController);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\widgets\\dataMemberEditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { FieldListEditor } from './fieldListEditor';\nimport { DataMemberTreeListController } from './_dataMemberEditor';\nexport class DataMemberEditor extends FieldListEditor {\n constructor(modelPropertyInfo, level, parentDisabled, textToSearch) {\n super(modelPropertyInfo, level, parentDisabled, textToSearch);\n this.treeListController = new DataMemberTreeListController();\n this._disposables.push(this.treeListController);\n }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\registerBaseEdtior.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { editorTemplates } from './editorsInfo';\nimport { FontEditor } from './fonteditor/editor';\nimport { PropertyGridEditor, PropertyGridEditorFlat } from '../propertygrid';\nimport { BooleanEditor } from '../../core/widgets/booleanEditor';\nexport function registerBaseEditors() {\n editorTemplates.registerEditors({\n 'bool': { header: 'dx-boolean', editorType: BooleanEditor },\n 'boolSelect': { header: 'dx-boolean-select' },\n 'numeric': { header: 'dx-numeric' },\n 'modificators': { custom: 'dx-modificators' },\n 'combobox': { header: 'dx-combobox' },\n 'comboboxEditable': { header: 'dx-combobox-editable' },\n 'text': { header: 'dx-text' },\n 'image': { header: 'dx-image' },\n 'file': { header: 'dx-file' },\n 'commonCollection': { custom: 'dx-commonCollection' },\n 'stringArray': { header: 'dx-emptyHeader', content: 'dx-string-array' },\n 'font': { header: 'dx-emptyHeader', content: 'dx-objectEditorContent', editorType: FontEditor },\n 'objecteditor': { header: 'dx-emptyHeader', content: 'dx-objectEditorContent', editorType: PropertyGridEditor },\n 'inplaceObjectEditor': { custom: 'dx-objectEditorContent', editorType: PropertyGridEditorFlat }\n });\n}\n","/**\r\n* DevExpress Analytics (core\\widgets\\registerDesignerEditors.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { editorTemplates } from '../../property-grid/widgets/editorsInfo';\nimport { GuidEditor } from '../../property-grid/widgets/guideditor';\nimport { RequiredNullableEditor, createNumericEditor } from './_requiredNullableEditor';\nimport { PropertyGridEditor } from '../../property-grid/propertygrid';\nimport { FieldListEditor } from './fieldListEditor';\nimport { DataMemberEditor } from './dataMemberEditor';\nimport { ColorPickerEditor } from './colorPickerEditor';\nexport function registerDesignerEditors() {\n editorTemplates.registerEditors({\n guid: { header: 'dxrd-guid', editorType: GuidEditor },\n date: { header: 'dx-date', editorType: RequiredNullableEditor },\n borders: { header: 'dxrd-borders' },\n textAlignment: { header: 'dxrd-textalignment' },\n objecteditorCustom: { custom: 'dxrd-objectEditorContent', editorType: PropertyGridEditor },\n field: { header: 'dxrd-field', editorType: FieldListEditor },\n dataMember: { header: 'dxrd-field', editorType: DataMemberEditor },\n filterEditor: { header: 'dxrd-filterstring' },\n formatEditor: { header: 'dxrd-formatstring' },\n expressionEditor: { header: 'dxrd-expressionstring' },\n customColorEditor: { header: 'dxrd-colorpicker', editorType: ColorPickerEditor },\n sbyte: createNumericEditor('System.SByte', 'integer'),\n decimal: createNumericEditor('System.Decimal', 'float'),\n int64: createNumericEditor('System.Int64', 'integer'),\n int32: createNumericEditor('System.Int32', 'integer'),\n int16: createNumericEditor('System.Int16', 'integer'),\n single: createNumericEditor('System.Single', 'float'),\n double: createNumericEditor('System.Double', 'float'),\n byte: createNumericEditor('System.Byte', 'integer'),\n uint16: createNumericEditor('System.UInt16', 'integer'),\n uint32: createNumericEditor('System.UInt32', 'integer'),\n uint64: createNumericEditor('System.UInt64', 'integer')\n });\n}\n","/**\r\n* DevExpress Analytics (core\\_bindings.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport * as ko from 'knockout';\nimport { KeyboardEnum } from '../property-grid/widgets/internal/_utils';\nimport { getTemplate } from '../property-grid/widgets/templateUtils';\nimport { addDisposeCallback } from '../serializer/_internal';\nimport { extend } from '../serializer/_utils';\nimport { DragDropHandler } from './dragDrop/_dragDropHandler';\nimport { KeyDownHandlersManager } from './tools/_keyboardHelper';\nimport { cssTransform } from './utils/_utils';\nimport { Selectable } from './internal/selectable';\nimport { Draggable } from './internal/_draggable';\nimport { convertToCssPixelUnits } from './internal/_utils';\nko.bindingHandlers['cssArray'] = {\n 'update': function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var value = ko.utils.unwrapObservable(valueAccessor());\n for (var i = 0; i < value.length; i++) {\n ko.bindingHandlers['css'].update(element, () => { return value[i]; });\n }\n }\n};\nko.bindingHandlers['selectable'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var values = valueAccessor();\n var selection = ko.unwrap(values.selection), options = extend({ filter: '.dxd-selectable', distance: 1 }, ko.unwrap(values), {\n selecting: function (event, selectionElement) {\n var _event = { control: ko.dataFor(selectionElement), cancel: false, ctrlKey: event.ctrlKey };\n selection.selecting(_event);\n if (_event.cancel) {\n $.fn.constructor(selectionElement).removeClass('ui-selecting');\n }\n },\n start: (event, element) => {\n selection.clickHandler(null, event);\n selection.expectClick = true;\n selection.started = true;\n },\n stop: () => {\n selection.started = false;\n setTimeout(() => { selection.expectClick = false; }, 100);\n selection.applySelection();\n },\n unselecting: function (event, selectionElement) {\n selection.unselecting(ko.dataFor(selectionElement));\n }\n });\n const selectable = new Selectable(element, options);\n var subscriptions = [];\n if (selection.disabled && ko.isSubscribable(selection.disabled)) {\n subscriptions.push(selection.disabled.subscribe((newVal) => {\n return Selectable.disabled = newVal;\n }));\n }\n addDisposeCallback(element, () => {\n selectable.dispose();\n element = null;\n subscriptions.forEach(x => x.dispose());\n });\n }\n};\nko.bindingHandlers['updateTop'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var value = valueAccessor();\n var $element = $.fn.constructor(element);\n var updateTop = (value) => {\n var scaleY = element.getBoundingClientRect().height / element.offsetHeight;\n var top = (value === 0 || !!value) ? value : ($element.prev().position().top / scaleY) + $element.prev().outerHeight();\n $element.css('top', top + 'px');\n };\n var subscription = value.subscribe((newVal) => {\n updateTop(newVal);\n });\n updateTop(value());\n addDisposeCallback(element, function () {\n subscription.dispose();\n });\n }\n};\nfunction _getElementOffset(element, containment) {\n if (!element)\n return { top: 0, left: 0 };\n const containmentElement = _getContainment(element, containment);\n return {\n top: containmentElement.offset().top,\n left: containmentElement.offset().left\n };\n}\nfunction _getContainment(parent, containment) {\n return (containment === 'parent' || containment === parent) ? parent : parent.find(containment);\n}\nfunction _getBoundary($parent, $containment) {\n if (!$parent || !$containment)\n return null;\n var top = $parent.offset().top - $containment.offset().top;\n var left = $parent.offset().left - $containment.offset().left;\n return {\n left: left,\n top: top,\n right: left + $containment.width(),\n bottom: top + $containment.height()\n };\n}\nko.bindingHandlers['draggable'] = {\n init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var values = valueAccessor();\n if (!values)\n return;\n var $element = $.fn.constructor(element), $parent = values.parent && values.parent() || $element.closest('.dx-designer-viewport'), containment = values.containment || '.dxrd-ghost-container', $viewport, $ghostContainerOffset, $containmentOffset, initialScroll = { left: 0, top: 0 }, attachDelta = (ui) => {\n ui['delta'] = {\n left: (($ghostContainerOffset && $ghostContainerOffset.left || 0) - $containmentOffset.left),\n top: ($ghostContainerOffset && $ghostContainerOffset.top || 0) - $containmentOffset.top\n };\n ui['scroll'] = {\n left: $viewport.scrollLeft() - initialScroll.left,\n top: $viewport.scrollTop() - initialScroll.top\n };\n }, options = extend({}, ko.unwrap(values), {\n start: function (event, uiElement) {\n DragDropHandler.started(true);\n $viewport = $parent.find('.dxrd-viewport');\n $ghostContainerOffset = $parent.find('.dxrd-ghost-container').offset();\n $containmentOffset = _getContainment($parent, containment).offset();\n initialScroll.left = $viewport.scrollLeft();\n initialScroll.top = $viewport.scrollTop();\n values.startDrag && values.startDrag(ko.dataFor(uiElement));\n },\n stop: function (event, uiElement) {\n attachDelta(uiElement);\n values.stopDrag(uiElement, ko.dataFor(uiElement), event);\n DragDropHandler.started(false);\n },\n drag: function (event, uiElement) {\n attachDelta(uiElement);\n values.drag && values.drag(event, uiElement, ko.dataFor(uiElement));\n },\n helper: function (event, uiElement) {\n let $container;\n var parentOffset = _getElementOffset($parent, options.containment);\n if (values.helper) {\n $container = values.helper(ko.dataFor(uiElement), event);\n if ($container) {\n $container.css({ 'position': 'absolute' });\n $container[0].dataset.startLeftPosition = convertToCssPixelUnits(event.pageX - parentOffset.left);\n $container[0].dataset.startTopPosition = convertToCssPixelUnits(event.pageY - parentOffset.top);\n return $container;\n }\n }\n var templateHtml = getTemplate(bindingContext.$root.dragHelperContent.template);\n var draggableModel = ko.dataFor(uiElement);\n $container = $.fn.constructor(templateHtml).css({ 'display': values.helper ? 'block' : 'none', 'position': 'absolute' });\n $container[0].dataset.startLeftPosition = convertToCssPixelUnits(draggableModel.absolutePosition ? draggableModel.absolutePosition.x() : event.pageX - parentOffset.left);\n $container[0].dataset.startTopPosition = convertToCssPixelUnits(draggableModel.absolutePosition ? draggableModel.absolutePosition.y() : event.pageY - parentOffset.top);\n $container.prependTo(_getContainment($parent, options.containment));\n ko.applyBindingsToDescendants(bindingContext.$root.dragHelperContent, $container[0]);\n return $container;\n }\n });\n options.containment = _getContainment($parent, options.containment);\n setDragOffsetMode(element);\n var draggable = new Draggable(element, options);\n addDisposeCallback(element, () => {\n draggable.dispose();\n element = null;\n });\n }\n};\nvar trackCursorData = 'dxd-track-cursor-data';\nvar trackCursorClass = 'dxd-track-cursor';\nvar trackCursorSelector = '.' + trackCursorClass;\nvar dragHelperLineClass = 'dxrd-drag-helper-item';\nko.bindingHandlers['trackCursor'] = {\n init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var $element = $.fn.constructor(element);\n $element.addClass(trackCursorClass);\n var value = valueAccessor();\n var recalculateBounds = false;\n if (value['recalculateBounds']) {\n recalculateBounds = value['recalculateBounds'];\n value = value['underCursor'];\n }\n var bounds = element.getBoundingClientRect(), body = document.body, docElem = document.documentElement, overHandler = (event) => {\n if (!(bindingContext.$root.selection.started && bindingContext.$root.resizeHandler.started)) {\n if (!value().isNotDropTarget) {\n bindingContext.$root.selection.dropTarget = bindingContext.$data;\n event.stopPropagation();\n }\n }\n }, enterHandler = (event) => {\n value(extend(value(), { isOver: true }));\n if (!(bindingContext.$root.selection.started && bindingContext.$root.resizeHandler.started)) {\n bounds = element.getBoundingClientRect();\n }\n }, leaveHandler = (event) => {\n value(extend(value(), { isOver: false }));\n }, handler = (event) => {\n if (recalculateBounds)\n bounds = element.getBoundingClientRect();\n if (!(bindingContext.$root.selection.started && bindingContext.$root.resizeHandler.started)) {\n var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop, scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft, clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, y = event.pageY - (bounds.top + scrollTop - clientTop), x = event.pageX - (bounds.left + scrollLeft - clientLeft);\n value(extend(value(), { x: x, y: y }));\n }\n };\n element.addEventListener('mousemove', handler);\n !recalculateBounds && element.addEventListener('mouseenter', enterHandler);\n element.addEventListener('mouseover', overHandler);\n element.addEventListener('mouseleave', leaveHandler);\n element.addEventListener('dragover', handler);\n addDisposeCallback(element, function () {\n element.removeEventListener('dragover', handler);\n element.removeEventListener('mousemove', handler);\n element.removeEventListener('mouseover', overHandler);\n element.removeEventListener('mouseleave', leaveHandler);\n !recalculateBounds && element.removeEventListener('mouseenter', enterHandler);\n $element.removeClass(trackCursorClass);\n });\n }\n};\nko.bindingHandlers['templates'] = {\n init: function (element, valueAccessor) {\n var templateHtml = $.fn.constructor(valueAccessor()).text(), $templateHtml = $.fn.constructor(templateHtml);\n $.fn.constructor(element).append($templateHtml);\n return { controlsDescendantBindings: true };\n }\n};\nko.bindingHandlers['zoom'] = {\n update: function (element, valueAccessor) {\n var value = ko.unwrap(valueAccessor() || {});\n for (var i = 0; i < cssTransform.length; i++) {\n element.style[cssTransform[i]] = 'scale(' + (value) + ')';\n }\n $.fn.constructor(element).addClass('dxrd-transform-origin-left-top');\n }\n};\nko.bindingHandlers['keyDownActions'] = (() => {\n var handlersManager = new KeyDownHandlersManager(window);\n return {\n init: function (element, valueAccessor) {\n var actionLists = valueAccessor(), handler = (e) => { actionLists.processShortcut(ko.unwrap(actionLists.toolbarItems), e); };\n if (ko.isSubscribable(actionLists.enabled)) {\n var subscribe = actionLists.enabled.subscribe((newVal) => {\n if (newVal)\n handlersManager.bindHandler(element, handler);\n });\n addDisposeCallback(element, () => subscribe.dispose());\n }\n if (ko.unwrap(actionLists.enabled))\n handlersManager.bindHandler(element, handler);\n }\n };\n})();\nko.bindingHandlers['accessibilityKeyboardHelper'] = (() => {\n return {\n init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var handlersManager = valueAccessor();\n if (handlersManager && (bindingContext.$root.accessibilityCompliant || handlersManager.accessibilityCompliantEnabled)) {\n var subscription = ko.bindingEvent.subscribe(element, 'childrenComplete', function () {\n handlersManager.bindHandler(element);\n });\n addDisposeCallback(element, function () {\n subscription.dispose();\n });\n }\n }\n };\n})();\nko.bindingHandlers['dxAction'] = (() => {\n return {\n init: (element, valueAccessor) => {\n var values = valueAccessor();\n var clickHandler = function (e) {\n values.action.call(values.model, values.model, e);\n };\n var keyPressHandler = function (e) {\n if (e.key == KeyboardEnum.Enter || e.key == KeyboardEnum.Space) {\n values.action.call(values.model, values.model, e);\n }\n };\n element.addEventListener('click', clickHandler);\n element.addEventListener('keydown', keyPressHandler);\n addDisposeCallback(element, function () {\n element.removeEventListener('click', clickHandler);\n element.removeEventListener('keydown', keyPressHandler);\n });\n }\n };\n})();\nko.extenders.dxdnum = function (target, value) {\n target.subscribe((newValue) => {\n newValue = newValue || 0;\n if (!isNaN(value.max)) {\n target(Math.min(newValue, value.max));\n }\n else if (!isNaN(value.min)) {\n target(Math.max(newValue, value.min));\n }\n else {\n target(newValue);\n }\n });\n return target;\n};\nfunction setDragOffsetMode(element) {\n const startDragWithOffset = element.parentElement.classList.contains('dxrd-toolbox-item');\n if (startDragWithOffset) {\n element.dataset.startDragWithOffset = 'true';\n }\n}\n","/**\r\n* DevExpress Analytics (core\\_metadata.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { editorTemplates } from '../property-grid/widgets/editorsInfo';\nexport var sizeFake = [\n { propertyName: 'height', displayName: 'Height', localizationId: 'AnalyticsCoreStringId.SizeF.Height', editor: editorTemplates.getEditor('numeric'), editorOptions: { min: 2 } },\n { propertyName: 'width', displayName: 'Width', localizationId: 'AnalyticsCoreStringId.SizeF.Width', editor: editorTemplates.getEditor('numeric'), editorOptions: { min: 2 } }\n];\nexport var locationFake = [\n { propertyName: 'x', displayName: 'X', editor: editorTemplates.getEditor('numeric') },\n { propertyName: 'y', displayName: 'Y', editor: editorTemplates.getEditor('numeric') }\n];\n","/**\r\n* DevExpress Analytics (core\\binding\\_jsDesignerBindingCommon.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport * as ko from 'knockout';\nimport { getTemplate } from '../../property-grid/widgets/templateUtils';\nimport { addDisposeCallback } from '../../serializer/_internal';\nimport { Disposable } from '../../serializer/utils';\nimport { _processError } from '../internal/_processError';\nimport { RequestHelper } from './_requestHelper';\nimport { troubleshootingPageWrapper } from '../utils/_troubleshootingHelpers';\nexport class JSDesignerBindingCommon extends Disposable {\n constructor(_options, _customEventRaiser) {\n super();\n this._options = _options;\n this._customEventRaiser = _customEventRaiser;\n this._templateHtml = getTemplate('dxrd-designer');\n this.developmentMode = _options.developmentMode;\n }\n dispose() {\n super.dispose();\n if (this.sender && this.sender instanceof Disposable)\n this.sender.dispose();\n this.removeProperties();\n }\n _fireEvent(eventName, args) {\n if (this._customEventRaiser) {\n this._customEventRaiser(eventName, args);\n return;\n }\n this._options && this._options.callbacks && this._options.callbacks[eventName] && this._options.callbacks[eventName](this.sender, args);\n }\n _warnForIncorrectCallbackName(publicName, privateName) {\n console.warn('The callback name must be different. Use \"' + publicName + '\" instead of \"' + privateName + '\" to call the function with the correct arguments.');\n }\n _checkCallbackName(availableEvents) {\n Object.keys(this._options.callbacks).forEach(callbackName => {\n availableEvents.forEach(event => {\n if (callbackName === event.privateName) {\n this._warnForIncorrectCallbackName(event.publicName, callbackName);\n }\n });\n });\n }\n _getServerActionUrl(host, uri) {\n return RequestHelper.generateUri(host, uri);\n }\n _generateCallbackDictionary(eventsArray, prefix) {\n var events = JSDesignerBindingCommon.convertCallbackArrayToDictionary(eventsArray);\n var result = events;\n if (prefix && this._options.callbacks[prefix]) {\n Object.keys(events).forEach(propertyName => {\n result[propertyName] = this._options.callbacks[prefix][propertyName] || events[propertyName];\n });\n }\n else {\n Object.keys(events).forEach(propertyName => {\n result[propertyName] = this._options.callbacks[propertyName] || events[propertyName];\n });\n }\n return result;\n }\n _getLocalizationRequest() {\n var deferred = $.Deferred();\n var requestOptions = this._options.requestOptions;\n if (requestOptions.getLocalizationAction) {\n var actionUrl = this._getServerActionUrl(requestOptions.host, requestOptions.getLocalizationAction);\n $.getJSON(actionUrl)\n .fail(function (jqXHR, textStatus, errorThrown) {\n try {\n _processError(errorThrown.message, $.Deferred(), jqXHR, textStatus);\n }\n finally {\n deferred.reject();\n }\n }).done((localization) => {\n deferred.resolve(localization);\n });\n }\n else {\n deferred.resolve();\n }\n return deferred.promise();\n }\n _createDisposeFunction(element) {\n addDisposeCallback(element, () => {\n this.dispose();\n });\n }\n static convertCallbackArrayToDictionary(callbackArray) {\n var callbacks = {};\n callbackArray.forEach((event) => { callbacks[event['privateName']] = event['callback']; });\n return callbacks;\n }\n}\nexport class DxAnalyticsComponentCommon {\n constructor(_element, _options) {\n this._element = _element;\n this._options = _options;\n }\n getBindingName() {\n return '';\n }\n render() {\n ko.cleanNode(this._element);\n this._element.setAttribute('data-bind', `${this.getBindingName()}: $data`);\n troubleshootingPageWrapper(() => ko.applyBindings(this._options, this._element), this._options.developmentMode, this._element);\n }\n dispose() {\n ko.cleanNode(this._element);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\binding\\_requestHelper.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport class RequestHelper {\n static generateUri(host, uri) {\n host = host || '';\n if (host && host[host.length - 1] === '/' && uri && uri[0] === '/') {\n return host + uri.substring(1);\n }\n return host + uri;\n }\n}\n","/**\r\n* DevExpress Analytics (core\\dragDrop\\_dragDropHandler.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../serializer/utils';\nimport { Size } from '../elements/size';\nimport { findSurface } from '../internal/_surfaceHelpers';\nimport { unitsToPixel } from '../utils/_units';\nimport { convertFromCssPixelUnits, convertToCssPixelUnits } from '../internal/_utils';\nexport class DragDropHandler extends Disposable {\n constructor(surface, selection, undoEngine, snapHelper, dragHelperContent) {\n super();\n this._snapDisabled = false;\n this._size = new Size(0, 0);\n this.alwaysAlt = false;\n this.surface = surface;\n this.selection = selection;\n this.snapHelper = snapHelper;\n this.dragHelperContent = dragHelperContent;\n this.stopDrag = (ui, draggable, event) => {\n undoEngine() && undoEngine().start();\n this.doStopDrag(ui, draggable, event);\n undoEngine() && undoEngine().end();\n snapHelper && snapHelper.deactivateSnapLines();\n };\n }\n dispose() {\n super.dispose();\n this.surface = null;\n this.selection = null;\n this.snapHelper = null;\n this.dragHelperContent = null;\n }\n getTarget(event) {\n return event['toElement'] || (ko.dataFor(event.relatedTarget) && event.relatedTarget) || (event && event.target) || null;\n }\n _getAbsoluteSurfacePosition(uiElement) {\n return { left: convertFromCssPixelUnits(uiElement.dataset.leftPosition) - uiElement['delta'].left, top: convertFromCssPixelUnits(uiElement.dataset.topPosition) - uiElement['delta'].top };\n }\n addControl(control, dropTargetSurface, size) {\n var targetWidth = (dropTargetSurface['width'] && dropTargetSurface['width']()) || (dropTargetSurface['_width'] && dropTargetSurface['_width']());\n var underCursor = dropTargetSurface.underCursor();\n if (underCursor.x < targetWidth) {\n dropTargetSurface.getControlModel().addChild(control);\n var controlSurface = findSurface(control);\n if (!controlSurface)\n return;\n var width = size.width(), height = size.height();\n var left = (underCursor.x + width > targetWidth) ? (targetWidth - width - 1) : underCursor.x;\n controlSurface.rect({ left: left, top: Math.max(underCursor.y, 0), width: width, height: height });\n this.selection.initialize(controlSurface);\n }\n }\n recalculateSize(size) {\n var surface = ko.unwrap(this.surface);\n this._size.width(unitsToPixel(ko.unwrap(size.width) * surface.dpi() / 100, surface.measureUnit(), surface.zoom()));\n this._size.height(unitsToPixel(ko.unwrap(size.height) * surface.dpi() / 100, surface.measureUnit(), surface.zoom()));\n }\n helper(draggable, event) {\n this.snapHelper && this.snapHelper.updateSnapLines(draggable || null);\n }\n canDrop(dropTarget, controlModel, metaData) {\n var locked = dropTarget.locked;\n if (metaData && metaData.canDrop) {\n locked = locked || !metaData.canDrop(dropTarget, controlModel);\n }\n return !locked;\n }\n startDrag(_) { }\n drag(event, uiElement, draggableModel) {\n var needToActivateSnapLines = !this._snapDisabled && event.altKey !== true;\n if (this.selection.dropTarget) {\n var dropTarget = this.selection.dropTarget.getControlModel().getMetaData().isContainer ? this.selection.dropTarget : (this.selection.dropTarget.parent || this.selection.dropTarget), controlModel = draggableModel.getControlModel && draggableModel.getControlModel(), metaData = controlModel && controlModel.getMetaData() || draggableModel.info;\n if (this.canDrop(dropTarget, controlModel, metaData)) {\n this.dragHelperContent && this.dragHelperContent.isLocked(false);\n }\n else {\n this.snapHelper && this.snapHelper.deactivateSnapLines();\n needToActivateSnapLines = false;\n this.dragHelperContent && this.dragHelperContent.isLocked(true);\n }\n }\n if (needToActivateSnapLines) {\n var position = this._getAbsoluteSurfacePosition(uiElement);\n var snapDelta = this.snapHelper && this.snapHelper.activateSnapLines({\n left: position.left,\n top: position.top,\n right: position.left + this._size.width(),\n bottom: position.top + this._size.height()\n });\n if (snapDelta && (snapDelta.left > 0 || snapDelta.top > 0)) {\n uiElement.dataset.leftPosition = convertToCssPixelUnits(convertFromCssPixelUnits(uiElement.dataset.leftPosition) - snapDelta.left);\n uiElement.dataset.topPosition = convertToCssPixelUnits(convertFromCssPixelUnits(uiElement.dataset.topPosition) - snapDelta.top);\n uiElement.ghostContainer.style.left = uiElement.dataset.leftPosition;\n uiElement.ghostContainer.style.top = uiElement.dataset.topPosition;\n }\n }\n }\n doStopDrag(uiElement, draggableModel, event) { }\n}\nDragDropHandler.started = ko.observable(false);\n","/**\r\n* DevExpress Analytics (core\\dragDrop\\_dragHelperContent.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Rectangle } from '../elements/rectangle';\nexport class DragHelperControlRectangle extends Rectangle {\n constructor(position, left, top, width, height) {\n super(left, top, width, height);\n this.position = position;\n }\n}\nexport class DragHelperContent extends Rectangle {\n constructor(selectionProvider) {\n super();\n this.controls = ko.observableArray([]);\n this.customData = ko.observable({});\n this.template = 'dxrd-drag-helper-source';\n this.isLocked = ko.observable(false);\n this._selectionProvider = selectionProvider;\n }\n get _isEmpty() {\n return this.controls().length === 0;\n }\n reset() {\n this.controls([]);\n this.customData({});\n }\n update(surface) {\n this.left(surface.absolutePosition.x());\n this.top(surface.absolutePosition.y());\n this.width(surface.rect().width);\n this.height(surface.rect().height);\n if (this._isEmpty) {\n var controls = [];\n this._selectionProvider.selectedItems.forEach((item, index) => {\n if (!item.locked && item.parent === surface.parent)\n controls.push(new DragHelperControlRectangle(index));\n });\n this.controls(controls);\n }\n this.controls().forEach((item) => {\n var surfaceElement = this._selectionProvider.selectedItems[item.position];\n item.left(surfaceElement.absolutePosition.x() - this.left());\n item.top(surfaceElement.absolutePosition.y() - this.top());\n item.width(surfaceElement.rect().width);\n item.height(surfaceElement.rect().height);\n });\n }\n setContent(area, customData = null) {\n if (this._isEmpty)\n this.controls([area]);\n this.left(area.left());\n this.top(area.top());\n this.width(area.width());\n this.height(area.height());\n this.customData(customData);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\dragDrop\\_selectionDragDropHandler.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { DragDropHandler } from './_dragDropHandler';\nimport { findSurface } from '../internal/_surfaceHelpers';\nimport { convertFromCssPixelUnits, convertToCssPixelUnits } from '../internal/_utils';\nexport class SelectionDragDropHandler extends DragDropHandler {\n adjustDropTarget(dropTargetSurface) {\n var selectedItemInTree = dropTargetSurface;\n while (selectedItemInTree != null) {\n if (selectedItemInTree.selected && selectedItemInTree.selected()) {\n dropTargetSurface = selectedItemInTree.parent;\n break;\n }\n selectedItemInTree = selectedItemInTree.parent;\n }\n return dropTargetSurface;\n }\n constructor(surface, selection, undoEngine, snapHelper, dragHelperContent) {\n super(surface, selection, undoEngine, snapHelper, dragHelperContent);\n this.cursor = 'move';\n this.containment = '.dxrd-ghost-container';\n this['helper'] = (draggable) => {\n super.helper(draggable);\n if (this.selection.selectedItems.indexOf(draggable) === -1) {\n this.selection.updateSelection(draggable);\n }\n dragHelperContent.update(draggable);\n this._size.width(dragHelperContent.width());\n this._size.height(dragHelperContent.height());\n };\n }\n startDrag(control) {\n this.selection.swapFocusedItem(control);\n var focusedSurface = this.selection.focused();\n var baseOffsetX = focusedSurface.rect().left + focusedSurface.underCursor().x;\n var baseOffsetY = focusedSurface.rect().top + focusedSurface.underCursor().y;\n this.selection.selectedItems.filter((item) => { return !item.locked; }).forEach((item) => {\n if (item.parent === focusedSurface.parent) {\n item.underCursor().offsetX = item.rect().left - baseOffsetX;\n item.underCursor().offsetY = item.rect().top - baseOffsetY;\n }\n });\n }\n drag(event, uiElement, draggable) {\n uiElement.dataset.leftPosition = convertToCssPixelUnits(convertFromCssPixelUnits(uiElement.dataset.leftPosition) + uiElement['scroll'].left);\n uiElement.dataset.topPosition = convertToCssPixelUnits(convertFromCssPixelUnits(uiElement.dataset.topPosition) + uiElement['scroll'].top);\n super.drag(event, uiElement, draggable);\n }\n getLocation(adjustedTarget, item) {\n var left = adjustedTarget.underCursor().x + item.underCursor().offsetX, top = adjustedTarget.underCursor().y + item.underCursor().offsetY;\n return { left: left > 0 ? left : 0, top: top > 0 ? top : 0 };\n }\n ajustLocation(adjustedTarget, item) {\n item.rect(this.getLocation(adjustedTarget, item));\n }\n doStopDrag(uiElement, _) {\n this.dragHelperContent.reset();\n if (this.dragHelperContent.isLocked())\n return;\n if (this.selection.dropTarget) {\n var dropTarget = this.selection.dropTarget.getControlModel(), dropTargetSurface = dropTarget.getNearestParent(dropTarget)['surface'];\n var focusedSurface = this.selection.focused();\n var adjustedTarget = this.adjustDropTarget(dropTargetSurface), focusedModel = focusedSurface.getControlModel(), parent = focusedModel.getNearestParent(adjustedTarget.getControlModel()), adjustedTarget = parent && findSurface(parent), changeParent = adjustedTarget !== focusedSurface.parent;\n if (!adjustedTarget || !adjustedTarget.canDrop()) {\n return;\n }\n var position = this._getAbsoluteSurfacePosition(uiElement);\n adjustedTarget.underCursor().x = position.left - (adjustedTarget['absolutePosition'] && adjustedTarget['absolutePosition'].x() || 0) - focusedSurface.underCursor().offsetX;\n adjustedTarget.underCursor().y = position.top - (adjustedTarget['absolutePosition'] && adjustedTarget['absolutePosition'].y() || 0) - focusedSurface.underCursor().offsetY;\n var itemsToDrop = this.selection.selectedItems\n .filter((item) => { return !item.locked && item.parent === focusedSurface.parent; })\n .map((item) => {\n return item.getControlModel();\n })\n .filter((item) => {\n return item.getMetaData().canDrop(adjustedTarget, item);\n });\n if (changeParent) {\n for (var i = 0; i < itemsToDrop.length; i++) {\n itemsToDrop[i].surface.rect({ top: 0, left: 0 });\n }\n focusedModel.parentModel().removeChilds(itemsToDrop);\n parent['addChilds'](itemsToDrop);\n for (var i = 0; i < itemsToDrop.length; i++) {\n this.ajustLocation(adjustedTarget, itemsToDrop[i].surface);\n }\n this.selection.focused(focusedSurface);\n this.selection.selectItems(itemsToDrop.map((item) => { return item.surface; }));\n }\n else {\n for (var i = 0; i < itemsToDrop.length; i++) {\n this.ajustLocation(adjustedTarget, itemsToDrop[i].surface);\n }\n }\n this.selection.expectClick = !changeParent;\n }\n }\n}\n","/**\r\n* DevExpress Analytics (core\\dragDrop\\_toolboxDragDropHandler.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { DragDropHandler } from './_dragDropHandler';\nimport { Size } from '../elements/size';\nimport { Rectangle } from '../elements/rectangle';\nimport { findSurface } from '../internal/_surfaceHelpers';\nimport { extend } from '../../serializer/_utils';\nexport class ToolboxDragDropHandler extends DragDropHandler {\n constructor(surface, selection, undoEngine, snapHelper, dragHelperContent, controlsFactory) {\n super(surface, selection, undoEngine, snapHelper, dragHelperContent);\n this.cursor = 'arrow';\n this._controlsFactory = controlsFactory;\n this.containment = '.dxrd-designer';\n this['cursorAt'] = {\n top: 0,\n left: 0\n };\n }\n helper(draggable) {\n super.helper(draggable);\n var toolboxItem = draggable;\n var size = Size.fromString(toolboxItem.info['@SizeF'] || toolboxItem.info['size'] || '100,23');\n this.recalculateSize(size);\n this.dragHelperContent.setContent(new Rectangle(0, 0, this._size.width(), this._size.height()));\n }\n doStopDrag(uiElement, draggableModel) {\n this.dragHelperContent.reset();\n if (this.dragHelperContent.isLocked())\n return;\n if (this.selection.dropTarget) {\n var toolboxItem = draggableModel, control = this._controlsFactory.createControl(extend({}, toolboxItem.info), null), parent = control.getNearestParent(this.selection.dropTarget.getControlModel()), dropTargetSurface = findSurface(parent);\n if (!dropTargetSurface || !dropTargetSurface.canDrop()) {\n return;\n }\n var position = this._getAbsoluteSurfacePosition(uiElement);\n dropTargetSurface.underCursor().x = position.left - (dropTargetSurface['absolutePosition'] && dropTargetSurface['absolutePosition'].x() || 0);\n dropTargetSurface.underCursor().y = position.top - (dropTargetSurface['absolutePosition'] && dropTargetSurface['absolutePosition'].y() || 0);\n if (this.surface().isFit && this.surface().isFit(dropTargetSurface) || dropTargetSurface.underCursor().isOver) {\n this.addControl(control, dropTargetSurface, this._size);\n }\n }\n }\n}\n","/**\r\n* DevExpress Analytics (core\\dragDrop\\_wizardDragDropHandler.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { DragDropHandler } from './_dragDropHandler';\nimport { Rectangle } from '../elements/rectangle';\nimport { getTemplate } from '../../property-grid/widgets/templateUtils';\nexport class WizardDragDropHandler extends DragDropHandler {\n constructor(options) {\n super(null, null, ko.observable(null), null, options.dragHelperContent);\n this.parent = () => $.fn.constructor(options.parent);\n this.containment = options.containment;\n this._target = options.target;\n this._addHandler = options.addHandler;\n }\n helper(draggable, event) {\n this._dropTarget = null;\n var item = draggable;\n var target = $.fn.constructor(event.target).closest('.ui-draggable');\n var rect = new Rectangle(6, 6, target.width(), target.height());\n rect.className = 'dxrd-image-ghost-report';\n this.dragHelperContent.reset();\n this.dragHelperContent.setContent(rect, {\n template: 'dxrd-drag-helper-source-reorder-treelist',\n data: {\n imageClassName: item.imageClassName,\n imageTemplateName: item.imageTemplateName,\n text: item.text\n }\n });\n var templateHtml = getTemplate(this.dragHelperContent.template);\n var $container = $.fn.constructor(templateHtml).css({ 'display': 'block' });\n $container.prependTo(this.parent());\n ko.applyBindingsToDescendants(this.dragHelperContent, $container[0]);\n return $container;\n }\n doStopDrag(uiElement, _) {\n this.dragHelperContent.reset();\n if (this._dropTarget) {\n this._addHandler(this._dropTarget, ko.dataFor(uiElement), this._getAbsoluteSurfacePosition(uiElement));\n }\n }\n drag(event, ui) {\n var $target = $.fn.constructor(this.getTarget(event));\n var page = $target.closest(this._target);\n this._dropTarget = null;\n if (page.length && (!this._target || $target.closest(this._target)[0])) {\n this._dropTarget = ko.dataFor(page.get(0));\n }\n }\n}\n","/**\r\n* DevExpress Analytics (core\\elements\\baseSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../serializer/utils';\nimport { createUnitProperties } from '../utils/_units';\nimport { CssCalculator } from '../internal/_cssCalculator';\nimport { createObservableReverseArrayMapCollection, createObservableArrayMapCollection } from '../utils/_arrayutils';\nimport { HoverInfo } from '../internal/_hoverInfo';\nimport { Point } from './point';\nimport { extend } from '../../serializer/_utils';\nexport class SurfaceElementArea extends Disposable {\n constructor(control, context, unitProperties) {\n super();\n this._createSurface = (item) => {\n return item['surface'] || new (item.getControlFactory()).controlsMap[item.controlType].surfaceType(item, this._context);\n };\n this.preInitProperties(control, context, unitProperties);\n this._control = control;\n this._context = context;\n control['surface'] = this;\n if (this._context) {\n createUnitProperties(control, this, unitProperties, this._context.measureUnit, this._context.zoom, (property) => { this._disposables.push(property); });\n }\n this._x = this._x || ko.observable(0);\n this._y = this._y || ko.observable(0);\n this._width = this._width || ko.observable(0);\n this._height = this._height || ko.observable(0);\n var container = ko.pureComputed(() => this.container());\n this._disposables.push(container);\n this._container = container();\n this._disposables.push(container.subscribe((value) => {\n if (this._container !== value && this.rtlLayout()) {\n var x = this._getX();\n this._container = value;\n this._setX(x);\n }\n else {\n this._container = value;\n }\n }));\n var x = ko.computed({\n read: () => this._getX(),\n write: (value) => {\n this._setX(value);\n }\n }), y = this._y, width = this._width, height = this._height;\n this['position'] = {\n top: y,\n left: x,\n width: width,\n height: height,\n lineHeight: height\n };\n this._disposables.push(x);\n var _rect = ko.observable();\n this._disposables.push(ko.computed(() => {\n if (!this._control.update()) {\n _rect({ top: y(), left: x(), right: x() + width(), bottom: y() + height(), width: width(), height: height() });\n }\n }));\n this._disposables.push(this.rect = ko.pureComputed({\n read: () => {\n return _rect();\n },\n write: (newRect) => {\n newRect = this.beforeRectUpdated(newRect);\n this._control.update(true);\n try {\n if (newRect.left !== undefined) {\n this._setX(newRect.left, newRect.width);\n }\n else if (newRect.width !== undefined) {\n this._setX(x(), newRect.width);\n }\n if (newRect.top !== undefined) {\n y(newRect.top);\n }\n if (newRect.right !== undefined && newRect.left === undefined && newRect.width === undefined) {\n width(newRect.right - x());\n }\n if (newRect.bottom !== undefined && newRect.top === undefined) {\n height(newRect.bottom - y());\n }\n if (newRect.right !== undefined && newRect.left !== undefined && newRect.width === undefined) {\n width(newRect.right - newRect.left);\n }\n if (newRect.bottom !== undefined && newRect.top !== undefined) {\n height(newRect.bottom - newRect.top);\n }\n if (newRect.width !== undefined) {\n width(newRect.width);\n }\n if (newRect.height !== undefined) {\n height(newRect.height);\n }\n }\n finally {\n this._control.update(false);\n }\n }\n }));\n }\n _getX() {\n if (this.rtlLayout() && this._container) {\n return this._container.rect().width - this._x() - this._width();\n }\n else {\n return this._x();\n }\n }\n _setX(value, width) {\n width = width || this._width();\n if (this.rtlLayout() && this._container) {\n this._x(this._container.rect().width - value - width);\n }\n else {\n this._x(value);\n }\n }\n getRoot() {\n return this._context;\n }\n preInitProperties(control, context, unitProperties) { }\n container() {\n return this['parent'];\n }\n beforeRectUpdated(rect) {\n rect.left = rect.left < 0 ? 0 : rect.left;\n rect.top = rect.top < 0 ? 0 : rect.top;\n return rect;\n }\n rtlLayout() {\n return !!ko.unwrap(this._context.rtl);\n }\n getControlModel() {\n return this._control;\n }\n}\nexport class SurfaceElementBase extends SurfaceElementArea {\n constructor(control, context, unitProperties) {\n super(control, context, unitProperties);\n this._countSelectedChildren = ko.observable(0);\n this.focused = ko.observable(false);\n this.selected = ko.observable(false);\n this.underCursor = ko.observable(new HoverInfo());\n this.allowMultiselect = true;\n this.absolutePosition = new Point(0, 0);\n this.getControlModel = () => {\n return control;\n };\n this.cssCalculator = new CssCalculator(control, context.rtl);\n if (this._getChildrenHolderName() && control[this._getChildrenHolderName()]) {\n var collection = ko.observableArray();\n if (this._getChildrenHolderName() === 'controls') {\n this._disposables.push(createObservableReverseArrayMapCollection(control[this._getChildrenHolderName()], collection, this._createSurface));\n }\n else {\n this._disposables.push(createObservableArrayMapCollection(control[this._getChildrenHolderName()], collection, this._createSurface));\n }\n this[this._getChildrenHolderName()] = collection;\n this._disposables.push(this.isSelected = ko.pureComputed(() => {\n if (!(this.focused() || this.selected())) {\n return collection().some((item) => {\n return item.isSelected();\n });\n }\n return true;\n }));\n }\n else {\n this._disposables.push(this.isSelected = ko.pureComputed(() => {\n return this.focused() || this.selected();\n }));\n }\n this._disposables.push(this.css = ko.pureComputed(() => {\n return extend({}, this.cssCalculator.fontCss(), this.cssCalculator.foreColorCss(), this.cssCalculator.backGroundCss(), this.cssCalculator.textAlignmentCss());\n }));\n this._disposables.push(this.contentCss = ko.pureComputed(() => {\n return extend({}, this.cssCalculator.fontCss(), this.cssCalculator.foreColorCss(), this.cssCalculator.textAlignmentCss(), this.cssCalculator.angle(), this.cssCalculator.wordWrapCss(), this.cssCalculator.paddingsCss());\n }));\n this._disposables.push(ko.computed(() => {\n this.updateAbsolutePosition();\n }));\n this._disposables.push(this.absoluteRect = ko.pureComputed(() => {\n var controlRect = this.rect(), absolutePositionY = this.absolutePosition.y(), absolutePositionX = this.absolutePosition.x();\n return { top: absolutePositionY, left: absolutePositionX, right: absolutePositionX + controlRect.width, bottom: absolutePositionY + controlRect.height, width: controlRect.width, height: controlRect.height };\n }));\n this.locked = control['lockedInUserDesigner'] ? control['lockedInUserDesigner']() : false;\n }\n _getParent() {\n return this.getControlModel().parentModel() && this.getControlModel().parentModel().surface;\n }\n get parent() {\n return this._getParent();\n }\n checkParent(surfaceParent) {\n return this.parent === surfaceParent;\n }\n _getChildrenHolderName() { return 'controls'; }\n getChildrenCollection() {\n return this._getChildrenHolderName() && this[this._getChildrenHolderName()] || ko.observableArray([]);\n }\n updateAbsolutePosition() {\n if (this.parent && this.parent.absolutePosition) {\n var parentX = this.parent.absolutePosition.x(), parentY = this.parent.absolutePosition.y(), newX = parentX + this.rect().left, newY = parentY + this.rect().top;\n this.absolutePosition.x(newX);\n this.absolutePosition.y(newY);\n }\n else {\n this.absolutePosition.x(0);\n this.absolutePosition.y(0);\n }\n this.afterUpdateAbsolutePosition();\n }\n canDrop() { return !this.locked && this._control.getMetaData().isContainer; }\n afterUpdateAbsolutePosition() {\n }\n findNextSelection() {\n var parentSurface = this.parent;\n var targetSurface = parentSurface;\n if (parentSurface) {\n var childrenCollection = parentSurface.getChildrenCollection()();\n var indexInCollection = childrenCollection.indexOf(this);\n if (indexInCollection === -1 && childrenCollection.length > 0) {\n targetSurface = childrenCollection[childrenCollection.length - 1];\n }\n else if (childrenCollection.length > 1 && indexInCollection === childrenCollection.length - 1) {\n targetSurface = childrenCollection[indexInCollection - 1];\n }\n else if (childrenCollection.length > 1 && indexInCollection === 0) {\n targetSurface = childrenCollection[childrenCollection.length - 1];\n }\n else if (childrenCollection.length > 1) {\n targetSurface = childrenCollection[childrenCollection.length - 1];\n }\n else if (indexInCollection === -1 && targetSurface.parent && targetSurface.parent.getChildrenCollection()().indexOf(targetSurface) === -1) {\n targetSurface = targetSurface.findNextSelection();\n }\n }\n return targetSurface;\n }\n}\n","/**\r\n* DevExpress Analytics (core\\elements\\elementViewModel.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nimport { ModelSerializer } from '../../serializer/serializer';\nimport { Disposable } from '../../serializer/utils';\nimport { compareObjects, copyObservables } from '../utils/_utils';\nexport class ElementViewModel extends Disposable {\n constructor(model, parent, serializer) {\n super();\n this.actions = [];\n this.actionProviders = [];\n this.update = ko.observable(false);\n this.controlType = this.controlType || this.getControlFactory().getControlType(model);\n this.preInitProperties(model, parent, serializer);\n this.parentModel = ko.observable(parent);\n serializer = serializer || new ModelSerializer();\n serializer.deserialize(this, model);\n this._disposables.push(this['displayName'] = ko.pureComputed(() => {\n var result = this.name && this.name();\n if (!result) {\n result = 'unnamed ' + this.controlType;\n }\n return result;\n }));\n this.resetValue = (propertyName) => {\n this._resetProperty(propertyName);\n };\n this.actions.push({\n action: this.resetValue,\n id: 'dxd-reset',\n title: getLocalization('Reset', 'AnalyticsCoreStringId.PropertyGrid_PopupMenu_Reset'), visible: this.isResettableProperty,\n weight: 1000\n });\n }\n _resetProperty(propertyName) {\n if (this[propertyName].resetValue) {\n this[propertyName].resetValue();\n }\n else {\n var defaultValue = this.getPropertyDefaultValue(propertyName);\n if (ko.isObservable(this[propertyName])) {\n this[propertyName](defaultValue);\n }\n else {\n copyObservables(defaultValue, this[propertyName]);\n }\n }\n }\n getPropertyDefaultValue(propertyName) {\n var info = this.getPropertyInfo(propertyName);\n return ko.unwrap(info && new ModelSerializer().deserializeDefaultValue(info));\n }\n getPropertyInfo(propertyName) {\n return this.getInfo().filter((info) => { return info.propertyName === propertyName; })[0];\n }\n getInfo() {\n return this.getControlFactory().controlsMap[this.controlType].info;\n }\n createControl(model, serializer) {\n return this.getControlFactory().createControl(model, this, serializer);\n }\n dispose() {\n super.dispose();\n this.surface && this.surface.dispose();\n }\n preInitProperties(model, parent, serializer) { }\n getNearestParent(target) {\n return target.getMetaData().isContainer ? target : target.getNearestParent(target.parentModel());\n }\n getControlInfo() {\n return this.getControlFactory().controlsMap[this.controlType || 'Unknown'];\n }\n getMetaData() {\n var controlType = this.controlType ? this.controlType : 'Unknown', data = this.getControlFactory().controlsMap[controlType];\n return {\n isContainer: data.isContainer || false,\n isCopyDeny: data.isCopyDeny || false,\n isDeleteDeny: data.isDeleteDeny || false,\n canDrop: data.canDrop || (() => true),\n isPasteDeny: data.isPasteDeny || !data.isContainer\n };\n }\n _hasModifiedValue(name) {\n return this['_' + name] && this['_' + name]() && this.isPropertyModified(name);\n }\n createChild(info) {\n var newControl = this.getControlFactory().createControl(info, this);\n this.addChild(newControl);\n return newControl;\n }\n removeChilds(controls) {\n if (this['controls']) {\n var childs = this['controls']();\n for (var i = 0; i < controls.length; i++) {\n childs.splice(childs.indexOf(controls[i]), 1);\n }\n this['controls'].valueHasMutated();\n }\n }\n addChilds(controls) {\n if (this['controls']) {\n var childs = this['controls']();\n for (var i = 0; i < controls.length; i++) {\n childs.splice(0, 0, controls[i]);\n }\n this['controls'].valueHasMutated();\n }\n }\n removeChild(control) {\n if (this['controls']) {\n this['controls'].splice(this['controls']().indexOf(control), 1);\n control.onDelete();\n }\n }\n addChild(control) {\n if (this['controls'] && this['controls']().indexOf(control) === -1) {\n control.parentModel(this);\n this['controls'].splice(0, 0, control);\n }\n }\n isPropertyVisible(name) {\n return true;\n }\n isPropertyDisabled(name) {\n return false;\n }\n isPropertyModified(name) {\n var needName = this['_' + name] ? '_' + name : name;\n if (this[needName].isPropertyModified) {\n return this[needName].isPropertyModified();\n }\n else if (this[needName].isEmpty) {\n return !this[needName].isEmpty();\n }\n else {\n var defaultValue = this.getPropertyDefaultValue(name), propertyValue = ko.unwrap(this[needName]);\n if (defaultValue instanceof Object) {\n return !compareObjects(defaultValue, propertyValue);\n }\n else {\n return defaultValue !== propertyValue;\n }\n }\n }\n getControlFactory() {\n throw Error('Virtual method getControlFactory');\n }\n isResettableProperty(propertyName) {\n return ['name', 'size', 'location'].indexOf(propertyName) === -1;\n }\n _getRoot() {\n var root = this;\n while (root && root.parentModel()) {\n root = root.parentModel();\n }\n return root;\n }\n get root() {\n return this._getRoot();\n }\n rtl() {\n return false;\n }\n onDelete() { }\n}\n","/**\r\n* DevExpress Analytics (core\\elements\\margins.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { paddingSerializationsInfo } from './paddingModelMetaData';\nexport class Margins {\n constructor(left, right, top, bottom) {\n this.bottom = ko.observable(bottom);\n this.left = ko.observable(left);\n this.right = ko.observable(right);\n this.top = ko.observable(top);\n }\n getInfo() {\n return paddingSerializationsInfo;\n }\n isEmpty() {\n return this.toString() === Margins.defaultVal;\n }\n static fromString(value = Margins.defaultVal) {\n var components = value.split(',');\n return new Margins(parseFloat(components[0]), parseFloat(components[1]), parseFloat(components[2]), parseFloat(components[3]));\n }\n toString() {\n var result = this.left() + ', ' + this.right() + ', ' + this.top() + ', ' + this.bottom();\n return result;\n }\n}\nMargins.defaultVal = '100, 100, 100, 100';\nMargins.unitProperties = ['left', 'right'];\n","/**\r\n* DevExpress Analytics (core\\elements\\paddingModel.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../serializer/utils';\nimport { paddingSerializationsInfo } from './paddingModelMetaData';\nexport class PaddingModel extends Disposable {\n constructor(left = ko.observable(null), right = ko.observable(null), top = ko.observable(null), bottom = ko.observable(null), dpi = ko.observable(100)) {\n super();\n this.left = left;\n this.right = right;\n this.top = top;\n this.bottom = bottom;\n this.dpi = dpi;\n ['left', 'right', 'top', 'bottom'].forEach((propertyName) => {\n this['_' + propertyName] = ko.observable(this[propertyName]());\n this._disposables.push(this[propertyName] = ko.computed({\n read: () => {\n return this['_' + propertyName]() || 0;\n },\n write: (newVal) => {\n this['_' + propertyName](newVal);\n }\n }));\n });\n var isUpdating = ko.observable(false);\n var oldValue = null;\n this._disposables.push(this.all = ko.computed({\n read: () => {\n if (isUpdating())\n return oldValue;\n if (['right', 'top', 'bottom'].every(propertyName => this[propertyName]() === this.left()))\n oldValue = this.left();\n else\n oldValue = null;\n return oldValue;\n },\n write: (newVal) => {\n isUpdating(true);\n ['left', 'right', 'top', 'bottom'].forEach((propertyName) => this[propertyName](newVal));\n isUpdating(false);\n }\n }));\n }\n getInfo() {\n return paddingSerializationsInfo;\n }\n resetValue() {\n ['left', 'right', 'top', 'bottom'].forEach(name => this['_' + name](null));\n }\n isEmpty() {\n return ['left', 'right', 'top', 'bottom'].map(x => ko.unwrap(this['_' + x])).every(x => x === null);\n }\n applyFromString(value) {\n if (value) {\n var components = (value || '').split(',');\n this.left(parseInt(components[0]) || 0);\n this.right(parseInt(components[1]) || 0);\n this.top(parseInt(components[2]) || 0);\n this.bottom(parseInt(components[3]) || 0);\n }\n return this;\n }\n static from(val) {\n return new PaddingModel().applyFromString(val);\n }\n toString() {\n if (this.isEmpty())\n return;\n return this._toString();\n }\n _toString(inner = false) {\n return ['left', 'right', 'top', 'bottom'].map(x => parseInt(ko.unwrap(this[x]))).concat(this.dpi()).join(', ');\n }\n}\nPaddingModel.defaultVal = '0, 0, 0, 0, 100';\nPaddingModel.unitProperties = ['left', 'right', 'top', 'bottom'];\n","/**\r\n* DevExpress Analytics (core\\elements\\paddingModelMetaData.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { editorTemplates } from '../../property-grid/widgets/editorsInfo';\nexport var left = {\n propertyName: 'left', modelName: '@Left', localizationId: 'AnalyticsCoreStringId.PaddingInfo.Left', displayName: 'Left', editor: editorTemplates.getEditor('numeric')\n}, right = { propertyName: 'right', localizationId: 'AnalyticsCoreStringId.PaddingInfo.Right', modelName: '@Right', displayName: 'Right', editor: editorTemplates.getEditor('numeric') }, top = { propertyName: 'top', localizationId: 'AnalyticsCoreStringId.PaddingInfo.Top', modelName: '@Top', displayName: 'Top', editor: editorTemplates.getEditor('numeric') }, bottom = { propertyName: 'bottom', localizationId: 'AnalyticsCoreStringId.PaddingInfo.Bottom', modelName: '@Bottom', displayName: 'Bottom', editor: editorTemplates.getEditor('numeric') }, all = { propertyName: 'all', localizationId: 'AnalyticsCoreStringId.PaddingInfo.All', displayName: 'All', editor: editorTemplates.getEditor('numeric') };\nexport var paddingSerializationsInfo = [all, left, right, top, bottom];\n","/**\r\n* DevExpress Analytics (core\\elements\\point.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { locationFake } from '../_metadata';\nexport class Point {\n constructor(x, y) {\n this.x = ko.observable(x).extend({ 'dxdnum': {} });\n this.y = ko.observable(y).extend({ 'dxdnum': {} });\n }\n getInfo() {\n return locationFake;\n }\n static fromString(value = '0, 0') {\n var components = value.split(',');\n return new Point(parseFloat(components[0]), parseFloat(components[1]));\n }\n toString() {\n return this.x() + ', ' + this.y();\n }\n}\nPoint.unitProperties = ['x', 'y'];\n","/**\r\n* DevExpress Analytics (core\\elements\\rectangle.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport class Rectangle {\n constructor(left = 0, top = 0, width = 0, height = 0) {\n this.left = ko.observable(0);\n this.top = ko.observable(0);\n this.width = ko.observable(0);\n this.height = ko.observable(0);\n this.className = 'dxrd-drag-helper-item';\n this.left(left);\n this.top(top);\n this.width(width);\n this.height(height);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\elements\\size.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { sizeFake } from '../_metadata';\nexport class Size {\n constructor(width, height) {\n this.isPropertyDisabled = (name) => void 0;\n this.height = ko.observable(height).extend({ 'dxdnum': { min: 2 } });\n this.width = ko.observable(width).extend({ 'dxdnum': { min: 2 } });\n }\n getInfo() {\n return sizeFake;\n }\n static fromString(value = '0, 0') {\n var components = value.split(',');\n return new Size(parseFloat(components[0]), parseFloat(components[1]));\n }\n toString() {\n return this.width() + ', ' + this.height();\n }\n}\nSize.unitProperties = ['width', 'height'];\n","/**\r\n* DevExpress Analytics (core\\internal\\_ajaxRequestManager.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport { extend } from '../../serializer/_utils';\nexport class AjaxRequestManager {\n constructor(ajaxSttingsFn) {\n this.getAjaxSettings = ajaxSttingsFn;\n }\n sendRequest(settings) {\n var requestSettings = this._prepareRequestSettings(settings);\n return $.ajax(requestSettings);\n }\n _prepareRequestSettings(settings) {\n return extend({}, this.getAjaxSettings(), settings);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_controlsHelper.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../serializer/utils';\nimport { getUniqueNameForNamedObjectsArray } from './_getNameHelpers';\nimport { collectionsVisitor } from '../utils/_visitors';\nexport class DesignControlsHelper extends Disposable {\n constructor(target, handlers, collectionNames) {\n super();\n this.target = target;\n this.collectionNames = collectionNames;\n this._handlers = [];\n this._setText = false;\n this._visitedCollections = [];\n this._subscriptions = [];\n this.added = (value) => {\n this._setText = true;\n this._collectControls(value);\n this._setText = false;\n };\n this.deleted = (value) => {\n var allControls = this.allControls();\n var index = allControls.indexOf(value);\n allControls.splice(index, 1);\n collectionsVisitor(value, (collection) => {\n collection().forEach((item) => {\n allControls.splice(allControls.indexOf(item), 1);\n });\n });\n this.allControls.valueHasMutated();\n };\n this.allControls = ko.observableArray();\n var unwrappedTarget = target;\n if (ko.isSubscribable(target)) {\n this._disposables.push(target.subscribe((newTarget) => {\n this._visitedCollections = [];\n for (var i = 0, len = this._subscriptions.length; i < len; i++) {\n this._subscriptions[i].dispose();\n }\n this._subscriptions = [];\n this.allControls([]);\n if (newTarget) {\n this._collectControls(newTarget);\n }\n }));\n unwrappedTarget = target.peek();\n }\n this._disposables.push(this.allControls.subscribe((args) => {\n var addedItems = args.filter(x => x.status === 'added');\n for (var i = 0; i < addedItems.length; i++) {\n this._setName(addedItems[i].value);\n }\n }, null, 'arrayChange'));\n unwrappedTarget && this._collectControls(unwrappedTarget);\n this._handlers.push.apply(this._handlers, handlers);\n }\n getNameProperty(model) {\n return model.name;\n }\n getControlByName(name) {\n var control = null;\n this.allControls().some(x => {\n if (ko.unwrap(x.name) == name) {\n control = x;\n return true;\n }\n return false;\n });\n return control;\n }\n _setName(value) {\n var names = this.allControls().map((item) => { return ko.unwrap(this.getNameProperty(item)); });\n if (!this.getNameProperty(value)() || names.filter((x) => { return x === this.getNameProperty(value)(); }).length > 1) {\n var newName = getUniqueNameForNamedObjectsArray(this.allControls(), this._getNamePrefix(value), names);\n this.getNameProperty(value)(newName);\n this._setText && this._setDefaultText(value);\n }\n }\n _setDefaultText(value) {\n var initialText = value.getControlInfo && value.getControlInfo().defaultVal && value.getControlInfo().defaultVal['@Text'];\n if (this._setText && value['text'] && !value['text']() && (initialText === null || initialText === undefined)) {\n value['text'](this.getNameProperty(value)());\n }\n }\n _getNamePrefix(value) {\n var controlType = value.controlType || 'Unknown';\n return controlType.split('.').pop();\n }\n dispose() {\n super.dispose();\n this._subscriptions.forEach(subscription => subscription.dispose());\n this._subscriptions.splice(0);\n this._visitedCollections.splice(0);\n this._handlers.splice(0);\n this.target = null;\n this.allControls([]);\n }\n processCollection(collection) { }\n _collectControls(target) {\n var array = [target];\n collectionsVisitor(target, (collection, owner) => {\n if (this._visitedCollections.indexOf(collection) === -1) {\n this._visitedCollections.push(collection);\n var subscriptionsArray = this._subscriptions;\n if (owner instanceof Disposable) {\n subscriptionsArray = owner._disposables;\n }\n var subscription = collection.subscribe((args) => {\n args.forEach((changeSet) => {\n if (changeSet.moved != undefined)\n return;\n this[changeSet.status] && this[changeSet.status](changeSet.value);\n this._handlers.forEach((handler) => {\n handler[changeSet.status] && handler[changeSet.status](changeSet.value);\n });\n });\n }, null, 'arrayChange');\n subscriptionsArray.push({\n dispose: () => {\n subscription.dispose();\n subscription = null;\n this._visitedCollections.splice(this._visitedCollections.indexOf(collection), 1);\n }\n });\n }\n this.processCollection(collection());\n array.push.apply(array, collection());\n }, this.collectionNames);\n this.allControls.push.apply(this.allControls, array);\n }\n getControls(target) {\n var controls = ko.observableArray();\n collectionsVisitor(target, (collection) => {\n controls.push.apply(controls, collection());\n });\n return controls;\n }\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_cssCalculator.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { unitsToPixel } from '../utils/_units';\nimport { PaddingModel } from '../elements/paddingModel';\nimport { extend } from '../../serializer/_utils';\nexport function patchPositionByRTL(position, rtl) {\n if (rtl) {\n if (position === 'Left')\n return 'Right';\n else if (position === 'Right')\n return 'Left';\n }\n return position;\n}\nexport class CssCalculator {\n constructor(control, _rtlLayout) {\n this._rtlLayout = _rtlLayout;\n this._control = control;\n this.borderCss = (zoom) => {\n var borderWidth = this._getBorderWidth(control, zoom);\n var borderDefault = control['borderDefault'] && control['borderDefault']();\n var borderColor = control['borderColor'] && control['borderColor']() || '';\n var borders = control['borders'] && control['borders']() || '';\n var borderStyle = control['borderDashStyle'] && control['borderDashStyle']() || '';\n return borderDefault ? this.createBorders(borderStyle, borderWidth, borderColor, borders, borderDefault) :\n this.createBorders(borderStyle, borderWidth, borderColor, borders);\n };\n this.backGroundCss = () => {\n return { backgroundColor: control['backColor'] && control['backColor']() || 'transparent' };\n };\n this.foreColorCss = () => {\n var color = (control['foreColor'] && control['foreColor']() || 'transparent') === 'transparent' ? 'black' : control['foreColor']();\n return { color: color };\n };\n this.fontCss = () => {\n return this.createFont(control['font'] && control['font']() || '');\n };\n this.wordWrapCss = () => {\n return this.createWordWrap(ko.unwrap(control['wordWrap']), ko.unwrap(control['multiline']));\n };\n this.paddingsCss = () => {\n var controlPaddings = ko.unwrap(control['paddingObj'] || control['padding']) || PaddingModel.from(PaddingModel.defaultVal);\n var paddings = {\n paddingLeft: this._getPixelValueFromUnit(controlPaddings.left(), control) + 'px',\n paddingTop: this._getPixelValueFromUnit(controlPaddings.top(), control) + 'px',\n paddingRight: this._getPixelValueFromUnit(controlPaddings.right(), control) + 'px',\n paddingBottom: this._getPixelValueFromUnit(controlPaddings.bottom(), control) + 'px'\n };\n return paddings;\n };\n this.textAlignmentCss = () => {\n var align = control['textAlignment'] && control['textAlignment']() || '';\n return extend(this.createVerticalAlignment(align), this.createHorizontalAlignment(align));\n };\n this.stroke = () => {\n var color = (control['foreColor'] && control['foreColor']() || 'transparent') === 'transparent' ? 'black' : control['foreColor']();\n return { 'stroke': color };\n };\n this.strokeWidth = () => {\n var lineWidth = control['lineWidth'] && control['lineWidth']() || '';\n return { 'strokeWidth': lineWidth };\n };\n this.strokeWidthWithWidth = () => {\n var lineWidth = control['width'] && control['width']() || '';\n return { 'strokeWidth': lineWidth };\n };\n this.strokeDashArray = () => {\n var dashArray = this.createStrokeDashArray(control['lineStyle'] && control['lineStyle']() || '', control['lineWidth'] && control['lineWidth']() || '');\n return { 'strokeDasharray': dashArray };\n };\n this.strokeDashArrayWithWidth = () => {\n var dashArray = this.createStrokeDashArray(control['lineStyle'] && control['lineStyle']() || '', control['width'] && control['width']() || '');\n return { 'strokeDasharray': dashArray };\n };\n this.crossBandBorder = (position) => {\n return this.createBorder(control['borderDashStyleCrossband'] && control['borderDashStyleCrossband']() || 'solid', this._getBorderWidth(control), control['borderColor'] && control['borderColor']() || '', control['borders'] && control['borders']() || '', position);\n };\n this.angle = () => {\n return this.createAngle(control['angle'] && control['angle']() || 0);\n };\n this.cellBorder = (position, zoom) => {\n return this.createControlBorder(control['borderDashStyle'] && control['borderDashStyle']() || 'solid', this._getBorderWidth(control, zoom), control['borderColor'] && control['borderColor']() || '', control['borders'] && control['borders']() || '', position);\n };\n this.zipCodeFontCss = (fontSize) => {\n return this.createZipCodeFont(fontSize || control['size']['height']());\n };\n this.zipCodeAlignment = () => {\n var align = 'TopLeft';\n return extend(this.createVerticalAlignment(align), this.createHorizontalAlignment(align));\n };\n }\n _getPixelValueFromUnit(value, control) {\n if (control['root'] && control['root'].measureUnit) {\n return unitsToPixel(value, control['root'].measureUnit());\n }\n return value;\n }\n _patchPosition(position) {\n return patchPositionByRTL(position, this._rtlLayout());\n }\n _getBorderWidth(control, zoom) {\n return control['borderWidth'] && typeof (control['borderWidth']()) == 'number' ? Math.floor(control['borderWidth']() * (zoom || 1)) : '';\n }\n createBorder(dashStyle, width, color, positions, position) {\n var line = {};\n positions = positions || 'All';\n line = { stroke: 'Silver', strokeWidth: 2 };\n var dash = this.createStrokeDashArray(dashStyle, width);\n if (positions.indexOf(position) !== -1 || positions.indexOf('All') !== -1) {\n line['stroke'] = color;\n line['strokeWidth'] = width;\n line['strokeDasharray'] = dash;\n }\n return line;\n }\n createControlBorder(borderStyle, width, color, positions, position, defaultColor = 'solid 1px Silver') {\n var border = {};\n positions = positions || '';\n if (borderStyle === 'Dash') {\n borderStyle = 'dashed';\n }\n else if (borderStyle === 'Dot') {\n borderStyle = 'dotted';\n }\n else if (borderStyle === 'Double') {\n borderStyle = 'double';\n }\n else {\n borderStyle = 'solid';\n }\n if (positions.indexOf(position) !== -1 || positions.indexOf('All') !== -1) {\n border['border' + this._patchPosition(position)] = borderStyle + ' ' + width + 'px ' + color;\n }\n else {\n border['border' + this._patchPosition(position)] = defaultColor;\n }\n return border;\n }\n createBorders(borderStyle, width, color, positions, defaultColor = CssCalculator.DEFAULT_BORDER) {\n var left = this.createControlBorder(borderStyle, width, color, positions, 'Left', defaultColor);\n var right = this.createControlBorder(borderStyle, width, color, positions, 'Right', defaultColor);\n var top = this.createControlBorder(borderStyle, width, color, positions, 'Top', defaultColor);\n var bottom = this.createControlBorder(borderStyle, width, color, positions, 'Bottom', defaultColor);\n var border = extend({}, left, right, top, bottom);\n return border;\n }\n createZipCodeFont(height) {\n var fontStyles = {};\n fontStyles['fontFamily'] = 'Impact';\n fontStyles['fontSize'] = height + 'px';\n return fontStyles;\n }\n createFont(fontString) {\n var fontStyles = {};\n fontString = fontString || '';\n var components = fontString.split(',');\n fontStyles['fontFamily'] = components[0] ? '\"' + components[0] + '\"' : '';\n fontStyles['fontSize'] = components[1];\n if (components.length > 2) {\n for (var i = 2; i < components.length; i++) {\n if (components[i].indexOf('Bold') !== -1)\n fontStyles['fontWeight'] = 'Bold';\n if (components[i].indexOf('Italic') !== -1)\n fontStyles['fontStyle'] = 'Italic';\n if (components[i].indexOf('Underline') != -1)\n fontStyles['textDecoration'] = 'Underline';\n if (components[i].indexOf('Strikeout') != -1)\n fontStyles['textDecoration'] = (fontStyles['textDecoration'] ? fontStyles['textDecoration'] + ' ' : '') + 'Line-through';\n }\n }\n if (!fontStyles['fontWeight']) {\n fontStyles['fontWeight'] = '';\n }\n if (!fontStyles['fontStyle']) {\n fontStyles['fontStyle'] = '';\n }\n if (!fontStyles['textDecoration']) {\n fontStyles['textDecoration'] = '';\n }\n return fontStyles;\n }\n createVerticalAlignment(alignment) {\n var result = {};\n if (alignment.indexOf('Top') !== -1) {\n result['verticalAlign'] = 'top';\n }\n if (alignment.indexOf('Middle') !== -1) {\n result['verticalAlign'] = 'middle';\n }\n if (alignment.indexOf('Bottom') !== -1) {\n result['verticalAlign'] = 'bottom';\n }\n return result;\n }\n createHorizontalAlignment(alignment) {\n var result = {};\n if (alignment.indexOf('Left') !== -1) {\n result['textAlign'] = patchPositionByRTL('Left', this._control.rtl()).toLowerCase();\n }\n if (alignment.indexOf('Right') !== -1) {\n result['textAlign'] = patchPositionByRTL('Right', this._control.rtl()).toLowerCase();\n }\n if (alignment.indexOf('Center') !== -1) {\n result['textAlign'] = 'center';\n }\n if (alignment.indexOf('Justify') !== -1) {\n result['textAlign'] = 'justify';\n }\n return result;\n }\n createStrokeDashArray(style, width) {\n if (style === 'Solid') {\n return '';\n }\n else if (style === 'Dot') {\n return [width, width * 2].join('px, ') + 'px';\n }\n else if (style === 'Dash') {\n return [width * 4, width * 4].join('px, ') + 'px';\n }\n else if (style === 'DashDot') {\n return [width * 4, width * 2, width, width * 2].join('px, ') + 'px';\n }\n else if (style === 'DashDotDot') {\n return [width * 4, width * 2, width, width * 2, width, width * 2].join('px, ') + 'px';\n }\n else {\n return '';\n }\n }\n createWordWrap(wordwrap, multiline) {\n var result = {};\n if (wordwrap === false && multiline === false) {\n result['white-space'] = 'nowrap';\n result['word-wrap'] = 'normal';\n }\n else if (wordwrap === true && multiline === false) {\n result['word-wrap'] = 'break-word';\n result['white-space'] = '';\n }\n else if (wordwrap === false && multiline === true) {\n result['word-wrap'] = 'normal';\n result['white-space'] = 'pre';\n }\n else if (wordwrap === true && multiline === true) {\n result['white-space'] = 'pre-wrap';\n result['word-wrap'] = 'break-word';\n }\n return result;\n }\n createAngle(angle) {\n angle = -angle;\n return {\n '-webkit-transform': 'rotate(' + angle + 'deg)',\n '-moz-transform': 'rotate(' + angle + 'deg)',\n '-o-transform': 'rotate(' + angle + 'deg)',\n '-ms-transform': 'rotate(' + angle + 'deg)',\n 'transform': 'rotate(' + angle + 'deg)'\n };\n }\n contentSizeCss(controlSurfaceWidth, controlSurfaceHeight, zoom, borders, paddings) {\n var result = { top: 1, left: 1, right: 1, bottom: 1, width: 1, height: 1 };\n borders = borders || this._control['borders'] && this._control['borders']() || '';\n var borderWidth = this._getBorderWidth(this._control, zoom);\n ['Left', 'Top', 'Right', 'Bottom'].forEach((item) => {\n var value = 0;\n if (borderWidth != '' && (borders.indexOf(item) !== -1 || borders.indexOf('All') !== -1)) {\n value += borderWidth;\n }\n if (paddings) {\n value += this._getPixelValueFromUnit(ko.unwrap(paddings[item.toLowerCase()]), this._control) * (zoom || 1);\n }\n if (value)\n result[this._patchPosition(item).toLowerCase()] = value;\n });\n result.width = controlSurfaceWidth - result.left - result.right;\n result.height = controlSurfaceHeight - result.top - result.bottom;\n return result;\n }\n}\nCssCalculator.DEFAULT_BORDER = 'none';\n","/**\r\n* DevExpress Analytics (core\\internal\\_draggable.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { Disposable } from '../../serializer/utils';\nimport { convertFromCssPixelUnits, convertToCssPixelUnits } from './../internal/_utils';\nimport { Resizable } from './_resizable';\nexport class Draggable extends Disposable {\n constructor(_element, _options) {\n super();\n this._element = _element;\n this._options = _options;\n this._bodyEvents = { move: null, up: null };\n this._windowEvents = { up: null };\n this._originalDragStartCoordinates = null;\n this._originalElementPosition = null;\n this._dragInitialized = false;\n this._scrollableContainer = null;\n this._draggableElementClass = 'ui-draggable';\n this._minDragDistance = 1;\n var mousedown = event => this._mouseDown(event);\n this._addClassToElement(this._draggableElementClass);\n this._element.addEventListener('mousedown', mousedown);\n this._disposables.push({\n dispose: () => {\n this._element.removeEventListener('mousedown', mousedown);\n mousedown = null;\n this._element = null;\n this._options = null;\n }\n });\n }\n _initScrollContainer() {\n var containment = this._options.containment;\n if (containment && containment[0].classList.contains('dxrd-ghost-container')) {\n this._scrollableContainer = containment.find('.dx-scrollable-container')[0];\n }\n }\n _initDrag(event) {\n this._startRect = {\n left: event.pageX,\n top: event.pageY\n };\n this._bodyEvents.move = event => this._mouseMove(event);\n this._windowEvents.up = event => this._mouseUp(event);\n document.body.addEventListener('mousemove', this._bodyEvents.move);\n window.addEventListener('mouseup', this._windowEvents.up);\n this._initScrollContainer();\n }\n _addClassToElement(className) {\n this._element.classList.add(className);\n }\n _calculateElementPosition(dragDeltaLeft, dragDeltaTop) {\n var _a, _b;\n var left = this._originalElementPosition.left - dragDeltaLeft - (((_a = this._scrollableContainer) === null || _a === void 0 ? void 0 : _a.scrollLeft) || 0);\n var top = this._originalElementPosition.top - dragDeltaTop - (((_b = this._scrollableContainer) === null || _b === void 0 ? void 0 : _b.scrollTop) || 0);\n var boundary = this._options.boundary;\n if (boundary) {\n left = left < boundary.left ? boundary.left : left > boundary.right ? boundary.right : left;\n top = top < boundary.top ? boundary.top : top > boundary.bottom ? boundary.bottom : top;\n }\n return { left, top };\n }\n _mouseMove(event) {\n if (Resizable.inProcess || !this._startRect)\n return;\n const leftButtonPressed = event.which === 1;\n if (!leftButtonPressed || !this.shouldStartDrag(event))\n return;\n if (!this._dragInitialized) {\n this._dragInitialized = true;\n this._options.helper && (this._ghostContainer = this._options.helper(event, this._element));\n if (this._ghostContainer)\n this._element.ghostContainer = this._ghostContainer[0];\n this._originalDragStartCoordinates = { left: this._element.dataset.startDragWithOffset ? event.pageX : this._startRect.left, top: this._element.dataset.startDragWithOffset ? event.pageY : this._startRect.top };\n this._originalElementPosition = { left: this._ghostContainer ? convertFromCssPixelUnits(this._ghostContainer[0].dataset.startLeftPosition) : event.pageX, top: this._ghostContainer ? convertFromCssPixelUnits(this._ghostContainer[0].dataset.startTopPosition) : event.pageY };\n this._element.dataset.leftPosition = convertToCssPixelUnits(this._originalElementPosition.left);\n this._element.dataset.topPosition = convertToCssPixelUnits(this._originalElementPosition.top);\n this._options.start(event, this._element);\n }\n var dragDeltaLeft = this._originalDragStartCoordinates.left - event.pageX;\n var dragDeltaTop = this._originalDragStartCoordinates.top - event.pageY;\n const position = this._calculateElementPosition(dragDeltaLeft, dragDeltaTop);\n this._element.dataset.leftPosition = convertToCssPixelUnits(position.left);\n this._element.dataset.topPosition = convertToCssPixelUnits(position.top);\n if (this._ghostContainer) {\n this._ghostContainer[0].style.left = this._element.dataset.leftPosition;\n this._ghostContainer[0].style.top = this._element.dataset.topPosition;\n }\n this._options.drag(event, this._element);\n }\n shouldStartDrag(event) {\n return Math.abs(this._startRect.left - event.pageX) >= this._minDragDistance || Math.abs(this._startRect.top - event.pageY) >= this._minDragDistance;\n }\n _mouseUp(event) {\n if (Resizable.inProcess)\n return;\n Draggable.inProcess = false;\n this._bodyEvents.move && document.body.removeEventListener('mousemove', this._bodyEvents.move);\n this._windowEvents.up && window.removeEventListener('mouseup', this._windowEvents.up);\n if (this._dragInitialized) {\n this._dragInitialized = false;\n this._ghostContainer && this._ghostContainer.remove();\n this._ghostContainer = null;\n this._scrollableContainer = null;\n this._options.stop(event, this._element);\n }\n this._startRect = null;\n }\n _mouseDown(event) {\n event.stopPropagation();\n if (Resizable.inProcess)\n return;\n Draggable.inProcess = true;\n this._initDrag(event);\n }\n}\nDraggable.inProcess = false;\n","/**\r\n* DevExpress Analytics (core\\internal\\_editorTypeMapper.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { editorTemplates } from '../../property-grid/widgets/editorsInfo';\nexport const ExpressionType = 'DevExpress.DataAccess.Expression';\nexport function IsDataAccessExpression(type) {\n return type === ExpressionType;\n}\nexport var editorTypeMapper = {\n 'Enum': editorTemplates.getEditor('combobox'),\n 'System.String': editorTemplates.getEditor('text'),\n 'System.Guid': editorTemplates.getEditor('guid'),\n 'System.SByte': editorTemplates.getEditor('sbyte'),\n 'System.Decimal': editorTemplates.getEditor('decimal'),\n 'System.Int64': editorTemplates.getEditor('int64'),\n 'System.Int32': editorTemplates.getEditor('int32'),\n 'System.Int16': editorTemplates.getEditor('int16'),\n 'System.Single': editorTemplates.getEditor('single'),\n 'System.Double': editorTemplates.getEditor('double'),\n 'System.Byte': editorTemplates.getEditor('byte'),\n 'System.UInt16': editorTemplates.getEditor('uint16'),\n 'System.UInt32': editorTemplates.getEditor('uint32'),\n 'System.UInt64': editorTemplates.getEditor('uint64'),\n 'System.Boolean': editorTemplates.getEditor('boolSelect'),\n 'System.DateTime': editorTemplates.getEditor('date'),\n 'DevExpress.DataAccess.Expression': editorTemplates.getEditor('expressionEditor')\n};\nexport function getEditorType(typeString) {\n return editorTypeMapper[typeString] || editorTemplates.getEditor('text');\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_fetchRequestManager.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as $ from 'jquery';\nexport class FetchRequestManager {\n constructor(fetchSettingsFn) {\n this._executeRequest = (method, url, body, params, abortControler) => {\n const success = 'success';\n const responseDeferred = $.Deferred();\n const response = this._fetch(method, url, body, params, abortControler);\n response.then((response) => __awaiter(this, void 0, void 0, function* () {\n var _a;\n const contentType = (_a = response.headers.get('content-type')) === null || _a === void 0 ? void 0 : _a.split(';')[0];\n let statusText = '';\n if (contentType === 'application/json') {\n try {\n const json = yield response.json();\n if (response.ok) {\n statusText = success;\n responseDeferred.resolve(json, statusText, Object.assign(Object.assign({}, responseDeferred.promise()), { responseJSON: json }));\n }\n else {\n statusText = json.statusText;\n responseDeferred.reject(Object.assign(Object.assign({}, responseDeferred.promise()), { responseJSON: json, statusText, status: response.status }), statusText);\n }\n }\n catch (error) {\n responseDeferred.reject(Object.assign(Object.assign({}, responseDeferred.promise()), { statusText: error.message, status: response.status }), error.message, error);\n throw error;\n }\n }\n else if (contentType) {\n responseDeferred.resolve({\n result: response,\n success: true\n });\n }\n else {\n responseDeferred.reject(response);\n }\n }));\n response.catch((error) => {\n responseDeferred.reject({ error: error, statusText: error.message, status: 0 }, error.message, error);\n });\n return responseDeferred.promise();\n };\n this._fetch = (method, url, body, params, abortControler) => {\n const settings = {\n method,\n cache: params === null || params === void 0 ? void 0 : params.cache,\n headers: params === null || params === void 0 ? void 0 : params.headers,\n body,\n signal: abortControler === null || abortControler === void 0 ? void 0 : abortControler.signal\n };\n const fetchSettings = this.getFetchSettings();\n fetchSettings && fetchSettings.beforeSend && fetchSettings.beforeSend(settings);\n return fetch(url, settings);\n };\n this.getFetchSettings = fetchSettingsFn || (() => ({}));\n }\n sendRequest(settings) {\n const { method, preparedUrl, body, params } = this._prepareParams(settings);\n return this._executeRequest(method, preparedUrl, body, params, settings.abortController);\n }\n _prepareParams(settings) {\n var _a;\n const GET = 'GET';\n const POST = 'POST';\n const method = settings.type;\n const data = settings.data;\n let preparedUrl = settings.url;\n let body = null;\n let cache = 'default';\n const queryParams = $.param(data);\n if (queryParams) {\n if (settings.type === GET) {\n preparedUrl += `?${queryParams}`;\n }\n else if (settings.type === POST) {\n body = new URLSearchParams(queryParams);\n }\n }\n const params = {\n cache,\n headers: Object.assign(Object.assign({}, settings.headers), (_a = this.getFetchSettings()) === null || _a === void 0 ? void 0 : _a.headers)\n };\n return { method, preparedUrl, body, params };\n }\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_getNameHelpers.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nexport function getTypeNameFromFullName(controlType) {\n return controlType.split(',')[0].trim();\n}\nexport function getShortTypeName(controlType) {\n var fullTypeName = getTypeNameFromFullName(controlType), typeNameParts = fullTypeName.split('.');\n return typeNameParts[typeNameParts.length - 1];\n}\nexport function getControlTypeName(value) {\n var controlType = value.displayType && value.displayType() || value.controlType;\n if (value.getControlFactory) {\n var info = value.getControlFactory().getControlInfo(controlType);\n if (info.displayName)\n controlType = info.displayName;\n }\n return controlType && getLocalization(getShortTypeName(controlType));\n}\nexport function getControlFullName(value) {\n if (!value)\n return '';\n var displayName = ko.unwrap(value.name) || ko.unwrap(value.displayName), controlType = getControlTypeName(value);\n return displayName + (controlType ? (' (' + controlType + ')') : '');\n}\nexport function getImageClassName(controlType, isTemplate = false) {\n var controlType = getTypeNameFromFullName(controlType || '').split('.').join('_'), name;\n if (controlType.indexOf('XR') === 0) {\n name = controlType.slice(2).toLowerCase();\n }\n else if (controlType === 'DevExpress_XtraReports_UI_XtraReport') {\n name = 'master_report';\n }\n return (isTemplate ? 'dxrd-svg-toolbox-' : 'dxrd-image-') + (name ? name : controlType.toLowerCase());\n}\nexport function getUniqueNameForNamedObjectsArray(objects, prefix, names) {\n if (prefix.indexOf('XR') === 0) {\n prefix = prefix[2].toLowerCase() + prefix.slice(3);\n }\n else {\n var indexBand = prefix.indexOf('Band');\n if (indexBand !== -1 && prefix !== 'SubBand') {\n prefix = prefix.slice(0, indexBand) + prefix.slice(indexBand + 4);\n }\n }\n return getUniqueName(names || objects.map((item) => { return ko.unwrap(item.name); }), prefix);\n}\nexport function getUniqueName(names, prefix, inculdeFirst = true) {\n var i = inculdeFirst ? 1 : 0, result = inculdeFirst ? (prefix + i) : prefix;\n while (names.filter((item) => { return item === result; }).length > 0) {\n i++;\n result = prefix + i;\n }\n return result;\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_hoverInfo.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport class HoverInfo {\n constructor() {\n this._x = 0;\n this._y = 0;\n this.isOver = false;\n }\n get x() {\n return this._x;\n }\n set x(newX) {\n this._x = newX;\n }\n get y() {\n return this._y;\n }\n set y(newY) {\n this._y = newY;\n }\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_inlineTextEdit.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { Disposable } from '../../serializer/utils';\nimport { KeyboardEnum } from '../../property-grid/widgets/internal/_utils';\nexport function processTextEditorHotKeys(event, delegates) {\n if (!event || !delegates)\n return;\n if (event.key === KeyboardEnum.Esc && !!delegates['esc']) {\n delegates['esc']();\n }\n if (event.key === KeyboardEnum.Enter && event.ctrlKey && !!delegates['ctrlEnter']) {\n delegates['ctrlEnter']();\n }\n}\nexport class InlineTextEdit extends Disposable {\n constructor(selection) {\n super();\n this._showInline = ko.observable(false);\n this.text = ko.observable();\n var _controlText;\n this._disposables.push(selection.focused.subscribe(() => {\n if (this._showInline() && _controlText) {\n _controlText(this.text());\n this._showInline(false);\n }\n var controlModel = selection.focused() && selection.focused().getControlModel();\n _controlText = controlModel && (controlModel.textEditableProperty || controlModel.text || controlModel.alias);\n }));\n this._disposables.push(this.visible = ko.pureComputed({\n read: () => {\n return this._showInline();\n },\n write: (val) => {\n this._showInline(val);\n }\n }));\n this.show = (element) => {\n if (this._showInline()) {\n return;\n }\n var isSingleControlSelected = !!selection.selectedItems ? selection.selectedItems.length === 1 : !!selection.focused();\n if (isSingleControlSelected && _controlText && !selection.focused().locked) {\n this.text(_controlText());\n this._showInline(true);\n if (element) {\n var textarea = $.fn.constructor(element).find('textarea')[0];\n textarea && textarea['select']();\n }\n }\n else {\n this._showInline(false);\n }\n };\n this.keypressAction = (args) => {\n processTextEditorHotKeys(args.event, {\n esc: () => { this._showInline(false); },\n ctrlEnter: () => {\n _controlText(this.text());\n this._showInline(false);\n }\n });\n };\n }\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_processError.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { getErrorMessage, NotifyAboutWarning } from '../utils/_infoMessageHelpers';\nexport var _addErrorPrefix = true;\nexport function _processError(errorThrown, deferred, jqXHR, textStatus, processErrorCallback) {\n var message = errorThrown;\n var error = getErrorMessage(jqXHR);\n if (error && error !== message) {\n if (!_addErrorPrefix)\n message = error;\n else\n message += ': ' + error;\n }\n try {\n processErrorCallback ? processErrorCallback(message, jqXHR, textStatus) : NotifyAboutWarning(message);\n }\n finally {\n deferred.reject(jqXHR, textStatus, errorThrown);\n }\n}\nexport var _errorProcessor = {\n handlers: [],\n call: (e) => {\n for (var i = 0; i < _errorProcessor.handlers.length; i++) {\n _errorProcessor.handlers[i](e);\n }\n }\n};\nexport function processErrorEvent(func) {\n if (func) {\n _errorProcessor.handlers.push(func);\n }\n return {\n dispose: () => {\n func && _removeErrorEvent(func);\n }\n };\n}\nfunction _removeErrorEvent(func) {\n _errorProcessor.handlers.splice(_errorProcessor.handlers.indexOf(func), 1);\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_resizable.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport * as ko from 'knockout';\nimport { Disposable } from '../../serializer/utils';\nimport { convertFromCssPixelUnits, convertToCssPixelUnits } from './_utils';\nexport class Resizable extends Disposable {\n constructor(_element, _options) {\n super();\n this._element = _element;\n this._options = _options;\n this.handleClass = 'ui-resizable-handle';\n this.handleClassSelector = `.${this.handleClass}`;\n this.resizableElementClass = 'ui-resizable';\n this._defaultMinSize = 1;\n this._bodyEvents = {\n move: null,\n up: null\n };\n this._resizeDirection = null;\n this._resizeHandles = ['w', 'e', 's', 'n', 'se', 'sw', 'ne', 'nw'];\n }\n _initResize(event) {\n this._startResizeMousePosition = {\n left: event.pageX,\n top: event.pageY\n };\n this._resizeDirection = getResizeDirection(event.target.classList);\n this._addClassToElement('ui-resizable-resizing');\n var bounds = this._element.getBoundingClientRect();\n var $el = $.fn.constructor(this._element);\n this._element.dataset.originalLeftPosition = $el.css('left');\n this._element.dataset.originalTopPosition = $el.css('top');\n this._element.dataset.originalWidth = convertToCssPixelUnits(bounds.width);\n this._element.dataset.originalHeight = convertToCssPixelUnits(bounds.height);\n this._element.dataset.originalLeftMousePosition = convertToCssPixelUnits(event.pageX);\n this._element.dataset.originalTopMousePosition = convertToCssPixelUnits(event.pageY);\n this._bodyEvents.move = event => this._mouseMove(event);\n this._bodyEvents.up = event => this._mouseUp(event);\n document.body.addEventListener('mousemove', this._bodyEvents.move);\n document.body.addEventListener('mouseup', this._bodyEvents.up);\n }\n _mouseMove(event) {\n const leftButtonPressed = event.which === 1;\n if (leftButtonPressed) {\n const boundsDiff = this._getBoundsDiff(event);\n this._options.resize(event, this._element, boundsDiff);\n }\n }\n _mouseUp(event) {\n this._bodyEvents.move && document.body.removeEventListener('mousemove', this._bodyEvents.move);\n this._bodyEvents.up && document.body.removeEventListener('mouseup', this._bodyEvents.up);\n this._options.stop();\n Resizable.inProcess = false;\n this._removeClassFromElement('ui-resizable-resizing');\n this._startResizeMousePosition = null;\n this._resizeDirection = null;\n }\n _mouseDown(event) {\n Resizable.inProcess = true;\n this._initResize(event);\n this._options.start(event, this._element);\n }\n _initResizeHandle(className, handleResizeEvent) {\n const handleDiv = document.createElement('div');\n handleDiv.classList.add(this.handleClass);\n handleDiv.style.zIndex = '95';\n handleDiv.classList.add(className);\n handleDiv.addEventListener('mousedown', handleResizeEvent);\n this._element.append(handleDiv);\n }\n _addClassToElement(className) {\n this._element.classList.add(className);\n }\n _removeClassFromElement(className) {\n this._element.classList.remove(className);\n }\n _getBoundsDiff(event) {\n let diffWidth = 0;\n let diffHeight = 0;\n let leftDiff = 0;\n let topDiff = 0;\n const originalHeight = convertFromCssPixelUnits(this._element.dataset.originalHeight);\n const originalWidth = convertFromCssPixelUnits(this._element.dataset.originalWidth);\n const updateHeightFunc = (resizeFromTop) => {\n const minHeight = this._element.style.minHeight ? convertFromCssPixelUnits(this._element.style.minHeight) : this._defaultMinSize;\n const resizeDistance = (this._startResizeMousePosition.top - event.pageY) * (resizeFromTop ? 1 : -1);\n const newHeightIsLessThanMinHeight = minHeight > originalHeight + resizeDistance;\n if (newHeightIsLessThanMinHeight) {\n var respectedDiff = originalHeight - minHeight;\n if (resizeFromTop)\n topDiff = respectedDiff;\n diffHeight = -respectedDiff;\n return;\n }\n diffHeight = resizeDistance;\n if (resizeFromTop) {\n topDiff = -diffHeight;\n }\n };\n const updateWidthFunc = (resizeFromLeft) => {\n const minWidth = this._element.style.minWidth ? convertFromCssPixelUnits(this._element.style.minWidth) : this._defaultMinSize;\n const resizeDistance = (this._startResizeMousePosition.left - event.pageX) * (resizeFromLeft ? 1 : -1);\n const newWidthIsLessThanMinWidth = minWidth > originalWidth + resizeDistance;\n if (newWidthIsLessThanMinWidth) {\n var respectedDiff = originalWidth - minWidth;\n if (resizeFromLeft)\n leftDiff = respectedDiff;\n diffWidth = -respectedDiff;\n return;\n }\n diffWidth = resizeDistance;\n if (resizeFromLeft) {\n leftDiff = -diffWidth;\n }\n };\n const updateHeight = this._resizeDirection && /sw|se|nw|ne|s|n/.test(this._resizeDirection);\n const updateWidth = this._resizeDirection && /sw|se|nw|ne|e|w/.test(this._resizeDirection);\n if (updateHeight)\n updateHeightFunc(/nw|ne|n/.test(this._resizeDirection));\n if (updateWidth)\n updateWidthFunc(/sw|nw|w/.test(this._resizeDirection));\n const boundsDiff = {\n width: diffWidth,\n height: diffHeight,\n left: leftDiff,\n top: topDiff\n };\n return boundsDiff;\n }\n initialize() {\n var mousedown = event => this._mouseDown(event);\n var addElementHandles = (handles) => {\n if (!handles)\n return;\n this._addClassToElement(this.resizableElementClass);\n $.fn.constructor(this._element).children(this.handleClassSelector).remove();\n const elementResizeHandles = handles === 'all' ? this._resizeHandles : handles.split(',');\n elementResizeHandles.forEach(handle => {\n this._initResizeHandle(`ui-resizable-${handle}`, mousedown);\n });\n };\n addElementHandles(ko.unwrap(this._options.handles));\n if (ko.isSubscribable(this._options.handles)) {\n var subscribe = this._options.handles.subscribe((newHandles) => {\n this._removeClassFromElement(this.resizableElementClass);\n var oldElementHandles = this._element.querySelectorAll(this.handleClassSelector);\n oldElementHandles.forEach(handle => handle.removeEventListener('mousedown', mousedown));\n $.fn.constructor(this._element).children(this.handleClassSelector).remove();\n addElementHandles(newHandles);\n });\n this._disposables.push(subscribe);\n }\n this._disposables.push({\n dispose: () => {\n addElementHandles = null;\n var elementHandles = this._element.querySelectorAll(this.handleClass);\n elementHandles.forEach(handle => handle.removeEventListener('mousedown', mousedown));\n this._element.removeEventListener('mousedown', mousedown);\n mousedown = null;\n this._element = null;\n this._options = null;\n }\n });\n return this;\n }\n}\nResizable.inProcess = false;\nexport function getResizeDirection(currentClassList) {\n for (var i = 0; i < currentClassList.length; i++) {\n if (currentClassList[i] !== 'ui-resizable-handle' && currentClassList[i].indexOf('ui-resizable-') === 0)\n return currentClassList[i].slice('ui-resizable-'.length, currentClassList[i].length);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_scrollProcessor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport dxScrollView from 'devextreme/ui/scroll_view';\nimport { Disposable } from '../../serializer/utils';\nexport class dxScrollProcessor extends Disposable {\n constructor(_container, _updateTime = 10) {\n super();\n this._container = _container;\n this._updateTime = _updateTime;\n this._currentOffsetY = 0;\n this._currentOffsetX = 0;\n this._scroll = null;\n this._updateInterval = null;\n this._scroll = dxScrollView.getInstance(this._container);\n }\n dispose() {\n this._scroll = null;\n this._container = null;\n this._updateInterval && clearTimeout(this._updateInterval);\n this._updateInterval = null;\n }\n _startUpdateScrollPosition() {\n this._updateInterval && clearInterval(this._updateInterval);\n this._updateInterval = setInterval(() => this._scroll.scrollTo({\n top: this._scroll.scrollTop() + this._currentOffsetY,\n left: this._scroll.scrollLeft() + this._currentOffsetX\n }), this._updateTime);\n }\n _calculateOffset(screenPosition, containerRect, offsetProperty) {\n var sizeProperty = offsetProperty === 'y' ? 'height' : 'width';\n if (screenPosition[offsetProperty] > (containerRect[offsetProperty] + containerRect[sizeProperty] - 50)) {\n return 5;\n }\n else if (screenPosition[offsetProperty] < (containerRect[offsetProperty] + 50)) {\n return -5;\n }\n return 0;\n }\n getScrollOffset() {\n return this._scroll.scrollOffset();\n }\n processOffset(screenPosition) {\n var containerRect = this._container.getBoundingClientRect();\n this._currentOffsetY = this._calculateOffset(screenPosition, containerRect, 'y');\n this._currentOffsetX = this._calculateOffset(screenPosition, containerRect, 'x');\n if (!this._currentOffsetX && !this._currentOffsetY) {\n this._updateInterval && clearInterval(this._updateInterval);\n this._updateInterval = null;\n }\n else if (!this._updateInterval) {\n this._startUpdateScrollPosition();\n }\n }\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_stores.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport ArrayStore from 'devextreme/data/array_store';\nimport CustomStore from 'devextreme/data/custom_store';\nimport DataSource from 'devextreme/data/data_source';\nimport * as $ from 'jquery';\nimport * as ko from 'knockout';\nimport { Disposable } from '../../serializer/utils';\nexport class CustomSortedArrayStore extends CustomStore {\n static _sortItems(items, sortPropertyName) {\n return items.sort((a, b) => {\n var propA = ko.unwrap(a[sortPropertyName]), propB = ko.unwrap(b[sortPropertyName]);\n if (propA && propB) {\n var diff = propA - propB;\n if (!isNaN(diff))\n return diff;\n propA = propA.toLowerCase ? propA.toLowerCase() : propA;\n propB = propB.toLowerCase ? propB.toLowerCase() : propB;\n return (propA < propB) ? -1 : (propA > propB) ? 1 : 0;\n }\n });\n }\n static _createOptions(items, sortPropertyName) {\n items = this._sortItems(items, sortPropertyName);\n return {\n load: (options) => {\n var result = [].concat(items);\n if (options.take)\n result = result.splice(options.skip, options.take);\n return $.Deferred().resolve(result).promise();\n },\n byKey: (key) => {\n if (items.some(x => x === key))\n return key;\n }\n };\n }\n constructor(items, sortPropertyName = 'name') {\n super(CustomSortedArrayStore._createOptions(items, sortPropertyName));\n }\n}\nexport class SortedArrayStore extends ArrayStore {\n constructor(options, sortPropertyName = 'name') {\n if (options instanceof Array) {\n CustomSortedArrayStore._sortItems(options, sortPropertyName);\n }\n super(options);\n }\n}\nexport class ControlsStore extends Disposable {\n constructor(allControls) {\n super();\n this._filter = ko.observable(null);\n var dataSource = null;\n this._disposables.push(this.dataSource = ko.computed(() => {\n dataSource && dataSource.dispose();\n var items = this._filter() ? allControls().filter(this._filter()) : allControls();\n dataSource = new DataSource({\n store: new CustomSortedArrayStore(items),\n paginate: true,\n pageSize: 100\n });\n return dataSource;\n }));\n this._disposables.push(this.visible = ko.computed(() => {\n return allControls().length > 0;\n }));\n }\n getFilter() {\n return this._filter();\n }\n setFilter(filter) {\n this._filter(filter);\n }\n resetFilter() {\n this._filter(null);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_surfaceHelpers.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nexport function findSurface(viewModel) {\n return !!viewModel ? viewModel['surface'] : null;\n}\nexport function getControlNewAbsolutePositionOnResize(snapHelper, absolutePosition, ui, delta) {\n var newAbsolutePosition = {\n top: absolutePosition.top + delta.y,\n left: absolutePosition.left + delta.x,\n bottom: absolutePosition.top + ui.originalSize.height,\n right: absolutePosition.left + ui.originalSize.width\n };\n if (delta.x !== 0) {\n newAbsolutePosition.left = snapHelper.snapPosition(newAbsolutePosition.left, false);\n }\n else if (delta.width !== 0) {\n newAbsolutePosition.right = snapHelper.snapPosition(absolutePosition.left + ui.size.width, false);\n }\n if (delta.y !== 0) {\n newAbsolutePosition.top = snapHelper.snapPosition(newAbsolutePosition.top, true);\n }\n else if (delta.height !== 0) {\n newAbsolutePosition.bottom = snapHelper.snapPosition(absolutePosition.top + ui.size.height, true);\n }\n return newAbsolutePosition;\n}\nfunction num(v) {\n return parseInt(v, 10) || 0;\n}\nexport function getControlRect(element, control, surface) {\n var curleft = num(element.css('left')), curtop = num(element.css('top'));\n if (surface.rtl()) {\n var posLeft = surface.pageWidth() - surface.margins.left() - element.width();\n if (curleft > posLeft) {\n curleft = posLeft;\n }\n }\n var bounds = element[0].getBoundingClientRect();\n return { top: curtop, left: curleft, width: bounds.width, height: bounds.height };\n}\nexport function minHeightWithoutScroll(element) {\n return Math.min(element.scrollHeight, element.offsetHeight, element.clientHeight) + element.offsetTop;\n}\nexport function chooseBetterPositionOf(html, designer) {\n return designer && (minHeightWithoutScroll(html) < minHeightWithoutScroll(designer) ? window : designer) || window;\n}\nexport function updateSurfaceContentSize(surfaceSize, root, rtl = false) {\n return () => {\n var $root = $.fn.constructor(root).find('.dxrd-designer').eq(0);\n var toolboxWidth = $root.find('.dxrd-toolbox-wrapper:visible').outerWidth() || 0;\n var rightAreaWidth = ($root.find('.dxrd-right-panel:visible').outerWidth() || 0) + ($root.find('.dxrd-right-tabs:visible').outerWidth() || 0);\n var otherWidth = rightAreaWidth + toolboxWidth, surfaceWidth = $root.width() - (otherWidth);\n $root.find('.dxrd-surface-wrapper').eq(0).css({\n 'left': rtl ? rightAreaWidth : toolboxWidth,\n 'right': !rtl ? rightAreaWidth : toolboxWidth,\n 'width': surfaceWidth,\n 'bottom': $root.find('.dxrd-navigation-panel-wrapper:visible').outerHeight() || 0\n });\n surfaceSize(surfaceWidth);\n };\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_utils.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { ToolboxItem } from '../tools/toolbox';\nexport function getToolboxItems(controlsMap, defaultGroup = '') {\n var toolboxItems = [];\n Object.keys(controlsMap).forEach((controlType) => {\n if (!controlsMap[controlType].nonToolboxItem) {\n var item = {\n '@ControlType': controlType,\n displayName: controlsMap[controlType].displayName,\n index: controlsMap[controlType].toolboxIndex || 0,\n canDrop: controlsMap[controlType].canDrop,\n group: controlsMap[controlType].group || defaultGroup\n };\n if (controlsMap[controlType].size) {\n item['size'] = controlsMap[controlType].size;\n }\n if (controlsMap[controlType].defaultVal) {\n Object.keys(controlsMap[controlType].defaultVal).forEach((name) => {\n item[name] = controlsMap[controlType].defaultVal[name];\n });\n }\n toolboxItems.push(new ToolboxItem(item));\n }\n });\n return toolboxItems.sort((item1, item2) => { return item1.index - item2.index; });\n}\nexport function blur(element) {\n try {\n element['blur'] && element['blur']();\n }\n catch (e) {\n document.body.blur();\n }\n}\nexport const convertToCssPixelUnits = (value) => `${value}px`;\nexport const convertFromCssPixelUnits = (value) => parseFloat(value.replace('px', ''));\nexport function isDefined(object) {\n return null !== object && void 0 !== object && Object.keys(object).length > 0;\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\_validation.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nconst restrictedNames = ['Name', 'Version'];\nexport function validateName(nameCandidate) {\n if (!nameCandidate)\n return false;\n var letter = '\\\\u0041-\\\\u005A\\\\u0061-\\\\u007A\\\\u00AA\\\\u00B5\\\\u00BA\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376-\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E-\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5-\\\\u06E6\\\\u06EE-\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4-\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0-\\\\u08B4\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0980\\\\u0985-\\\\u098C\\\\u098F-\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC-\\\\u09DD\\\\u09DF-\\\\u09E1\\\\u09F0-\\\\u09F1\\\\u0A05-\\\\u0A0A\\\\u0A0F-\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32-\\\\u0A33\\\\u0A35-\\\\u0A36\\\\u0A38-\\\\u0A39\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A72-\\\\u0A74\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2-\\\\u0AB3\\\\u0AB5-\\\\u0AB9\\\\u0ABD\\\\u0AD0\\\\u0AE0-\\\\u0AE1\\\\u0AF9\\\\u0B05-\\\\u0B0C\\\\u0B0F-\\\\u0B10\\\\u0B13-\\\\u0B28\\\\u0B2A-\\\\u0B30\\\\u0B32-\\\\u0B33\\\\u0B35-\\\\u0B39\\\\u0B3D\\\\u0B5C-\\\\u0B5D\\\\u0B5F-\\\\u0B61\\\\u0B71\\\\u0B83\\\\u0B85-\\\\u0B8A\\\\u0B8E-\\\\u0B90\\\\u0B92-\\\\u0B95\\\\u0B99-\\\\u0B9A\\\\u0B9C\\\\u0B9E-\\\\u0B9F\\\\u0BA3-\\\\u0BA4\\\\u0BA8-\\\\u0BAA\\\\u0BAE-\\\\u0BB9\\\\u0BD0\\\\u0C05-\\\\u0C0C\\\\u0C0E-\\\\u0C10\\\\u0C12-\\\\u0C28\\\\u0C2A-\\\\u0C39\\\\u0C3D\\\\u0C58-\\\\u0C5A\\\\u0C60-\\\\u0C61\\\\u0C85-\\\\u0C8C\\\\u0C8E-\\\\u0C90\\\\u0C92-\\\\u0CA8\\\\u0CAA-\\\\u0CB3\\\\u0CB5-\\\\u0CB9\\\\u0CBD\\\\u0CDE\\\\u0CE0-\\\\u0CE1\\\\u0CF1-\\\\u0CF2\\\\u0D05-\\\\u0D0C\\\\u0D0E-\\\\u0D10\\\\u0D12-\\\\u0D3A\\\\u0D3D\\\\u0D4E\\\\u0D5F-\\\\u0D61\\\\u0D7A-\\\\u0D7F\\\\u0D85-\\\\u0D96\\\\u0D9A-\\\\u0DB1\\\\u0DB3-\\\\u0DBB\\\\u0DBD\\\\u0DC0-\\\\u0DC6\\\\u0E01-\\\\u0E30\\\\u0E32-\\\\u0E33\\\\u0E40-\\\\u0E46\\\\u0E81-\\\\u0E82\\\\u0E84\\\\u0E87-\\\\u0E88\\\\u0E8A\\\\u0E8D\\\\u0E94-\\\\u0E97\\\\u0E99-\\\\u0E9F\\\\u0EA1-\\\\u0EA3\\\\u0EA5\\\\u0EA7\\\\u0EAA-\\\\u0EAB\\\\u0EAD-\\\\u0EB0\\\\u0EB2-\\\\u0EB3\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F40-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F88-\\\\u0F8C\\\\u1000-\\\\u102A\\\\u103F\\\\u1050-\\\\u1055\\\\u105A-\\\\u105D\\\\u1061\\\\u1065-\\\\u1066\\\\u106E-\\\\u1070\\\\u1075-\\\\u1081\\\\u108E\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F5\\\\u13F8-\\\\u13FD\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16F1-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE-\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5-\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2183-\\\\u2184\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2-\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3006\\\\u3031-\\\\u3035\\\\u303B-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FD5\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A-\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA69D\\\\uA6A0-\\\\uA6E5\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA7AD\\\\uA7B0-\\\\uA7B7\\\\uA7F7-\\\\uA801\\\\uA803-\\\\uA805\\\\uA807-\\\\uA80A\\\\uA80C-\\\\uA822\\\\uA840-\\\\uA873\\\\uA882-\\\\uA8B3\\\\uA8F2-\\\\uA8F7\\\\uA8FB\\\\uA8FD\\\\uA90A-\\\\uA925\\\\uA930-\\\\uA946\\\\uA960-\\\\uA97C\\\\uA984-\\\\uA9B2\\\\uA9CF\\\\uA9E0-\\\\uA9E4\\\\uA9E6-\\\\uA9EF\\\\uA9FA-\\\\uA9FE\\\\uAA00-\\\\uAA28\\\\uAA40-\\\\uAA42\\\\uAA44-\\\\uAA4B\\\\uAA60-\\\\uAA76\\\\uAA7A\\\\uAA7E-\\\\uAAAF\\\\uAAB1\\\\uAAB5-\\\\uAAB6\\\\uAAB9-\\\\uAABD\\\\uAAC0\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEA\\\\uAAF2-\\\\uAAF4\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB65\\\\uAB70-\\\\uABE2\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D\\\\uFB1F-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40-\\\\uFB41\\\\uFB43-\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC';\n var pattern = new RegExp('^[' + letter + '_][' + letter + '_\\\\d]*$');\n return pattern.test(nameCandidate) && restrictedNames.every(name => nameCandidate != name);\n}\nexport function replaceInvalidSymbols(text) {\n return text.replace(/[\\W_]+/g, '_');\n}\nexport var nameValidationRules = [\n {\n type: 'custom',\n validationCallback: (options) => { return validateName(options.value); },\n get message() {\n return getLocalization('Name is required and should be a valid identifier.', 'AnalyticsCoreStringId.NameIsRequired_Error');\n }\n }\n];\n","/**\r\n* DevExpress Analytics (core\\internal\\ajaxSetup.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { extend } from 'jquery';\nimport { _isFetchConfigured, requestManager } from './requestManager';\nexport var ajaxSetup = {\n ajaxSettings: {},\n sendRequest: function (settings) {\n if (!_isFetchConfigured())\n return requestManager.getInstance().sendRequest(extend({}, this.ajaxSettings, settings));\n const errorMessage = 'The request manager is currently configured as Fetch. Use either ajaxSetup or fetchSetup for configuration, but not both.';\n throw new Error(errorMessage);\n }\n};\n","/**\r\n* DevExpress Analytics (core\\internal\\dx-versions.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as devextremeVersion from 'devextreme/core/version';\nimport { version as clientVersions } from '../../analytics-version';\nexport var dxversions = {\n analytics: clientVersions,\n devextreme: devextremeVersion.version || devextremeVersion\n};\n","/**\r\n* DevExpress Analytics (analytics-version.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport const version = '23.1.4';\n","/**\r\n* DevExpress Analytics (core\\internal\\fetchSetup.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var fetchSetup = {\n fetchSettings: {}\n};\n","/**\r\n* DevExpress Analytics (core\\internal\\requestManager.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { AjaxRequestManager } from './_ajaxRequestManager';\nimport { FetchRequestManager } from './_fetchRequestManager';\nimport { isDefined } from './_utils';\nvar _requestManagerInstance = null;\nexport var requestManager = {\n getInstance: function (requestManagerSetup) {\n if (!_requestManagerInstance) {\n this.initialize(requestManagerSetup);\n }\n return _requestManagerInstance;\n },\n _initialize: function (requestManagerInstance) {\n _requestManagerInstance = requestManagerInstance;\n },\n initialize: function (requestManagerSetup) {\n const { ajaxSetup, fetchSetup } = requestManagerSetup !== null && requestManagerSetup !== void 0 ? requestManagerSetup : {};\n if (isDefined(ajaxSetup === null || ajaxSetup === void 0 ? void 0 : ajaxSetup.ajaxSettings) && isDefined(fetchSetup === null || fetchSetup === void 0 ? void 0 : fetchSetup.fetchSettings)) {\n throw new Error('You cannot configure more than one type of request manager. Use either ajaxSetup or fetchSetup for configuration, but not both.');\n }\n if (isDefined(ajaxSetup === null || ajaxSetup === void 0 ? void 0 : ajaxSetup.ajaxSettings)) {\n _requestManagerInstance = new AjaxRequestManager(() => ajaxSetup.ajaxSettings);\n return;\n }\n _requestManagerInstance = new FetchRequestManager(() => fetchSetup === null || fetchSetup === void 0 ? void 0 : fetchSetup.fetchSettings);\n }\n};\nexport function _isFetchConfigured() {\n return _requestManagerInstance instanceof FetchRequestManager;\n}\n","/**\r\n* DevExpress Analytics (core\\internal\\selectable.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport dxPopup from 'devextreme/ui/popup';\nimport * as $ from 'jquery';\nimport { Disposable } from '../../serializer/utils';\nimport { DragDropHandler } from '../dragDrop/_dragDropHandler';\nimport { Draggable } from './_draggable';\nimport { Resizable } from './_resizable';\nfunction rectIntersection(r1, r2) {\n return !(r2.left > r1.right ||\n r2.right < r1.left ||\n r2.top > r1.bottom ||\n r2.bottom < r1.top);\n}\nexport class SelectableElement extends Disposable {\n constructor(_element, _options) {\n super();\n this._element = _element;\n this._options = _options;\n this.isSelected = false;\n this.bounds = _element.getBoundingClientRect();\n this._disposables.push({\n dispose: () => {\n this._element = null;\n this._options = null;\n this.bounds = null;\n }\n });\n }\n updateSelection(currentRect, event) {\n var isSelected = rectIntersection(this.bounds, currentRect);\n if (isSelected != this.isSelected) {\n isSelected ? this._options.selecting(event, this._element) : this._options.unselecting(event, this._element);\n this.isSelected = isSelected;\n }\n }\n}\nexport class Selectable extends Disposable {\n constructor(_element, _options) {\n super();\n this._element = _element;\n this._options = _options;\n this._elements = [];\n this._bodyEvents = {\n move: null,\n up: null\n };\n this._minSelectDistance = 2;\n var mousemove = event => this._mouseMove(event);\n var mouseup = event => this._mouseUp(event);\n var mousedown = event => this._mouseDown(event);\n this._element.addEventListener('mousemove', mousemove);\n this._element.addEventListener('mouseup', mouseup);\n this._element.addEventListener('mousedown', mousedown);\n this._$window = $.fn.constructor(window);\n this._disposables.push({\n dispose: () => {\n this._element.removeEventListener('mousemove', mousemove);\n this._element.removeEventListener('mouseup', mouseup);\n this._element.removeEventListener('mousedown', mousedown);\n mousemove = null;\n mouseup = null;\n mousedown = null;\n this._$window = null;\n this._element = null;\n this._options = null;\n }\n });\n }\n _clearElements() {\n this._elements.forEach(x => x.dispose());\n this._elements = [];\n }\n _collectElements() {\n this._clearElements();\n var elements = document.getElementsByClassName(this._options.filter.substr(1));\n for (var i = 0; i < elements.length; i++) {\n this._elements.push(new SelectableElement(elements[i], this._options));\n }\n }\n _updateSelectionContent(event) {\n if (this._startRect.left >= event.pageX) {\n this._$selectionContent.css('left', event.pageX);\n this._$selectionContent.css('right', this._startRect.right);\n }\n else {\n this._$selectionContent.css('left', this._startRect.left);\n this._$selectionContent.css('right', this._$window.width() - event.pageX);\n }\n if (this._startRect.top >= event.pageY) {\n this._$selectionContent.css('top', event.pageY);\n this._$selectionContent.css('bottom', this._startRect.bottom);\n }\n else {\n this._$selectionContent.css('top', this._startRect.top);\n this._$selectionContent.css('bottom', this._$window.height() - event.pageY);\n }\n const currentRect = this._$selectionContent[0].getBoundingClientRect();\n for (var i = 0; i < this._elements.length; i++) {\n this._elements[i].updateSelection(currentRect, event);\n }\n }\n _initStartRect(event) {\n this._startRect = {\n left: event.pageX,\n top: event.pageY,\n right: this._$window.width() - event.pageX,\n bottom: this._$window.height() - event.pageY\n };\n }\n _mouseMove(event) {\n setTimeout(() => {\n if (DragDropHandler.started() || Selectable.disabled || Resizable.inProcess || !this._startRect)\n return;\n var leftButtonPressed = event.which === 1;\n if (leftButtonPressed) {\n if (!this._$selectionContent) {\n if (this.shouldStartSelect(event)) {\n this._options.start(event);\n Selectable.inProcess = true;\n this._$selectionContent = $.fn.constructor('
').appendTo(document.body);\n this._$selectionContent.addClass('dxrd-selection-content ui-selectable-helper');\n if (dxPopup.prototype['_zIndexInitValue'])\n this._$selectionContent.css('z-index', dxPopup.prototype['_zIndexInitValue']() + 100);\n this._updateSelectionContent(event);\n this._bodyEvents.move = event => this._mouseMove(event);\n this._bodyEvents.up = event => this._mouseUp(event);\n document.body.addEventListener('mousemove', this._bodyEvents.move);\n document.body.addEventListener('mouseup', this._bodyEvents.up);\n }\n }\n else {\n this._updateSelectionContent(event);\n }\n }\n }, 1);\n }\n shouldStartSelect(event) {\n return Math.abs(this._startRect.left - event.pageX) >= this._minSelectDistance || Math.abs(this._startRect.top - event.pageY) >= this._minSelectDistance;\n }\n _mouseUp(event) {\n if (Selectable.disabled || Resizable.inProcess || Draggable.inProcess)\n return;\n this._options.stop();\n this._$selectionContent && this._$selectionContent.remove();\n this._$selectionContent = null;\n this._bodyEvents.move && document.body.removeEventListener('mousemove', this._bodyEvents.move);\n this._bodyEvents.up && document.body.removeEventListener('mouseup', this._bodyEvents.up);\n this._startRect = null;\n this._clearElements();\n Selectable.inProcess = false;\n }\n _mouseDown(event) {\n if (Selectable.disabled || Resizable.inProcess || Draggable.inProcess)\n return;\n this._initStartRect(event);\n this._collectElements();\n }\n}\nSelectable.inProcess = false;\nSelectable.disabled = false;\n","/**\r\n* DevExpress Analytics (core\\selection\\_combinedObj.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { extend, isEmptyObject } from '../../serializer/_utils';\nexport class CombinedObject {\n static getInfo(controls) {\n var infos = controls.map((item) => { return item['getInfo'](); });\n return () => {\n var info = [];\n for (var i = 0; i < infos[0].length; i++) {\n if (infos.filter((info) => { return info.filter((x) => { return x.propertyName === infos[0][i].propertyName; }).length > 0; }).length === infos.length) {\n info.push(infos[0][i]);\n }\n }\n return info;\n };\n }\n static isPropertyDisabled(controls) {\n return (name) => {\n for (var i = 0; i < controls.length; i++) {\n if (controls[i]['isPropertyDisabled'](name)) {\n return true;\n }\n }\n return false;\n };\n }\n static getPath(controls) {\n return (name) => {\n var result = '';\n for (var i = 0; i < controls.length; i++) {\n var currentPath = controls[i].getPath(name);\n if (i === 0) {\n result = currentPath;\n }\n else if (result !== currentPath) {\n result = '';\n break;\n }\n }\n return result;\n };\n }\n static isPropertyVisible(controls) {\n return (name) => {\n for (var i = 0; i < controls.length; i++) {\n if (!controls[i]['isPropertyVisible'](name)) {\n return false;\n }\n }\n return true;\n };\n }\n static mergeProperty(controls, propertyName, undoEngine, customMerge) {\n var property = controls[0][propertyName];\n var combinedObj = null;\n var subscriptions = null;\n if (controls.filter(x => !!x[propertyName]).length === controls.length) {\n combinedObj = customMerge && customMerge(propertyName, controls, undoEngine);\n if (!combinedObj) {\n if (ko.isObservable(property) && !property['push']) {\n if (!controls.every(control => ko.isObservable(control[propertyName])))\n return combinedObj;\n var combinedObservable = ko.observable(controls.every((control) => { return controls[0][propertyName].peek() === control[propertyName].peek(); }) ? controls[0][propertyName].peek() : null);\n combinedObj = {\n result: combinedObservable,\n subscriptions: [combinedObservable.subscribe((newVal) => {\n undoEngine && undoEngine().start();\n controls.forEach(control => { control[propertyName](newVal); });\n undoEngine && undoEngine().end();\n })]\n };\n }\n else if (typeof property === 'object' && !$.isArray(property)) {\n combinedObj = this._merge(controls.map(x => x[propertyName]), undoEngine, customMerge);\n }\n }\n }\n return combinedObj;\n }\n static _createProperty(result, propertyName, propertyValue) {\n if (propertyValue) {\n if (typeof propertyValue === 'object' && isEmptyObject(propertyValue))\n return;\n result[propertyName] = propertyValue;\n }\n }\n static _merge(controls, undoEngine, customMerge, ignoreProperties) {\n var result = {};\n var subscriptions = [];\n ['getInfo', 'isPropertyVisible', 'isPropertyDisabled', 'getPath'].forEach((propertyName) => {\n if (controls[0][propertyName])\n this._createProperty(result, propertyName, this[propertyName](controls));\n });\n if (ignoreProperties) {\n var oldPropertyDisabled = result['isPropertyDisabled'];\n result['isPropertyDisabled'] = (name) => {\n return (oldPropertyDisabled && oldPropertyDisabled(name)) || ignoreProperties.indexOf(name) !== -1;\n };\n }\n if (result && result['getInfo']) {\n result['getInfo']().map(x => x.propertyName).forEach((propertyName) => {\n var combinedObj = this.mergeProperty(controls, propertyName, undoEngine, customMerge);\n if (combinedObj) {\n subscriptions = [].concat.apply(subscriptions, combinedObj.subscriptions);\n this._createProperty(result, propertyName, combinedObj.result);\n }\n });\n }\n else {\n Object.keys(controls[0]).forEach((propertyName) => {\n var combinedObj = this.mergeProperty(controls, propertyName, undoEngine, customMerge);\n if (combinedObj) {\n subscriptions = [].concat.apply(subscriptions, combinedObj.subscriptions);\n this._createProperty(result, propertyName, combinedObj.result);\n }\n });\n }\n return { result, subscriptions };\n }\n static mergeControls(controls, undoEngine, customMerge, ignoreProperties) {\n var combinedObj = this._merge(controls, undoEngine, customMerge, ignoreProperties);\n return {\n result: extend(combinedObj.result, { controlType: 'multiselect', displayName: ko.observable('') }),\n subscriptions: combinedObj.subscriptions\n };\n }\n static getEditableObject(selectionProvider, undoEngine, customMerge) {\n var editableObject = ko.observable(null);\n var subscriptions = [];\n var subscription = selectionProvider.focused.subscribe((newVal) => {\n editableObject(newVal && newVal.getControlModel());\n });\n if (selectionProvider._disposables) {\n selectionProvider._disposables.push(subscription);\n selectionProvider._disposables.push({\n dispose: () => {\n subscriptions.forEach(x => x.dispose());\n subscriptions.splice(0);\n }\n });\n }\n return ko.pureComputed({\n read: () => {\n subscriptions.forEach(x => x.dispose());\n subscriptions = [];\n if (selectionProvider.selectedItems.length > 1) {\n var combinedObj = this.mergeControls(selectionProvider.selectedItems.map((item) => { return item.getControlModel(); }), undoEngine, customMerge, selectionProvider.ignoreMultiSelectProperties);\n subscriptions = combinedObj.subscriptions;\n return combinedObj.result;\n }\n else {\n return editableObject();\n }\n },\n write: (val) => {\n if (val && val.surface) {\n selectionProvider.focused(val.surface);\n }\n else {\n selectionProvider.updateSelection(null);\n editableObject(val);\n }\n }\n }).extend({ deferred: true });\n }\n}\n","/**\r\n* DevExpress Analytics (core\\selection\\_selection.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { Disposable } from '../../serializer/utils';\nimport { blur } from '../internal/_utils';\nexport class SurfaceSelection extends Disposable {\n constructor(ignoreMultiSelectProperties = ['name']) {\n super();\n this.ignoreMultiSelectProperties = ignoreMultiSelectProperties;\n this._focused = ko.observable(null);\n this._selectedControls = ko.observableArray();\n this._selectedControlsInner = [];\n this.focused = ko.pureComputed({\n read: () => {\n return this._focused();\n },\n write: (val) => {\n if (val !== this._focused()) {\n if (!!val) {\n this._firstSelected = val;\n }\n this.updateSelection(this._firstSelected);\n }\n }\n });\n this.dropTarget = null;\n this.expectClick = false;\n this.disabled = ko.observable(false);\n this._disposables.push(this.focused);\n }\n dispose() {\n this.reset();\n super.dispose();\n }\n _removeFromSelection(control) {\n control.focused(false);\n control.selected(false);\n if (this._selectedControlsInner.indexOf(control) !== -1) {\n this._selectedControlsInner.splice(this._selectedControlsInner.indexOf(control), 1);\n }\n }\n _setFocused(control) {\n if (this._focused()) {\n this._removeFromSelection(this._focused());\n }\n this._focused(control);\n if (control) {\n control.focused(true);\n if (this._selectedControlsInner.indexOf(control) === -1) {\n this._selectedControlsInner.push(control);\n }\n control.selected(true);\n }\n }\n _resetTabPanelFocus() {\n var isTabPanelFocused = document.activeElement && $.fn.constructor(document.activeElement).closest('.dxrd-surface').length === 0;\n if (isTabPanelFocused) {\n blur(document.activeElement);\n }\n }\n get selectedItems() {\n return this._selectedControls();\n }\n clear() {\n this.focused(null);\n this._selectedControls([]);\n }\n reset() {\n this._focused(null);\n this._selectedControlsInner.splice(0);\n this._firstSelected = null;\n this._selectedControls([]);\n }\n applySelection() {\n this._selectedControls(this._selectedControlsInner);\n }\n selectItems(items) {\n this._selectedControlsInner = items;\n this._selectedControlsInner.forEach((selectedControl) => {\n if (!selectedControl.focused()) {\n selectedControl.selected(true);\n }\n });\n this.applySelection();\n }\n updateSelection(control) {\n this._selectedControlsInner.forEach((selectedControl) => {\n selectedControl.focused(false);\n selectedControl.selected(false);\n });\n this._selectedControlsInner = [];\n this._setFocused(control);\n this.applySelection();\n }\n swapFocusedItem(control) {\n if (this._focused() !== control) {\n this._focused().focused(false);\n this._focused(control);\n this._focused().focused(true);\n }\n }\n initialize(control) {\n control = control || this.dropTarget;\n this._firstSelected = !!(control && control['focused']) ? control : null;\n this.updateSelection(this._firstSelected);\n }\n clickHandler(control, event = { ctrlKey: false, metaKey: false }) {\n if (this.expectClick) {\n this.expectClick = false;\n return;\n }\n control = control || this.dropTarget;\n if (!event.ctrlKey && !event.metaKey) {\n if (this._selectedControlsInner.length > 1 && this._selectedControlsInner.indexOf(control) !== -1) {\n this.swapFocusedItem(control);\n }\n else {\n if (this._focused() !== control) {\n this.initialize(control);\n }\n }\n }\n else {\n this.selectionWithCtrl(control);\n this.applySelection();\n }\n this._resetTabPanelFocus();\n }\n selecting(event) {\n if (!this._focused()) {\n this._setFocused(event.control);\n }\n else {\n event.cancel = !event.control.checkParent(this._firstSelected);\n if (!event.cancel) {\n if (this._firstSelected && this._firstSelected.focused()) {\n this._setFocused(event.control);\n }\n else if (this._selectedControlsInner.indexOf(event.control) === -1) {\n event.control.selected(true);\n this._selectedControlsInner.push(event.control);\n }\n }\n }\n }\n unselecting(control) {\n if (this._focused() === control) {\n this._setFocused(null);\n if (this._selectedControlsInner.length === 0) {\n this._setFocused(this._firstSelected);\n }\n else {\n this._setFocused(this._selectedControlsInner[0]);\n }\n }\n else {\n this._removeFromSelection(control);\n }\n }\n selectionWithCtrl(control) {\n if (control && control.allowMultiselect) {\n var selectedControls = this._selectedControlsInner;\n if (selectedControls.length === 0 || (selectedControls.length === 1 && (!selectedControls[0].allowMultiselect))) {\n this.initialize(control);\n }\n else {\n if (this._selectedControlsInner.indexOf(control) === -1) {\n control.selected(true);\n this._selectedControlsInner.push(control);\n }\n else {\n if (this._selectedControlsInner.length > 1) {\n this.unselecting(control);\n }\n }\n }\n }\n }\n}\n","/**\r\n* DevExpress Analytics (core\\selection\\_selectionHelpers.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { UndoEngine } from '../../undo-engine/undoengine';\nexport function deleteSelection(selection, selectedObject) {\n var focused = selection.focused();\n if (!selectedObject) {\n selectedObject = focused.getControlModel();\n selection.selectedItems.forEach((item) => {\n var itemModel = item.getControlModel(), parent = itemModel.parentModel();\n if (!item.getControlModel().getMetaData().isDeleteDeny && parent && item !== focused) {\n parent.removeChild(itemModel);\n }\n });\n }\n var undo = UndoEngine.tryGetUndoEngine(selectedObject.parentModel());\n undo && undo.start();\n selectedObject.parentModel().removeChild(selectedObject);\n undo && undo.end();\n selection.focused(focused.findNextSelection());\n}\n","/**\r\n* DevExpress Analytics (core\\snapLines\\_snapLineSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport class SnapLineSurface {\n constructor() {\n this._position = ko.observable(SnapLineSurface._blankPosition);\n }\n transform() {\n var position = this._position();\n return 'matrix(' + position.width + ', 0, 0, ' + position.height + ', ' + position.left + ', ' + position.top + ')';\n }\n updatePosition(position) {\n this._position(position);\n }\n reset() {\n this.updatePosition(SnapLineSurface._blankPosition);\n }\n}\nSnapLineSurface._blankPosition = { top: 0, left: 0, width: 0, height: 0, };\n","/**\r\n* DevExpress Analytics (core\\snapLines\\_snapLinesCollector.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { binaryIndexOf } from '../utils/_arrayutils';\nexport class SnapLinesCollector {\n constructor() {\n this._verticalSnapLines = [];\n this._horizontalSnapLines = [];\n this._snapTargetToIgnore = null;\n }\n _appendSnapLine(position, limitInf, limitSup, snapLines) {\n var line = {\n position: position,\n limitInf: limitInf,\n limSup: limitSup\n };\n var index = binaryIndexOf(snapLines, line, (a, b) => a.position - b.position);\n if (index > -1) {\n snapLines[index].limitInf = Math.min(snapLines[index].limitInf, limitInf);\n snapLines[index].limSup = Math.max(snapLines[index].limSup, limitSup);\n }\n else {\n snapLines.splice(~index, 0, line);\n }\n }\n _collectSnaplines(parent, parentAbsoluteProsition) {\n this._enumerateCollection(parent, parentAbsoluteProsition, (item, itemAbsoluteRect) => {\n if (item !== this._snapTargetToIgnore) {\n this._appendSnapLine(itemAbsoluteRect.left, itemAbsoluteRect.top, itemAbsoluteRect.bottom, this._verticalSnapLines);\n this._appendSnapLine(itemAbsoluteRect.right, itemAbsoluteRect.top, itemAbsoluteRect.bottom, this._verticalSnapLines);\n this._appendSnapLine(itemAbsoluteRect.top, itemAbsoluteRect.left, itemAbsoluteRect.right, this._horizontalSnapLines);\n this._appendSnapLine(itemAbsoluteRect.bottom, itemAbsoluteRect.left, itemAbsoluteRect.right, this._horizontalSnapLines);\n this._collectSnaplines(item, itemAbsoluteRect);\n }\n });\n }\n _getCollection(parent) {\n return parent['controls'] && parent['controls']();\n }\n _enumerateCollection(parent, parentAbsoluteProsition, callback) {\n var collection = this._getCollection(parent);\n if (!collection)\n return;\n for (var i = 0; i < collection.length; i++) {\n var itemRect = collection[i].rect && collection[i].rect();\n if (itemRect) {\n callback(collection[i], {\n top: itemRect.top + parentAbsoluteProsition.top,\n bottom: itemRect.bottom + parentAbsoluteProsition.top,\n left: itemRect.left + parentAbsoluteProsition.left,\n right: itemRect.right + parentAbsoluteProsition.left\n });\n }\n }\n }\n collectSnaplines(root, snapTargetToIgnore) {\n this._snapTargetToIgnore = snapTargetToIgnore;\n this._verticalSnapLines.splice(0);\n this._horizontalSnapLines.splice(0);\n this._collectSnaplines(root, { top: 0, left: 0 });\n return {\n vertical: this._verticalSnapLines,\n horizontal: this._horizontalSnapLines\n };\n }\n}\n","/**\r\n* DevExpress Analytics (core\\snapLines\\_snapLinesHelper.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { SnapLinesCollector } from './_snapLinesCollector';\nimport { SnapLineSurface } from './_snapLineSurface';\nimport { binaryIndexOf } from '../utils/_arrayutils';\nexport class SnapLinesHelper {\n constructor(surface = null, snapTolerance = SnapLinesHelper.snapTolerance, snapLinesCollector = new SnapLinesCollector()) {\n this.snapLineSurfaces = [new SnapLineSurface(), new SnapLineSurface(), new SnapLineSurface(), new SnapLineSurface()];\n this.verticalSnapLines = [];\n this.horizontalSnapLines = [];\n this._surfaceContext = surface;\n this._snapTolerance = snapTolerance;\n this._snapLinesCollector = snapLinesCollector;\n }\n _findClosestSnapLine(position, snapLines) {\n var line = {\n position: position,\n limitInf: 0,\n limSup: 0\n };\n var index = binaryIndexOf(snapLines, line, (a, b) => a.position - b.position);\n var snapLineCandidate;\n if (index > -1) {\n snapLineCandidate = {\n snapLine: snapLines[index],\n distance: position - snapLines[index].position\n };\n }\n else {\n index = ~index;\n var delta1 = snapLines[index] ? (position - snapLines[index].position) : Number.MAX_VALUE;\n var delta2 = snapLines[index - 1] ? (position - snapLines[index - 1].position) : Number.MAX_VALUE;\n snapLineCandidate = Math.abs(delta1) > Math.abs(delta2) ?\n { snapLine: snapLines[index - 1], distance: delta2 } :\n { snapLine: snapLines[index], distance: delta1 };\n }\n return snapLineCandidate;\n }\n _getActiveSnapLines(position1, position2, snapLines) {\n var line1 = this._findClosestSnapLine(position1, snapLines);\n var line2 = this._findClosestSnapLine(position2, snapLines);\n var result = {\n lines: [],\n distance: 0\n };\n if (Math.abs(line1.distance - line2.distance) >= 1) {\n var line = Math.abs(line1.distance) < Math.abs(line2.distance) ? line1 : line2;\n if (Math.abs(line.distance) <= this._snapTolerance) {\n result.lines = [line];\n result.distance = line.distance;\n }\n }\n else if (Math.abs(line1.distance) <= this._snapTolerance) {\n result.lines = [line1, line2];\n result.distance = line1.distance;\n }\n return result;\n }\n updateSnapLines(snapTargetToIgnore = null) {\n this.verticalSnapLines.splice(0);\n this.horizontalSnapLines.splice(0);\n var result = this._snapLinesCollector.collectSnaplines(this._surfaceContext(), snapTargetToIgnore);\n this.verticalSnapLines.push.apply(this.verticalSnapLines, result.vertical);\n this.horizontalSnapLines.push.apply(this.horizontalSnapLines, result.horizontal);\n }\n deactivateSnapLines() {\n this.snapLineSurfaces[0].reset();\n this.snapLineSurfaces[1].reset();\n this.snapLineSurfaces[2].reset();\n this.snapLineSurfaces[3].reset();\n }\n activateSnapLines(position) {\n var vertical = this._getActiveSnapLines(position.left, position.right, this.verticalSnapLines);\n var horizontal = this._getActiveSnapLines(position.top, position.bottom, this.horizontalSnapLines);\n for (var i = 0; i < 2; i++) {\n var line = vertical.lines[i];\n if (!line) {\n this.snapLineSurfaces[i].reset();\n }\n else {\n var top = Math.min(line.snapLine.limitInf, position.top);\n var bottom = Math.max(line.snapLine.limSup, position.bottom);\n if (position.top < line.snapLine.limitInf) {\n top -= horizontal.distance;\n }\n if (position.bottom > line.snapLine.limSup) {\n bottom -= horizontal.distance;\n }\n this.snapLineSurfaces[i].updatePosition({\n top: top,\n left: line.snapLine.position,\n height: bottom - top,\n width: 1\n });\n }\n }\n for (var i = 0; i < 2; i++) {\n var line = horizontal.lines[i];\n if (!line) {\n this.snapLineSurfaces[i + 2].reset();\n }\n else {\n var left = Math.min(line.snapLine.limitInf, position.left);\n var right = Math.max(line.snapLine.limSup, position.right);\n if (position.left < line.snapLine.limitInf) {\n left -= vertical.distance;\n }\n if (position.right > line.snapLine.limSup) {\n right -= vertical.distance;\n }\n this.snapLineSurfaces[i + 2].updatePosition({\n top: line.snapLine.position,\n left: left,\n width: right - left,\n height: 1\n });\n }\n }\n return {\n left: vertical.distance,\n top: horizontal.distance\n };\n }\n snapPosition(position, horizontal) {\n var line = this._findClosestSnapLine(position, horizontal ? this.horizontalSnapLines : this.verticalSnapLines);\n return (line && Math.abs(line.distance) <= this._snapTolerance) ? line.snapLine.position : position;\n }\n}\nSnapLinesHelper.snapTolerance = 10;\n","/**\r\n* DevExpress Analytics (core\\tools\\_actionList.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { Disposable } from '../../serializer/utils';\nimport { KeyboardHelper } from './_keyboardHelper';\nimport { CopyPasteHandler } from './_copyPaste';\nimport { ActionId } from './actionId';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nimport { deleteSelection } from '../selection/_selectionHelpers';\nimport { parseZoom } from '../utils/_utils';\nexport class ActionListsBase extends Disposable {\n constructor(enabled) {\n super();\n this.toolbarItems = [];\n this.enabled = enabled || ko.observable(true);\n }\n processShortcut(actions, e) {\n for (var i = 0; i < actions.length; i++) {\n if (actions[i].hotKey && (actions[i].disabled && !actions[i].disabled() || !actions[i].disabled) && ($.isFunction(actions[i].visible) ? actions[i].visible() : actions[i].visible)) {\n if (actions[i].hotKey.ctrlKey === e.ctrlKey && actions[i].hotKey.keyCode === e.keyCode) {\n actions[i].clickAction();\n e.preventDefault();\n }\n }\n }\n }\n shouldIgnoreProcessing(e) {\n if (e.altKey || !this.enabled.peek())\n return true;\n var activeElement = $.fn.constructor(document.activeElement);\n if (activeElement.is('textarea') || activeElement.is(':input') && (['password', 'text', 'number'].indexOf(activeElement.attr('type')) != -1)) {\n return true;\n }\n return false;\n }\n}\nexport class ActionLists extends ActionListsBase {\n constructor(surfaceContext, selection, undoEngine, customizeActions, enabled, copyPasteStrategy, zoomStep = ko.observable(0.01), isLocked = (item) => false) {\n super(enabled);\n this.menuItems = [];\n var copyPasteHandler = new CopyPasteHandler(selection, copyPasteStrategy), actions = [];\n if (selection) {\n var selectionControlsLocked = ko.computed(() => {\n return selection.selectedItems.some(item => item.locked || isLocked(item));\n });\n this._disposables.push(selectionControlsLocked);\n this._keyboardHelper = new KeyboardHelper(selection, undoEngine);\n actions.push({\n id: ActionId.Cut,\n text: 'Cut',\n displayText: () => getLocalization('Cut', 'AnalyticsCoreStringId.EditCut'),\n imageClassName: 'dxrd-image-cut',\n imageTemplateName: 'dxrd-svg-toolbar-cut',\n disabled: ko.pureComputed(() => {\n return !surfaceContext() || !copyPasteHandler.canCopy() || selectionControlsLocked();\n }),\n visible: true,\n clickAction: () => {\n undoEngine().start();\n copyPasteHandler.cut();\n undoEngine().end();\n },\n hotKey: { ctrlKey: true, keyCode: 'X'.charCodeAt(0) }\n });\n actions.push({\n id: ActionId.Copy,\n text: 'Copy',\n displayText: () => getLocalization('Copy', 'AnalyticsCoreStringId.Cmd_Copy'),\n imageClassName: 'dxrd-image-copy',\n imageTemplateName: 'dxrd-svg-toolbar-copy',\n disabled: ko.pureComputed(() => {\n return !surfaceContext() || !copyPasteHandler.canCopy() || selectionControlsLocked();\n }),\n visible: true,\n clickAction: () => {\n copyPasteHandler.copy();\n },\n hotKey: { ctrlKey: true, keyCode: 'C'.charCodeAt(0) }\n });\n actions.push({\n id: ActionId.Paste,\n text: 'Paste',\n displayText: () => getLocalization('Paste', 'AnalyticsCoreStringId.Cmd_Paste'),\n imageClassName: 'dxrd-image-paste',\n imageTemplateName: 'dxrd-svg-toolbar-paste',\n disabled: ko.pureComputed(() => {\n return !surfaceContext() || !copyPasteHandler.canPaste() || selectionControlsLocked();\n }),\n visible: true,\n clickAction: () => {\n undoEngine().start();\n copyPasteHandler.paste();\n undoEngine().end();\n },\n hotKey: { ctrlKey: true, keyCode: 'V'.charCodeAt(0) }\n });\n actions.push({\n id: ActionId.Delete,\n text: 'Delete',\n displayText: () => getLocalization('Delete', 'AnalyticsCoreStringId.Cmd_Delete'),\n imageClassName: 'dxrd-image-delete',\n imageTemplateName: 'dxrd-svg-toolbar-delete',\n disabled: ko.pureComputed(() => {\n if (selection.focused()) {\n return selection.focused().getControlModel().getMetaData().isDeleteDeny || selectionControlsLocked();\n }\n else {\n return true;\n }\n }),\n visible: true,\n hotKey: { ctrlKey: false, keyCode: 46 },\n clickAction: () => {\n undoEngine().start();\n deleteSelection(selection);\n undoEngine().end();\n }\n });\n }\n actions.push({\n id: ActionId.Undo,\n text: 'Undo',\n displayText: () => getLocalization('Undo', 'AnalyticsCoreStringId.Undo'),\n imageClassName: 'dxrd-image-undo',\n imageTemplateName: 'dxrd-svg-toolbar-undo',\n disabled: ko.pureComputed(() => { return !surfaceContext() || !undoEngine() || (undoEngine() && !undoEngine().undoEnabled()); }),\n visible: true,\n clickAction: () => {\n undoEngine().undo();\n },\n hotKey: { ctrlKey: true, keyCode: 'Z'.charCodeAt(0) },\n hasSeparator: true\n });\n actions.push({\n id: ActionId.Redo,\n text: 'Redo',\n displayText: () => getLocalization('Redo', 'AnalyticsCoreStringId.Redo'),\n imageClassName: 'dxrd-image-redo',\n imageTemplateName: 'dxrd-svg-toolbar-redo',\n disabled: ko.pureComputed(() => { return !surfaceContext() || !undoEngine() || (undoEngine() && !undoEngine().redoEnabled()); }),\n visible: true,\n clickAction: () => {\n undoEngine().redo();\n },\n hotKey: { ctrlKey: true, keyCode: 'Y'.charCodeAt(0) }\n });\n actions.push({\n id: ActionId.ZoomOut,\n text: 'Zoom Out',\n displayText: () => getLocalization('Zoom Out', 'AnalyticsCoreStringId.ZoomOut'),\n imageClassName: 'dxrd-image-zoomout',\n imageTemplateName: 'dxrd-svg-toolbar-zoomout',\n disabled: ko.pureComputed(() => {\n return !surfaceContext();\n }),\n visible: true,\n hotKey: { ctrlKey: true, keyCode: 109 },\n zoomStep: zoomStep,\n clickAction: () => {\n surfaceContext().zoom(Math.max(surfaceContext().zoom() - zoomStep(), 0.01));\n },\n hasSeparator: true\n });\n actions.push({\n id: ActionId.ZoomSelector,\n text: 'Zoom 100%',\n displayText: () => getLocalization('Zoom 100%'),\n imageClassName: 'dxrd-image-zoom',\n disabled: ko.pureComputed(() => {\n return !surfaceContext();\n }),\n visible: true,\n hotKey: { ctrlKey: true, keyCode: 187 },\n clickAction: () => {\n surfaceContext().zoom(1);\n },\n templateName: 'dxrd-zoom-select-template',\n zoomLevels: ko.observableArray([5, 2, 1.5, 1, 0.75, 0.5, 0.25]),\n zoom: ko.pureComputed({\n read: () => { return surfaceContext() && surfaceContext().zoom(); },\n write: (val) => { surfaceContext().zoom(val); }\n }),\n onCustomItemCreating: (e) => {\n e.customItem = parseZoom(e.text);\n }\n });\n actions.push({\n id: ActionId.ZoomIn,\n text: 'Zoom In',\n displayText: () => getLocalization('Zoom In', 'AnalyticsCoreStringId.ZoomIn'),\n imageClassName: 'dxrd-image-zoomin',\n imageTemplateName: 'dxrd-svg-toolbar-zoomin',\n disabled: ko.pureComputed(() => {\n return !surfaceContext();\n }),\n visible: true,\n hotKey: { ctrlKey: true, keyCode: 107 },\n zoomStep: zoomStep,\n clickAction: () => {\n surfaceContext().zoom(surfaceContext().zoom() + zoomStep());\n }\n });\n if (customizeActions) {\n customizeActions(actions);\n }\n actions.forEach((action) => {\n Object.keys(action).forEach((name) => {\n if (ko.isComputed(action[name])) {\n this._disposables.push(action[name]);\n }\n });\n this._registerAction(action['container'] === 'menu' ? this.menuItems : ko.unwrap(this.toolbarItems), action);\n });\n }\n _registerAction(container, action) {\n if (action['index']) {\n container.splice(action['index'], 0, action);\n }\n else {\n container.push(action);\n }\n }\n processShortcut(actions, e) {\n if (this.shouldIgnoreProcessing(e)) {\n return;\n }\n if (!this._keyboardHelper.processShortcut(e)) {\n super.processShortcut(actions, e);\n }\n else {\n e.preventDefault();\n }\n }\n}\n","/**\r\n* DevExpress Analytics (core\\tools\\_copyPaste.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { Point } from '../elements/point';\nimport { ModelSerializer } from '../../serializer/serializer';\nimport { findSurface } from '../internal/_surfaceHelpers';\nexport var copyPasteStrategy = {\n createChild: (pasteTarget, info) => {\n return pasteTarget.createChild(info);\n },\n calculateDelta: (selection, pasteTargetSurface, minPoint) => {\n return {\n x: selection.rect().left - minPoint.x(),\n y: selection.rect().top - minPoint.y()\n };\n },\n canPaste: (pasteTarget, info) => true\n};\nexport class CopyPasteHandler {\n constructor(selectionProvider, _copyPasteStrategy = copyPasteStrategy) {\n this._copyPasteStrategy = _copyPasteStrategy;\n this._copyInfo = ko.observable(null);\n this.hasPasteInfo = ko.pureComputed(() => { return this._copyInfo() !== null; });\n this._selectionProvider = selectionProvider;\n }\n canCopy() {\n return this._selectionProvider.focused() !== null && !this._selectionProvider.focused().getControlModel().getMetaData().isCopyDeny;\n }\n canPaste() {\n var pasteTargetSurface = this._selectionProvider.focused();\n return pasteTargetSurface !== null\n && this.hasPasteInfo()\n && pasteTargetSurface.canDrop()\n && (!this._copyPasteStrategy.canPaste || this._copyPasteStrategy.canPaste(pasteTargetSurface.getControlModel(), this._copyInfo()))\n && !pasteTargetSurface.getControlModel().getMetaData().isPasteDeny;\n }\n copy() {\n if (this.canCopy()) {\n var serializer = new ModelSerializer(), copyInfo = {\n focused: this._selectionProvider.focused(),\n objects: $.map(this._selectionProvider.selectedItems, (item) => {\n return serializer.serialize(item.getControlModel());\n })\n };\n this._copyInfo(copyInfo);\n }\n }\n cut() {\n var serializer = new ModelSerializer(), focused = this._selectionProvider.focused(), objects = [];\n this._selectionProvider.selectedItems.forEach(item => {\n var control = item.getControlModel();\n control.parentModel().removeChild(control);\n objects.push(serializer.serialize(control));\n if (this._copyPasteStrategy.createSelfRestoringItems)\n objects.push(...this._copyPasteStrategy.createSelfRestoringItems(control, serializer));\n });\n var cutInfo = {\n focused: focused,\n objects: objects\n };\n this._copyInfo(cutInfo);\n }\n paste() {\n if (this.canPaste()) {\n var pasteTargetSurface = this._selectionProvider.focused(), pasteTarget = pasteTargetSurface.getControlModel(), newSelection = [];\n if (pasteTargetSurface === this._copyInfo().focused) {\n pasteTargetSurface = pasteTargetSurface.parent;\n pasteTarget = pasteTargetSurface.getControlModel();\n }\n if (!pasteTarget.getMetaData().isContainer) {\n pasteTargetSurface = pasteTargetSurface.parent;\n pasteTarget = pasteTargetSurface.getControlModel();\n }\n var minPoint = new Point(Number.MAX_VALUE, Number.MAX_VALUE), maxPoint = new Point(-1, -1);\n for (var i = 0; i < this._copyInfo().objects.length; i++) {\n var newControl = this._copyPasteStrategy.createChild(pasteTarget, this._copyInfo().objects[i]);\n var newControlSurface = findSurface(newControl);\n if (!newControlSurface)\n continue;\n var posMin = new Point(newControlSurface.rect().left, newControlSurface.rect().top);\n var posMax = new Point(newControlSurface.rect().left + newControlSurface.rect().width, newControlSurface.rect().top + newControlSurface.rect().height);\n if (minPoint.x() >= posMin.x())\n minPoint.x(posMin.x());\n if (maxPoint.x() <= posMax.x())\n maxPoint.x(posMax.x());\n if (minPoint.y() >= posMin.y())\n minPoint.y(posMin.y());\n if (maxPoint.y() <= posMax.y())\n maxPoint.y(posMax.y());\n newSelection.push(newControlSurface);\n }\n var newOriginPoint = new Point(((pasteTargetSurface.rect().width - pasteTargetSurface['_context'].margins.right()) / 2) - ((maxPoint.x() - minPoint.x()) / 2) + (pasteTargetSurface['rtlLayout']() ? pasteTargetSurface['_context'].margins.right() : 0), (pasteTargetSurface.rect().height / 2) - ((maxPoint.y() - minPoint.y()) / 2));\n for (var i = 0; i < newSelection.length; i++) {\n var delta = this._copyPasteStrategy.calculateDelta(newSelection[i], pasteTargetSurface, minPoint);\n newSelection[i].rect({ left: newOriginPoint.x() + delta.x, top: newOriginPoint.y() + delta.y });\n }\n this._selectionProvider.initialize();\n newSelection.forEach(newControlSurface => {\n this._selectionProvider.selecting({ control: newControlSurface, cancel: false });\n });\n }\n }\n}\n","/**\r\n* DevExpress Analytics (core\\tools\\_keyboardHelper.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport { addDisposeCallback } from '../../serializer/_internal';\nimport { Disposable } from '../../serializer/utils';\nimport { KeyboardCodesEnum } from '../../property-grid/widgets/internal/_utils';\nexport class KeyboardHelperBase extends Disposable {\n _processShortcut(map, e, index) {\n var method = map[KeyboardCodesEnum[e.keyCode]];\n if (method) {\n return method(e, index);\n }\n return false;\n }\n processShortcut(e, index) {\n return this._processShortcut(this.shortcutMap, e, index);\n }\n processChildrenShortcut(e, index) {\n return this._processShortcut(this.childrenShortcutMap, e, index);\n }\n}\nexport class KeyboardHelper extends KeyboardHelperBase {\n constructor(selection, undoEngine) {\n super();\n this._selection = selection;\n this._undoEngine = undoEngine;\n this.shortcutMap = {\n Esc: (e) => { this.processEsc(); return true; },\n Left: (e) => { this.moveSelectedControls(true, true, -1); return true; },\n Up: (e) => { this.moveSelectedControls(true, false, -1); return true; },\n Right: (e) => { this.moveSelectedControls(false, true, 1); return true; },\n Down: (e) => { this.moveSelectedControls(false, false, 1); return true; }\n };\n }\n processEsc() {\n var parent = this._selection.focused() && this._selection.focused().parent;\n parent && this._selection.focused(parent);\n }\n moveSelectedControls(leftUp, isHoriz, sign) {\n var focusedControl = this._selection.focused();\n if (!focusedControl || focusedControl && focusedControl.getControlModel().getMetaData().isCopyDeny) {\n return;\n }\n this._undoEngine && this._undoEngine().start();\n var distance = 1, axisProperty = isHoriz ? 'left' : 'top', lengthProperty = isHoriz ? 'width' : 'height', minAxis, maxSide, newAxis;\n if (focusedControl.rect) {\n minAxis = focusedControl.rect()[axisProperty];\n maxSide = focusedControl.rect()[axisProperty] + focusedControl.rect()[lengthProperty];\n }\n else {\n return;\n }\n this._selection.selectedItems.filter((item) => { return !item.locked; }).forEach((item) => {\n var axis = item.rect()[axisProperty];\n if (axis < minAxis) {\n minAxis = axis;\n }\n });\n this._selection.selectedItems.filter((item) => { return !item.locked; }).forEach((item) => {\n var side = item.rect()[axisProperty] + item.rect()[lengthProperty];\n if (side > maxSide) {\n maxSide = side;\n }\n });\n if ((leftUp && minAxis <= 0) || (!focusedControl.parent.rect || (!leftUp && maxSide.toFixed(5) >= focusedControl.parent.rect()[lengthProperty]))) {\n return;\n }\n else {\n this._selection.selectedItems.filter((item) => { return !item.locked; })\n .filter((item) => { return !!item.rect; })\n .forEach((item) => {\n var newVal = {}, itemAxisProperty = item.rect()[axisProperty], itemLengthProperty = item.rect()[lengthProperty], parentLengthProperty = item.parent.rect()[lengthProperty];\n newAxis = itemAxisProperty + sign * distance;\n if ((leftUp && newAxis >= 0) || (!leftUp && (newAxis + itemLengthProperty) <= parentLengthProperty)) {\n newVal[axisProperty] = newAxis;\n }\n if (!leftUp && (newAxis + itemLengthProperty) > parentLengthProperty) {\n newVal[axisProperty] = parentLengthProperty - itemLengthProperty;\n }\n if (leftUp && newAxis < 0 && itemAxisProperty > 0) {\n newVal[axisProperty] = 0;\n }\n item.rect(newVal);\n });\n }\n this._undoEngine && this._undoEngine().end();\n }\n}\nexport class KeyDownHandlersManager {\n constructor(targetElement) {\n this._handlers = [];\n this._targetElement = targetElement;\n }\n get _activeHandler() {\n return this._handlers.length > 0 ? this._handlers[this._handlers.length - 1] : null;\n }\n _removeHandler(handler, eventName) {\n var index = this._handlers.indexOf(handler);\n if (index < 0)\n return;\n this._handlers.splice(index, 1);\n if (index === this._handlers.length) {\n this._targetElement.removeEventListener(eventName, handler);\n if (this._activeHandler)\n this._targetElement.addEventListener(eventName, this._activeHandler);\n }\n }\n bindHandler(element, handler, eventName = 'keydown') {\n if (this._activeHandler)\n this._targetElement.removeEventListener(eventName, this._activeHandler);\n var _handler = (e) => {\n if ($.fn.constructor(this._targetElement).closest('.dx-designer').length > 0 ||\n $.fn.constructor(e.target).closest('.dx-designer').length > 0 ||\n e.target === document.body)\n handler(e);\n };\n this._handlers.push(_handler);\n this._targetElement.addEventListener(eventName, _handler);\n addDisposeCallback(element, () => { this._removeHandler(_handler, eventName); });\n }\n}\n","/**\r\n* DevExpress Analytics (core\\tools\\actionId.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var ActionId = {\n Cut: 'dxd-cut',\n Copy: 'dxd-copy',\n Paste: 'dxd-paste',\n Delete: 'dxd-delete',\n Undo: 'dxd-undo',\n Redo: 'dxd-redo',\n ZoomOut: 'dxd-zoom-out',\n ZoomSelector: 'dxd-zoom-selector',\n ZoomIn: 'dxd-zoom-in',\n};\n","/**\r\n* DevExpress Analytics (core\\tools\\tabInfo.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { getLocalization } from '../../property-grid/localization/_localization';\nimport { SvgTemplatesEngine } from '../../property-grid/widgets/internal/_svgTemplateEngine';\nimport { Disposable } from '../../serializer/utils';\nexport class TabInfo extends Disposable {\n constructor(options) {\n super();\n this.active = ko.observable(false);\n this.visible = ko.observable();\n this.disabled = ko.observable();\n var imageBaseName = options.imageClassName || options.text.toLowerCase();\n this._text = options.text;\n this.name = options.text;\n this._localizationId = options.localizationId;\n this._disposables.push(this.imageClassName = ko.pureComputed(() => {\n return 'dxrd-image-' + imageBaseName;\n }));\n this.imageTemplateName = options.imageTemplateName || SvgTemplatesEngine.getExistingTemplate('dxrd-svg-tabs-' + options.text.toLowerCase());\n this.template = options.template;\n this._disposables.push(options.model, options.keyboardHelper);\n var computedVisible = options.visible;\n var computedDisabled = options.disabled;\n this._disposables.push(this.visible = ko.pureComputed(() => { return computedVisible !== undefined ? computedVisible() : true; }));\n this._disposables.push(this.disabled = ko.pureComputed(() => { return computedDisabled !== undefined ? computedDisabled() : false; }));\n this._disposables.push(this.visible.subscribe((visibility) => {\n if (!visibility) {\n this.active(false);\n }\n }));\n computedVisible && this._disposables.push(computedVisible);\n computedDisabled && this._disposables.push(computedDisabled);\n this.model = options.model;\n this.keyboardHelper = options.keyboardHelper;\n if (this.keyboardHelper)\n this._disposables.push(ko.computed(() => {\n if (this.active() && this.collapsed && !this.collapsed())\n this.focus();\n }).extend({ rateLimit: 0 }));\n }\n focus() {\n this.keyboardHelper && this.keyboardHelper.focus(document.getElementsByClassName('dxrd-tab-item dxd-state-active')[0]);\n }\n get text() {\n return getLocalization(this._text, this._localizationId);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\tools\\tabPanel.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../serializer/utils';\nimport { getResizableOptions } from '../utils/_utils';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nimport { extend } from '../../serializer/_utils';\nimport { accessibilityFontSizeZoomFactor } from '../../accessibility/_internal';\nimport { RightPanelKeyboardHelper } from '../../accessibility/_rightPanelKeyboardHelper';\nexport class TabPanel extends Disposable {\n constructor(options) {\n super();\n this.tabs = [];\n this.collapsed = ko.observable(false);\n this.position = ko.observable(TabPanel.Position.Right);\n this.toggleCollapsedText = ko.pureComputed(() => {\n var actionString = this.collapsed() ? 'Open' : 'Collapse';\n return getLocalization(actionString, 'ASPxReportsStringId.SidePanel_' + actionString);\n });\n this.cssClasses = (extendOptions) => {\n return extend({\n 'dxrd-tab-panel-left': this.position() === TabPanel.Position.Left,\n 'dxrd-tab-panel-right': this.position() === TabPanel.Position.Right,\n 'dxrd-tab-panel-empty': this.isEmpty()\n }, extendOptions);\n };\n var tabs = options.tabs;\n var autoSelectTab = options.autoSelectTab;\n if (options.rtl)\n this.position(TabPanel.Position.Left);\n var zoomFactor = accessibilityFontSizeZoomFactor();\n var _self = this;\n this.tabs = tabs;\n if (tabs && tabs.length) {\n this._disposables.push(this.isEmpty = ko.computed(() => this.tabs.every(tab => !tab.visible())));\n this.tabs.forEach(tab => {\n tab.collapsed = this.collapsed;\n });\n }\n else\n this.isEmpty = ko.observable(true);\n this._disposables.push(ko.computed(() => {\n var visibleTabs = tabs.filter((tab) => { return tab.visible(); });\n if (visibleTabs.length !== 0) {\n if (visibleTabs.filter((tab) => { return tab.active.peek(); }).length === 0) {\n visibleTabs[0].active(true);\n if (autoSelectTab) {\n this.collapsed(true);\n }\n }\n }\n else {\n this.collapsed(true);\n }\n }));\n this._disposables.push(ko.computed(() => {\n var disabledTabs = tabs.filter((tab) => { return tab.disabled(); });\n if (disabledTabs.length !== 0) {\n if (disabledTabs.filter((tab) => { return tab.active.peek(); }).length !== 0) {\n disabledTabs.forEach(t => t.active(false));\n var nextSelectedTab = tabs.filter((tab) => { return !tab.disabled.peek() && tab.visible.peek(); })[0];\n if (nextSelectedTab) {\n this.selectTab({ model: nextSelectedTab });\n }\n }\n }\n }));\n if (autoSelectTab) {\n this.tabs.forEach((tab) => {\n this._disposables.push(tab.active.subscribe((newVal) => {\n if (newVal) {\n this.selectTab({ model: tab });\n }\n }));\n });\n }\n this.toggleTabVisibility = (e) => {\n var selectedTab = e.model;\n var activeTab = this.tabs.filter((tab) => tab.active())[0];\n if (selectedTab === activeTab) {\n this.collapsed(!this.collapsed());\n }\n else {\n this.selectTab(e);\n }\n };\n this.selectTab = (e) => {\n var selectedTab = e.model;\n if (!selectedTab.disabled()) {\n this.tabs.forEach(function (tab) {\n tab.active(tab === selectedTab);\n });\n this.collapsed(false);\n }\n };\n var _width = ko.observable((options.width || 370) * zoomFactor);\n this._disposables.push(this.width = ko.pureComputed({\n read: () => { return this.collapsed() ? 0 : _width(); },\n write: (newWidth) => { _width(newWidth); }\n }));\n this._disposables.push(this.headerWidth = ko.pureComputed(() => { return this.isEmpty() ? 0 : (50 * zoomFactor + (this.collapsed() ? 0 : this.width())); }));\n this.getResizableOptions = ($element, panelOffset, minWidth) => {\n if (!this._resizableOptions || this._resizableOptions.$element !== $element) {\n this._resizableOptions = getResizableOptions($element, zoomFactor * panelOffset, minWidth, _self.position(), TabPanel.Position.Left, _self.width, _self.collapsed);\n _self._disposables.push(_self.position.subscribe((newVal) => {\n this._resizableOptions.handles(newVal === TabPanel.Position.Left ? 'e' : 'w');\n }));\n _self._disposables.push(_self.collapsed.subscribe((isCollapsed) => {\n this._resizableOptions.minimumWidth(isCollapsed ? 0 : minWidth);\n }));\n }\n return this._resizableOptions;\n };\n this._disposables.push({\n dispose: () => {\n this._resizableOptions = null;\n this.getResizableOptions = null;\n }\n });\n this._disposables.push(this.toggleCollapsedImage = ko.pureComputed(() => {\n var postfix = this.collapsed() ? '-expand' : '-collapse';\n return { class: 'dxrd-image-propertygrid' + postfix, template: 'dxrd-svg-tabs' + postfix };\n }));\n this.keyboardHelper = new RightPanelKeyboardHelper(this);\n this._disposables.push(this.toggleCollapsedText, this.keyboardHelper);\n }\n dispose() {\n super.dispose();\n this.disposeArray(this.tabs);\n }\n getTabByName(tabName) {\n return this.tabs.filter(x => x.name === tabName)[0];\n }\n}\nTabPanel.Position = {\n Left: 'Left',\n Right: 'Right'\n};\n","/**\r\n* DevExpress Analytics (core\\tools\\toolbox.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { getTypeNameFromFullName, getImageClassName } from '../internal/_getNameHelpers';\nimport { SvgTemplatesEngine } from '../../property-grid/widgets/internal/_svgTemplateEngine';\nexport class ToolboxItem {\n constructor(info) {\n this.disabled = ko.observable(false);\n this.info = info;\n }\n get type() {\n return getTypeNameFromFullName(this.info['@ControlType']);\n }\n get imageClassName() {\n return [getImageClassName(this.type), this.disabled() ? 'dxrd-disabled-button' : ''].join(' ');\n }\n get imageTemplateName() {\n var _a;\n var _templateName = getImageClassName(this.type, true);\n return (_a = SvgTemplatesEngine.getExistingTemplate(_templateName)) !== null && _a !== void 0 ? _a : SvgTemplatesEngine.getExistingTemplate('dxrd-svg-toolbox-unknown');\n }\n get index() {\n return this.info.index;\n }\n get displayName() {\n return this.info.displayName || this.type;\n }\n}\n","/**\r\n* DevExpress Analytics (core\\utils\\_arrayutils.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { knockoutArrayWrapper } from '../../serializer/_utils';\nexport function createObservableReverseArrayMapCollection(elementModels, target, createItem) {\n var array = target();\n elementModels.peek().forEach(item => {\n var surface = createItem(item);\n array.splice(0, 0, surface);\n });\n target.valueHasMutated();\n return elementModels.subscribe((args) => {\n var unwrapedTarget = target();\n var targetLength = unwrapedTarget.length;\n args.forEach((changeSet) => {\n if (changeSet.status === 'deleted') {\n unwrapedTarget.splice(unwrapedTarget.indexOf(changeSet.value.surface), 1);\n targetLength--;\n }\n });\n args.forEach((changeSet) => {\n if (changeSet.status === 'added') {\n unwrapedTarget.splice(targetLength - changeSet.index, 0, createItem(changeSet.value));\n targetLength++;\n }\n });\n target.valueHasMutated();\n }, null, 'arrayChange');\n}\nexport function createObservableArrayMapCollection(elementModels, target, createItem) {\n var array = target();\n elementModels.peek().forEach(item => {\n var surface = createItem(item);\n array.push(surface);\n });\n target.valueHasMutated();\n return elementModels.subscribe((args) => {\n var startIndex = target().length, deleteCount = 0, valuesToAdd = [];\n args.forEach((changeSet) => {\n if (changeSet.status === 'deleted') {\n deleteCount++;\n if (changeSet.index < startIndex) {\n startIndex = changeSet.index;\n }\n }\n });\n args.forEach((changeSet) => {\n if (changeSet.status === 'added') {\n if (changeSet.index < startIndex) {\n startIndex = changeSet.index;\n }\n valuesToAdd.push(createItem(changeSet.value));\n }\n });\n target.splice.apply(target, [startIndex, deleteCount].concat(valuesToAdd));\n }, null, 'arrayChange');\n}\nexport function deserializeChildArray(model, parent, creator) {\n var result = Object.keys(model || {}).map(propertyName => creator(model[propertyName]));\n return knockoutArrayWrapper(result, (array, event) => {\n if (event === 'beforeChange') {\n return;\n }\n if (event === 'arrayChange') {\n for (var i = 0; i < array.length; i++) {\n parent !== array[i].value.parentModel() && array[i].value.parentModel(parent);\n }\n }\n else {\n for (var i = 0; i < array.length; i++) {\n parent !== array[i].parentModel() && array[i].parentModel(parent);\n }\n }\n });\n}\nexport function getFirstItemByPropertyValue(array, propertyName, propertyValue, fromIndex) {\n var fromIndex = fromIndex || 0;\n for (var i = fromIndex; i < array.length; i++) {\n var value = ko.isObservable(array[i][propertyName]) ? array[i][propertyName].peek() : array[i][propertyName];\n if (value === propertyValue) {\n return array[i];\n }\n }\n return null;\n}\nexport function findFirstItemMatchesCondition(array, predicate) {\n for (var i = 0; i < array.length; i++) {\n if (predicate(array[i])) {\n return array[i];\n }\n }\n return null;\n}\nexport var find = findFirstItemMatchesCondition;\nexport function binaryIndexOf(ar, el, compare) {\n var m = 0;\n var n = ar.length - 1;\n while (m <= n) {\n var k = (n + m) >> 1;\n var cmp = compare(el, ar[k]);\n if (cmp > 0) {\n m = k + 1;\n }\n else if (cmp < 0) {\n n = k - 1;\n }\n else {\n return k;\n }\n }\n return ~m;\n}\nexport function compareArrays(array1, array2) {\n if (!array1 || !array2)\n return false;\n if (array1.length !== array2.length)\n return false;\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i])\n return false;\n }\n return true;\n}\n","/**\r\n* DevExpress Analytics (core\\utils\\_debug.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var DEBUG = false;\nexport function DebugMode(value) {\n DEBUG = value;\n}\n","/**\r\n* DevExpress Analytics (core\\utils\\_designerCreator.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { ObjectProperties } from '../../property-grid/propertygrid';\nimport { Disposable } from '../../serializer/utils';\nimport { extend } from '../../serializer/_utils';\nimport { UndoEngine } from '../../undo-engine/undoengine';\nimport { DesignControlsHelper } from '../internal/_controlsHelper';\nimport { ControlsStore } from '../internal/_stores';\nimport { TabPanel } from '../tools/tabPanel';\nimport { ActionLists } from '../tools/_actionList';\nimport { ControlProperties } from '../widgets/propertygrid/_controlProperties';\nimport { collectGroupsFromFlatList, createActionWrappingFunction, generateDefaultParts } from './_utils';\nexport class DesignerContextGeneratorInternal {\n constructor(_context, _rtl) {\n this._context = _context;\n this._rtl = _rtl;\n }\n addElement(propertyName, model) {\n this._context[propertyName] = model;\n return this;\n }\n addUndoEngine(undoEngine = ko.observable(new UndoEngine(this._context.model))) {\n this._context.undoEngine = undoEngine;\n return this;\n }\n addSurface(surface) {\n this._context.surface = surface;\n return this;\n }\n getContext() {\n return this._context;\n }\n}\nexport class DesignerContextGenerator {\n constructor(_rtl) {\n this._rtl = _rtl;\n }\n addModel(model) {\n return new DesignerContextGeneratorInternal({ model: model }, this._rtl);\n }\n}\nexport class ResizeSettings extends Disposable {\n get handler() { return this._handler; }\n set handler(newVal) {\n this._disposables.push(newVal);\n this._handler = newVal;\n }\n generate() {\n var result = {};\n if (this.handler)\n result['resizeHandler'] = this.handler;\n return result;\n }\n}\nexport class ContextActionsSettings extends Disposable {\n _actionUndoEngineWrappingFunction(contextActions, undoEngine) {\n return createActionWrappingFunction('WrapWithUndoEngine', (model, handler) => {\n undoEngine().start();\n handler(model);\n undoEngine().end();\n })(contextActions);\n }\n _collectActions(editableObj, undoEngine) {\n var editable = editableObj(), contextActions = [];\n this.actionProviders.forEach(actionProvider => {\n contextActions.push.apply(contextActions, actionProvider.getActions(editable));\n });\n this._actionUndoEngineWrappingFunction(contextActions, undoEngine);\n return contextActions;\n }\n get actionProviders() {\n return this._actionProviders;\n }\n set actionProviders(val) {\n this._disposables.push.apply(this._disposables, val);\n this._actionProviders = val;\n }\n get actions() {\n return this._actions;\n }\n set actions(val) {\n this._disposables.push(val);\n this._actions = val;\n }\n get groupActions() {\n return this._groupActions;\n }\n set groupActions(val) {\n this._disposables.push(val);\n this._groupActions = val;\n }\n createDefaultActions(editableObj, undoEngine) {\n this.actions = ko.computed(() => {\n return this._collectActions(editableObj, undoEngine);\n });\n }\n createDefaultGroupAction(editableObj, undoEngine) {\n this.groupActions = ko.computed(() => {\n return collectGroupsFromFlatList(this._collectActions(editableObj, undoEngine), (x) => x.group && x.group());\n });\n }\n generate() {\n var result = {};\n if (this.actionProviders)\n result['contextActionProviders'] = this.actionProviders;\n if (this.actions)\n result['contextActions'] = this.actions;\n if (this.groupActions)\n result['contextGroupActions'] = this.groupActions;\n return result;\n }\n}\nexport class DragDropSettings extends Disposable {\n constructor() {\n super(...arguments);\n this._model = {};\n }\n get dragHelperContent() {\n return this._dragHelperContent;\n }\n set dragHelperContent(val) {\n this._disposables.push(val);\n this._dragHelperContent = val;\n }\n get dragDropStarted() {\n return this._dragDropStarted;\n }\n set dragDropStarted(val) {\n this._disposables.push(val);\n this._dragDropStarted = val;\n }\n addDragDropHandler(propertyName, handler) {\n this._disposables.push(handler);\n this._model[propertyName] = handler;\n }\n generate() {\n var result = this._model;\n if (this.dragHelperContent)\n result['dragHelperContent'] = this.dragHelperContent;\n if (this.dragDropStarted)\n result['dragDropStarted'] = this.dragDropStarted;\n return result;\n }\n}\nexport class ControlsHelperSettings extends Disposable {\n constructor(_selection, _context) {\n super();\n this._selection = _selection;\n this._context = _context;\n this._model = {};\n }\n generate() {\n var result = this._model;\n if (this.controlsHelper)\n result['controlsHelper'] = this.controlsHelper;\n return result;\n }\n addControlsHelper(helper) {\n this.controlsHelper = helper || new DesignControlsHelper(this._context.model, [{\n added: (control) => { },\n deleted: (control) => { control.surface === this._selection.focused() && this._selection.focused(control.surface.findNextSelection()); }\n }]);\n this._disposables.push(this.controlsHelper);\n return this;\n }\n addControlsStore(store) {\n store = store || new ControlsStore(this.controlsHelper.allControls);\n this._disposables.push(store);\n this._model['controlsStore'] = store;\n return this;\n }\n}\nexport class MenuSettings extends Disposable {\n constructor() {\n super(...arguments);\n this.stopPropagation = false;\n }\n generate() {\n var result = {};\n if (this.appMenuVisible)\n result['appMenuVisible'] = this.appMenuVisible;\n if (this.toggleAppMenu)\n result['toggleAppMenu'] = this.toggleAppMenu;\n if (this.getMenuPopupContainer)\n result['getMenuPopupContainer'] = this.getMenuPopupContainer;\n if (this.getMenuPopupTarget)\n result['getMenuPopupTarget'] = this.getMenuPopupTarget;\n result['stopPropagation'] = this.stopPropagation;\n return result;\n }\n get appMenuVisible() {\n return this._appMenuVisible;\n }\n set appMenuVisible(val) {\n this._disposables.push(val);\n this._appMenuVisible = val;\n }\n}\nexport class SelectionSettings extends Disposable {\n constructor() {\n super(...arguments);\n this._dragDropSettings = new DragDropSettings();\n this._resizeSettings = new ResizeSettings();\n }\n dispose() {\n this._editableObject(null);\n super.dispose();\n this.removeProperties();\n }\n get selection() {\n return this._selection;\n }\n set selection(val) {\n this._disposables.push(val);\n this._selection = val;\n }\n get snapHelper() {\n return this._snapHelper;\n }\n set snapHelper(val) {\n this._disposables.push(val);\n this._snapHelper = val;\n }\n get editableObject() {\n return this._editableObject;\n }\n set editableObject(val) {\n this._disposables.push(val);\n this._editableObject = val;\n }\n addDragDrop(func) {\n func(this._dragDropSettings);\n this._disposables.push(this._dragDropSettings);\n }\n addResize(func) {\n func(this._resizeSettings);\n this._disposables.push(this._resizeSettings);\n }\n generate() {\n var result = {};\n if (this.selection)\n result['selection'] = this.selection;\n if (this.snapHelper)\n result['snapHelper'] = this.snapHelper;\n if (this.editableObject)\n result['editableObject'] = this.editableObject;\n return extend(result, this._dragDropSettings.generate(), this._resizeSettings.generate());\n }\n}\nexport class CommonDesignerGenerator extends Disposable {\n constructor(_context, _rtl) {\n super();\n this._context = _context;\n this._rtl = _rtl;\n this._model = {};\n this._selectionSettings = new SelectionSettings();\n this._model.rtl = this._rtl;\n this._model.dispose = () => {\n this.dispose();\n };\n }\n _createPopularProperties(info, popularProperties) {\n var properties = [];\n popularProperties.forEach((name) => {\n var property = info.filter((propertyInfo) => { return propertyInfo.propertyName === name; })[0];\n if (property) {\n properties.push(property);\n }\n });\n return properties;\n }\n _resetModel() {\n Object.keys(this._model).forEach((propertyName) => {\n if (propertyName !== 'dispose')\n delete this._model[propertyName];\n });\n }\n get rtl() {\n return this._rtl;\n }\n set rtl(newVal) {\n this._rtl = newVal;\n this._model.rtl = newVal;\n }\n dispose() {\n super.dispose();\n this._resetModel();\n }\n initializeContext(context) {\n this._context = context;\n return this;\n }\n getPropertyByName(propertyName) {\n return this._model[propertyName];\n }\n addElement(propertyName, elementFunc) {\n this._model[propertyName] = elementFunc();\n this._disposables.push(this._model[propertyName]);\n return this;\n }\n mapOnContext() {\n this._model.model = this._context.model;\n this._model.surface = this._context.surface;\n this._model.undoEngine = this._context.undoEngine;\n return this;\n }\n addSelection(func) {\n func(this._selectionSettings);\n this._disposables.push(this._selectionSettings);\n extend(this._model, this._selectionSettings.generate());\n return this;\n }\n addPropertyGrid(propertyGrid, propertyName = 'propertyGrid') {\n this._model[propertyName] = propertyGrid && propertyGrid();\n this._disposables.push(this._model[propertyName]);\n return this;\n }\n addDisposableContainer() {\n this._model.disposableContainer = new Disposable();\n this._model.addDisposables = (...elem) => this._model.disposableContainer._disposables.push(...elem);\n return this;\n }\n addControlProperties(editors, groups, accessibilityProvider) {\n return this.addPropertyGrid(() => this.createControlProperties(editors, groups, accessibilityProvider));\n }\n createControlProperties(editors, groups, accessibilityProvider) {\n var properties = new ControlProperties(this._model.editableObject, { groups: groups, editors: editors }, null);\n if (accessibilityProvider)\n properties.registerAccessibilityProvider(accessibilityProvider);\n return properties;\n }\n addPopularProperties(controlsFactory, accessibilityProvider) {\n return this.addPropertyGrid(() => {\n var properties = new ObjectProperties(ko.pureComputed(() => {\n var popularPropertiesObject = { getInfo: () => { return []; } }, editable = this._model.editableObject();\n if (editable) {\n var controlInfo = controlsFactory.controlsMap[editable.controlType], propertiesInfo = this._createPopularProperties(controlInfo && controlInfo.info || [], controlInfo && controlInfo.popularProperties || []);\n (propertiesInfo).forEach(item => {\n if (item.propertyName in editable)\n popularPropertiesObject[item.propertyName] = editable[item.propertyName];\n });\n popularPropertiesObject.getInfo = () => {\n return propertiesInfo;\n };\n popularPropertiesObject['root'] = editable.root;\n popularPropertiesObject['actions'] = editable.actions;\n popularPropertiesObject['actionProviders'] = editable.actionProviders;\n popularPropertiesObject['getPath'] = (propertyName) => { return editable.getPath && editable.getPath(propertyName) || ''; };\n popularPropertiesObject['getModel'] = () => editable;\n popularPropertiesObject['isPropertyModified'] = (name) => {\n return editable.isPropertyModified ? editable.isPropertyModified(name) : false;\n };\n popularPropertiesObject['getActionClassName'] = (name) => {\n return editable['getActionClassName'] ? editable['getActionClassName'](name) : '';\n };\n popularPropertiesObject['getMenuBoxTemplate'] = (name) => {\n return editable['getMenuBoxTemplate'] ? editable['getMenuBoxTemplate'](name) : '';\n };\n popularPropertiesObject['isPropertyVisible'] = (propertyName) => {\n return propertiesInfo.some(x => x.propertyName === propertyName) && (editable['isPropertyVisible'] ? editable['isPropertyVisible'](propertyName, true) : true);\n };\n popularPropertiesObject['isPropertyHighlighted'] = (propertyName) => {\n return editable['isPropertyHighlighted'] ? editable['isPropertyHighlighted'](propertyName) : false;\n };\n popularPropertiesObject['isPropertyDisabled'] = (name) => {\n return editable.isPropertyDisabled ? editable.isPropertyDisabled(name) : false;\n };\n popularPropertiesObject['isSame'] = x => x === editable;\n ['name', 'displayName'].forEach((propertyName) => {\n if (propertyName in editable) {\n popularPropertiesObject[propertyName] = editable[propertyName];\n }\n });\n }\n return popularPropertiesObject;\n }), undefined, undefined, undefined);\n if (accessibilityProvider)\n properties.registerAccessibilityProvider(accessibilityProvider);\n return properties;\n }, 'popularProperties');\n }\n addToolboxItems(items) {\n this._model.toolboxItems = items && items();\n return this;\n }\n addGroupedToolboxItems() {\n this._model.groupedToolboxItems = collectGroupsFromFlatList(this._model.toolboxItems, (item) => item.info.group);\n return this;\n }\n addTabPanel(panel, addTabInfo = () => []) {\n var panelModel = panel && panel() || new TabPanel({ tabs: addTabInfo(), rtl: this._rtl, width: 396 });\n this._model.tabPanel = panelModel;\n this._disposables.push(panelModel);\n return this;\n }\n addIsLoading(isLoadingFunc = () => ko.observable(true)) {\n this._model.isLoading = isLoadingFunc();\n this._disposables.push(this._model.isLoading);\n return this;\n }\n addControlsHelper(func) {\n var settings = new ControlsHelperSettings(this._selectionSettings.selection, this._context);\n func(settings);\n this._disposables.push(settings);\n extend(this._model, settings.generate());\n return this;\n }\n addMenu(func) {\n var settings = new MenuSettings();\n func(settings);\n this._disposables.push(settings);\n extend(this._model, settings.generate());\n return this;\n }\n addContextActions(func) {\n var settings = new ContextActionsSettings();\n func(settings);\n this._disposables.push(settings);\n extend(this._model, settings.generate());\n return this;\n }\n addParts(func = (parts) => parts, useDefaults = true) {\n var parts = [];\n if (useDefaults)\n parts = generateDefaultParts(this._model);\n this._model.parts = func(parts);\n return this;\n }\n getModel() {\n return this._model;\n }\n addActionList(actionListsFunc) {\n var actionLists = actionListsFunc && actionListsFunc() || new ActionLists(this._context.surface, this._selectionSettings.selection, this._context.undoEngine, () => { });\n this._disposables.push(actionLists);\n this._model.actionLists = actionLists;\n return this;\n }\n}\n","/**\r\n* DevExpress Analytics (core\\utils\\_designerInitializer.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nimport { availableFonts } from '../../property-grid/widgets/fonteditor/_fonts';\nimport { DragDropHandler } from '../dragDrop/_dragDropHandler';\nimport { DragHelperContent } from '../dragDrop/_dragHelperContent';\nimport { SelectionDragDropHandler } from '../dragDrop/_selectionDragDropHandler';\nimport { ToolboxDragDropHandler } from '../dragDrop/_toolboxDragDropHandler';\nimport { InlineTextEdit } from '../internal/_inlineTextEdit';\nimport { getToolboxItems } from '../internal/_utils';\nimport { CombinedObject } from '../selection/_combinedObj';\nimport { SurfaceSelection } from '../selection/_selection';\nimport { SnapLinesCollector } from '../snapLines/_snapLinesCollector';\nimport { SnapLinesHelper } from '../snapLines/_snapLinesHelper';\nimport { TabInfo } from '../tools/tabInfo';\nimport { CommonDesignerGenerator, DesignerContextGenerator } from './_designerCreator';\nexport function createDesigner(model, surface, controlsFactory, groups = {}, editors = [], parts, rtl, selection, designControlsHelper, undoEngine, customMerge, snapLinesCollector, groupLocalizationIDs) {\n var context = new DesignerContextGenerator(rtl)\n .addModel(model)\n .addSurface(surface)\n .addUndoEngine(undoEngine)\n .getContext();\n var designerGenerator = new CommonDesignerGenerator(context, rtl);\n return designerGenerator\n .addDisposableContainer()\n .mapOnContext()\n .addSelection((settings) => {\n settings.selection = selection || new SurfaceSelection();\n settings.snapHelper = new SnapLinesHelper(surface, SnapLinesHelper.snapTolerance, snapLinesCollector || new SnapLinesCollector());\n settings.editableObject = CombinedObject.getEditableObject(settings.selection, context.undoEngine, customMerge).extend({ throttle: 1 });\n settings.addDragDrop((dragDropSettings) => {\n dragDropSettings.dragHelperContent = new DragHelperContent(settings.selection);\n dragDropSettings.dragDropStarted = DragDropHandler.started;\n dragDropSettings.addDragDropHandler('dragHandler', new SelectionDragDropHandler(context.surface, settings.selection, context.undoEngine, settings.snapHelper, dragDropSettings.dragHelperContent));\n dragDropSettings.addDragDropHandler('toolboxDragHandler', new ToolboxDragDropHandler(context.surface, settings.selection, context.undoEngine, settings.snapHelper, dragDropSettings.dragHelperContent, controlsFactory));\n });\n settings.addResize((resizeSettings) => {\n resizeSettings.handler = {\n starting: () => {\n selection.expectClick = true;\n context.undoEngine().start();\n },\n stopped: () => {\n context.undoEngine().end();\n setTimeout(() => { selection.expectClick = false; }, 100);\n },\n disabled: DragDropHandler.started,\n snapHelper: settings.snapHelper\n };\n });\n })\n .addToolboxItems(() => getToolboxItems(controlsFactory.controlsMap))\n .addIsLoading()\n .addControlProperties(editors, groups)\n .addPopularProperties(controlsFactory)\n .addControlsHelper((settings) => {\n settings\n .addControlsHelper(designControlsHelper)\n .addControlsStore();\n })\n .addTabPanel(undefined, () => {\n return [\n new TabInfo({\n text: 'Properties',\n template: 'dxrd-propertiestab',\n model: designerGenerator.getModel().propertyGrid,\n localizationId: 'AnalyticsCoreStringId.Cmd_Properties',\n visible: ko.pureComputed(() => { return !!model(); }),\n disabled: ko.pureComputed(() => { return designerGenerator.getModel().propertyGrid.focusedItem() instanceof Array; }).extend({ throttle: 100 })\n })\n ];\n })\n .addContextActions((settings) => {\n settings.actionProviders = [];\n settings.createDefaultActions(designerGenerator.getModel().editableObject, designerGenerator.getModel().undoEngine);\n })\n .addMenu((settings) => {\n settings.appMenuVisible = ko.observable(false);\n settings.toggleAppMenu = function () {\n settings.appMenuVisible(!settings.appMenuVisible());\n };\n settings.getMenuPopupContainer = (el) => $.fn.constructor(el).closest('.dxrd-menu-button').prev('.dxrd-menu-container');\n settings.getMenuPopupTarget = (el) => $.fn.constructor(el).closest('.dxrd-menu-button').find('.dxrd-menu-place');\n })\n .addElement('inlineTextEdit', () => new InlineTextEdit(designerGenerator.getModel().selection))\n .addElement('actionsGroupTitle', () => () => getLocalization('Actions', 'AnalyticsCoreStringId.Actions'))\n .addElement('updateFont', () => (values) => {\n availableFonts(Object.assign(Object.assign({}, availableFonts()), values));\n })\n .addElement('sortFont', () => () => {\n var sortedObj = {};\n var fonts = availableFonts.peek();\n Object.keys(fonts).sort((a, b) => { return a.localeCompare(b); }).forEach(key => sortedObj[key] = fonts[key]);\n availableFonts(sortedObj);\n })\n .addElement('surfaceSize', () => ko.observable(0))\n .addElement('popularVisible', () => ko.pureComputed(() => {\n return designerGenerator.getModel().popularProperties._editors().some((x) => { return x.visible(); }) ||\n designerGenerator.getModel().contextActions && designerGenerator.getModel().contextActions().length > 0;\n }))\n .addActionList()\n .addParts()\n .getModel();\n}\n","/**\r\n* DevExpress Analytics (core\\utils\\_fieldListProvider.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nexport class FieldListProvider {\n constructor(fieldListCallback, rootItems, extenders, rootItemsNoDragable = false) {\n this.deferreds = [];\n this._extenders = extenders;\n this.getItems = (pathRequest) => {\n var result = $.Deferred();\n var items = [];\n if (this._beforeFieldListCallback(pathRequest, items)) {\n result.resolve(items);\n }\n else if (rootItems && !pathRequest.fullPath) {\n items.push.apply(items, $.map(rootItems(), (item) => {\n var _el = { name: item.id || item.ref, displayName: item.name, isList: true, specifics: item.specifics || 'ListSource', dragData: { noDragable: false } };\n if (rootItemsNoDragable)\n delete _el.dragData;\n return _el;\n }));\n this._afterFieldListCallBack(pathRequest, items);\n result.resolve(items);\n }\n else {\n this._patchRequest(pathRequest, rootItems);\n this.deferreds.push(result);\n fieldListCallback(pathRequest).done((fields) => {\n items.push.apply(items, fields);\n this._afterFieldListCallBack(pathRequest, items);\n result.resolve(items);\n })\n .fail((error) => result.reject(error))\n .always(() => this.deferreds.splice(this.deferreds.indexOf(result), 1));\n }\n return result.promise();\n };\n this.dispose = () => {\n this.getItems = null;\n fieldListCallback = null;\n this.deferreds.forEach(result => result.reject());\n };\n }\n _patchRequest(request, dataSources) {\n if (!dataSources) {\n return;\n }\n var dss = dataSources.peek();\n for (var i = 0; i < dss.length; i++) {\n if (dss[i].id === request.id && !!request.id) {\n request.ref = undefined;\n return;\n }\n if (dss[i].ref === request.ref && !!request.ref) {\n request.id = undefined;\n return;\n }\n }\n }\n _beforeFieldListCallback(request, items) {\n return !!this._extenders && this._extenders.some((extender) => { return extender.beforeItemsFilled(request, items); });\n }\n _afterFieldListCallBack(request, items) {\n this._extenders && this._extenders.forEach((extender) => { extender.afterItemsFilled && extender.afterItemsFilled(request, items); });\n }\n}\n","/**\r\n* DevExpress Analytics (core\\utils\\_infoMessageHelpers.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport notify from 'devextreme/ui/notify';\nimport * as $ from 'jquery';\nimport { chooseBetterPositionOf } from '../internal/_surfaceHelpers';\nimport { DEBUG } from './_debug';\nexport var NotifyType = {\n info: 'info',\n warning: 'warning',\n error: 'error',\n success: 'success'\n};\nvar wrappedConsole = (console => {\n var getWrappedMethod = methodName => (function (...args) {\n if (console && $.isFunction(console[methodName])) {\n console[methodName].apply(console, arguments);\n }\n });\n return {\n info: getWrappedMethod('info'),\n warn: getWrappedMethod('warn'),\n error: getWrappedMethod('error')\n };\n})(window.console);\nexport function NotifyAboutWarning(msg, showForUser = false) {\n if (showForUser) {\n ShowMessage(msg);\n }\n if (DEBUG) {\n throw new Error(msg);\n }\n else {\n wrappedConsole.warn(msg);\n }\n}\nexport function getErrorMessage(deferredResult) {\n return deferredResult && deferredResult.responseJSON && deferredResult.responseJSON.error ? deferredResult.responseJSON.error : '';\n}\nvar _showMessage = (msg, type = 'error', displayTime, debugInfo, contentTemplate, containerElement) => {\n containerElement = containerElement || $.fn.constructor('.dx-designer-viewport')[0];\n notify({\n message: msg,\n type: type,\n maxWidth: containerElement ? containerElement.clientWidth : undefined,\n position: { boundary: containerElement, collision: 'fit', of: chooseBetterPositionOf(document.documentElement, containerElement), my: 'bottom', at: 'bottom', offset: '0 -10' },\n container: containerElement,\n hideOnOutsideClick: true,\n closeOnSwipe: false,\n displayTime: displayTime || (type === 'error' ? 60000 : 3000),\n contentTemplate: contentTemplate\n });\n};\nexport var ShowMessage = _showMessage;\nexport var _setShowMessageFunc = (func) => ShowMessage = func;\nexport var _resetShowMessageFunc = () => ShowMessage = _showMessage;\n","/**\r\n* DevExpress Analytics (core\\utils\\_troubleshootingHelpers.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { getTemplate } from '../../property-grid/widgets/templateUtils';\nimport { ShowMessage } from './_infoMessageHelpers';\nconst href = 'https://go.devexpress.com/Web_Reporting_Diagnostics_Tips.aspx';\nexport const showTroubleshootingMessage = () => {\n const link = `
Reporting Application Diagnostics`;\n const popupMessage = 'Open the browser developer console to investigate the issue. Review the following help topic: ';\n const consoleMessage = `Review the following help topic to diagnose a problem: ${href}`;\n ShowMessage('', 'error', null, null, function () {\n return `
${popupMessage}${link}
`;\n });\n console.log(consoleMessage);\n};\nexport const assignTroubleshootingPage = (element) => {\n const page = getTroubleshootingPage();\n const _element = element instanceof Element ? element : element[0];\n _element.innerHTML = page;\n};\nexport const troubleshootingPageWrapper = (target, showErrorPage, element) => {\n try {\n return target();\n }\n catch (e) {\n if (showErrorPage && element) {\n assignTroubleshootingPage(element);\n }\n throw e;\n }\n};\nexport const getTroubleshootingPage = () => {\n const link = `
following help topic`;\n const iconTemplate = getTemplate('dxrd-svg-error');\n const icon = iconTemplate ? `
${iconTemplate}
` : '';\n const title = 'Something went wrong';\n const message = `Review the ${link} to diagnose a problem.`;\n return `
${icon}
${title}
${message}
`;\n};\n","/**\r\n* DevExpress Analytics (core\\utils\\_units.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport function roundingXDecimals(value, useFloor = false, x = 3) {\n return (useFloor ? Math.floor : Math.round)(value * Math.pow(10, x)) / Math.pow(10, x);\n}\nexport function unitsToPixel(val, measureUnit, zoom = 1) {\n var result;\n if (measureUnit === 'Pixels') {\n result = 1 * val;\n }\n else if (measureUnit === 'TenthsOfAMillimeter') {\n result = val * 3.78 / 10;\n }\n else {\n result = val * 96 / 100;\n }\n result = result * (zoom);\n return roundingXDecimals(result, true);\n}\nexport function pixelToUnits(val, measureUnit, zoom) {\n var result;\n if (measureUnit === 'Pixels') {\n result = 1 * val;\n }\n else if (measureUnit === 'TenthsOfAMillimeter') {\n result = val / 3.78 * 10;\n }\n else {\n result = val / 96 * 100;\n }\n result = result / (zoom);\n return roundingXDecimals(result);\n}\nexport function createUnitProperty(model, target, propertyName, property, measureUnit, zoom, afterCreation) {\n var lastVal = 0;\n target[propertyName] = ko.pureComputed({\n read: () => {\n var val = property(model)(), newVal = unitsToPixel(val, measureUnit.peek(), zoom());\n if (Math.abs(newVal - lastVal) > 0.2) {\n lastVal = newVal;\n return lastVal;\n }\n return lastVal;\n },\n write: (val) => {\n if (Math.abs(val - lastVal) <= 0.2)\n return;\n lastVal = val;\n var result = pixelToUnits(val, measureUnit.peek(), zoom());\n property(model)(result);\n }\n });\n afterCreation(target[propertyName]);\n}\nexport function createUnitProperties(model, target, properties, measureUnit, zoom, afterCreation) {\n if (!properties)\n return;\n Object.keys(properties).forEach(propertyName => {\n createUnitProperty(model, target, propertyName, properties[propertyName], measureUnit, zoom, afterCreation);\n });\n}\n","/**\r\n* DevExpress Analytics (core\\utils\\_utils.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport * as ko from 'knockout';\nimport { calculateWithZoomFactor } from '../../accessibility/_internal';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nimport { noDataText, searchPlaceholder, selectPlaceholder } from '../../property-grid/localization/_localization';\nimport { editorTemplates } from '../../property-grid/widgets/editorsInfo';\nimport { createGlobalModuleVariableFunc } from '../../serializer/_internal';\nimport { extend } from '../../serializer/_utils';\nimport { getParentContainer } from '../../widgets/_utils';\nimport { ajaxSetup } from '../internal/ajaxSetup';\nimport { dxversions } from '../internal/dx-versions';\nimport { _errorProcessor, _processError } from '../internal/_processError';\nimport { convertFromCssPixelUnits } from '../internal/_utils';\nimport { getErrorMessage as igetErrorMessage } from './_infoMessageHelpers';\nimport { objectsVisitor } from './_visitors';\nimport { requestManager } from '../internal/requestManager';\nimport { fetchSetup } from '../internal/fetchSetup';\nexport function copyObservables(from, to) {\n Object.keys(from || {}).forEach((name) => {\n if (ko.isObservable(from[name])) {\n to[name](from[name]());\n }\n else if (!$.isFunction(from[name])) {\n copyObservables(from[name], to[name]);\n }\n });\n}\nexport function _wrapModelInObservable(model) {\n return ko.isWritableObservable(model) ? model : ko.observable(null);\n}\nexport function collectGroupsFromFlatList(list, getGroupId) {\n var temp = {};\n return list.reduce((res, val) => {\n var groupId = getGroupId(val);\n if (groupId) {\n if (temp[groupId])\n temp[groupId].push(val);\n else {\n var group = { group: groupId, items: [val] };\n res.push(group);\n temp[groupId] = group.items;\n }\n }\n return res;\n }, []);\n}\nexport function compareObjects(a, b) {\n var result = a && b && !(a instanceof Array) && !(b instanceof Array);\n result = result && (Object.getOwnPropertyNames(a).length === Object.getOwnPropertyNames(b).length);\n if (result) {\n Object.keys(a || {}).some((name) => {\n if (name.indexOf('_') !== 0 && (typeof a[name] !== 'function' || ko.isObservable(a[name]))) {\n if (ko.isObservable(a[name])) {\n result = ko.unwrap(a[name]) === ko.unwrap(b[name]);\n }\n else if (a[name] instanceof Array) {\n if ((b[name] instanceof Array) && a[name].length === b[name].length) {\n for (var i = 0; i < a[name].length; i++) {\n result = compareObjects(a[name][i], b[name][i]);\n if (result === false)\n break;\n }\n }\n else {\n result = false;\n }\n }\n else if (a[name] instanceof Object) {\n result = compareObjects(a[name], b[name]);\n }\n else {\n result = a[name] === b[name];\n }\n return !result;\n }\n });\n }\n return result;\n}\nexport var cssTransform = ['-webkit-transform', '-moz-transform', '-ms-transform', '-o-transform', 'transform'];\nexport function getFullPath(path, dataMember) {\n return path + (dataMember ? '.' + dataMember : '');\n}\nexport function loadTemplates() {\n var promises = $.fn.constructor(\"script[type='text/html']\").map(function (_, script) {\n if (script.src) {\n var deffered = $.Deferred();\n $.get(script.src)\n .done(function (tmpl) {\n script.text = tmpl;\n if (tmpl.indexOf('type=\"text/html\"') !== -1 || tmpl.indexOf(\"type='text/html'\") !== -1) {\n $.fn.constructor(document.body).append(tmpl);\n }\n deffered.resolve();\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n deffered.reject();\n });\n return deffered.promise();\n }\n });\n return $.when.apply($.when, promises);\n}\nexport function getSizeFactor(width) {\n if (width < 768) {\n return 'xs';\n }\n else if (width < 992) {\n return 'sm';\n }\n else if (width < 1200) {\n return 'md';\n }\n else if (width < 1380) {\n return 'lg';\n }\n else {\n return 'xl';\n }\n}\nexport var staticContext = {\n _static: {\n searchPlaceholder: () => searchPlaceholder(),\n selectPlaceholder: () => selectPlaceholder(),\n noDataText: () => noDataText(),\n ajaxSetup: ajaxSetup\n }\n};\nexport var _defaultStaticContext = createGlobalModuleVariableFunc({});\nexport function appendStaticContextToRootViewModel(root, dx = staticContext, className) {\n if (dx)\n root.dx = Object.assign(Object.assign({}, dx), _defaultStaticContext());\n root.getLocalization = function () {\n return getLocalization.apply(root, arguments);\n };\n root.getPopupContainer = getParentContainer;\n root.calculateWithZoomFactor = calculateWithZoomFactor;\n root.surfaceClass = (el) => 'dx-designer-viewport dx-designer-viewport-' + getSizeFactor(el.clientWidth) +\n ' ' + (!getParentContainer(el, '.dx-theme-generic').length ? ' dx-theme-generic' : '') +\n (className ? ' ' + className : '');\n}\nexport function _ajax(uri, action, arg, processErrorCallback, ignoreError, customOptions, isError = (data) => !data.success, getErrorMessage = igetErrorMessage, method = 'POST') {\n var deferred = $.Deferred();\n var requestData;\n if (action !== undefined && arg !== undefined) {\n requestData = {\n actionKey: action,\n arg: arg,\n dxversions: JSON.stringify(dxversions)\n };\n }\n const requestManagerSetup = {\n ajaxSetup,\n fetchSetup\n };\n requestManager.getInstance(requestManagerSetup).sendRequest(extend({}, {\n type: method,\n data: requestData,\n url: uri\n }, customOptions)).fail((jqXHR, textStatus, errorThrown) => {\n if (ignoreError && ignoreError()) {\n deferred.reject();\n return;\n }\n _errorProcessor.call({ jqXHR: jqXHR, textStatus: textStatus, errorThrown: errorThrown, getRequestDetails: () => requestData || uri });\n _processError(errorThrown, deferred, jqXHR, textStatus, processErrorCallback);\n })\n .done((data, textStatus, jqXHR) => {\n if (!data) {\n deferred.reject();\n return;\n }\n if (!isError(data)) {\n deferred.resolve(data.result);\n }\n else {\n if (ignoreError && ignoreError()) {\n deferred.reject();\n return;\n }\n _errorProcessor.call({ jqXHR: jqXHR, textStatus: textStatus, data: data, errorThrown: getErrorMessage(jqXHR), getRequestDetails: () => requestData || uri });\n _processError('Internal Server Error', deferred, jqXHR, textStatus, processErrorCallback);\n }\n });\n return deferred.promise();\n}\nexport function _ajaxWithOptions(options) {\n return _ajax(options.uri, options.action, options.arg, options.processErrorCallback, options.ignoreError, options.customOptions, options.isError, options.getErrorMessage, options.method);\n}\nexport var ajax = (...params) => {\n if (params.length > 1) {\n return _ajax.apply(this, params);\n }\n else {\n return _ajaxWithOptions(params[0]);\n }\n};\nexport function setAjax(newFunc) {\n ajax = newFunc;\n}\nexport function cutRefs(model) {\n objectsVisitor(model, (target) => {\n delete target['@Ref'];\n });\n return model;\n}\nexport var DesignerBaseElements = {\n MenuButton: 'dxrd-menubutton-template-base',\n Toolbar: 'dxrd-toolbar-template-base',\n Toolbox: 'dxrd-toolbox-template-base',\n GroupedToolbox: 'dxrd-grouped-toolbox-template-base',\n Surface: 'dxrd-surface-template-base',\n RightPanel: 'dxrd-right-panel-template-base'\n};\nexport function generateDefaultParts(model) {\n return [\n { id: DesignerBaseElements.MenuButton, templateName: DesignerBaseElements.MenuButton, model: model },\n { id: DesignerBaseElements.Toolbar, templateName: DesignerBaseElements.Toolbar, model: model },\n { id: DesignerBaseElements.Toolbox, templateName: DesignerBaseElements.Toolbox, model: model },\n { id: DesignerBaseElements.Surface, templateName: DesignerBaseElements.Surface, model: model },\n { id: DesignerBaseElements.RightPanel, templateName: DesignerBaseElements.RightPanel, model: model }\n ];\n}\nexport function createActionWrappingFunction(wrapperName, func) {\n return (actions) => {\n actions.forEach(action => {\n if (!action['wrappedWith'] || action['wrappedWith'].indexOf(wrapperName) === -1) {\n var oldClickHandler = action.clickAction;\n action.clickAction = (model) => {\n return func(model, oldClickHandler);\n };\n action['wrappedWith'] = action['wrappedWith'] || [];\n action['wrappedWith'].push(wrapperName);\n }\n });\n };\n}\nexport function localizeNoneString(noneValue) {\n var value = ko.unwrap(noneValue);\n if (value === 'none') {\n return getLocalization('none', 'DataAccessStringId.ParameterListEmpty');\n }\n else if (value === '(none)') {\n return (getLocalization('(none)', 'DxDesignerStringId.None') !== '(none)') ? getLocalization('(none)', 'DxDesignerStringId.None') : ('(' + getLocalization('none', 'DataAccessStringId.ParameterListEmpty') + ')');\n }\n return value;\n}\nexport function parseZoom(val) {\n var _value = Math.round(parseInt(val.replace('%', ''))) / 100;\n if (!_value)\n return 1;\n if (_value >= 5)\n return 5;\n if (_value <= 0.1)\n return 0.1;\n return _value;\n}\nexport function getResizableOptions($element, panelOffset, minWidth, position, startPosition, width, disabled) {\n const disabledOption = ko.unwrap(disabled);\n const minWidthOption = ko.unwrap(minWidth);\n return {\n starting: function (e) {\n $.fn.constructor($element).css(position === startPosition ? 'right' : 'left', '');\n },\n handles: ko.observable(position === startPosition ? 'e' : 'w'),\n stopped: $.noop,\n stop: $.noop,\n resize: function (event, element) {\n const startResizePosition = convertFromCssPixelUnits(element.dataset.originalLeftMousePosition);\n const originalWidth = convertFromCssPixelUnits(element.dataset.originalWidth);\n const sizeDiff = event.x - startResizePosition;\n $.fn.constructor($element).css({ left: position === startPosition ? panelOffset + 'px' : '', right: position === startPosition ? '' : panelOffset + 'px' });\n const newWidth = Math.min(Math.max(minWidthOption, position === startPosition ? originalWidth + sizeDiff : originalWidth - sizeDiff), 1000);\n width && ko.isObservable(width) && width(newWidth);\n },\n disabled: disabled || false,\n zoom: 1,\n minimumWidth: ko.observable(disabledOption ? 0 : minWidthOption),\n maximumWidth: 1000,\n $element: $element\n };\n}\nexport function createPasswordSerializationInfo(info, isNew = true) {\n info.editor = editorTemplates.getEditor('text');\n info.editorOptions = { mode: 'password' };\n if (isNew)\n info.editorOptions.inputAttr = { autocomplete: 'new-password' };\n return info;\n}\n","/**\r\n* DevExpress Analytics (core\\utils\\_visitors.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport function objectsVisitor(target, visitor, visited = [], skip = ['surface', 'reportSource']) {\n if (visited.indexOf(target) !== -1) {\n return;\n }\n if (target && target !== undefined) {\n var properties = [];\n Object.keys(target).forEach(propertyName => {\n if (visited.indexOf(target[propertyName]) === -1 && propertyName.indexOf('_') !== 0 && skip.indexOf(propertyName) === -1) {\n properties.push(target[propertyName]);\n }\n });\n visitor(target);\n visited.push(target);\n for (var i = 0; i < properties.length; i++) {\n properties[i] = ko.unwrap(properties[i]);\n if (typeof properties[i] === 'object') {\n objectsVisitor(properties[i], visitor, visited, skip);\n }\n }\n }\n}\nexport function collectionsVisitor(target, visitor, collectionsToProcess = ['controls', 'bands', 'subBands', 'crossBandControls', 'rows', 'cells', 'fields'], visited = []) {\n if (target && target !== undefined) {\n visited.push(target);\n for (var i = 0, len = collectionsToProcess.length; i < len; i++) {\n if (target[collectionsToProcess[i]]) {\n visitor(target[collectionsToProcess[i]], target);\n (target[collectionsToProcess[i]]() || []).forEach((item) => collectionsVisitor(item, visitor, collectionsToProcess, visited));\n }\n }\n }\n}\n","/**\r\n* DevExpress Analytics (core\\utils\\controlsFactory.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport { getLocalization } from '../../property-grid/localization/_localization';\nimport { extend } from '../../serializer/_utils';\nimport { ElementViewModel } from '../elements/elementViewModel';\nimport { getTypeNameFromFullName } from '../internal/_getNameHelpers';\nexport class ControlsFactory {\n constructor() {\n this.controlsMap = {};\n }\n getControlInfo(controlType) {\n var info = this.controlsMap[controlType] || null;\n return info;\n }\n getControlType(model) {\n var controlType = getTypeNameFromFullName(model['@ControlType'] || '');\n return this.controlsMap[controlType] ? controlType : 'Unknown';\n }\n createControl(model, parent, serializer) {\n var controlType = this.getControlType(model);\n return new (this.controlsMap[controlType] && this.controlsMap[controlType].type || ElementViewModel)(model, parent, serializer);\n }\n registerControl(typeName, metadata) {\n if (metadata.isToolboxItem !== undefined) {\n metadata.nonToolboxItem = !metadata.isToolboxItem;\n }\n Object.defineProperty(metadata, 'isToolboxItem', {\n get: () => {\n return !metadata.nonToolboxItem;\n },\n set: (newVal) => {\n metadata.nonToolboxItem = !newVal;\n },\n enumerable: true,\n configurable: true\n });\n this.controlsMap[typeName] = metadata;\n this.controlsMap[typeName].info = extend(true, [], metadata.info);\n }\n _getPropertyInfoByDisplayName(info, path, position) {\n return info.filter((x) => getLocalization(x.displayName, x.localizationId) === path[position])[0];\n }\n _getPropertyInfoByName(info, path, position) {\n return info.filter((x) => x.propertyName === path[position] || x.modelName === '@' + path[position] || x.modelName === path[position])[0];\n }\n _getPropertyInfo(info, path, position) {\n var propertyInfo = this._getPropertyInfoByDisplayName(info, path, position) || this._getPropertyInfoByName(info, path, position);\n if (position === path.length - 1) {\n return propertyInfo || null;\n }\n else {\n if (propertyInfo.info) {\n return this._getPropertyInfo(propertyInfo.info, path, position + 1);\n }\n else if (propertyInfo.from) {\n var object = null;\n try {\n object = propertyInfo.from({});\n }\n catch (e) {\n return null;\n }\n var newInfo = object.getInfo && object.getInfo();\n if (newInfo) {\n return this._getPropertyInfo(newInfo, path, position + 1);\n }\n }\n }\n return null;\n }\n getPropertyInfo(controlType, path) {\n var properties = path;\n if (!$.isArray(path)) {\n properties = path.split('.');\n }\n return this._getPropertyInfo(this.controlsMap[controlType].info, properties, 0);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\utils\\parsers.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { getShortTypeName } from '../internal/_getNameHelpers';\nexport function floatFromModel(val) {\n return ko.observable(val === undefined || val === null ? null : parseFloat(val));\n}\nexport function fromEnum(value) {\n var shotEnumValueKey = getShortTypeName(value);\n var valuesArrayItem = this.valuesArray && this.valuesArray.filter(item => item.value == shotEnumValueKey)[0];\n return ko.observable((this.values && this.values[shotEnumValueKey] !== undefined || valuesArrayItem) ? shotEnumValueKey : value);\n}\nexport function parseBool(val) {\n return ko.observable(val !== void 0 ? String(val).toLowerCase() === 'true' : val);\n}\nexport function colorFromString(val) {\n var color = (val || '').split(',');\n var result = ko.observable(val);\n if (color.length === 3) {\n result = ko.observable('rgb(' + color.join(', ') + ')');\n }\n else if (color.length === 4) {\n var alpha = Math.round(parseFloat(color[0]) / 255 * 100) / 100;\n color.shift();\n color.push(alpha.toString());\n result = ko.observable('rgba(' + color.join(', ') + ')');\n }\n return result;\n}\nexport function saveAsInt(val) {\n return Math.round(val).toString();\n}\nexport function colorToInt(color) {\n var colorAsString = colorToString(color).split(',');\n return (parseInt(colorAsString[0]) << 24) + (parseInt(colorAsString[1]) << 16) + (parseInt(colorAsString[2]) << 8) + (parseInt(colorAsString[3]));\n}\nexport function intToColor(color, hasAlpha = true) {\n var r = Math.round((color >> 16) & 0xff);\n var g = Math.round((color >> 8) & 0xff);\n var b = Math.round((color) & 0xff);\n if (hasAlpha) {\n var a = Math.round((color >> 24) & 0xff);\n return colorFromString([a, r, g, b].join(', '))();\n }\n else {\n return colorFromString([r, g, b].join(', '))();\n }\n}\nexport function colorToString(val) {\n var color = (val || '').split(', ');\n var result = val;\n if (color.length === 3) {\n color[0] = color[0].split('(')[1];\n color[2] = color[2].split(')')[0];\n result = color.join(',');\n }\n else if (color.length === 4) {\n var alpha = Math.round(parseFloat(color[3]) * 255);\n color.pop();\n color[0] = color[0].split('(')[1];\n result = alpha.toString() + ',' + color.join(',');\n }\n return result;\n}\n","/**\r\n* DevExpress Analytics (core\\widgets\\_dataMemberEditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport class DataMemberTreeListController {\n constructor() {\n this.selectedItem = null;\n this.suppressActions = true;\n }\n dispose() {\n this.selectedItem = null;\n }\n itemsFilter(item) {\n return item.specifics !== 'parameters' && (item.specifics === 'List' || item.specifics === 'ListSource' || item.isList === true || item.specifics === 'none');\n }\n hasItems(item) {\n return item.specifics !== 'none';\n }\n canSelect(value) {\n return (this.hasItems(value.data) && !!value.path && (value.data.specifics === 'List' || value.data.specifics === 'ListSource')) || value.data.specifics === 'none';\n }\n select(value) {\n if (this.canSelect(value)) {\n this.selectedItem && this.selectedItem.isSelected(false);\n this.selectedItem = value;\n value.isSelected(true);\n }\n }\n isDraggable(item) {\n return false;\n }\n}\n","/**\r\n* DevExpress Analytics (core\\widgets\\_popupEditorBase.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { getLocalization } from '../../property-grid/localization/_localization';\nimport { StringId } from '../../property-grid/localization/_localizationStringIds';\nimport { Disposable } from '../../serializer/utils';\nexport class PopupEditorBase extends Disposable {\n constructor() {\n super();\n this.popupVisible = ko.observable(false);\n this.buttonItems = [];\n this._createMainPopupButtons();\n }\n _createMainPopupButtons() {\n var self = this;\n this._disposables.push(this._disableSaveButton = ko.pureComputed(() => !self.canSave()));\n this.buttonItems = [\n { toolbar: 'bottom', location: 'after', widget: 'dxButton', options: { text: this.saveLocalization, type: 'default', stylingMode: 'contained', onClick: function (sender) { self.save(sender); }, disabled: this._disableSaveButton } },\n { toolbar: 'bottom', location: 'after', widget: 'dxButton', options: { text: this.cancelLocalization, type: 'normal', stylingMode: 'contained', onClick: function () { self.close(); } } }\n ];\n this._disposables.push(this._disableSaveButton);\n }\n canSave() {\n return true;\n }\n save(sender) {\n this.popupVisible(false);\n }\n close() {\n this.popupVisible(false);\n }\n get cancelLocalization() {\n return getLocalization('Cancel', StringId.DataAccessBtnCancel);\n }\n get saveLocalization() {\n return getLocalization('OK', StringId.DataAccessBtnOK);\n }\n}\n","/**\r\n* DevExpress Analytics (core\\widgets\\_requiredNullableEditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Editor } from '../../property-grid/widgets/editor';\nimport { requiredValidationRules } from '../../property-grid/widgets/internal/_internal';\nimport { ValueEditorHelper } from '../../widgets/internal/_valueEditorHelper';\nexport class RequiredNullableEditor extends Editor {\n _getEditorValidationRules() {\n var _a;\n return (super._getEditorValidationRules() || []).concat(ko.unwrap((_a = this.editorOptions) === null || _a === void 0 ? void 0 : _a.showClearButton) ? [] : requiredValidationRules);\n }\n}\nexport function createNumericEditor(dotNetTypeFullName, specifics) {\n class DynamicNumberEditor extends RequiredNullableEditor {\n constructor(info, level, parentDisabled, textToSearch) {\n super(info, level, parentDisabled, textToSearch);\n }\n getOptions(templateOptions) {\n var options = super.getOptions(templateOptions);\n return ValueEditorHelper.getNumberEditorOptions(dotNetTypeFullName, specifics, options);\n }\n }\n return {\n header: 'dx-number-editor',\n editorType: DynamicNumberEditor\n };\n}\n","/**\r\n* DevExpress Analytics (core\\widgets\\bordereditor\\_binding.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { BordersModel } from './_bordereditor';\nimport { getTemplate } from '../../../property-grid/widgets/templateUtils';\nimport { addDisposeCallback } from '../../../serializer/_internal';\nko.bindingHandlers['dxBorderEditor'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n $.fn.constructor(element).children().remove();\n var templateHtml = getTemplate('dxrd-bordereditor'), $element = $.fn.constructor(element).append(templateHtml);\n var model = new BordersModel(valueAccessor());\n ko.applyBindings({ value: model }, $element.children()[0]);\n addDisposeCallback(element, () => model.dispose());\n return { controlsDescendantBindings: true };\n }\n};\n","/**\r\n* DevExpress Analytics (core\\widgets\\bordereditor\\_bordereditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../../serializer/utils';\nexport class BordersModel extends Disposable {\n constructor(object) {\n super();\n this.left = ko.observable(false);\n this.right = ko.observable(false);\n this.top = ko.observable(false);\n this.bottom = ko.observable(false);\n this.disabled = object.disabled || ko.observable(false);\n this.value = object.value;\n this.updateModel(object.value());\n this._disposables.push(object.value.subscribe((newVal) => {\n this.updateModel(newVal);\n }));\n }\n _setAllValues(value) {\n this.left(value), this.bottom(value), this.right(value), this.top(value);\n }\n setValue(name) {\n if (this.disabled())\n return;\n this[name](!this[name]());\n this.updateValue();\n }\n setAll() {\n if (this.disabled())\n return;\n this._setAllValues(true);\n this.updateValue();\n }\n setNone() {\n if (this.disabled())\n return;\n this._setAllValues(false);\n this.updateValue();\n }\n updateModel(value) {\n var val = value || 'None';\n if (val.indexOf('All') !== -1) {\n this._setAllValues(true);\n }\n else if (val.indexOf('None') !== -1) {\n this._setAllValues(false);\n }\n else {\n this.left(val.indexOf('Left') !== -1);\n this.top(val.indexOf('Top') !== -1);\n this.right(val.indexOf('Right') !== -1);\n this.bottom(val.indexOf('Bottom') !== -1);\n }\n }\n updateValue() {\n var result = [];\n if (this.left() && this.right() && this.top() && this.bottom()) {\n result.push('All');\n }\n else if (!this.left() && !this.right() && !this.top() && !this.bottom()) {\n result.push('None');\n }\n else {\n this.left() ? result.push('Left') : null;\n this.right() ? result.push('Right') : null;\n this.top() ? result.push('Top') : null;\n this.bottom() ? result.push('Bottom') : null;\n }\n this.value(result.join(','));\n }\n}\n","/**\r\n* DevExpress Analytics (core\\widgets\\propertygrid\\_controlProperties.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { ObjectProperties } from '../../../property-grid/propertygrid';\nimport { Group } from './_group';\nimport { PopupService } from '../../../property-grid/internal/_popupService';\nimport { getImageClassName, getControlFullName } from '../../internal/_getNameHelpers';\nimport { searchPlaceholder } from '../../../property-grid/localization/_localization';\nimport dxTextBox from 'devextreme/ui/text_box';\nexport class ControlProperties extends ObjectProperties {\n constructor(target, editorsInfo, level = 0, useAddons = true) {\n super(target, editorsInfo, level, undefined, undefined, ko.observable(''), useAddons && new PopupService());\n this.focusedItem = ko.observable();\n this.editorsRendered = ko.observable(false);\n this.isSortingByGroups = ko.observable(true);\n this.isSearching = ko.observable(false);\n this.allEditorsCreated = ko.observable(false);\n this.textToSearch = ko.observable('');\n this._searchBox = null;\n this.searchPlaceholder = () => searchPlaceholder();\n this.switchSearchBox = () => {\n if (this.isSearching()) {\n this.isSearching(false);\n this.textToSearch('');\n }\n else {\n this.isSearching(true);\n this._searchBox && this._searchBox.focus();\n }\n };\n this.createGroups(editorsInfo.groups);\n this.update(target());\n this._disposables.push(this.focusedImageClassName = ko.pureComputed(() => {\n return getImageClassName(target() && target().controlType);\n }));\n var subscription = this.isSortingByGroups.subscribe((newVal) => {\n if (!newVal) {\n this.editorsRendered(true);\n subscription.dispose();\n }\n });\n this._disposables.push(subscription);\n this.focusedItem = target;\n this._disposables.push(target.subscribe((newValue) => {\n if (this.isSearching() && !this.textToSearch())\n this.switchSearchBox();\n }));\n this.displayExpr = (value) => getControlFullName(value);\n var timeout = null;\n this._disposables.push(this.textToSearch.subscribe((newValue) => {\n timeout && clearTimeout(timeout);\n timeout = setTimeout(() => {\n this._textToSearch(newValue);\n newValue && this.groups.forEach(group => group.collapsed() && group.editors().some(editor => editor.isSearchedProperty()) && group.collapsed(false));\n }, 200);\n }));\n }\n getEditors() {\n var editors = super.getEditors();\n var editorNames = editors.map((editor) => { return editor.displayName(); }).sort();\n editors.sort((a, b) => {\n return editorNames.indexOf(a.displayName()) - editorNames.indexOf(b.displayName());\n });\n return editors;\n }\n _update(target, editorsInfo, recreateEditors) {\n this.groups && this.groups.forEach((group) => {\n if (group.editors().length === 0)\n group.recreate();\n });\n return super._update(target, editorsInfo, recreateEditors);\n }\n cleanEditors() {\n super.cleanEditors();\n this.groups.forEach(x => x.resetEditors());\n }\n dispose() {\n super.dispose();\n this.disposeArray(this.groups);\n this.disposeObservableArray(this._editors);\n this.resetObservableArray(this._editors);\n this.cleanSubscriptions();\n this._searchBox = null;\n this.focusedItem = null;\n }\n createGroups(groups) {\n this.groups = Object.keys(groups).map((name) => {\n return new Group(name, groups[name].info, (serializationInfo) => {\n return serializationInfo\n .filter(info => !!info.editor)\n .map(info => {\n var editor = this.findEditorByInfo(info);\n if (editor)\n return editor;\n editor = this.createEditor(info);\n this._editors.push(editor);\n return editor;\n });\n }, true, groups[name].displayName);\n });\n this._disposables.push.apply(this._disposables, this.groups);\n }\n registerAccessibilityProvider(accessibilityProvider) {\n super.registerAccessibilityProvider(accessibilityProvider);\n this.groups.forEach((group) => {\n group.registerAccessibilityProvider(accessibilityProvider);\n });\n }\n searchBox($element) {\n this._searchBox = dxTextBox.getInstance($element.get(0));\n }\n}\n","/**\r\n* DevExpress Analytics (core\\widgets\\propertygrid\\_group.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../../serializer/utils';\nimport { getLocalization } from '../../../property-grid/localization/localization_utils';\nexport class Group extends Disposable {\n constructor(name, serializationsInfo, createEditors, collapsed = true, displayName) {\n super();\n this.editors = ko.observableArray([]).extend({ deferred: true });\n this.editorsCreated = ko.observable(false);\n this.editorsRendered = ko.observable(false);\n this._displayName = name;\n this.displayName = displayName || (() => getLocalization(name));\n this._serializationsInfo = serializationsInfo;\n this.collapsed = ko.observable(collapsed);\n if (collapsed) {\n var subscription = this.collapsed.subscribe((newVal) => {\n subscription.dispose();\n this.editorsRendered(true);\n });\n this._disposables.push(subscription);\n }\n this.recreate = () => {\n this.editors(createEditors(serializationsInfo));\n if (this._accessibilityProvider) {\n this.editors().forEach((editor) => {\n editor.registerAccessibilityProvider(this._accessibilityProvider);\n });\n }\n };\n this.editors(createEditors(serializationsInfo));\n this.visible = ko.computed(() => {\n return this.editors().some(editor => editor.visible());\n });\n this._disposables.push(this.visible);\n }\n resetEditors() {\n this.disposeObservableArray(this.editors);\n this.resetObservableArray(this.editors);\n }\n dispose() {\n super.dispose();\n this.disposeObservableArray(this.editors);\n this.resetObservableArray(this.editors);\n }\n update(viewModel) {\n this._viewModel = viewModel;\n this.editors().forEach((editor) => {\n editor.update(this._viewModel);\n });\n }\n registerAccessibilityProvider(accessibilityProvider) {\n this._accessibilityProvider = accessibilityProvider;\n this.editors().forEach((editor) => {\n editor.registerAccessibilityProvider(accessibilityProvider);\n });\n }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\_propertiesAccessibilityProvider.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport class PropertiesAccessibilityProvider {\n isPropertyVisible(editor) {\n if (!editor._model())\n return false;\n var model = editor._model();\n var visible = model.isPropertyVisible ? model.isPropertyVisible(editor.name) : true;\n if (visible) {\n visible = this._calculateAccessibilityByPropertyInfo(model, editor.info().visible, true);\n }\n return visible;\n }\n isPropertyDisabled(editor) {\n if (!editor._model())\n return true;\n var model = editor._model();\n return model.isPropertyDisabled && model.isPropertyDisabled(editor.name) || this._calculateAccessibilityByPropertyInfo(model, editor.info().disabled, false);\n }\n _calculateAccessibilityByPropertyInfo(model, propertyInfo, defaultValue) {\n var result;\n if (ko.isObservable(propertyInfo)) {\n result = propertyInfo();\n }\n else if (typeof propertyInfo === 'function') {\n result = propertyInfo(model);\n }\n else {\n result = propertyInfo !== undefined ? propertyInfo : defaultValue;\n }\n return result;\n }\n}\nexport var defaultAccessibilityProvider = new PropertiesAccessibilityProvider();\n","/**\r\n* DevExpress Analytics (property-grid\\bindings.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { ObjectProperties } from './propertygrid';\nimport { addDisposeCallback } from '../serializer/_internal';\nimport { globalResolver } from './internal/_codeResolver';\nimport { selectPlaceholder, noDataText } from './localization/_localization';\nimport { getLocalization } from './localization/localization_utils';\nimport dxScrollView from 'devextreme/ui/scroll_view';\nimport * as events from 'devextreme/events';\nimport { getTemplate } from './widgets/templateUtils';\nko.bindingHandlers['dxPropertyGrid'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n $.fn.constructor(element).children().remove();\n var templateHtml = getTemplate('dx-propertieseditor'), $element = $.fn.constructor(element).append(templateHtml);\n var value = valueAccessor();\n var model = new ObjectProperties(value.target, value.editorsInfo, value.level, value.parentDisabled, value.recreateEditors, value.textToSearch);\n element.setAttribute('role', 'tree');\n ko.applyBindings(bindingContext.createChildContext(model), $element.children()[0]);\n addDisposeCallback(element, function () {\n model.dispose();\n });\n return { controlsDescendantBindings: true };\n }\n};\nko.virtualElements.allowedBindings['lazy'] = true;\nko.bindingHandlers['lazy'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var parsedBindings = valueAccessor();\n var resolver = parsedBindings.resolver || globalResolver;\n var isResolved = parsedBindings.isResolved || ko.observable(false);\n if (parsedBindings.innerBindings) {\n parsedBindings = parsedBindings.innerBindings;\n }\n var isDisposed = false;\n var tasks = [];\n $.each(parsedBindings, (innerBindingKey, innerBindingParameters) => {\n var innerBinding = ko.bindingHandlers[innerBindingKey];\n tasks.push(resolver.execute(() => {\n if (!isDisposed) {\n var isInitialized = false;\n ko.computed({\n read: () => {\n if (!isInitialized && innerBinding.init) {\n innerBinding.init(element, () => { return innerBindingParameters; }, allBindings, viewModel, bindingContext);\n isInitialized = true;\n }\n if (innerBinding.update) {\n innerBinding.update(element, () => { return innerBindingParameters; }, allBindings, viewModel, bindingContext);\n }\n },\n disposeWhenNodeIsRemoved: element\n });\n isResolved(true);\n }\n }, 1));\n });\n addDisposeCallback(element, function () {\n isDisposed = true;\n tasks.forEach(x => x.dispose());\n tasks = [];\n });\n return { controlsDescendantBindings: true };\n }\n};\nko.bindingHandlers['dxdAccordion'] = {\n init: function (element, valueAccessor) {\n var options = valueAccessor(), $element = $.fn.constructor(element), $accordionContent = $element.find('.dx-accordion-content').first(), scrollUpdateCallback = () => {\n var $scroll = $element.parents('.dx-scrollview');\n if ($scroll.length > 0) {\n var scrollView = dxScrollView.getInstance($scroll.get(0));\n scrollView && scrollView['update']();\n }\n };\n var accordionButton = $element\n .find('.dx-accordion-header,.dx-accordion-button').get(0);\n events.off(accordionButton, 'dxclick');\n events.on(accordionButton, 'dxclick', function () {\n options.collapsed(ko.unwrap(options.alwaysShow) ? false : !options.collapsed());\n $element.addClass('dx-transition-style');\n if (options.collapsed())\n $element.addClass('dx-accordion-collapsed');\n setTimeout(() => {\n $element.removeClass('dx-accordion-collapsed');\n if (!options.collapsed())\n $element.removeClass('dx-transition-style');\n }, 500);\n });\n options.collapsed() ? $accordionContent.hide() : $accordionContent.show();\n var subscription = options.collapsed.subscribe((newVal) => {\n $accordionContent.slideToggle(options.timeout, () => scrollUpdateCallback());\n });\n addDisposeCallback(element, () => subscription.dispose());\n }\n};\nko.bindingHandlers['dxdAccordionExt'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var options = valueAccessor(), $element = $.fn.constructor(element), scrollUpdateCallback = () => {\n var $scroll = $element.parents('.dx-scrollview');\n if ($scroll.length > 0) {\n var scrollView = dxScrollView.getInstance($scroll.get(0));\n scrollView && scrollView['update']();\n }\n }, $accordionContent = $element.find('.dx-accordion-content').first(), accordionContentHTML = null;\n if (options.collapsed() && options.lazyContentRendering === true) {\n accordionContentHTML = $accordionContent.html();\n $accordionContent.empty();\n }\n options.collapsed.subscribe((newVal) => {\n if (newVal) {\n $accordionContent.slideUp(options.timeout, () => {\n scrollUpdateCallback();\n });\n }\n else {\n if (accordionContentHTML) {\n $accordionContent.html(accordionContentHTML);\n ko.applyBindingsToDescendants(bindingContext, $accordionContent.get(0));\n accordionContentHTML = null;\n }\n $accordionContent.slideDown(options.timeout, () => {\n scrollUpdateCallback();\n });\n }\n });\n options.collapsed() ? $accordionContent.hide() : $accordionContent.show();\n }\n};\nko.bindingHandlers['dxLocalizedSelectBox'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var options = valueAccessor();\n var prevDisplayExpr = options.displayExpr;\n options['placeholder'] = options['placeholder'] || selectPlaceholder();\n options['noDataText'] = options['noDataText'] || noDataText();\n options['encodeNoDataText'] = true;\n options.displayExpr = function (value) {\n if (!value)\n return value;\n if (!prevDisplayExpr)\n return getLocalization(value, value.localizationId);\n return getLocalization($.isFunction(prevDisplayExpr) ? prevDisplayExpr(value) : value[prevDisplayExpr], value.localizationId);\n };\n options.itemTemplate = function (itemData, itemIndex, itemElement) {\n var context = bindingContext.createChildContext({\n display: options.displayExpr(itemData)\n });\n $.fn.constructor(itemElement).children().remove();\n var templateHtml = getTemplate('item-with-title'), $element = $.fn.constructor(itemElement).append(templateHtml);\n ko.applyBindingsToDescendants(context, $element[0]);\n return itemElement;\n };\n if (options.useLocalizedTextAsValue) {\n options.valueExpr = options.displayExpr;\n }\n var extendedOptions = viewModel.getOptions ? viewModel.getOptions(options) : options;\n ko.bindingHandlers['dxSelectBox'].init(element, () => { return extendedOptions; }, allBindings, viewModel, bindingContext);\n return { controlsDescendantBindings: true };\n }\n};\nko.bindingHandlers['styleunit'] = {\n 'update': function (element, valueAccessor) {\n var value = ko.utils.unwrapObservable(valueAccessor() || {});\n $.each(value, (styleName, styleValue) => {\n styleValue = ko.utils.unwrapObservable(styleValue) || 0;\n element.style[styleName] = styleValue + 'px';\n });\n }\n};\nko.bindingHandlers['service'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var value = ko.unwrap(valueAccessor() || {}), findService = (serviceName) => {\n var context = bindingContext.$parents.filter((item) => { return item[serviceName] !== undefined; })[0];\n if (context) {\n return context[serviceName];\n }\n return null;\n }, service = findService(value.name), entity = service && service(viewModel);\n if (entity) {\n var childContext = bindingContext.createChildContext(entity.data);\n ko.renderTemplate(entity.templateName, childContext, {}, element, 'replaceNode');\n }\n }\n};\n","/**\r\n* DevExpress Analytics (property-grid\\internal\\_addon.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../serializer/utils';\nexport class EditorAddOn extends Disposable {\n constructor(editor, popupService) {\n super();\n this.templateName = null;\n this._editor = editor;\n this._popupService = popupService;\n this._disposables.push(this._actions = ko.pureComputed(() => {\n return (editor.getPopupServiceActions() || []).filter(x => this.actionFilter(x));\n }));\n this._disposables.push(this.visible = ko.pureComputed(() => {\n return this._actions().length > 0;\n }));\n this._disposables.push(this.hint = ko.pureComputed(() => {\n var acc = [];\n this._actions().forEach(x => this._getTitles(x, [], acc));\n return acc.join('\\n');\n }));\n this._disposables.push(this.editorMenuButtonCss = ko.pureComputed(() => {\n var editorModel = editor._model();\n return editorModel && editorModel['getActionClassName'] && editorModel['getActionClassName'](editor.name) || '';\n }));\n this._disposables.push(this.imageTemplateName = ko.pureComputed(() => {\n var editorModel = editor._model();\n return editorModel && editorModel['getMenuBoxTemplate'] && editorModel['getMenuBoxTemplate'](editor.name) || '';\n }));\n }\n _updateActions(actions) {\n this._popupService.actions([]);\n if (!actions || !actions.length)\n return;\n actions\n .sort((x, y) => (x.title < y.title ? -1 : x.title > y.title ? 1 : 0))\n .sort((x, y) => (x.weight || 0) - (y.weight || 0));\n this._wrapVisibleItems(actions, this._editor.name).forEach(visibleItem => {\n this._popupService.actions.push(visibleItem);\n });\n }\n _getTitles(item, currentItemPath = [], acc = []) {\n var title = ko.unwrap(item.title);\n (item.items || []).forEach(x => {\n var nextPath = title ? currentItemPath.concat([title]) : currentItemPath;\n this._getTitles(x, nextPath, acc);\n });\n var hint = ko.unwrap(item.hint);\n if (!hint || !title)\n return;\n var resultTitle = currentItemPath.concat([title]).join('. ');\n acc.push(resultTitle + ':\\n' + hint + '\\n');\n return acc;\n }\n _wrapVisibleItems(actions, editorName) {\n if (!actions)\n return undefined;\n return actions.map(modelAction => this._wrapActionClick(modelAction, editorName)).filter(x => !!x);\n }\n _wrapActionClick(modelAction, editorName) {\n if (this.actionFilter(modelAction)) {\n return {\n id: modelAction.id,\n items: this._wrapVisibleItems(modelAction.items, editorName),\n innerTemplate: modelAction.innerTemplate,\n itemTemplate: modelAction.itemTemplate,\n action: () => {\n modelAction.action(editorName);\n this._popupService.visible(false);\n },\n title: modelAction.title,\n hint: modelAction.hint,\n visible: () => { return true; }\n };\n }\n else {\n return null;\n }\n }\n showPopup(_, element) {\n this._popupService.title(this._editor.displayName());\n this._updateActions(this._editor.getPopupServiceActions());\n this._popupService.target(element);\n this._popupService.visible(true);\n }\n actionFilter(action) {\n return action.visible(this._editor.name);\n }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\internal\\_codeResolver.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport { guid } from '../../undo-engine/_utils';\nexport class CodeResolver {\n constructor() {\n this._queue = [];\n this._queueObj = {};\n this._done = [];\n this._doneOnce = [];\n }\n clear() {\n this._queue = [];\n this._queueObj = {};\n }\n done(callback) {\n this._done.push(callback);\n }\n doneOnce(callback) {\n this._doneOnce.push(callback);\n }\n _executeNext(id = this._queue[0]) {\n delete this._queueObj[id];\n while (this._queue.length > 0 && !this._queueObj[this._queue[0]]) {\n this._queue.splice(0, 1);\n }\n if (this._queue.length !== 0) {\n this._queueObj[this._queue[0]]();\n }\n else {\n for (var i = 0; i < this._done.length; i++) {\n this._done[i]();\n }\n do {\n var doOnceCallback = this._doneOnce.pop();\n doOnceCallback && doOnceCallback();\n } while (this._doneOnce.length);\n }\n }\n execute(func, time = 0) {\n var id = guid();\n var $deferred = $.Deferred();\n if (time) {\n this._queue.push(id);\n this._queueObj[id] = () => {\n if (!this._queueObj[id])\n return this._executeNext(id);\n setTimeout(() => {\n this._queueObj[id] && $deferred.resolve(func());\n this._executeNext(id);\n }, time);\n };\n if (this._queue.length === 1) {\n this._queueObj[this._queue[0]]();\n }\n }\n else {\n $deferred.resolve(func());\n }\n return {\n dispose: () => (delete this._queueObj[id], $deferred.reject()),\n force: () => (delete this._queueObj[id], $deferred.resolve(func())),\n doNext: () => (this._queue.splice(0, 0, id)),\n $promise: $deferred.promise()\n };\n }\n}\nexport var globalResolver = new CodeResolver();\n","/**\r\n* DevExpress Analytics (property-grid\\internal\\_popupService.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport class PopupService {\n constructor() {\n this.data = ko.observable();\n this.title = ko.observable();\n this.visible = ko.observable(false);\n this.disabled = ko.observable(false);\n this.actions = ko.observableArray([]);\n this.target = ko.observable();\n }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\localization\\_localization.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as localization from 'devextreme/localization';\nimport * as $ from 'jquery';\nimport { deserializeDate } from '../../serializer/utils';\nimport { extend } from '../../serializer/_utils';\nexport function loadMessages(_messages) {\n extend(messages, _messages);\n}\nfunction _processLocalization(id, _removeWinSymbols = removeWinSymbols) {\n var text = localize(id);\n if (text && _removeWinSymbols) {\n if (text.indexOf('&') !== -1 ||\n text.indexOf('
') !== -1 ||\n text.indexOf('') !== -1) {\n var obj = {};\n obj[id] = text.replace('&', '').replace('
', '').replace('', '');\n loadMessages(obj);\n return obj[id];\n }\n }\n}\nfunction _getLocalization(text) {\n return localize(text) || text;\n}\nexport function getLocalization(text, id = null, _removeWinSymbols = removeWinSymbols) {\n var _localizedText = id && localize(id) || _getLocalization(text);\n _localizedText = id && _processLocalization(id, _removeWinSymbols) || _localizedText;\n if (isCustomizedWithUpdateLocalizationMethod(_localizedText)) {\n text = _localizedText;\n }\n if (!isCustomizedWithUpdateLocalizationMethod(text)) {\n return _localizedText;\n }\n return _getLocalization(text);\n}\nexport var removeWinSymbols = true;\nexport var Globalize = Globalize || window['Globalize'];\nexport var messages = {};\nexport var custom_localization_values = {};\nexport function selectPlaceholder() {\n return getLocalization('Select...', 'AnalyticsCoreStringId.PropertyGrid_Editor_EmptyText');\n}\nexport function noDataText() {\n return getLocalization('No data to display', 'AnalyticsCoreStringId.DataPreview_Empty');\n}\nexport function searchPlaceholder() {\n return getLocalization('Enter text to search...', 'AnalyticsCoreStringId.QueryBuilder_SearchBox_EmptyText');\n}\nexport function resolveFromPromises(promises, createModel) {\n var deferred = $.Deferred();\n if (promises.length > 0) {\n $.when(...promises).done((...messages) => {\n messages.forEach(x => loadMessages(x[0]));\n }).always(() => deferred.resolve(createModel()));\n }\n else {\n deferred.resolve(createModel());\n }\n return deferred;\n}\nexport function isCustomizedWithUpdateLocalizationMethod(text) {\n return !!custom_localization_values[text];\n}\nexport function localizeWithUpdateLocalizationMethod(oldText) {\n return isCustomizedWithUpdateLocalizationMethod(oldText) ? getLocalization(oldText) : false;\n}\nexport function localize(val) {\n return messages[val];\n}\nexport function formatDate(val) {\n return localization.formatDate(val, 'shortDate');\n}\nexport function parseDate(val, useDefault = true, format) {\n if (!useDefault)\n return format ? localization.parseDate(val, format) : localization.parseDate(val, undefined);\n if (val) {\n if (val instanceof Date)\n return val;\n return deserializeDate(val);\n }\n return null;\n}\n","/**\r\n* DevExpress Analytics (property-grid\\localization\\_localizationStringIds.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var StringId = {\n MasterDetailRelationsEditor: 'DataAccessUIStringId.MasterDetailEditorForm_Title',\n DataAccessBtnOK: 'DataAccessUIStringId.Button_OK',\n DataAccessBtnCancel: 'DataAccessUIStringId.Button_Cancel',\n DataSourceWizardTitle: 'DataAccessUIStringId.WizardTitleDatasource',\n WizardPageConfigureQuery: 'DataAccessUIStringId.WizardPageConfigureQuery'\n};\n","/**\r\n* DevExpress Analytics (property-grid\\localization\\localization.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { loadMessages as _loadMessages } from './_localization';\nexport function loadMessages(messages) { _loadMessages(messages); }\n","/**\r\n* DevExpress Analytics (property-grid\\localization\\localization_utils.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { extend } from '../../serializer/_utils';\nimport { custom_localization_values, getLocalization as _getLocalization, messages, removeWinSymbols } from './_localization';\nexport function addCultureInfo(json) {\n extend(messages, json.messages);\n}\nexport function getLocalization(text, id, _removeWinSymblols) {\n return _getLocalization(text, id, removeWinSymbols);\n}\nexport function _stringEndsWith(value, searchString) {\n return value.indexOf(searchString, value.length - searchString.length) !== -1;\n}\nexport function updateLocalization(object) {\n extend(custom_localization_values, object);\n var messages = {};\n Object.keys(object).forEach(name => {\n messages[name] = object[name];\n });\n addCultureInfo({\n messages: messages\n });\n}\n","/**\r\n* DevExpress Analytics (property-grid\\propertygrid.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../serializer/utils';\nimport { defaultAccessibilityProvider } from './_propertiesAccessibilityProvider';\nimport { Editor } from './widgets/editor';\nimport { compareEditorInfo, findMatchesInString } from './widgets/internal/_utils';\nimport { EditorAddOn } from './internal/_addon';\nimport config from 'devextreme/core/config';\nimport { isEmptyObject } from '../serializer/_utils';\nexport class ObjectProperties extends Disposable {\n constructor(viewModel, editorsInfo, level = 0, parentDisabled = ko.observable(false), recreateEditors = false, textToSearch, popupService) {\n super();\n this._viewModelSubscription = null;\n this._infoSubscription = null;\n this._getInfoComputed = null;\n this._accessibilityProvider = defaultAccessibilityProvider;\n this.level = 0;\n this.rtl = config()['rtlEnabled'];\n if (popupService) {\n this.createEditorAddOn = (editor) => {\n var editorAddOn = new EditorAddOn(editor, this.popupService);\n editor._disposables.push(editorAddOn);\n return {\n templateName: 'dx-editor-addons',\n data: [editorAddOn]\n };\n };\n this.popupService = popupService;\n }\n this._editors = ko.observableArray([]).extend({ deferred: true });\n this.level = level;\n this._parentDisabled = parentDisabled;\n this._textToSearch = textToSearch;\n this._disposables.push(this.visible = ko.computed(() => {\n return this._editors().some(editor => editor.visible());\n }));\n this._viewModelSubscription = viewModel.subscribe((newVal) => {\n this._infoSubscription && this._infoSubscription.dispose();\n this._getInfoComputed && this._getInfoComputed.dispose();\n this._update(newVal, editorsInfo, recreateEditors);\n });\n this._update(viewModel(), editorsInfo, recreateEditors);\n }\n update(viewModel) {\n if (viewModel) {\n this._editors().forEach((editor) => {\n editor.update(viewModel);\n });\n }\n }\n _cleanEditorsSubscriptions() {\n this._editors().forEach((editor) => {\n editor.dispose();\n Object.keys(editor).forEach(name => {\n if (ko.isComputed(editor[name])) {\n editor[name].dispose();\n }\n });\n });\n }\n dispose() {\n super.dispose();\n this.disposeObservableArray(this._editors);\n this.resetObservableArray(this._editors);\n this.cleanSubscriptions();\n }\n cleanSubscriptions() {\n this._infoSubscription && this._infoSubscription.dispose();\n this._getInfoComputed && this._getInfoComputed.dispose();\n this._viewModelSubscription && this._viewModelSubscription.dispose();\n this._cleanEditorsSubscriptions();\n }\n cleanEditors() {\n this._cleanEditorsSubscriptions();\n this.resetObservableArray(this._editors);\n }\n findEditorByInfo(serializationInfo) {\n return this._editors().filter(editor => editor.name === serializationInfo.propertyName && compareEditorInfo(editor.info().editor, serializationInfo.editor))[0];\n }\n createEditor(modelPropertyInfo) {\n var editorType = modelPropertyInfo.editor && modelPropertyInfo.editor.editorType || Editor;\n var editor = new editorType(modelPropertyInfo, this.level, this._parentDisabled, this._textToSearch, this.popupService);\n editor.assignParent(this._parent);\n editor.registerAccessibilityProvider(this._accessibilityProvider);\n return editor;\n }\n createEditors(serializationInfo) {\n var self = this;\n return (serializationInfo || [])\n .filter(info => { return !!info.editor && !this.findEditorByInfo(info); })\n .map(info => { return this.createEditor(info); });\n }\n registerAccessibilityProvider(accessibilityProvider) {\n this._accessibilityProvider = accessibilityProvider;\n this._editors().forEach((editor) => {\n editor.registerAccessibilityProvider(accessibilityProvider);\n });\n }\n assignParent(parent) {\n this._parent = parent;\n this._editors().forEach((editor) => {\n editor.assignParent(parent);\n });\n }\n _createEditors(serializationInfo) {\n if (!serializationInfo || serializationInfo.length === 0)\n return false;\n var newEditors = this.createEditors(serializationInfo);\n if (!newEditors.length)\n return;\n var currentEditors = this._editors();\n if (currentEditors.length === 0) {\n currentEditors = newEditors;\n }\n else {\n newEditors.forEach((editor) => {\n var existEditorIndex = currentEditors.map(_editor => _editor.name).indexOf(editor.name);\n if (existEditorIndex !== -1)\n currentEditors.splice(existEditorIndex, 0, editor);\n else\n currentEditors.push(editor);\n });\n }\n this._editors(currentEditors);\n }\n _update(viewModel, editorsInfo, recreateEditors) {\n if (recreateEditors) {\n this.cleanEditors();\n }\n this._getInfoComputed = ko.computed(() => {\n return (editorsInfo && editorsInfo.editors && ko.unwrap(editorsInfo.editors))\n || (viewModel && viewModel['getInfo'] && viewModel['getInfo']());\n });\n this._infoSubscription = this._getInfoComputed.subscribe((newInfo) => {\n if (recreateEditors) {\n this.cleanEditors();\n }\n this._recreateEditors(viewModel, newInfo);\n });\n this._recreateEditors(viewModel, this._getInfoComputed());\n }\n _recreateEditors(viewModel, serializationInfo) {\n this._createEditors(serializationInfo);\n this.update(viewModel);\n }\n getEditors() {\n return this._editors();\n }\n}\nexport class PropertyGridEditor extends Editor {\n constructor(info, level, parentDisabled, textToSearch, _popupService) {\n super(info, level, parentDisabled, textToSearch);\n this._popupService = _popupService;\n this.editorCreated = ko.observable(false);\n this.viewmodel = this.createObjectProperties();\n if (!isEmptyObject(this.viewmodel)) {\n this.viewmodel.assignParent(this);\n }\n this._disposables.push(this.viewmodel);\n var subscription = this.collapsed.subscribe((newVal) => {\n if (!newVal) {\n subscription.dispose();\n this.editorCreated(true);\n }\n });\n this._disposables.push(subscription);\n if (textToSearch) {\n this._disposables.push(this.visibleByName = ko.computed(() => {\n var visible = !!findMatchesInString(this.displayName(), textToSearch());\n if (!isEmptyObject(this.viewmodel)) {\n this.viewmodel._editors().forEach((editor) => editor.isParentSearched(visible));\n }\n return visible;\n }));\n this.isSearchedProperty['dispose'] && this.isSearchedProperty['dispose']();\n this._disposables.push(this.isSearchedProperty = ko.computed(() => {\n if (this.visibleByName())\n return true;\n var visibleByEditors = this.viewmodel.visible();\n visibleByEditors && this.collapsed(false);\n return visibleByEditors;\n }));\n }\n }\n createObjectProperties() {\n return new ObjectProperties(this.value, { editors: ko.computed(() => { var _a, _b; return ((_a = this.value()) === null || _a === void 0 ? void 0 : _a.getInfo) && ((_b = this.value()) === null || _b === void 0 ? void 0 : _b.getInfo()) || this.info().info; }) }, this.level + 1, this.disabled, undefined, this.textToSearch, this._popupService);\n }\n registerAccessibilityProvider(accessibilityProvider) {\n super.registerAccessibilityProvider(accessibilityProvider);\n this.viewmodel.registerAccessibilityProvider(accessibilityProvider);\n }\n}\nexport class PropertyGridEditorFlat extends PropertyGridEditor {\n createObjectProperties() {\n this.collapsed(false);\n this.editorCreated(true);\n this.level = -1;\n return super.createObjectProperties();\n }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\collectioneditor\\_bindings.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { CollectionEditorViewModel } from './_editor';\nimport { addDisposeCallback } from '../../../serializer/_internal';\nimport { getTemplate } from '../templateUtils';\nko.bindingHandlers['dxCollectionEditor'] = {\n init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var values = valueAccessor(), gridViewModel = new CollectionEditorViewModel(values, viewModel.disabled), templateHtml = getTemplate(values.editorTemplate || '#dx-collectioneditor'), $templateHtml = $.fn.constructor(templateHtml), itemTemplateName = values.info && values.info() && values.info()['template'] || values.template;\n if (itemTemplateName) {\n var itemTemplateHtml = getTemplate(itemTemplateName);\n $templateHtml.find('.dx-collection-item').append($.fn.constructor(itemTemplateHtml));\n }\n else {\n $templateHtml.find('.dx-collection-item').append($.fn.constructor(element).children());\n }\n var $element = $.fn.constructor(element).append($templateHtml);\n var childContext = bindingContext.createChildContext(gridViewModel);\n ko.applyBindings(childContext, $element.children()[0]);\n addDisposeCallback(element, () => gridViewModel.dispose());\n return { controlsDescendantBindings: true };\n }\n};\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\collectioneditor\\_editor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../../serializer/utils';\nimport { propertiesGridEditorsPaddingLeft } from '../internal/_internal';\nimport { getLocalization } from '../../localization/localization_utils';\nimport { addDisposeCallback } from '../../../serializer/_internal';\nimport { ListKeyboardHelper } from '../../../accessibility/_listKeyboardHelper';\nimport { guid } from '../../../undo-engine/_utils';\nexport class CollectionItemWrapper extends Disposable {\n constructor(editor, array, index, displayNameField = '') {\n super();\n this.collapsed = ko.observable(true);\n this.selected = ko.observable(false);\n this._disposables.push(this.value = ko.computed({\n read: () => {\n return array.peek()[index()];\n },\n write: (val) => {\n array.peek()[index()] = val;\n }\n }));\n this.editor = editor;\n this.index = index;\n this._disposables.push(this.name = ko.computed(() => {\n return displayNameField && this.value() && this.value()[displayNameField] ? ko.unwrap(this.value()[displayNameField]) : index();\n }));\n }\n}\nexport class CollectionEditorViewModel extends Disposable {\n constructor(options, disabled = ko.observable(false)) {\n super();\n this.buttonMap = {\n 'delete': { text: 'Delete', localizationId: 'AnalyticsCoreStringId.Cmd_Delete' },\n 'add': { text: 'Add', localizationId: 'DataAccessUIStringId.Button_Add' },\n 'down': { text: 'Move Down', localizationId: 'AnalyticsCoreStringId.Cmd_MoveDown' },\n 'up': { text: 'Move Up', localizationId: 'AnalyticsCoreStringId.Cmd_MoveUp' }\n };\n this.selectedIndex = ko.observable(null);\n this.alwaysShow = ko.observable(false);\n this.collapsed = ko.observable(options.collapsed !== false);\n var addHandler = () => (options.addHandler || options.info && options.info() && options.info()['addHandler']).call(this);\n var removeHandler = options.removeHandler;\n var hideButtons = options.hideButtons || options.info && options.info() && options.info()['hideButtons'];\n this._textEmptyArray = options.textEmptyArray || { text: 'To create an item click the Add button.', localizationId: 'AnalyticsCoreStringId.SqlDSWizard_PageConfigureParametersEmpty' };\n this.displayPropertyName = options.info && options.info() && options.info()['displayPropertyName'] || options.displayName;\n this._disposables.push(this.showButtons = ko.computed(() => {\n return !ko.unwrap(hideButtons) && !this.collapsed();\n }));\n this.showScroll = !!options.showScroll;\n var _isDisabled = (selectedIndex, name) => {\n if (options.isDisabledButton) {\n return options.isDisabledButton(selectedIndex, name);\n }\n else if (name === 'delete') {\n return selectedIndex === null;\n }\n else if (name === 'add') {\n return false;\n }\n else if (name === 'up') {\n return selectedIndex === null || selectedIndex === 0;\n }\n else if (name === 'down') {\n return selectedIndex === null || selectedIndex === (this.values().length - 1);\n }\n };\n this.isDisabledButton = (name) => {\n return disabled() || _isDisabled(this.selectedIndex(), name);\n };\n this.isVisibleButton = (name) => {\n if (!this.showButtons()) {\n return false;\n }\n else\n return options.isVisibleButton ? options.isVisibleButton(this.selectedIndex(), name) : true;\n };\n this.padding = options.level !== void 0 ? options.level * propertiesGridEditorsPaddingLeft() : 0;\n this.displayName = (options.info && options.info()) ? getLocalization(options.info().displayName, options.info().localizationId) : options.displayName;\n this.options = options;\n if (!options.displayName) {\n this.collapsed(false);\n this.alwaysShow(true);\n }\n if (options.alwaysShow)\n this.alwaysShow(true);\n this._disposables.push(this.values = ko.computed(() => {\n this._timeoutItemRendered && clearTimeout(this._timeoutItemRendered);\n this._timeoutItemRendered = setTimeout(() => {\n this.listKeyboardHelper && this.listKeyboardHelper.initialize();\n }, 100);\n return ko.unwrap(options.values());\n }));\n var selectedItem = ko.unwrap(options.selectedItem);\n if (selectedItem) {\n this._setSelectedIndex(selectedItem);\n this._disposables.push(options.selectedItem.subscribe((newVal) => {\n this._setSelectedIndex(newVal);\n }));\n }\n this.add = (model) => {\n model.event.stopPropagation();\n options.undoEngine && options.undoEngine().start();\n var item = addHandler();\n if (!item)\n return;\n var index = options.values().push(item);\n options.undoEngine && options.undoEngine().end();\n if (options.selectedItem) {\n this.select({ index: () => index - 1 });\n }\n };\n this.up = (model) => {\n this._move(options.values(), -1);\n model.event.stopPropagation();\n };\n this.down = (model) => {\n this._move(options.values(), 1);\n model.event.stopPropagation();\n };\n this.remove = (model) => {\n model.event.stopPropagation();\n if (this.selectedIndex() < 0)\n return;\n if (removeHandler) {\n options.undoEngine && options.undoEngine().start();\n var selectedItem = options.values()()[this.selectedIndex()];\n removeHandler(selectedItem);\n options.undoEngine && options.undoEngine().end();\n }\n else {\n options.values().splice(this.selectedIndex(), 1);\n }\n var valuesCount = options.values()().length;\n if (valuesCount > 0) {\n this.select({\n index: () => this.selectedIndex() >= valuesCount ? valuesCount - 1 : this.selectedIndex()\n }, true);\n }\n else {\n this.select({ index: () => null }, true);\n }\n };\n this.select = (model, force = false) => {\n if (this.selectedIndex() === model.index() && !force)\n return;\n this.selectedIndex(model.index());\n if (options.selectedItem) {\n options.selectedItem(this.selectedIndex() !== null ? this.values()[this.selectedIndex()] : null);\n }\n };\n this.disabled = disabled;\n this.listKeyboardHelper = new ListKeyboardHelper();\n this.headerId = `dxrd-ce-trigger-${guid()}`;\n this.contentId = `dxrd-ce-pannel-${guid()}`;\n }\n dispose() {\n super.dispose();\n this.removeProperties();\n }\n _move(array, offset) {\n if (this.selectedIndex() >= 0) {\n var old_index = this.selectedIndex(), new_index = old_index + offset;\n if ((new_index >= array().length) || (new_index < 0)) {\n return;\n }\n array.splice(new_index, 0, array.splice(old_index, 1)[0]);\n this.selectedIndex(new_index);\n }\n }\n _setSelectedIndex(selectedItem) {\n var index = this.values().indexOf(selectedItem);\n this.selectedIndex(index === -1 ? null : index);\n }\n getDisplayTextButton(key) {\n return getLocalization(this.buttonMap[key].text, this.buttonMap[key].localizationId);\n }\n getDisplayTextEmptyArray() {\n return getLocalization(this._textEmptyArray.text, this._textEmptyArray.localizationId);\n }\n createCollectionItemWrapper(grandfather, index, element) {\n var wrapper = new CollectionItemWrapper(grandfather, this.values, index, this.displayPropertyName);\n addDisposeCallback(element, () => wrapper.dispose());\n return wrapper;\n }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\editor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { Disposable } from '../../serializer/utils';\nimport { findMatchesInString, compareEditorInfo } from './internal/_utils';\nimport { defaultAccessibilityProvider } from '../_propertiesAccessibilityProvider';\nimport { EditorValidator } from './editorValidator';\nimport { getLocalization } from '../localization/localization_utils';\nimport { propertiesGridEditorsPaddingLeft } from './internal/_internal';\nimport { editorTemplates } from './editorsInfo';\nimport config from 'devextreme/core/config';\nimport { extend } from '../../serializer/_utils';\nimport { roundingXDecimals } from '../../core/utils/_units';\nimport { guid } from '../../undo-engine/_utils';\nexport class Editor extends Disposable {\n constructor(modelPropertyInfo, level, parentDisabled = ko.observable(false), textToSearch = undefined) {\n super();\n this._model = ko.observable();\n this._parent = ko.observable(null);\n this.isSearchedProperty = ko.observable(true);\n this.isParentSearched = ko.observable(false);\n this.rtl = config().rtlEnabled;\n this._accessibilityProvider = ko.observable(defaultAccessibilityProvider);\n this._validator = new EditorValidator(this);\n this._cachedValue = undefined;\n this.isEditorSelected = ko.observable(false);\n this.isRequired = false;\n this.isRendered = ko.observable(false);\n this.collapsed = ko.observable(true);\n this.alwaysShow = ko.observable(false);\n this.info = ko.observable(modelPropertyInfo);\n this._disposables.push(this.displayName = ko.computed({\n read: () => {\n var info = this.info();\n return info && getLocalization(info.displayName, info['localizationId']);\n },\n write: (value) => { }\n }));\n if (textToSearch) {\n this.textToSearch = textToSearch;\n this._disposables.push(this.isSearchedProperty = ko.computed(() => {\n return this.isParentSearched() || !!findMatchesInString(this.displayName(), textToSearch());\n }));\n }\n this.padding = this._setPadding(this.rtl ? 'right' : 'left', level * propertiesGridEditorsPaddingLeft());\n var defaultValue = ko.observable(null), propertyName = modelPropertyInfo.propertyName;\n this._disposables.push(this._editorOptions = ko.pureComputed(() => this.info().editorOptions));\n this.validatorOptions = modelPropertyInfo.validatorOptions;\n this.isRequired = modelPropertyInfo.isRequired;\n if (modelPropertyInfo.defaultVal !== undefined) {\n defaultValue = ko.observable(modelPropertyInfo.defaultVal);\n }\n if (modelPropertyInfo.from) {\n defaultValue = modelPropertyInfo.from(modelPropertyInfo.defaultVal);\n }\n if (modelPropertyInfo.array) {\n defaultValue = ko.observableArray();\n }\n this._disposables.push(this.values = ko.computed(() => {\n var _values = this.info().valueStore || this.info().valuesArray;\n if (_values) {\n return _values;\n }\n _values = ko.unwrap(this.info().values);\n if (_values) {\n return $.map(_values, (displayValue, value) => {\n return { value: value, displayValue: displayValue };\n });\n }\n }));\n this.level = level;\n this._init(modelPropertyInfo.editor, defaultValue, propertyName);\n this._disposables.push(this.disabled = ko.computed(() => {\n return parentDisabled() || this._accessibilityProvider() && this._accessibilityProvider().isPropertyDisabled(this);\n }));\n this._disposables.push(this.visible = ko.computed(() => {\n return this.isSearchedProperty() && this._accessibilityProvider() && this._accessibilityProvider().isPropertyVisible(this);\n }));\n this._disposables.push(this.isPropertyModified = ko.computed(() => {\n return !!(this._model() && this._model().isPropertyModified && this._model().isPropertyModified(this.name));\n }));\n this._disposables.push(this.isPropertyHighlighted = ko.pureComputed(() => {\n if (this._shouldSkipHighlighting(this.name))\n return false;\n var controlModel = this._model();\n return !!(controlModel && controlModel.isPropertyHighlighted && controlModel.isPropertyHighlighted(this.name));\n }));\n this.headerId = `dxrd-accordion-trigger-${guid()}`;\n this.contentId = `dxrd-accordion-pannel-${guid()}`;\n this.editorInputId = `dxrd-editor-${guid()}`;\n }\n _setPadding(position, value) {\n var obj = {};\n obj['padding-' + position] = value;\n return obj;\n }\n dispose() {\n this._validator && this._validator.dispose();\n this._validator = null;\n super.dispose();\n this._cachedValue = null;\n this._model(null);\n }\n _shouldSkipHighlighting(propertyName) {\n return this.isComplexEditor;\n }\n _assignValue(modelValue, model, newValue, name) {\n if (ko.isObservable(modelValue)) {\n modelValue(newValue);\n }\n else {\n model[name] = newValue;\n }\n }\n _roundTwoDesemialsForUnitProperties(value, model, propertyName) {\n var properties = model && model['constructor'] && model['constructor'].unitProperties;\n if (!properties || properties.indexOf(propertyName) === -1)\n return value;\n return roundingXDecimals(value);\n }\n _init(editorTemplate, value, name) {\n editorTemplate = editorTemplate || editorTemplates.getEditor('text');\n this.templateName = editorTemplate.header;\n this.contentTemplateName = editorTemplate.content;\n this._cachedValue = undefined;\n this._disposables.push(this.value = ko.computed({\n read: () => {\n var model = this._model();\n if (!model && this._cachedValue) {\n return this._cachedValue;\n }\n var modelValue = model && model[name] !== undefined ? model[name] : value;\n if (ko.isObservable(modelValue) && !modelValue['push']) {\n var hasValueInModel = modelValue() !== undefined && modelValue() !== null;\n this._cachedValue = hasValueInModel ? this._roundTwoDesemialsForUnitProperties(modelValue(), model, name) : this.defaultValue;\n return this._cachedValue;\n }\n else {\n this._cachedValue = modelValue;\n return this._cachedValue;\n }\n },\n write: (newValue) => {\n var model = this._model();\n if (!model) {\n return;\n }\n var modelValue = model[name];\n this._validator.assignWithValidation(newValue, () => {\n this._assignValue(modelValue, model, newValue, name);\n });\n }\n }));\n this.name = name;\n this.editorTemplate = editorTemplate && editorTemplate.custom || 'dx-property-editor';\n }\n _getInfoFromModel(viewModel) {\n if (!viewModel)\n return null;\n var modelInfo = viewModel['getInfo'] && viewModel['getInfo']();\n if (modelInfo) {\n return modelInfo.filter(property => property.propertyName === this.name)[0];\n }\n return null;\n }\n update(viewModel) {\n if (!!viewModel) {\n var propertyInfo = this._getInfoFromModel(viewModel);\n var isSameEditorType = propertyInfo && compareEditorInfo(propertyInfo.editor, this.info().editor);\n if (isSameEditorType && this.info() !== propertyInfo) {\n this.info(propertyInfo);\n }\n this._model(this.name in viewModel && (isSameEditorType || !propertyInfo) ? viewModel : null);\n }\n else {\n this._model(null);\n }\n }\n getOptions(templateOptions) {\n var extendedOptions = this.info.peek().editor.extendedOptions;\n return extend(true, {}, templateOptions, this.editorOptions, extendedOptions);\n }\n getValidatorOptions(templateValidatorOptions) {\n return this._validator && this._validator.getValidatorOptions(templateValidatorOptions);\n }\n registerAccessibilityProvider(accessibilityProvider) {\n if (this._accessibilityProvider() != accessibilityProvider)\n this._accessibilityProvider(accessibilityProvider);\n }\n assignParent(parent) {\n if (this._parent() != parent)\n this._parent(parent);\n }\n _getEditorValidationRules() {\n var info = ko.unwrap(this.info);\n if (!info)\n return;\n var validationRules = info.validationRules;\n return validationRules || (validationRules === null ? null : []);\n }\n getValidationRules() {\n return this._validator && this._validator.getValidationRules();\n }\n get validationRules() {\n return this.getValidationRules();\n }\n getPopupServiceActions() {\n if (!this._model()) {\n return;\n }\n var actions = (this._model().actions || []).concat();\n (this._model().actionProviders || [])\n .forEach((provider) => {\n var additionalActions = provider && provider.getActions(this.name) || [];\n additionalActions.forEach((action) => actions.push(action));\n });\n return actions;\n }\n get editorOptions() { return ko.unwrap(this._editorOptions); }\n get isComplexEditor() { return !!this.contentTemplateName; }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\editorValidator.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { Disposable } from '../../serializer/utils';\nimport validationEngine from 'devextreme/ui/validation_engine';\nimport { extend } from '../../serializer/_utils';\nexport class EditorValidator extends Disposable {\n constructor(_editor) {\n super();\n this._editor = _editor;\n this._lastValidatorOptions = null;\n this._lastModelOverridableRules = null;\n this._onValidatedHandler = undefined;\n }\n dispose() {\n this.onValidatedHandler = null;\n this.validatorInstance && this.validatorInstance.dispose();\n this.validatorInstance = null;\n super.dispose();\n }\n _isValid(validationRules, newValue) {\n this.onValidatedHandler = undefined;\n if (this.validatorInstance) {\n (validationRules || []).forEach(rule => rule && (rule.validator = this.validatorInstance));\n return this.validatorInstance.validate();\n }\n else {\n return validationEngine['validate'](newValue, validationRules, this._editor.displayName());\n }\n }\n get validatorInstance() {\n return this._validatorInstance;\n }\n set validatorInstance(newValue) {\n if (this._validatorInstance && this.onValidatedHandler) {\n this._validatorInstance.off('validated', this._onValidatedHandler);\n }\n this._validatorInstance = newValue;\n }\n get onValidatedHandler() {\n return this._onValidatedHandler;\n }\n set onValidatedHandler(newValue) {\n if (this._onValidatedHandler && this.validatorInstance) {\n this.validatorInstance.off('validated', this._onValidatedHandler);\n this._onValidatedHandler = newValue;\n if (newValue) {\n this.validatorInstance.on('validated', this._onValidatedHandler);\n }\n }\n }\n getValidationRules() {\n var options = this.getValidatorOptions();\n var resultRules = (options || {}).validationRules;\n return resultRules || (resultRules === null ? null : []);\n }\n getValidatorOptions(templateValidatorOptions = {}) {\n var info = this._editor.info.peek();\n if (!info)\n return;\n var options = this._lastValidatorOptions;\n var modelOverridableRules = this._editor._getEditorValidationRules();\n if (options && !this.areRulesChanged(modelOverridableRules)) {\n return options;\n }\n this._lastModelOverridableRules = modelOverridableRules;\n var extendedValidationRules = this._concatValidationRules(info.validatorOptions, modelOverridableRules);\n var extendedValidatorOptions = info.editor.extendedOptions && info.editor.extendedOptions.validatorOptions;\n var options = extend({}, templateValidatorOptions, info.validatorOptions, { validationRules: extendedValidationRules }, extendedValidatorOptions);\n this._wrapValidatorEvents(options);\n this._lastValidatorOptions = options;\n return options;\n }\n areRulesChanged(overridableRuleSet) {\n if (!(this._lastModelOverridableRules && this._lastModelOverridableRules.length)) {\n return overridableRuleSet && overridableRuleSet.length;\n }\n else if (!overridableRuleSet || !overridableRuleSet.length) {\n return true;\n }\n else {\n return !overridableRuleSet.every(newRule => {\n return this._lastModelOverridableRules.some(rule => {\n return newRule.message === rule.message && newRule.validationCallback === rule.validationCallback && newRule.type === rule.type;\n });\n });\n }\n }\n wrapOnValidatorInitialized(options) {\n var onInitializedHandler = options.onInitialized;\n var _this = this;\n options.onInitialized = function (e) {\n _this._onValidatorInitialized(e);\n onInitializedHandler && onInitializedHandler.apply(this, arguments);\n };\n }\n _onValidatorInitialized(e) {\n this.validatorInstance = e && e.component;\n }\n _concatValidationRules(validatorOptions, validationRules) {\n if ((!validatorOptions || !validatorOptions.validationRules) && !validationRules) {\n return null;\n }\n return ((validatorOptions || {}).validationRules || []).concat(validationRules || []);\n }\n _wrapValidatorEvents(validatorOptions) {\n if (!validatorOptions || !validatorOptions.validationRules || !validatorOptions.validationRules.length) {\n return;\n }\n this.wrapOnValidatorInitialized(validatorOptions);\n return validatorOptions;\n }\n assignWithValidation(newValue, assignValueFunc) {\n var validationRules = this.getValidationRules();\n var assignValueFirst = !validationRules || validationRules.some(x => x.assignValueFirst);\n if (assignValueFirst) {\n assignValueFunc();\n }\n var validationResult = this._isValid(validationRules, newValue);\n if (!validationResult.isValid) {\n if (validationResult.brokenRule && validationResult.brokenRule['isDeferred']) {\n this.onValidatedHandler = (result) => {\n this.onValidatedHandler = undefined;\n if (!result.isValid)\n return;\n assignValueFunc();\n };\n }\n return;\n }\n if (!assignValueFirst) {\n assignValueFunc();\n }\n }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\editorsInfo.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { extend } from '../../serializer/_utils';\nexport class EditorTemplates {\n constructor(_useDeferredRegistration = true) {\n this._useDeferredRegistration = _useDeferredRegistration;\n this._editorTemplates = {};\n }\n register(name, editorInfo) {\n if (!!this._editorTemplates[name] && !this._editorTemplates[name]._deferred) {\n throw Error(`Editor with name ${name} is already exists`);\n }\n else if (!this._editorTemplates[name]) {\n this._editorTemplates[name] = editorInfo;\n }\n else {\n delete this._editorTemplates[name]._deferred;\n extend(this._editorTemplates[name], editorInfo);\n }\n }\n unregister(name) {\n delete this._editorTemplates[name];\n }\n registerEditors(editors) {\n for (var name in editors)\n this.register(name, editors[name]);\n }\n getEditor(name) {\n if (!this._editorTemplates[name] && this._useDeferredRegistration) {\n this._editorTemplates[name] = { _deferred: true };\n }\n return this._editorTemplates[name];\n }\n}\nexport var editorTemplates = new EditorTemplates();\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\fonteditor\\_fonts.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport var availableFonts = ko.observable({});\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\fonteditor\\_model.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../../serializer/utils';\nimport { defaultFontSerialization } from '../internal/_internal';\nexport var availableUnits = [\n { value: 'pt', displayValue: 'Point', localizationId: 'DevExpress.ReportDesigner_FontOptions_Unit_Point' },\n { value: 'world', displayValue: 'World', localizationId: 'AnalyticsCoreStringId.FontOptions_Unit_World' },\n { value: 'px', displayValue: 'Pixel', localizationId: 'AnalyticsCoreStringId.FontOptions_Unit_Pixel' },\n { value: 'in', displayValue: 'Inch', localizationId: 'AnalyticsCoreStringId.Wizard_Inch' },\n { value: 'doc', displayValue: 'Document', localizationId: 'PreviewStringId.ReportDesigner_FontOptions_Unit_Document' },\n { value: 'mm', displayValue: 'Millimetr', localizationId: 'AnalyticsCoreStringId.Wizard_Millimeter' }\n];\nexport class FontModel extends Disposable {\n constructor(value) {\n super();\n this.family = ko.observable(null);\n this.unit = ko.observable(null);\n this.isUpdateModel = false;\n this.size = ko.observable(null);\n this.modificators = {\n bold: ko.observable(false),\n italic: ko.observable(false),\n strikeout: ko.observable(false),\n underline: ko.observable(false)\n };\n this.updateModel(value());\n this._disposables.push(value.subscribe((newVal) => {\n this.isUpdateModel = true;\n this.updateModel(newVal);\n this.isUpdateModel = false;\n }));\n this._disposables.push(this.modificators.bold.subscribe((newVal) => this.updateValue(value)));\n this._disposables.push(this.modificators.italic.subscribe((newVal) => this.updateValue(value)));\n this._disposables.push(this.modificators.strikeout.subscribe((newVal) => this.updateValue(value)));\n this._disposables.push(this.modificators.underline.subscribe((newVal) => this.updateValue(value)));\n this._disposables.push(this.family.subscribe((newVal) => this.updateValue(value)));\n this._disposables.push(this.size.subscribe((newVal) => this.updateValue(value)));\n this._disposables.push(this.unit.subscribe((newVal) => this.updateValue(value)));\n }\n _toString() {\n var leftPart = [this.family(), this.size() + this.unit()].join(', ');\n var modificators = [];\n if (this.modificators.bold())\n modificators.push('Bold');\n if (this.modificators.italic())\n modificators.push('Italic');\n if (this.modificators.underline())\n modificators.push('Underline');\n if (this.modificators.strikeout())\n modificators.push('Strikeout');\n var rightPart = modificators.join(', ');\n return !!rightPart ? [leftPart, rightPart].join(', style=') : leftPart;\n }\n updateModel(value) {\n if (!value)\n value = defaultFontSerialization();\n var components = value.split(',');\n this.family(components[0]);\n var self = this;\n availableUnits.forEach(function (element) {\n if (components[1].trim().indexOf(element.value) != -1) {\n self.size(parseFloat(components[1].split(element.value)[0]));\n self.unit(element.value);\n }\n });\n this.modificators.bold(value.indexOf('Bold') !== -1);\n this.modificators.italic(value.indexOf('Italic') !== -1);\n this.modificators.underline(value.indexOf('Underline') !== -1);\n this.modificators.strikeout(value.indexOf('Strikeout') !== -1);\n }\n updateValue(value) {\n if (!this.isUpdateModel) {\n value(this._toString());\n }\n }\n}\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\fonteditor\\metadata.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { editorTemplates } from '../editorsInfo';\nimport { availableFonts } from './_fonts';\nimport { availableUnits } from './_model';\nexport var fontName = {\n propertyName: 'family', displayName: 'Font Name', localizationId: 'AnalyticsCoreStringId.FormatFontName',\n editor: editorTemplates.getEditor('combobox'), values: availableFonts, editorOptions: { searchEnabled: true }\n};\nexport var fontSize = {\n propertyName: 'size', displayName: 'Size', localizationId: 'AnalyticsCoreStringId.Font.Size', editor: editorTemplates.getEditor('numeric')\n};\nexport var fontSizeUnit = {\n propertyName: 'unit', displayName: 'Unit', localizationId: 'AnalyticsCoreStringId.Font.Unit', editor: editorTemplates.getEditor('combobox'),\n valuesArray: availableUnits\n};\nexport var fontInfo = [\n fontName,\n fontSize,\n fontSizeUnit,\n { propertyName: 'modificators', editor: editorTemplates.getEditor('modificators') },\n];\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\internal\\_bindingsCache.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport config from 'devextreme/core/config';\nimport * as ko from 'knockout';\nvar cache = {};\nfunction createBaseFunction(controlName, optionsName) {\n return function ($context, $index) {\n var obj = {};\n obj[controlName] = function () {\n if (optionsName === '$data')\n return $context.$data;\n return optionsName === undefined ? undefined : $context.$data[optionsName];\n };\n return obj;\n };\n}\nexport function registerBaseBinding(bindingName, optionsName) {\n addToBindingsCache(!optionsName ? bindingName : `${bindingName}: ${optionsName}`, createBaseFunction(bindingName, optionsName));\n}\nexport function addToBindingsCache(key, value) {\n cache[key] = value;\n}\nfunction getFromCache(key) {\n return cache[key];\n}\nregisterBaseBinding('svgAttrs');\nregisterBaseBinding('dxButtonWithTemplate', 'options');\nregisterBaseBinding('dxButton', 'options');\nregisterBaseBinding('dxCheckBox', 'options');\nregisterBaseBinding('dxToolbarBase', 'options');\nregisterBaseBinding('dxToolbar', 'options');\nregisterBaseBinding('treelist', 'options');\nvar currentParseBindingsString = ko.bindingProvider.prototype.parseBindingsString;\nko.utils.extend(ko.bindingProvider.prototype, {\n 'parseBindingsString': function (bindingsString, bindingContext, node, options) {\n try {\n var func = getFromCache(bindingsString.trim());\n if (func)\n return func(bindingContext, node);\n return currentParseBindingsString.call(ko.bindingProvider.instance, bindingsString, bindingContext, node, options);\n }\n catch (ex) {\n ex.message = 'Unable to parse bindings.\\nBindings value: ' + bindingsString + '\\nMessage: ' + ex.message;\n throw ex;\n }\n }\n});\nvar optionsParser = config()['optionsParser'];\nconfig({\n optionsParser: function (optionsString) {\n var func = getFromCache(optionsString.trim());\n if (func)\n return func();\n return optionsParser(optionsString);\n }\n});\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\internal\\_internal.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { createGlobalModuleVariableFunc } from '../../../serializer/_internal';\nimport { getLocalization } from '../../localization/localization_utils';\nexport var propertiesGridEditorsPaddingLeft = createGlobalModuleVariableFunc(19);\nexport var defaultFontSerialization = createGlobalModuleVariableFunc('Times New Roman, 9.75pt');\nfunction RegexGuid(guid) {\n return (/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(guid)\n || /^\\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\}$/.test(guid)\n || /^\\([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\)$/.test(guid)\n || /^[0-9a-fA-F]{32}$/.test(guid));\n}\nexport function validateGuid(guid) {\n return guid && RegexGuid(guid);\n}\nexport function validateNullableGuid(guid) {\n return !guid || RegexGuid(guid);\n}\nvar guidValidationMessage = () => getLocalization('Guid is required and should have a valid format.', 'AnalyticsCoreStringId.GuidIsRequired_Error');\nexport var guidValidationRules = [{\n type: 'custom',\n validationCallback: (options) => { return validateNullableGuid(options.value); },\n get message() {\n return guidValidationMessage();\n }\n }];\nexport var guidRequiredValidationRules = [{\n type: 'required',\n get message() {\n return guidValidationMessage();\n }\n }];\nvar requiredValidationRule = {\n type: 'required',\n get message() {\n return getLocalization('The value cannot be empty', 'AnalyticsCoreStringId.ParametersPanel_DateTimeValueValidationError');\n }\n};\nexport var requiredValidationRules = [requiredValidationRule];\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\internal\\_svgTemplateEngine.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nclass SvgTemplateSource {\n constructor(template, _data, _templates) {\n this._data = _data;\n this._templates = _templates;\n this.templateName = template;\n }\n data(key, value) {\n this._data[this.templateName] = this._data[this.templateName] || {};\n if (arguments.length === 1) {\n return this._data[this.templateName][key];\n }\n this._data[this.templateName][key] = value;\n }\n text(value) {\n if (arguments.length === 0) {\n if (this.templateName in this._templates)\n return this._templates[this.templateName];\n else\n throw new Error('Cannot find template with ID ' + this.templateName);\n }\n this._templates[this.templateName] = value;\n }\n}\nexport class SvgTemplatesEngine {\n constructor() {\n this._hasTemplate = (name, findEverywhere) => {\n return findEverywhere && !!document.getElementById(name) || this._templates.hasOwnProperty(name);\n };\n this._data = {};\n this._templates = {};\n }\n static get Instance() {\n return this._instance || (this._instance = new this());\n }\n static get templates() {\n return SvgTemplatesEngine.Instance._templates;\n }\n static addTemplate(templateName, templateMarkup) {\n SvgTemplatesEngine.templates[templateName] = templateMarkup;\n }\n static addTemplates(templates) {\n ko.utils.extend(SvgTemplatesEngine.templates, templates);\n }\n static getExistingTemplate(name, findEverywhere = true) {\n return SvgTemplatesEngine.Instance._hasTemplate(name, findEverywhere) ? name : undefined;\n }\n}\nvar makeTemplateSource = ko.templateEngine.prototype['makeTemplateSource'];\nko.templateEngine.prototype['makeTemplateSource'] = function (template, doc) {\n if (typeof template === 'string' && SvgTemplatesEngine.getExistingTemplate(template, false) && !document.getElementById(template)) {\n return new SvgTemplateSource(template, SvgTemplatesEngine['_instance']['_data'], SvgTemplatesEngine.templates);\n }\n else {\n return makeTemplateSource.apply(this, [template, doc]);\n }\n};\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\internal\\_utils.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport { formatDate } from '../../localization/_localization';\nexport var SearchMode;\n(function (SearchMode) {\n SearchMode[SearchMode[\"contains\"] = 0] = \"contains\";\n SearchMode[SearchMode[\"startWith\"] = 1] = \"startWith\";\n})(SearchMode || (SearchMode = {}));\nexport function _getFileContent(content, readMode) {\n return readMode !== 'text' ? (content).replace(/(^data:[^,]+,)|(^data:)/, '') : content;\n}\nfunction _uploadFile(filesHolder, deferred, options) {\n try {\n var files = filesHolder.files;\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n if (options.type === 'img') {\n var imageType = /image.*/;\n if (!file.type.match(imageType)) {\n continue;\n }\n }\n var fr = new FileReader();\n var format = file.name.split('.').pop();\n fr.onload = () => {\n try {\n deferred.resolve({\n format: format,\n content: _getFileContent(fr.result, options.readMode)\n });\n }\n catch (e) {\n deferred.reject();\n }\n };\n options.readMode === 'text' || format === 'html' || format === 'htm' ? fr.readAsText(file) : fr.readAsDataURL(file);\n }\n }\n catch (e) {\n deferred.reject();\n }\n}\nvar fileUploaderId = 'dxd-fileuploader-input';\nfunction createFileUploaderElement() {\n var input = document.createElement('input');\n input.type = 'file';\n input.id = fileUploaderId;\n input.style.width = '0px';\n input.style.height = '0px';\n input.style.display = 'none';\n document.body.appendChild(input);\n return input;\n}\nexport var uploadFile = (options) => {\n var deferred = $.Deferred();\n var element = document.getElementById(fileUploaderId);\n if (!element) {\n element = createFileUploaderElement();\n }\n element.accept = options.accept;\n element.onchange = () => {\n _uploadFile(element, deferred, options);\n element.value = '';\n };\n element.click();\n return deferred.promise();\n};\nexport var _replaceUploadFile = (newFunc) => uploadFile = newFunc;\nexport function setUploadFile(newFunc) {\n uploadFile = newFunc;\n}\nexport function compareEditorInfo(editor1, editor2) {\n return !!editor1 && !!editor2 &&\n editor1.header === editor2.header\n && editor1.content === editor2.content\n && editor1.editorType === editor2.editorType;\n}\nexport function findMatchesInString(stringWhereSearch, searchPattern, options) {\n if (!options) {\n var searchExpr = escapeToRegExp(searchPattern);\n return !!stringWhereSearch && stringWhereSearch.match(new RegExp(searchExpr, 'gi'));\n }\n var searchExpr = !options.canUseRegex ? escapeToRegExp(searchPattern) : searchPattern;\n if (options.searchMode == SearchMode.startWith && !options.canUseRegex)\n searchExpr = '^' + searchExpr;\n var exprRule = '';\n if (!options.caseSensitive)\n exprRule = exprRule + 'i';\n if (options.globalMatch)\n exprRule = exprRule + 'g';\n return !!stringWhereSearch && stringWhereSearch.match(new RegExp(searchExpr, exprRule));\n}\nexport function escapeToRegExp(value) {\n return value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\nexport function stringRemove(value, start, count) {\n count = count ? count : value.length - start;\n return value.slice(0, start) + value.slice(start + count, value.length);\n}\nexport function stringReplace(value, start, count, newChar = '') {\n var temp = value;\n temp = stringRemove(temp, start, count);\n temp = stringInsert(temp, start, Array(count + 1).join(newChar));\n return temp;\n}\nexport function stringInsert(value, pos, subStr) {\n return value.substring(0, pos) + subStr + value.substring(pos);\n}\nexport function formatUnicorn(format, ...args) {\n return format.replace(/{(\\d+)(:[^}]+)?}/g, (match, number, formatSpecifier) => {\n const value = args[parseInt(number)];\n if (value !== undefined && value !== null) {\n if (formatSpecifier) {\n switch (formatSpecifier.substring(1)) {\n case 'd':\n return formatDate(new Date(value));\n }\n }\n return value.toString();\n }\n else {\n return match;\n }\n });\n}\nexport var KeyboardEnum;\n(function (KeyboardEnum) {\n KeyboardEnum[\"Plus\"] = \"+\";\n KeyboardEnum[\"Minus\"] = \"-\";\n KeyboardEnum[\"Equal\"] = \"=\";\n KeyboardEnum[\"Tab\"] = \"Tab\";\n KeyboardEnum[\"Delete\"] = \"Delete\";\n KeyboardEnum[\"Enter\"] = \"Enter\";\n KeyboardEnum[\"Esc\"] = \"Escape\";\n KeyboardEnum[\"Space\"] = \" \";\n KeyboardEnum[\"End\"] = \"End\";\n KeyboardEnum[\"Home\"] = \"Home\";\n KeyboardEnum[\"PageUp\"] = \"PageUp\";\n KeyboardEnum[\"PageDown\"] = \"PageDown\";\n KeyboardEnum[\"ArrowLeft\"] = \"ArrowLeft\";\n KeyboardEnum[\"ArrowUp\"] = \"ArrowUp\";\n KeyboardEnum[\"ArrowRight\"] = \"ArrowRight\";\n KeyboardEnum[\"ArrowDown\"] = \"ArrowDown\";\n})(KeyboardEnum || (KeyboardEnum = {}));\nexport var KeyboardCodesEnum;\n(function (KeyboardCodesEnum) {\n KeyboardCodesEnum[KeyboardCodesEnum[\"Tab\"] = 9] = \"Tab\";\n KeyboardCodesEnum[KeyboardCodesEnum[\"Enter\"] = 13] = \"Enter\";\n KeyboardCodesEnum[KeyboardCodesEnum[\"Esc\"] = 27] = \"Esc\";\n KeyboardCodesEnum[KeyboardCodesEnum[\"Space\"] = 32] = \"Space\";\n KeyboardCodesEnum[KeyboardCodesEnum[\"End\"] = 35] = \"End\";\n KeyboardCodesEnum[KeyboardCodesEnum[\"Home\"] = 36] = \"Home\";\n KeyboardCodesEnum[KeyboardCodesEnum[\"Left\"] = 37] = \"Left\";\n KeyboardCodesEnum[KeyboardCodesEnum[\"Up\"] = 38] = \"Up\";\n KeyboardCodesEnum[KeyboardCodesEnum[\"Right\"] = 39] = \"Right\";\n KeyboardCodesEnum[KeyboardCodesEnum[\"Down\"] = 40] = \"Down\";\n})(KeyboardCodesEnum || (KeyboardCodesEnum = {}));\n","/**\r\n* DevExpress Analytics (property-grid\\widgets\\templateUtils.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { SvgTemplatesEngine } from './internal/_svgTemplateEngine';\nexport function addTemplate(templateName, templateMarkup) {\n SvgTemplatesEngine.addTemplate(templateName, templateMarkup);\n}\nexport function getTemplate(id) {\n var id = id[0] === '#' ? id.substr(1) : id;\n var item = document.querySelector('#' + id);\n return item && item.innerHTML || SvgTemplatesEngine.templates[id];\n}\n","/**\r\n* DevExpress Analytics (serializer\\_internal.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport function _defineProperty(legacyObject, realObject, propertyName, newPropertyName) {\n delete legacyObject[propertyName];\n newPropertyName = newPropertyName || propertyName;\n Object.defineProperty(legacyObject, propertyName, {\n get: () => { return realObject[newPropertyName]; },\n set: (newVal) => { realObject[newPropertyName] = newVal; },\n configurable: true\n });\n}\nexport function _definePropertyByString(rootObject, ...objectPathes) {\n var getAndCreateObject = (path, createNew = true) => {\n var pathParts = path.split('.');\n var foundedObject = rootObject;\n for (var i = 0; i < pathParts.length - 1; i++) {\n if (!foundedObject[pathParts[i]] && createNew) {\n foundedObject[pathParts[i]] = {};\n }\n foundedObject = foundedObject[pathParts[i]];\n }\n return {\n object: foundedObject,\n propertyName: pathParts[pathParts.length - 1]\n };\n };\n var realObjectPath = objectPathes[objectPathes.length - 1];\n var realObject = getAndCreateObject(objectPathes[objectPathes.length - 1]);\n for (var i = 0; i < objectPathes.length - 1; i++) {\n ((legacyObjectPath, legacyObject) => {\n Object.defineProperty(legacyObject.object, legacyObject.propertyName, {\n get: () => {\n console.warn('DevExpress.' + legacyObjectPath + ' is now deprecated and will be removed in future versions. Use DevExpress.' + realObjectPath + ' instead.');\n return realObject.object[realObject.propertyName];\n },\n set: (newVal) => {\n console.warn('DevExpress.' + legacyObjectPath + ' is now deprecated and will be removed in future versions. Use DevExpress.' + realObjectPath + ' instead.');\n realObject.object[realObject.propertyName] = newVal;\n },\n configurable: true\n });\n })(objectPathes[i], getAndCreateObject(objectPathes[i]));\n }\n}\nexport function addDisposeCallback(element, callback) {\n var disposeCallback = () => {\n ko.utils.domNodeDisposal.removeDisposeCallback(element, disposeCallback);\n callback && callback();\n disposeCallback = null;\n callback = null;\n };\n ko.utils.domNodeDisposal.addDisposeCallback(element, disposeCallback);\n}\nexport function createGlobalModuleVariableFunc(defaultVal) {\n var currentValue = defaultVal;\n return (newVal) => {\n if (newVal !== undefined)\n currentValue = newVal;\n return currentValue;\n };\n}\n","/**\r\n* DevExpress Analytics (serializer\\_utils.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport function knockoutArrayWrapper(items, ...onChange) {\n var array = ko.observableArray(items);\n var notifySubscribers = array.notifySubscribers;\n array.notifySubscribers = (valueToNotify, event) => {\n if (onChange) {\n for (var i = 0, len = onChange.length; i < len; i++) {\n onChange[i](valueToNotify, event);\n }\n }\n return notifySubscribers.call(array, valueToNotify, event);\n };\n return array;\n}\nfunction isWindow(obj) {\n return obj != null && obj === obj.window;\n}\nvar class2type = {};\nvar hasOwn = class2type.hasOwnProperty;\n['Boolean', 'Number', 'String', 'Function', 'Array', 'Date', 'RegExp', 'Object', 'Error'].forEach(name => class2type['[object ' + name + ']'] = name.toLowerCase());\nfunction type(obj) {\n if (obj == null) {\n return obj + '';\n }\n return typeof obj === 'object' || typeof obj === 'function' ?\n class2type[class2type.toString.call(obj)] || 'object' :\n typeof obj;\n}\nfunction isNumeric(obj) {\n return !Array.isArray(obj) && (obj - parseFloat(obj) + 1) >= 0;\n}\nexport function isPlainObject(obj) {\n if (type(obj) !== 'object' || obj.nodeType || isWindow(obj)) {\n return false;\n }\n return !(obj.constructor && !hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'));\n}\nexport function isEmptyObject(obj) {\n if ((typeof obj) === 'string') {\n return false;\n }\n return obj !== null && typeof obj === 'object' && Object.keys(obj).length === 0;\n}\nexport function isFunction(obj) {\n return type(obj) === 'function';\n}\nexport function extend(target, object1, ...objectN) {\n var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;\n if (typeof target === 'boolean') {\n deep = target;\n target = arguments[i] || {};\n i++;\n }\n if (typeof target !== 'object' && !isFunction(target)) {\n target = {};\n }\n if (i === length) {\n target = this;\n i--;\n }\n for (; i < length; i++) {\n if ((options = arguments[i]) != null) {\n for (name in options) {\n src = target[name];\n copy = options[name];\n if (target === copy) {\n continue;\n }\n if (deep && copy && (isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && Array.isArray(src) ? src : [];\n }\n else {\n clone = src && isPlainObject(src) ? src : {};\n }\n target[name] = extend(deep, clone, copy);\n }\n else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n return target;\n}\nexport function assignObj(obj, objectProps) {\n return Object.assign(Object.create(Object.getPrototypeOf(obj)), objectProps || obj);\n}\n","/**\r\n* DevExpress Analytics (serializer\\eventManager.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { Disposable } from './utils';\nexport class EventManager extends Disposable {\n constructor() {\n super(...arguments);\n this._handlers = [];\n }\n dispose() {\n this._handlers = [];\n }\n call(type, args) {\n this._handlers.filter(x => x.type === type).forEach(x => x.value(args));\n }\n addHandler(type, listener) {\n this._handlers.push({\n type: type,\n value: listener\n });\n }\n removeHandler(type, listener) {\n var item = this._handlers.filter(handler => handler.type === type && handler.value === listener)[0];\n var index = this._handlers.indexOf(item);\n if (index !== -1) {\n this._handlers.splice(index, 1);\n }\n }\n}\n","/**\r\n* DevExpress Analytics (serializer\\serializer.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { extend, isPlainObject, isEmptyObject } from './_utils';\nimport { serializeDate } from './utils';\nexport class ModelSerializer {\n constructor(options) {\n this._refTable = {};\n this._linkTable = {};\n this._options = extend({\n useRefs: true,\n serializeDate: serializeDate\n }, options);\n }\n linkObjects() {\n Object.keys(this._linkTable).forEach((index) => {\n var val = this._refTable[index];\n if (val) {\n this._linkTable[index].splice(0).forEach(property => property(val));\n }\n });\n }\n _getModel(model, propertyPath) {\n var currentModel = model;\n propertyPath.forEach((name) => {\n currentModel = currentModel[name];\n });\n return currentModel;\n }\n _collectLinks(model, internalModel, propertyPath, propertyName) {\n var refVal = model[propertyName].slice('#Ref-'.length);\n var value = ko.observable();\n this._linkTable[refVal] = this._linkTable[refVal] || [];\n this._linkTable[refVal].push(value);\n if (!internalModel._restoreLinks)\n internalModel._restoreLinks = [];\n internalModel._restoreLinks.push((model) => {\n var currentModel = this._getModel(model, propertyPath);\n return {\n setRef: (ref) => {\n if (ref === -1)\n delete currentModel[propertyName];\n else\n currentModel[propertyName] = '#Ref-' + ref;\n },\n obj: value()\n };\n });\n }\n _enumRefs(internalModel, propertyPath, propertyName) {\n if (!internalModel._refs)\n internalModel._refs = [];\n internalModel._refs.push((model, ref) => {\n this._getModel(model, propertyPath)[propertyName] = ref;\n });\n }\n _collectLinksAndEnumRefs(model, internalModel = null, propertyPath = []) {\n var start = internalModel === null;\n internalModel = internalModel || model;\n Object.keys(model).forEach((propertyName) => {\n if (model[propertyName] instanceof Object) {\n this._collectLinksAndEnumRefs(model[propertyName], internalModel, [].concat(propertyPath, [propertyName]));\n }\n else if (model[propertyName].indexOf && model[propertyName].indexOf('#Ref-') === 0) {\n this._collectLinks(model, internalModel, propertyPath, propertyName);\n }\n else if (!start && propertyName === '@Ref') {\n this._enumRefs(internalModel, propertyPath, propertyName);\n }\n });\n if (start)\n this.linkObjects();\n }\n setLinks(refs) {\n refs.linkObjTable.forEach(item => {\n var refValue = refs.objects.indexOf(item.obj);\n item.setRef(refValue);\n });\n }\n deserializeProperty(modelPropertyInfo, model) {\n var propName = modelPropertyInfo.modelName;\n if (!propName) {\n return;\n }\n var modelValue = model[propName] !== undefined ? model[propName] : modelPropertyInfo.defaultVal;\n return this.deserializePropertyValue(modelPropertyInfo, modelValue);\n }\n deserializeDefaultValue(modelPropertyInfo) {\n var value = this.deserializePropertyValue(modelPropertyInfo, modelPropertyInfo.defaultVal, false);\n return value || modelPropertyInfo.defaultVal;\n }\n deserializePropertyValue(modelPropertyInfo, modelValue, strict = true) {\n if (typeof modelPropertyInfo === 'string') {\n return ko.observable(modelValue);\n }\n else if (modelPropertyInfo.link) {\n var value = ko.observable(null);\n if (modelValue) {\n var refVal = modelValue && modelValue.slice('#Ref-'.length);\n this._linkTable[refVal] = this._linkTable[refVal] || [];\n this._linkTable[refVal].push(value);\n }\n return value;\n }\n else if (modelPropertyInfo.array) {\n if (modelPropertyInfo.from) {\n return modelPropertyInfo.from(modelValue, this);\n }\n else if (modelPropertyInfo.info) {\n var result = Object.keys(modelValue || {}).map(propertyName => {\n var object = { getInfo: () => { return modelPropertyInfo.info; } };\n this.deserialize(object, modelValue[propertyName] || {});\n return object;\n });\n return ko.observableArray(result);\n }\n return;\n }\n else if (modelPropertyInfo.from) {\n return modelPropertyInfo.from(modelValue, this);\n }\n else if (modelPropertyInfo.type) {\n var ctorResult = new modelPropertyInfo.type(modelValue, this, modelPropertyInfo.info);\n if (!ctorResult._model) {\n this.deserialize(ctorResult, modelValue || {}, modelPropertyInfo.info);\n }\n return ctorResult;\n }\n else if (modelPropertyInfo.info) {\n var object = { getInfo: () => { return modelPropertyInfo.info; } };\n this.deserialize(object, modelValue || {});\n return object;\n }\n else if (modelPropertyInfo.modelName) {\n return ko.observable(modelValue);\n }\n if (strict) {\n throw new Error(\"Invalid info '\" + JSON.stringify(modelPropertyInfo) + \"'\");\n }\n return;\n }\n deserialize(viewModel, model, serializationsInfo = null) {\n if (!model) {\n return;\n }\n viewModel._model = extend({}, model);\n var serializationsInfo = viewModel.getInfo ? viewModel.getInfo() : serializationsInfo;\n var refValue = model['@Ref'];\n var proto = Object.getPrototypeOf(viewModel);\n serializationsInfo.forEach((modelPropertyInfo) => {\n var propertyName = modelPropertyInfo.propertyName, propName = modelPropertyInfo.modelName;\n if (model[propName] !== undefined) {\n delete viewModel._model[propName];\n }\n var property = this.deserializeProperty(modelPropertyInfo, model);\n var descriptor = Object.getOwnPropertyDescriptor(proto, propertyName);\n if (property !== undefined && (!descriptor || !!descriptor.set))\n viewModel[propertyName] = property;\n if (!(propertyName in viewModel) && property === undefined && modelPropertyInfo.array) {\n var currentArray = ko.observable(undefined);\n Object.defineProperty(viewModel, propertyName, {\n get: () => {\n return currentArray();\n },\n set: (val) => {\n currentArray(val);\n },\n enumerable: true\n });\n }\n });\n if (refValue) {\n this._refTable[refValue] = viewModel;\n }\n this.linkObjects();\n }\n serialize(viewModel, serializationsInfo, refs = null) {\n if (!serializationsInfo && !refs) {\n return this._serialize(viewModel, null, null);\n }\n return this._serialize(viewModel, serializationsInfo, refs);\n }\n _isSerializableValue(resultValue) {\n return (isPlainObject(resultValue) && !isEmptyObject(resultValue)) || (Array.isArray(resultValue) && resultValue['length'] > 0) || (!Array.isArray(resultValue) && !isPlainObject(resultValue));\n }\n serializeProperty(modelPropertyInfo, viewModel, serializationsInfo, refs, result) {\n var propertyName = modelPropertyInfo.propertyName, value = ko.unwrap(viewModel['_' + propertyName] || viewModel[propertyName]), defaultVal = modelPropertyInfo.defaultVal;\n if (modelPropertyInfo.beforeSerialize)\n value = modelPropertyInfo.beforeSerialize(value);\n if (!!modelPropertyInfo.from) {\n defaultVal = ko.unwrap(modelPropertyInfo.from(defaultVal, this));\n }\n var resultValue = {};\n if (!modelPropertyInfo.modelName) {\n return;\n }\n if (modelPropertyInfo.alwaysSerialize || ((value !== undefined && value !== null) && ((isPlainObject(value) || !isEmptyObject(value)) || (Array.isArray(value) && value.length > 0) || (!Array.isArray(value) && !isPlainObject(value))) && (value !== defaultVal))) {\n if (modelPropertyInfo.link) {\n refs.linkObjTable.push({\n obj: value,\n setRef: (index) => {\n if (index < 0) {\n delete result[modelPropertyInfo.modelName];\n }\n else {\n result[modelPropertyInfo.modelName] = '#Ref-' + index;\n }\n }\n });\n resultValue = undefined;\n }\n else if (modelPropertyInfo.array) {\n resultValue = {};\n var index = 1;\n value.forEach(item => {\n var info = modelPropertyInfo.info || null;\n var item_ = this._serialize(item, info, refs);\n if (this._isSerializableValue(item_) || modelPropertyInfo.alwaysSerialize) {\n resultValue['Item' + index] = item_;\n if (this._options.useRefs) {\n item_['@Ref'] = (refs.objects.push(item) - 1).toString();\n }\n index++;\n }\n });\n }\n else if (modelPropertyInfo.from) {\n if (value['isEmpty'] && value['isEmpty']()) {\n resultValue = {};\n }\n else {\n resultValue = modelPropertyInfo.toJsonObject ? modelPropertyInfo.toJsonObject(value, this, refs) : value.toString();\n }\n }\n else if (modelPropertyInfo.info || value['getInfo']) {\n resultValue = this._serialize(value, modelPropertyInfo.info, refs);\n }\n else if (modelPropertyInfo.modelName) {\n if (value instanceof Date) {\n resultValue = this._options.serializeDate(value);\n }\n else {\n resultValue = value;\n }\n }\n else {\n throw new Error(\"Invalid info '\" + serializationsInfo.stringify() + \"'\");\n }\n if (modelPropertyInfo.alwaysSerialize || this._isSerializableValue(resultValue)) {\n if (modelPropertyInfo.asRef) {\n resultValue['@Ref'] = (refs.objects.push(value) - 1).toString();\n }\n result[modelPropertyInfo.modelName] = resultValue;\n }\n }\n }\n _serialize(viewModel, serializationsInfo, refs) {\n var result = extend(true, {}, viewModel._model), isInitial = refs === null;\n refs = refs || { linkObjTable: [], objects: [] };\n if (result._restoreLinks) {\n refs.linkObjTable.push.apply(refs.linkObjTable, result._restoreLinks.map(x => x(result)));\n delete result._restoreLinks;\n }\n if (result._refs) {\n result._refs.forEach(x => x(result, (refs.objects.push('0') - 1).toString()));\n delete result._refs;\n }\n serializationsInfo = viewModel.getInfo ? viewModel.getInfo() : serializationsInfo;\n delete result['@Ref'];\n if (viewModel['isEmpty'] && viewModel['isEmpty']())\n return {};\n serializationsInfo.forEach((modelPropertyInfo) => {\n this.serializeProperty(modelPropertyInfo, viewModel, serializationsInfo, refs, result);\n });\n if (isInitial)\n this.setLinks(refs);\n return result;\n }\n}\n","/**\r\n* DevExpress Analytics (serializer\\utils.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport class Disposable {\n constructor() {\n this._disposables = [];\n this.isDisposing = false;\n }\n disposeObservableArray(array) {\n if (array) {\n array().forEach((item) => { item.dispose && item.dispose(); });\n }\n }\n resetObservableArray(array) {\n if (array)\n array([]);\n }\n disposeArray(array) {\n if (array) {\n array.forEach((item) => { item.dispose && item.dispose(); });\n array.splice(0, array.length);\n }\n }\n dispose() {\n if (!this.isDisposing) {\n this.isDisposing = true;\n (this._disposables || []).reverse().forEach(x => x && x.dispose && x.dispose());\n this._disposables = [];\n }\n }\n removeProperties() {\n Object.keys(this).forEach((propertyName) => {\n delete this[propertyName];\n });\n }\n}\nexport function deserializeArray(model, creator) {\n var result = Object.keys(model || {}).map(propertyName => creator(model[propertyName]));\n return ko.observableArray(result);\n}\nfunction toStringWithDelimiter(values, delimiter) {\n return (values || []).map(value => {\n var str = value !== undefined && value !== null ? value.toString() : '00';\n if (str.length === 1) {\n str = '0' + str;\n }\n return str;\n }).join(delimiter);\n}\nexport function serializeDate(date, dateDelimiter) {\n var datePart = [date.getMonth() + 1, date.getDate(), date.getFullYear()];\n var timePart = toStringWithDelimiter([date.getHours(), date.getMinutes(), date.getSeconds()], ':');\n if (dateDelimiter === '-' || timePart === '00:00:00') {\n var datePartString = toStringWithDelimiter([datePart[2], datePart[0], datePart[1]], '-');\n return timePart === '00:00:00' ? datePartString : datePartString + ' ' + timePart;\n }\n return timePart === '00:00:00' ? toStringWithDelimiter([datePart[2], datePart[0], datePart[1]], '-')\n : toStringWithDelimiter(datePart, '/') + ' ' + timePart;\n}\nexport function deserializeDate(dateTime) {\n var dateTimeParts = dateTime.split(' ');\n var dateArgs = dateTimeParts[0].split('-');\n var timeArgs = [0, 0, 0];\n if (dateTimeParts.length > 1) {\n if (dateArgs.length !== 3) {\n dateArgs = dateTimeParts[0].split('/');\n dateArgs.splice(0, 0, dateArgs.splice(2, 1)[0]);\n }\n timeArgs = dateTimeParts[1].split(':').map(x => parseInt(x));\n if (timeArgs.length !== 3)\n return null;\n }\n if (dateArgs.length !== 3)\n return null;\n dateArgs = dateArgs.map(x => parseInt(x));\n return new Date(dateArgs[0], dateArgs[1] - 1, dateArgs[2], timeArgs[0], timeArgs[1], timeArgs[2]);\n}\n","/**\r\n* DevExpress Analytics (undo-engine\\_utils.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nexport function propertiesVisitor(target, visitor, visited = [], skip = ['surface']) {\n if (target && target !== undefined) {\n var properties = [];\n Object.keys(target).forEach((propertyName) => {\n if (propertyName.indexOf('_') !== 0 && skip.indexOf(propertyName) === -1) {\n var realPropertyName = propertyName;\n if (ko.isComputed(target[propertyName]) && ko.isWritableObservable(target['_' + propertyName])) {\n realPropertyName = '_' + realPropertyName;\n }\n if (visited.indexOf(target[realPropertyName]) === -1 && !ko.isComputed(target[realPropertyName])) {\n properties.push(target[realPropertyName]);\n }\n }\n });\n visitor(properties);\n visited.push.apply(visited, properties);\n properties.forEach((property) => {\n property = ko.unwrap(property);\n if (typeof property === 'object') {\n propertiesVisitor(property, visitor, visited, skip);\n }\n });\n }\n}\nexport function checkModelReady(model) {\n return model.isModelReady ? model.isModelReady() : true;\n}\nexport function guid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\n","/**\r\n* DevExpress Analytics (undo-engine\\undoengine.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../serializer/utils';\nimport { checkModelReady, guid, propertiesVisitor } from './_utils';\nexport class _LatestChangeSet {\n constructor(changes, position) {\n this.changes = changes;\n this.position = position;\n }\n static Empty() {\n return new _LatestChangeSet(null, null);\n }\n equal(changeSet) {\n return this.changes === changeSet.changes && this.position === changeSet.position;\n }\n}\nvar activeEngines = [];\nexport class UndoEngine extends Disposable {\n constructor(target, _ignoredProperties = ['surface'], _getInfoMethodName, _alwaysSubscribeProperties = []) {\n super();\n this._ignoredProperties = _ignoredProperties;\n this._getInfoMethodName = _getInfoMethodName;\n this._alwaysSubscribeProperties = _alwaysSubscribeProperties;\n this._groupObservers = [];\n this._groupPosition = -1;\n this._observers = [];\n this._subscriptions = [];\n this._visited = [];\n this._position = ko.observable(-1);\n this._lockedPosition = ko.observable(-1);\n this._inUndoRedo = false;\n this._currentEngineName = UndoEngine._disposeUndoEngineSubscriptionsName + guid();\n this.redoEnabled = ko.observable(false);\n this.undoEnabled = ko.observable(false);\n this.isIngroup = -1;\n this.isDirty = ko.computed({\n read: () => { return this._position() !== this._lockedPosition(); },\n write: (value) => { value ? this._lockedPosition('forcibly marked as dirty') : this._lockedPosition(this._position()); }\n });\n activeEngines.push(this._currentEngineName);\n this._model = ko.unwrap(target);\n if (this._getInfoMethodName) {\n if (ko.isSubscribable(target)) {\n this._targetSubscription = this.subscribeProperty(target, true);\n }\n else {\n this._createDisposeFunction(target);\n }\n }\n else {\n var innerSubscriptions = this.subscribe(this._model);\n if (ko.isSubscribable(target)) {\n var prevVal = target();\n this._targetSubscription = target.subscribe((newTargetValue) => {\n this._removePropertiesSubscriptions();\n if (!this._inUndoRedo) {\n this.properyChanged({\n observable: target,\n propertyChanged: { oldVal: prevVal, val: newTargetValue }\n });\n prevVal = newTargetValue;\n }\n this._cleanSubscribtions(innerSubscriptions);\n this._model = newTargetValue;\n innerSubscriptions = this.subscribe(this._model);\n });\n }\n }\n this._disposables.push(this.isDirty);\n }\n static tryGetUndoEngine(object) {\n var undo = null;\n activeEngines.some(x => {\n undo = object[x] && object[x].instance;\n return !!undo;\n });\n return undo;\n }\n get _modelReady() {\n return checkModelReady(this._model);\n }\n _disposeObserver(record) {\n if (record.propertyChanged) {\n var value = record.propertyChanged.val;\n if (value && !value[this._currentEngineName]) {\n value.dispose && value.dispose();\n }\n }\n else if (record.arrayChanges) {\n record.arrayChanges.forEach(change => {\n if (change.status === 'added') {\n var value = change.value;\n if (value && !value[this._currentEngineName])\n value.dispose && value.dispose();\n }\n });\n }\n }\n _disposeRemovedRecord(record) {\n if (record.arrayChanges) {\n record.arrayChanges.forEach(change => {\n var _a, _b;\n if (change.status === 'deleted') {\n ((_a = change.value) === null || _a === void 0 ? void 0 : _a.dispose) && ((_b = change.value) === null || _b === void 0 ? void 0 : _b.dispose());\n }\n });\n }\n }\n _disposeObservers(removedItems, disposeRemovedRecords) {\n var disposalFunction = (disposeRemovedRecords ? this._disposeRemovedRecord : this._disposeObserver).bind(this);\n removedItems.forEach((changeSet) => {\n if (Array.isArray(changeSet)) {\n changeSet.reverse().forEach(item => disposalFunction(item));\n }\n else {\n disposalFunction(changeSet);\n }\n });\n }\n properyChanged(undoRecord) {\n if (this._inUndoRedo) {\n return;\n }\n var currentPosition = this._position() + 1;\n if (currentPosition < this._observers.length) {\n var removedItems = this._observers.splice(currentPosition, this._observers.length);\n this._disposeObservers(removedItems, false);\n }\n this._observers.push(undoRecord);\n this._position(currentPosition);\n this.undoEnabled(true);\n this.redoEnabled(false);\n }\n visitProperties(target, info) {\n var subscribtions = [];\n if (target && info) {\n for (var i = 0; i < info.length; i++) {\n var alwaysSubscribeProperty = this._alwaysSubscribeProperties.some(x => x === info[i].propertyName);\n if (info[i].modelName || info[i].editor || info[i].info || alwaysSubscribeProperty) {\n var realPropertyName = alwaysSubscribeProperty ? info[i].propertyName : this.validatePropertyName(target, info[i].propertyName);\n if (realPropertyName) {\n if (!ko.isComputed(target[realPropertyName])) {\n if (!ko.isObservable(target[realPropertyName])) {\n subscribtions.push.apply([], this._createDisposeFunction(target[realPropertyName], info[i].info));\n }\n else {\n subscribtions.push(this.subscribeProperty(target[realPropertyName], !info[i].link));\n }\n }\n }\n }\n }\n }\n return subscribtions;\n }\n undoChangeSet(changeSet) {\n if (changeSet.propertyChanged) {\n changeSet.observable(changeSet.propertyChanged.oldVal);\n }\n else {\n var array = changeSet.observable();\n for (var i = 0; i < changeSet.arrayChanges.length; i++) {\n if (changeSet.arrayChanges[i].status === 'added') {\n var addedIndex = array.indexOf(changeSet.arrayChanges[i].value);\n if (addedIndex != -1)\n array.splice(addedIndex, 1);\n }\n }\n for (var i = 0; i < changeSet.arrayChanges.length; i++) {\n if (changeSet.arrayChanges[i].status === 'deleted') {\n array.splice(changeSet.arrayChanges[i].index, 0, changeSet.arrayChanges[i].value);\n }\n }\n if (ko.isObservable(changeSet.observable)) {\n changeSet.observable.valueHasMutated();\n }\n }\n }\n redoChangeSet(changeSet) {\n if (changeSet.propertyChanged) {\n changeSet.observable(changeSet.propertyChanged.val);\n }\n else {\n var array = changeSet.observable();\n for (var i = 0; i < changeSet.arrayChanges.length; i++) {\n if (changeSet.arrayChanges[i].status === 'deleted') {\n array.splice(array.indexOf(changeSet.arrayChanges[i].value), 1);\n }\n }\n for (var i = 0; i < changeSet.arrayChanges.length; i++) {\n if (changeSet.arrayChanges[i].status === 'added') {\n array.splice(changeSet.arrayChanges[i].index, 0, changeSet.arrayChanges[i].value);\n }\n }\n if (ko.isObservable(changeSet.observable)) {\n changeSet.observable.valueHasMutated();\n }\n }\n }\n _disposeChilds(target, info) {\n if (target && info) {\n for (var i = 0; i < info.length; i++) {\n if (info[i].modelName || info[i].editor || info[i].info) {\n var propertyName = info[i].propertyName;\n if (propertyName.indexOf('_') !== 0) {\n var realPropertyName = propertyName;\n if (ko.isWritableObservable(target['_' + propertyName])) {\n realPropertyName = '_' + realPropertyName;\n }\n if (!ko.isComputed(target[realPropertyName])) {\n var val = ko.unwrap(target[realPropertyName]);\n if (!!val && typeof val === 'object') {\n if (!info[i].link) {\n this._callDisposeFunction(val);\n }\n }\n }\n }\n }\n }\n }\n }\n _createDisposeFunction(val, info) {\n var subscriptions = [];\n if (val && typeof val === 'object') {\n var objectInfo = info || (val[this._getInfoMethodName] && val[this._getInfoMethodName]());\n if (!!objectInfo) {\n if (val[this._currentEngineName]) {\n val[this._currentEngineName].inc++;\n }\n else {\n val[this._currentEngineName] = { inc: 1, instance: this };\n subscriptions = this.subscribe(val, objectInfo);\n val[this._currentEngineName]['func'] = () => {\n val[this._currentEngineName].inc--;\n this._disposeChilds(val, objectInfo);\n if (val[this._currentEngineName].inc === 0) {\n this._cleanSubscribtions(subscriptions);\n delete val[this._currentEngineName];\n }\n };\n }\n }\n }\n return subscriptions;\n }\n _callDisposeFunction(val) {\n if (val) {\n if (Array.isArray(val)) {\n for (var i = 0; i < val.length; i++) {\n val[i][this._currentEngineName] && val[i][this._currentEngineName].func();\n }\n }\n else {\n val[this._currentEngineName] && val[this._currentEngineName].func();\n }\n }\n }\n _cleanSubscribtions(subscribtionArray) {\n if (subscribtionArray) {\n if (subscribtionArray.length) {\n for (var i = 0; i < subscribtionArray.length; i++) {\n this._cleanSubscribtions(subscribtionArray[i]);\n }\n }\n else {\n subscribtionArray.dispose && subscribtionArray.dispose();\n }\n }\n }\n validatePropertyName(target, propertyName) {\n if ((!this._ignoredProperties || (this._ignoredProperties && this._ignoredProperties.every(x => x !== propertyName))) && propertyName[0] !== '_') {\n if (ko.isWritableObservable(target['_' + propertyName])) {\n return '_' + propertyName;\n }\n return propertyName;\n }\n return null;\n }\n subscribeProperty(property, subscribeChilds) {\n if (ko.isObservable(property)) {\n var prevVal = property();\n if (Array.isArray(prevVal)) {\n for (var i = 0; i < property().length; i++) {\n this._createDisposeFunction(property()[i]);\n }\n return property.subscribe((args) => {\n if (this._modelReady) {\n var addedItems = args.filter(x => x.status === 'added');\n var removedItems = args.filter(x => x.status === 'deleted');\n for (var i = 0; i < removedItems.length; i++) {\n this._callDisposeFunction(removedItems[i].value);\n }\n for (var i = 0; i < addedItems.length; i++) {\n this._createDisposeFunction(addedItems[i].value);\n }\n this.properyChanged({ observable: property, arrayChanges: args });\n }\n }, null, 'arrayChange');\n }\n else {\n if (ko.isWritableObservable(property)) {\n if (subscribeChilds) {\n this._createDisposeFunction(property());\n }\n return property.subscribe((val) => {\n if (this._modelReady) {\n if (subscribeChilds) {\n this._callDisposeFunction(prevVal);\n }\n this.properyChanged({\n observable: property, propertyChanged: { oldVal: prevVal, val: val }\n });\n prevVal = val;\n if (subscribeChilds) {\n this._createDisposeFunction(val);\n }\n }\n });\n }\n }\n }\n }\n subscribeProperties(properties) {\n properties.forEach((property) => {\n if (ko.isObservable(property)) {\n var prevVal = property();\n if (property['push']) {\n this._subscriptions.push(property.subscribe((args) => {\n if (this._modelReady) {\n if (!this._inUndoRedo) {\n this.properyChanged({ observable: property, arrayChanges: args });\n this.subscribe(args.map((item) => { return item.value; }));\n }\n }\n }, null, 'arrayChange'));\n }\n else {\n if (ko.isWritableObservable(property)) {\n this._subscriptions.push(property.subscribe((val) => {\n if (this._modelReady) {\n this.properyChanged({\n observable: property, propertyChanged: { oldVal: prevVal, val: val }\n });\n prevVal = property();\n }\n }));\n }\n }\n }\n });\n }\n subscribe(target, info) {\n if (this._getInfoMethodName) {\n return this.visitProperties(target, info || (target && target[this._getInfoMethodName] && target[this._getInfoMethodName]()));\n }\n else {\n propertiesVisitor(target, (properties) => { this.subscribeProperties(properties); }, this._visited, this._ignoredProperties);\n }\n }\n getCurrentChangeSet() {\n return new _LatestChangeSet(this._observers[this._position()], this._position());\n }\n _removePropertiesSubscriptions() {\n this._subscriptions.forEach(subscription => subscription.dispose());\n this._subscriptions = [];\n this._visited = [];\n }\n dispose() {\n super.dispose();\n this._disposeObservers(this._observers.splice(0, this._observers.length), true);\n this.removeTargetSubscription();\n var position = 0;\n activeEngines.some((x, index) => {\n if (x === this._currentEngineName) {\n position = index;\n return true;\n }\n return false;\n });\n activeEngines.splice(position, 1);\n }\n removeTargetSubscription() {\n this._targetSubscription && this._targetSubscription.dispose();\n this.reset();\n }\n undoAll() {\n if (this.undoEnabled()) {\n this.undo();\n this.undoAll();\n }\n }\n reset() {\n this._removePropertiesSubscriptions();\n this.clearHistory();\n }\n clearHistory() {\n this._groupObservers = [];\n this._observers = [];\n this.redoEnabled(false);\n this.undoEnabled(false);\n this._inUndoRedo = false;\n this._groupPosition = -1;\n this._position(-1);\n this._lockedPosition(this._position());\n }\n undo(removeNode = false) {\n try {\n this._inUndoRedo = true;\n if (this.undoEnabled()) {\n var changeSet = this._observers[this._position()];\n if (changeSet) {\n if (Array.isArray(changeSet)) {\n changeSet.reverse().forEach(item => this.undoChangeSet(item));\n }\n else {\n this.undoChangeSet(changeSet);\n }\n if (removeNode) {\n this._observers.splice(this._position(), 1);\n }\n this._position(this._position() - 1);\n this.undoEnabled(this._observers.length !== 0 && this._position() >= 0);\n this.redoEnabled(this._position() < this._observers.length - 1);\n }\n }\n }\n finally {\n this._inUndoRedo = false;\n }\n }\n redo() {\n try {\n this._inUndoRedo = true;\n if (this.redoEnabled()) {\n var changeSet = this._observers[this._position() + 1];\n if (changeSet) {\n if (Array.isArray(changeSet)) {\n changeSet.reverse().forEach(item => this.redoChangeSet(item));\n }\n else {\n this.redoChangeSet(changeSet);\n }\n this._position(this._position() + 1);\n this.undoEnabled(this._observers.length !== 0 && this._position() >= 0);\n this.redoEnabled(this._position() + 1 < this._observers.length);\n }\n }\n }\n finally {\n this._inUndoRedo = false;\n }\n }\n _hasSessionChanges() {\n return this.isIngroup === 0 && this._observers.length > 0;\n }\n start() {\n this.isIngroup++;\n if (this.isIngroup !== 0)\n return;\n this._groupObservers = this._observers;\n this._observers = [];\n this._groupPosition = this._position();\n this._position(-1);\n this._lockedPosition(this._position());\n }\n end() {\n this.isIngroup--;\n if (this.isIngroup !== -1) {\n return;\n }\n if (this._observers.length > 0) {\n this._position(this._groupPosition + 1);\n var removedItems = this._groupObservers.splice(this._position(), this._groupObservers.length - this._position(), this._observers);\n this._disposeObservers(removedItems, false);\n }\n else {\n this._position(this._groupPosition);\n }\n this._observers = this._groupObservers;\n }\n}\nUndoEngine._disposeUndoEngineSubscriptionsName = '___dispose___UndoEngine___Subscriptions___';\n","/**\r\n* DevExpress Analytics (widgets\\_utils.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport themes from 'devextreme/ui/themes';\nimport * as $ from 'jquery';\nimport { getLocalization } from '../property-grid/localization/localization_utils';\nimport { formatUnicorn } from '../property-grid/widgets/internal/_utils';\nimport { PathRequest } from './common/pathRequest';\nimport { OperandParameter } from './criteria/operators/parameter';\nimport { OperandProperty } from './criteria/operators/property';\nimport { criteriaForEach } from './criteria/utils/criteriaEnumeration';\nimport { CriteriaOperatorStateMachine } from './criteria/utils/criteriaOperatorStateMachine';\nimport { ValueEditorHelper } from './internal/_valueEditorHelper';\nexport function integerValueConverter(val, defaultValue, type) {\n var stringValue = '' + val;\n return ValueEditorHelper.isValid(type, 'integer', stringValue) ? stringValue : defaultValue;\n}\nexport function enumValueConverter(val, defaultValue, valuesList) {\n if (valuesList.filter((enumValue) => val === enumValue.value)[0])\n return val;\n var existingValue = valuesList.filter((enumValue) => val === enumValue.displayName || val === enumValue.name)[0];\n if (existingValue)\n return existingValue.value;\n return defaultValue;\n}\nexport function validateExpression(options) {\n var deferred = $.Deferred();\n try {\n var requests = [];\n var _pushRequest = (path, propertyName, isParameter = false) => {\n var message = formatUnicorn(getLocalization('{0} is not found', 'AnalyticsCoreStringId.WarningMessage_FieldNotFound'), isParameter ? ('?' + propertyName) : ('[' + propertyName + ']'));\n var propertyDeferred = $.Deferred();\n options.fieldListProvider.getItemByPath(new PathRequest(path))\n .done(_ => propertyDeferred.resolve({ success: true }))\n .fail(_ => {\n path === propertyName\n ? propertyDeferred.resolve({ success: false, message })\n : options.fieldListProvider.getItemByPath(new PathRequest([path.split('.')[0], propertyName].join('.')))\n .done(_ => propertyDeferred.resolve({ success: true }))\n .fail(_ => propertyDeferred.resolve({ success: false, message }));\n });\n requests.push(propertyDeferred);\n };\n var expression = CriteriaOperatorStateMachine.parse(options.expression);\n criteriaForEach(expression, (operator, innerPath) => {\n if (operator instanceof OperandProperty) {\n var propertyName = operator.propertyName.indexOf('^.') === 0 ? operator.propertyName.substring(2) : operator.propertyName;\n var path = propertyName;\n if ((options.rootItems || []).indexOf(propertyName.split('.')[0]) === -1 && innerPath) {\n path = propertyName ? [innerPath, propertyName].join('.') : innerPath;\n }\n _pushRequest(path, propertyName);\n }\n else if (operator instanceof OperandParameter) {\n var parameterName = operator.parameterName;\n var parameterPath = 'Parameters.' + parameterName;\n _pushRequest(parameterPath, parameterName, true);\n }\n }, options.path);\n $.when.apply($, requests).done((...responses) => deferred.resolve(responses.reduce((result, value) => {\n if (!value.success)\n result = result ? [result, value.message].join('\\n') : value.message;\n return result;\n }, '')));\n }\n catch (e) {\n deferred.reject();\n }\n return deferred.promise();\n}\nexport function floatValueConverter(val, defaultValue, type) {\n var stringValue = '' + val;\n return ValueEditorHelper.isValid(type, 'float', stringValue) ? stringValue : defaultValue;\n}\nfunction getCurrentTheme() {\n return themes.current();\n}\nexport var isDarkTheme = (theme) => {\n theme = theme || getCurrentTheme();\n return theme && ['dark', 'contrast'].some(x => theme.indexOf(x) !== -1);\n};\nexport function _setIsDarkTheme(callback) {\n isDarkTheme = callback;\n}\nexport function setCursorInFunctionParameter(paramCount, editor, insertValue) {\n if (!paramCount || paramCount <= 0)\n return;\n var cursorPosition = editor.getCursorPosition(), lastIndexOpeningBracket = insertValue.lastIndexOf('(');\n if (insertValue.charAt(lastIndexOpeningBracket + 1) === \"'\")\n lastIndexOpeningBracket++;\n editor.gotoLine(cursorPosition.row + 1, cursorPosition.column - (insertValue.length - 1 - lastIndexOpeningBracket));\n}\nexport function isList(data) {\n return data.isList === true || data.specifics === 'List' || data.specifics === 'ListSource';\n}\nexport function getParentContainer(el, container = '.dx-designer-viewport') {\n return $.fn.constructor(el).closest(container);\n}\nexport function isNullOrEmptyString(str) {\n return str == null || str === '';\n}\n","/**\r\n* DevExpress Analytics (widgets\\ace\\_ace-available.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport ace from 'ace-builds/src-noconflict/ace';\nexport var aceAvailable = createGlobalAceVariableFunc();\nfunction createGlobalAceVariableFunc() {\n var currentValue;\n return (newVal) => {\n if (newVal !== undefined)\n currentValue = newVal;\n return currentValue === undefined ? !!ace : currentValue;\n };\n}\n","/**\r\n* DevExpress Analytics (widgets\\bindings.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { addDisposeCallback } from '../serializer/_internal';\nko.bindingHandlers['focus'] = {\n init: function (element, valueAccessor) {\n var visible = valueAccessor().on || valueAccessor();\n var subscription = visible.subscribe((newVal) => {\n if (newVal) {\n setTimeout(() => {\n $.fn.constructor(element).find(':input').focus();\n }, 1);\n }\n });\n addDisposeCallback(element, function () {\n subscription.dispose();\n });\n }\n};\nko.bindingHandlers['svgAttrs'] = {\n update: function (element, valueAccessor, allBindingsAccessor, viewModel) {\n element.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n element.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n }\n};\n","/**\r\n* DevExpress Analytics (widgets\\common\\_codeCompletor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { functionDisplay } from '../expressioneditor/tools/_functions';\nimport { Disposable } from '../../serializer/utils';\nimport { isList, setCursorInFunctionParameter } from '../_utils';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nimport { PathRequest } from './pathRequest';\nimport { RangeSpecific } from '../expressioneditor/_expressioneditor';\nimport { operatorNames } from '../expressioneditor/tools/_operatorNames';\nimport { CriteriaOperatorStateMachine } from '../criteria/utils/criteriaOperatorStateMachine';\nexport class CodeCompletor extends Disposable {\n constructor(_options) {\n super();\n this._options = _options;\n this._contextPath = null;\n this._isInContext = () => this._contextPath !== null;\n this._getPath = () => this._contextPath ? this._path() + '.' + this._contextPath : this._path();\n this.identifierRegexps = [/\\./, /\\[/];\n this._fieldListProvider = _options.fieldListProvider;\n this._path = _options.path;\n this._editor = _options.editor;\n this._functions = ko.computed(() => { return ko.unwrap(_options.functions) || functionDisplay(); });\n this._rootItems = _options.rootItems || [{ name: 'Parameters', needPrefix: true }];\n this._disposables.push(this._functions);\n }\n _previousSymbol() {\n var cursorPosition = this._editor.getCursorPosition();\n return this._editor.session.getLine(cursorPosition.row)[cursorPosition.column - 1];\n }\n beforeInsertMatch(editor, token, parentPrefix) {\n var cursorPosition = editor.getCursorPosition();\n if (parentPrefix === 'Parameters.') {\n token = token || !this['_isInContext']() && editor.session.getTokenAt(cursorPosition.row, cursorPosition.column);\n if (token) {\n if ((token.type === 'support.variable.other' || token.type === 'support.function')) {\n editor.session.remove({\n start: { column: token.start - 1 || 0, row: cursorPosition.row },\n end: { column: Math.max(token.start + token.value.length || 0, cursorPosition.column), row: cursorPosition.row }\n });\n }\n else if (token.type === 'support.variable.parameter') {\n editor.session.remove({\n start: { column: token.start || 0, row: cursorPosition.row },\n end: { column: Math.max(token.start + token.value.length + 1 || 0, cursorPosition.column), row: cursorPosition.row }\n });\n }\n else if (token.type === 'text' && token.value[token.value.length - 1] === '?') {\n editor.session.remove({\n start: { column: token.start + token.value.length - 1 || 0, row: cursorPosition.row },\n end: { column: token.start + token.value.length || 0, row: cursorPosition.row },\n });\n }\n }\n }\n else {\n token = token || editor.session.getTokenAt(cursorPosition.row, cursorPosition.column);\n if (!token)\n return;\n var endColumn = null;\n if (token.type === 'support.variable.other' || token.type === 'support.function') {\n endColumn = Math.max(token.start + token.value.length || 0, cursorPosition.column);\n }\n else if (token.type === 'support.context.start' && cursorPosition.column < token.start + token.value.length) {\n endColumn = token.start + token.value.length - 1 || 0;\n }\n if (endColumn !== null)\n editor.session.remove({\n start: { column: token.start || 0, row: cursorPosition.row },\n end: { column: endColumn, row: cursorPosition.row }\n });\n }\n }\n insertMatch(editor, parentPrefix, fieldName) {\n if (parentPrefix === 'Parameters.') {\n editor.insert('?' + fieldName);\n }\n else {\n editor.insert('[' + (parentPrefix || '') + fieldName + ']');\n }\n }\n generateFieldDisplayName(parentPrefix, displayName) {\n if (parentPrefix === 'Parameters.') {\n return '?' + displayName;\n }\n return '[' + displayName + ']';\n }\n _convertDataMemberInfoToCompletions(fields, getToken, parentPrefix = '') {\n return (fields || []).map(field => {\n var displayName = this.generateFieldDisplayName(parentPrefix, field.displayName);\n return {\n caption: field.displayName || field.name,\n snippet: displayName,\n meta: isList(field) && getLocalization('list', 'DxDesignerStringId.CodeCompletion_List') || getLocalization('field', 'DxDesignerStringId.CodeCompletion_Field'),\n score: isList(field) && 200 || 100,\n completer: {\n insertMatch: (editor, data) => {\n this.beforeInsertMatch(editor, getToken(), parentPrefix);\n this.insertMatch(editor, parentPrefix, this._options.getRealExpression ? (field.displayName || field.name) : field.name);\n }\n }\n };\n });\n }\n _combinePath(parentPrefix) {\n var path = this._getPath();\n if (parentPrefix) {\n var rootItem = this._rootItems.filter(item => parentPrefix.indexOf(item.name) === 0)[0];\n if (rootItem && rootItem.rootPath)\n path = [rootItem.rootPath, parentPrefix].join('.');\n else\n path = [path, parentPrefix].join('.');\n }\n return path;\n }\n _getParentPrefix(token) {\n var position = this._editor.getCursorPosition().column - token.start - 1;\n var dotIndex = token.value.lastIndexOf('.', position);\n var closeIndex = token.value.lastIndexOf(']', position);\n dotIndex = Math.max(closeIndex, dotIndex);\n var startIndex = token.type === 'support.variable.other' || token.type === 'support.context.start' ? 1 : 0;\n var parentPrefix = token.value.substring(startIndex, dotIndex);\n if (parentPrefix[0] === '[')\n parentPrefix = parentPrefix.substr(1);\n if (parentPrefix[parentPrefix.length - 1] === ']')\n parentPrefix = parentPrefix.substring(0, parentPrefix.length - 1);\n return parentPrefix;\n }\n _getRealPath(path) {\n var pathArray = path.split('.');\n var $deferred = $.Deferred();\n if (this._options.getRealExpression) {\n this._options.getRealExpression(pathArray[0], this.generateFieldDisplayName(null, pathArray.splice(1).join('.'))).done(result => {\n result = result.slice(1, result.length - 1);\n $deferred.resolve(result && [pathArray[0], result].join('.') || pathArray[0]);\n }).fail(() => { $deferred.resolve(path); });\n }\n else {\n $deferred.resolve(path);\n }\n return $deferred.promise();\n }\n _getFields(getToken = () => null, completions = [], ignorePrefix = false) {\n var $deferred = $.Deferred();\n var parentPrefix = undefined;\n var token = getToken();\n if (token && (token.type === 'support.variable.other' || token.type === 'support.function' || token.type === 'support.context.start')) {\n parentPrefix = this._getParentPrefix(token);\n }\n this._getRealPath(this._combinePath(parentPrefix)).done((path) => {\n var $fields = ko.unwrap(this._fieldListProvider).getItems(new PathRequest(path))\n .done((fields) => {\n completions.push.apply(completions, this._convertDataMemberInfoToCompletions(CodeCompletor._cleanupFields(fields), getToken, ignorePrefix ? null : parentPrefix && parentPrefix + '.'));\n });\n var $deferreds = [$fields];\n var rootPathRequests = [];\n if (!parentPrefix) {\n this._rootItems.forEach(item => {\n var path = item.rootPath || item.name;\n if (rootPathRequests.indexOf(path) === -1) {\n rootPathRequests.push(path);\n $deferreds.push(ko.unwrap(this._fieldListProvider).getItems(new PathRequest(path))\n .done((fields) => {\n this._processFields($deferreds, fields, completions, path, getToken, item.needPrefix ? item.name + '.' : '', true);\n }));\n }\n });\n }\n $.when($deferreds).always(() => { $deferred.resolve(completions); });\n });\n return $deferred.promise();\n }\n static _cleanupFields(fields = []) {\n return fields.filter(x => x.specifics !== 'parameters' && x.specifics !== 'none');\n }\n _processFields($deferreds, fields, completions, path, getToken, parentPrefix = '', needCleanup = false) {\n var pushToCompletions = (fields) => {\n completions.push.apply(completions, this._convertDataMemberInfoToCompletions(needCleanup ? CodeCompletor._cleanupFields(fields) : fields, getToken, parentPrefix));\n };\n fields.forEach(item => {\n if (item.specifics === RangeSpecific && isList(item)) {\n $deferreds.push(ko.unwrap(this._fieldListProvider).getItems(new PathRequest(path + '.' + item.name))\n .done((subFields) => {\n pushToCompletions(subFields);\n })\n .fail(() => {\n pushToCompletions([item]);\n }));\n }\n else {\n pushToCompletions([item]);\n }\n });\n }\n getFunctionsCompletions() {\n var functions = [];\n var functionsWithoutAggregates = ko.unwrap(this._functions).filter(fnDisplay => fnDisplay.category !== 'Aggregate');\n functionsWithoutAggregates.forEach(fnDisplay => {\n Object.keys(fnDisplay.items).forEach(fnKey => {\n if (fnDisplay.items[fnKey]) {\n functions.push(createFunctionCompletion(fnDisplay.items[fnKey][0], fnKey));\n }\n });\n });\n return functions;\n }\n getAggregateCompletions() {\n var functions = [];\n var aggregates = ko.unwrap(this._functions).filter(fnDisplay => fnDisplay.category === 'Aggregate')[0];\n if (aggregates)\n Object.keys(aggregates.items).forEach(fnKey => {\n if (aggregates.items[fnKey]) {\n functions.push(createFunctionCompletion(aggregates.items[fnKey][0], fnKey, fnKey + '()'));\n }\n });\n return functions;\n }\n getOperatorCompletions(prefix) {\n return operatorNames.map(operator => {\n return { caption: operator.text, snippet: prefix + operator.text, meta: getLocalization('operator', 'DxDesignerStringId.CodeCompletion_Operator') };\n });\n }\n _addFunctions(completions) {\n completions.push.apply(completions, this.getFunctionsCompletions());\n }\n _addAggregates(completions) {\n completions.push.apply(completions, this.getAggregateCompletions());\n }\n _addOperators(completions, text) {\n var prefix = /\\s/.test(text[text.length - 1]) ? '' : ' ';\n completions.push.apply(completions, this.getOperatorCompletions(prefix));\n }\n _addParameterOperators(completions, getToken) {\n var $deferred = $.Deferred();\n var $parametersPromises = [];\n var paramPath = 'Parameters';\n $parametersPromises.push(ko.unwrap(this['_fieldListProvider']).getItems(new PathRequest(paramPath))\n .done((fields) => {\n this._processFields($parametersPromises, fields, completions, paramPath, getToken, paramPath + '.');\n }));\n $.when($parametersPromises).always(() => { $deferred.resolve(completions); });\n return $deferred.promise();\n }\n _getOperands(getToken = () => null) {\n var result = [];\n this._addFunctions(result);\n return this._getFields(getToken, result);\n }\n _getOperandsOrOperators(getToken, text, completions) {\n var exceptionInfo;\n try {\n CriteriaOperatorStateMachine.parse(text);\n }\n catch (exception) {\n exceptionInfo = exception.hash;\n }\n var trimmedText = text.trim();\n var lastNonSpaceSymbol = trimmedText[trimmedText.length - 1];\n if (lastNonSpaceSymbol === '?' && text[text.length - 1] !== ' ') {\n this._addParameterOperators(completions, getToken);\n }\n else if (!exceptionInfo && trimmedText || (lastNonSpaceSymbol === ']' || lastNonSpaceSymbol === ')')) {\n this._addOperators(completions, text);\n }\n else {\n return this._getOperands();\n }\n }\n _findStartContextTokenPosition(tokens, index) {\n var blocks = 0;\n var path = [];\n for (var i = index; i > -1; i--) {\n if (tokens[i].type === 'support.context.end') {\n blocks++;\n }\n else if (tokens[i].type === 'support.context.start') {\n if (blocks > 0)\n blocks--;\n else\n return i;\n }\n }\n }\n _findOpenedStartContext(tokens, index) {\n var openedContextIndexes = [];\n var contextItems = tokens.filter((token, tokenIndex) => (token.type === 'support.context.start' || token.type === 'support.context.end') && tokenIndex < index);\n for (var i = 0; i < contextItems.length; i++) {\n if (contextItems[i].type === 'support.context.start') {\n openedContextIndexes.push(tokens.indexOf(contextItems[i]));\n }\n else {\n openedContextIndexes.pop();\n }\n }\n return openedContextIndexes;\n }\n _findOpenedAggregates(tokens, index) {\n var openedAggregatesIndexes = [];\n var aggregates = tokens.filter((token, tokenIndex) => token.type === 'support.other.aggregate' && tokenIndex < index);\n if (aggregates.length > 0) {\n var currentToken = tokens[index];\n var currentCursorPosition = this._editor.getCursorPosition().column - (currentToken && currentToken.start || 0);\n for (var i = aggregates.length - 1; i > -1; i--) {\n var aggregateIndex = tokens.indexOf(aggregates[i]);\n var openBrace = 0;\n var closeBrace = 0;\n var isClosedAggregate = false;\n if (aggregateIndex + 1 === index && tokens[aggregateIndex + 1].value.substr(0, currentCursorPosition).indexOf('()') !== -1 ||\n aggregateIndex + 1 < index && tokens[aggregateIndex + 1].value.indexOf('()') !== -1) {\n isClosedAggregate = true;\n index = aggregateIndex;\n continue;\n }\n for (var j = aggregateIndex; j < index; j++) {\n if (tokens[j].value.trim() === '(') {\n openBrace++;\n }\n else if (tokens[j].value.trim() === ')') {\n closeBrace++;\n }\n if (openBrace === closeBrace && openBrace !== 0) {\n isClosedAggregate = true;\n break;\n }\n }\n if (!isClosedAggregate)\n openedAggregatesIndexes.splice(0, 0, aggregateIndex);\n index = aggregateIndex;\n }\n }\n return openedAggregatesIndexes;\n }\n _getContextPath(tokens, currentPosition) {\n var path = [];\n var openedAggregatePositions = this._findOpenedAggregates(tokens, currentPosition);\n var openedContextPositions = this._findOpenedStartContext(tokens, currentPosition);\n var contextPath = openedContextPositions.concat(...openedAggregatePositions).sort((a, b) => { return a - b; });\n if (contextPath.length > 0) {\n for (var i = 0; i < contextPath.length; i++) {\n if (tokens[contextPath[i]].type === 'support.other.aggregate') {\n if (tokens[contextPath[i] - 1].type === 'support.context.end') {\n var startContextToken = this._findStartContextTokenPosition(tokens, contextPath[i] - 2);\n var member = trimBrackets(tokens[startContextToken].value.match(/^\\[(?:[^\\]\\)])*\\]/)[0]);\n path.push(member);\n }\n else if (tokens[contextPath[i] - 1].type === 'support.variable.other') {\n path.push(trimBrackets(tokens[contextPath[i] - 1].value));\n }\n }\n else {\n var member = trimBrackets(tokens[contextPath[i]].value.match(/^\\[(?:[^\\]\\)])*\\]/)[0]);\n path.push(member);\n }\n }\n }\n return path.filter(x => !!x).join('.');\n }\n _getCompletions(editor, session, pos, prefix) {\n var $deferred;\n var completions = [];\n var getToken = () => session.getTokenAt(pos.row, pos.column);\n var currentToken = getToken();\n var text = editor.session.getLine(pos.row).substring(0, pos.column);\n var tokens = session.getTokens(pos.row);\n var currentTokenIndex = currentToken ? currentToken.index : -1;\n this._contextPath = this._getContextPath(tokens, currentTokenIndex);\n if (!currentToken) {\n $deferred = this._getOperands();\n }\n else if (currentToken.type === 'support.context.start') {\n var ignorePrefix = this._editor.getCursorPosition().column - currentToken.start === currentToken.value.length;\n if (ignorePrefix) {\n var functions = [];\n this._addFunctions(functions);\n }\n $deferred = this._getFields(getToken, functions, ignorePrefix);\n }\n else if (currentToken.type === 'string.quoted.single') {\n }\n else if (currentToken.type.indexOf('support.variable') === 0) {\n $deferred = this._getFields(getToken);\n }\n else if (currentToken.type === 'support.function') {\n $deferred = this.defaultProcess(getToken, text.substring(0, currentToken.start), completions);\n }\n else if (currentToken.type === 'support.other.aggregate') {\n var previousToken = tokens[currentTokenIndex - 1];\n this._addAggregates(completions);\n if (previousToken && trimBrackets(previousToken.value).trim()) {\n $deferred = this._getFields(() => ({\n start: (currentToken.start - (previousToken.value || '').length) || 0,\n value: previousToken.value + currentToken.value,\n type: 'support.function'\n }), completions);\n }\n }\n else {\n if (!(currentToken.type.indexOf('comment') === 0)) {\n $deferred = this.defaultProcess(getToken, text, completions);\n }\n }\n return $deferred ? $deferred.promise() : $.Deferred().resolve(completions).promise();\n }\n defaultProcess(getToken, text, completions) {\n return this._getOperandsOrOperators(getToken, text, completions);\n }\n getCompletions(aceEditor, session, pos, prefix, callback) {\n this._getCompletions(aceEditor, session, pos, prefix).done(completions => {\n callback(null, completions);\n });\n }\n getDocTooltip(item) {\n if (item.tooltip && !item.docHTML) {\n item.docHTML = [\n item.tooltip\n ].join('');\n }\n }\n}\nexport function createFunctionCompletion(fnInfo, name, insertValue = null) {\n var insertValue = insertValue || fnInfo.text;\n return {\n caption: name,\n snippet: insertValue,\n meta: getLocalization('function', 'DxDesignerStringId.CodeCompletion_Function'),\n tooltip: fnInfo.description || getLocalization(fnInfo.text, fnInfo.descriptionStringId) || null,\n score: 10,\n completer: {\n insertMatch: (editor, data) => {\n var completions = editor.completer.completions;\n if (completions.filterText) {\n var ranges = editor.selection.getAllRanges();\n for (var i = 0, range; range = ranges[i]; i++) {\n range.start.column -= completions.filterText.length;\n editor.session.remove(range);\n }\n }\n if (insertValue.substr(0, 3) === '[].') {\n var ranges = editor.selection.getAllRanges();\n for (var i = 0, range; range = ranges[i]; i++) {\n range.start.column -= 2;\n if (editor.session.getTextRange(range) === '].')\n insertValue = insertValue.substr(3);\n }\n }\n editor.insert(insertValue);\n setCursorInFunctionParameter(fnInfo.paramCount, editor, insertValue);\n }\n }\n };\n}\nexport function trimBrackets(value) {\n return value.substring(value[0] === '[' ? 1 : 0, value[value.length - 1] === ']' ? value.length - 1 : value.length);\n}\n","/**\r\n* DevExpress Analytics (widgets\\common\\_displayNameProvider.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport { OperandProperty } from '../criteria/operators/property';\nimport { FilterEditorSerializer } from '../filtereditor/helpers/_serializer';\nimport { criteriaForEach } from '../criteria/utils/criteriaEnumeration';\nimport { CriteriaOperatorStateMachine } from '../criteria/utils/criteriaOperatorStateMachine';\nexport class DisplayExpressionConverter {\n constructor(displayNameProvider) {\n this.displayNameProvider = displayNameProvider;\n }\n _replaceNames(path, expression, getDisplayExpression) {\n var def = $.Deferred();\n if (!expression)\n return def.resolve('').promise();\n try {\n var expressionCriteria = CriteriaOperatorStateMachine.parse(expression, true);\n }\n catch (e) {\n return def.reject().promise();\n }\n var requests = [];\n var result = [];\n var serializer = new FilterEditorSerializer();\n criteriaForEach(expressionCriteria, (operator, innerPath) => {\n if (operator instanceof OperandProperty) {\n var isContainsParentRelationshipTraversalOperator = operator.propertyName.indexOf('^.') === 0;\n var propertyName = isContainsParentRelationshipTraversalOperator ? operator.propertyName.substring(2) : operator.propertyName;\n propertyName = innerPath ? [innerPath, propertyName].join('.') : propertyName;\n var request = getDisplayExpression ? this.displayNameProvider.getDisplayNameByPath(path, propertyName) :\n this.displayNameProvider.getRealName(path, propertyName);\n requests.push(request.done(data => {\n var convertedName = isContainsParentRelationshipTraversalOperator ? '^.' + data : data;\n convertedName = innerPath ? convertedName.split('.').slice(innerPath.split('.').length).join('.') : convertedName;\n result.push({\n operand: operator,\n convertedName\n });\n }));\n }\n });\n if (requests.length === 0) {\n def.resolve(expression);\n }\n else {\n var processedRequestsCount = 0;\n var onAlways = () => {\n if (++processedRequestsCount < requests.length)\n return;\n var lines = expression.split('\\n');\n for (var i = 0; i < lines.length; i++) {\n var operands = result.filter((value) => value.operand.startPosition.line === i).sort((a, b) => {\n return a.operand.startPosition.column - b.operand.startPosition.column;\n });\n for (var j = 0, delta = 0; j < operands.length; j++) {\n var column = operands[j].operand.startPosition.column;\n var propertyName = operands[j].operand.propertyName;\n var deltaName = 0;\n if (operands[j].operand.originalPropertyLength !== propertyName.length) {\n deltaName = Math.max(0, operands[j].operand.originalPropertyLength - serializer.serialize(operands[j].operand, false).length);\n }\n var convertedName = operands[j].convertedName;\n if (!propertyName || column < 0)\n continue;\n lines[i] = lines[i].substring(0, column + delta) + convertedName + lines[i].substring(column + propertyName.length + deltaName + delta);\n delta += convertedName.length - propertyName.length - deltaName;\n }\n }\n def.resolve(lines.join('\\n'));\n };\n requests.forEach(r => r.always(onAlways));\n }\n return def.promise();\n }\n toDisplayExpression(path, expression) {\n return this._replaceNames(path, expression, true);\n }\n toRealExpression(path, expression) {\n return this._replaceNames(path, expression, false);\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\common\\pathRequest.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport class PathRequest {\n constructor(fullPath, pathParts = []) {\n this.pathParts = pathParts;\n this.path = '';\n this.fullPath = fullPath;\n if (fullPath) {\n if (fullPath.indexOf('.') !== -1) {\n var pathComponents = fullPath.split('.');\n this.id = this.ref = pathComponents[0];\n pathComponents.splice(0, 1);\n this.path = pathComponents.join('.');\n }\n else {\n this.id = this.ref = fullPath;\n }\n }\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\aggregate.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CriteriaOperator } from './criteriaOperator';\nimport { UnaryOperator } from './unary';\nimport { BinaryOperatorType } from './options/binary';\nimport { UnaryOperatorType } from './options/unary';\nimport { GroupOperatorType } from './options/group';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nexport class AggregateOperand extends CriteriaOperator {\n constructor(property, aggregatedExpression, aggregateType, condition) {\n super();\n this.change = (operationType, item) => {\n var operator = null;\n if (operationType.type === GroupOperatorType) {\n operator = criteriaCreator.changeByType(operationType);\n if (operationType.type !== operator.enumType) {\n operator.leftPart.assignFrom(item);\n }\n else {\n operator.assignFrom(item);\n }\n this.condition = operator;\n }\n return operator;\n };\n this.assignLeftPart = (criteriaOperator) => {\n if (criteriaOperator.leftPart instanceof AggregateOperand) {\n this.assignFrom(criteriaOperator.leftPart);\n }\n else {\n if (criteriaOperator instanceof AggregateOperand) {\n this.property = criteriaOperator.property;\n if (this.aggregatedExpression && criteriaOperator.aggregatedExpression) {\n this.aggregatedExpression = criteriaOperator.aggregatedExpression;\n }\n this.condition = criteriaOperator.condition;\n }\n else {\n this.property = criteriaOperator.leftPart;\n }\n }\n };\n this.type = 'aggregate';\n this.property = property;\n if (!!condition && condition.type === 'group') {\n this.condition = condition;\n }\n else {\n if (condition instanceof UnaryOperator && condition.operatorType === UnaryOperatorType.Not) {\n if (condition.operand.type === 'group') {\n this.condition = criteriaCreator.process('unary', { operator: condition.operand, operatorType: UnaryOperatorType.Not });\n }\n else {\n this.condition = criteriaCreator.process('unary', {\n operator: criteriaCreator.process('group', {\n operation: GroupOperatorType.And,\n operands: condition.operand ? [condition.operand] : []\n }),\n operatorType: UnaryOperatorType.Not\n });\n }\n }\n else {\n this.condition = criteriaCreator.process('group', {\n operation: GroupOperatorType.And,\n operands: condition ? [condition] : []\n });\n }\n }\n this.operatorType = aggregateType;\n this.aggregatedExpression = aggregatedExpression;\n }\n get displayType() {\n return this.operatorType;\n }\n get enumType() {\n return AggregateOperand;\n }\n get leftPart() {\n return this.property;\n }\n children() {\n var operands = [];\n this.condition && operands.push(this.condition);\n this.aggregatedExpression && operands.push(this.aggregatedExpression);\n return operands;\n }\n accept(visitor) {\n return visitor.visitAggregateOperand\n ? visitor.visitAggregateOperand(this)\n : criteriaCreator.process('aggregate', {\n aggregateType: this.operatorType,\n aggregatedExpression: this.aggregatedExpression && this.aggregatedExpression.accept(visitor),\n condition: this.condition && this.condition.accept(visitor),\n property: this.property && this.property.accept(visitor)\n });\n }\n}\ncriteriaCreator.register('aggregate', (options) => {\n return new AggregateOperand(options.property, options.aggregatedExpression, options.aggregateType, options.condition);\n}, (operatorType) => {\n var options = {\n property: criteriaCreator.process('property'),\n aggregateType: operatorType.value,\n aggregatedExpression: null,\n condition: criteriaCreator.process('group', { operation: GroupOperatorType.And, operands: [] })\n };\n if (operatorType.value === 'Exists') {\n return criteriaCreator.process('aggregate', options);\n }\n else {\n if (operatorType.value !== 'Count') {\n options.aggregatedExpression = criteriaCreator.process('property');\n }\n return criteriaCreator.process('binary', {\n left: criteriaCreator.process('aggregate', options),\n right: criteriaCreator.process('value', { value: undefined }),\n operatorType: BinaryOperatorType.Equal\n });\n }\n});\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\between.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CriteriaOperator } from './criteriaOperator';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nexport class BetweenOperator extends CriteriaOperator {\n constructor(property, begin, end) {\n super();\n this.assignLeftPart = (criteriaOperator) => {\n this.property = criteriaOperator.leftPart;\n };\n this.assignRightPart = (criteriaOperator) => {\n if (Array.isArray(criteriaOperator.rightPart)) {\n if (criteriaOperator.rightPart.length) {\n this.begin = criteriaOperator.rightPart[0];\n this.end = criteriaOperator.rightPart.length > 1 ? criteriaOperator.rightPart[1] : criteriaCreator.process('value');\n }\n else {\n this.begin = criteriaCreator.process('value');\n this.end = criteriaCreator.process('value');\n }\n }\n else {\n this.begin = criteriaOperator.rightPart;\n this.end = criteriaCreator.process('value');\n }\n };\n this.operatorType = 'Between';\n this.type = 'between';\n this.property = property;\n this.begin = begin || criteriaCreator.process('value');\n this.end = end || criteriaCreator.process('value');\n }\n get leftPart() {\n return this.property;\n }\n get rightPart() {\n return [this.begin, this.end];\n }\n get displayType() {\n return 'Between';\n }\n get enumType() {\n return BetweenOperator;\n }\n accept(visitor) {\n return visitor.visitBetweenOperator\n ? visitor.visitBetweenOperator(this)\n : new BetweenOperator(this.property && this.property.accept(visitor), this.begin && this.begin.accept(visitor), this.end && this.end.accept(visitor));\n }\n}\ncriteriaCreator.register('between', (options) => {\n return new BetweenOperator(options.property, options.begin, options.end);\n}, (operatorType) => (criteriaCreator.process('between', {\n property: criteriaCreator.process('property'),\n begin: criteriaCreator.process('value'),\n end: criteriaCreator.process('value')\n})));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\binary.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CriteriaOperator } from './criteriaOperator';\nimport { operatorTokens } from '../utils/operatorTokens';\nimport { BinaryOperatorType } from './options/binary';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nexport class BinaryOperator extends CriteriaOperator {\n constructor(left, right, operatorType) {\n super();\n this.assignLeftPart = (criteriaOperator) => {\n this.leftOperand = criteriaOperator.leftPart;\n };\n this.assignRightPart = (criteriaOperator) => {\n if (Array.isArray(criteriaOperator.rightPart)) {\n if (criteriaOperator.rightPart.length) {\n this.rightOperand = criteriaOperator.rightPart[0];\n }\n }\n else {\n this.rightOperand = criteriaOperator.rightPart;\n }\n };\n this.type = 'binary';\n this.leftOperand = left || criteriaCreator.process('default');\n this.rightOperand = right || criteriaCreator.process('default');\n this.operatorType = operatorType;\n }\n get leftPart() {\n return this.leftOperand;\n }\n get rightPart() {\n return this.rightOperand;\n }\n get displayType() {\n return operatorTokens[BinaryOperatorType[this.operatorType]] || BinaryOperatorType[this.operatorType];\n }\n get enumType() {\n return BinaryOperatorType;\n }\n accept(visitor) {\n return visitor.visitBinaryOperator\n ? visitor.visitBinaryOperator(this)\n : new BinaryOperator(this.leftOperand && this.leftOperand.accept(visitor), this.rightOperand && this.rightOperand.accept(visitor), this.operatorType);\n }\n}\ncriteriaCreator.register('binary', (options) => {\n return new BinaryOperator(options.left, options.right, options.operatorType);\n}, (operatorType) => criteriaCreator.process('binary', {\n left: criteriaCreator.process('property'),\n right: criteriaCreator.process('value'),\n operatorType: operatorType.value\n}));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\constant.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nimport { OperandValue } from './value';\nexport class ConstantValue extends OperandValue {\n constructor(value) {\n super(value);\n this.type = 'value';\n }\n accept(visitor) {\n return visitor.visitConstantValue\n ? visitor.visitConstantValue(this)\n : new ConstantValue(this.value);\n }\n}\ncriteriaCreator.register('const', (options) => new ConstantValue((options === null || options === void 0 ? void 0 : options.value) || null));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\criteriaOperator.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nimport { UnaryOperatorType } from './options/unary';\nexport class CriteriaOperator {\n constructor() {\n this.type = 'default';\n this.operands = null;\n this.changeValue = (operand, reverse, location) => {\n var result = reverse ? criteriaCreator.process('unary', { operatorType: UnaryOperatorType.Minus, operator: operand }) : operand;\n if (location.index !== null) {\n this[location.name][location.index] = result;\n }\n else {\n this[location.name] = result;\n }\n return result;\n };\n this.changeValueType = (type, location) => {\n var result = new type();\n if (location.index !== null) {\n this[location.name][location.index] = result;\n }\n else {\n this[location.name] = result;\n }\n return result;\n };\n this.assignLeftPart = (operator) => void 0;\n this.assignRightPart = (operator) => void 0;\n this.assignType = (type) => {\n this.operatorType = type;\n };\n }\n get displayType() {\n return this.operatorType;\n }\n get enumType() {\n return null;\n }\n get leftPart() { return null; }\n get rightPart() { return null; }\n assignFrom(criteriaOperator, incorrectSpecificsForAggregate = false, needAssignRightPart = true) {\n var operator = criteriaOperator;\n if (criteriaOperator.type === 'unary' && !Array.isArray(criteriaOperator.leftPart) && criteriaOperator.leftPart.type != 'property') {\n operator = criteriaOperator.leftPart;\n }\n if (incorrectSpecificsForAggregate) {\n this.assignLeftPart(operator.leftPart);\n }\n else {\n this.assignLeftPart(operator);\n }\n if (operator.rightPart) {\n needAssignRightPart && this.assignRightPart(operator);\n }\n }\n children() {\n var operands = [];\n if (this.leftPart)\n operands.push.apply(operands, Array.isArray(this.leftPart) ? this.leftPart : [this.leftPart]);\n if (this.rightPart)\n operands.push.apply(operands, Array.isArray(this.rightPart) ? this.rightPart : [this.rightPart]);\n return operands;\n }\n accept(visitor) { throw 'Not implemented'; }\n}\ncriteriaCreator.register('default', (options) => new CriteriaOperator());\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\function.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CriteriaOperator } from './criteriaOperator';\nimport { operatorTokens } from '../utils/operatorTokens';\nimport { FunctionOperatorType } from './options/function';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nexport class FunctionOperator extends CriteriaOperator {\n constructor(operatorType, operands) {\n super();\n this.toString = (reverse) => {\n var result = (operatorTokens[this.displayType] || this.displayType) + '(' + this.operands.map((operand) => {\n return operand.toString();\n }).join(', ') + ')';\n return reverse ? 'Not ' + result : result;\n };\n this.assignLeftPart = (criteriaOperator) => {\n this.operands = [criteriaOperator.leftPart];\n };\n this.assignRightPart = (criteriaOperator) => {\n if (Array.isArray(criteriaOperator.rightPart)) {\n if (criteriaOperator.rightPart.length) {\n this.operands.push(criteriaOperator.rightPart[0]);\n }\n else {\n this.operands.push(criteriaCreator.process('value'));\n }\n }\n else {\n this.operands.push(criteriaOperator.rightPart);\n }\n };\n this.operands = [];\n this.type = 'function';\n this.operatorType = operatorType;\n operands = operands || [criteriaCreator.process('default')];\n operands.forEach(operand => this.operands.push(operand));\n }\n get leftPart() {\n return this.operands[0];\n }\n get rightPart() {\n return this.operands.filter((_, index) => { return index !== 0; });\n }\n get displayType() {\n return FunctionOperatorType[this.operatorType] || this.operatorType.toString();\n }\n get enumType() {\n return FunctionOperatorType;\n }\n accept(visitor) {\n return visitor.visitFunctionOperator\n ? visitor.visitFunctionOperator(this)\n : new FunctionOperator(this.operatorType, this.operands && this.operands.map(op => op.accept(visitor)));\n }\n}\ncriteriaCreator.register('function', (options) => {\n return new FunctionOperator(options.operatorType, options.operands);\n}, (operatorType) => new FunctionOperator(operatorType.value, [criteriaCreator.process('property')]));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\group.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CriteriaOperator } from './criteriaOperator';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nimport { GroupOperatorType } from './options/group';\nimport { BinaryOperatorType } from './options/binary';\nexport class GroupOperator extends CriteriaOperator {\n constructor(operation, operands) {\n super();\n this.create = (isGroup, property, specifics) => {\n var operator = criteriaCreator.process('binary', {\n left: property,\n right: criteriaCreator.process('value', { value: '' }),\n operatorType: BinaryOperatorType.Equal\n });\n if (isGroup) {\n operator = criteriaCreator.process('group', { operation: GroupOperatorType.And, operands: [] });\n }\n else if (specifics && specifics === 'list') {\n operator = criteriaCreator.process('aggregate', {\n aggregateType: 'Exisits',\n property: property,\n aggregatedExpression: null,\n condition: criteriaCreator.process('group', {\n operands: [],\n operation: GroupOperatorType.And\n })\n });\n }\n this.operands.push(operator);\n return this.operands[this.operands.indexOf(operator)];\n };\n this.change = (operationType, item, incorrectSpecificsForAggregate = false) => {\n var position = this.operands.indexOf(item);\n if (position !== -1) {\n var operator = criteriaCreator.changeByType(operationType);\n if (operationType.type !== operator.enumType && !Array.isArray(operator.leftPart)) {\n operator.leftPart.assignFrom(item, incorrectSpecificsForAggregate, !operationType.emptyRightPart);\n }\n else {\n operator.assignFrom(item, incorrectSpecificsForAggregate, !operationType.emptyRightPart);\n }\n this.operands[position] = operator;\n }\n else {\n throw Error('dont have this element in operands collection');\n }\n item = null;\n return this.operands[position];\n };\n this.remove = (operator) => {\n this.operands.splice(this.operands.indexOf(operator), 1);\n };\n this.assignLeftPart = (operator) => {\n this.operands = operator.operands;\n };\n this.operands = [];\n this.type = 'group';\n this.operatorType = operation;\n operands = operands || [criteriaCreator.process('default'), criteriaCreator.process('default')];\n operands.forEach(operand => this.operands.push(operand));\n }\n static combine(operation, operands) {\n var combinedOperands = [];\n (operands || []).forEach(operand => {\n if (operand.type === 'group' && operand.operatorType === operation) {\n combinedOperands.push.apply(combinedOperands, operand.operands);\n }\n else {\n combinedOperands.push(operand);\n }\n });\n if (combinedOperands.length === 1) {\n return combinedOperands[0];\n }\n return criteriaCreator.process('group', { operands: combinedOperands, operation: operation });\n }\n children() {\n return this.operands;\n }\n get displayType() {\n return GroupOperatorType[this.operatorType];\n }\n get enumType() {\n return GroupOperatorType;\n }\n accept(visitor) {\n return visitor.visitGroupOperator\n ? visitor.visitGroupOperator(this)\n : new GroupOperator(this.operatorType, this.operands && this.operands.map(op => op.accept(visitor)));\n }\n}\ncriteriaCreator.register('group', (options) => {\n return new GroupOperator(options.operation, options.operands);\n}, (operatorType) => criteriaCreator.process('group', {\n operation: operatorType.value,\n operands: []\n}));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\in.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CriteriaOperator } from './criteriaOperator';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nexport class InOperator extends CriteriaOperator {\n constructor(criteriaOperator, operands) {\n super();\n this.assignLeftPart = (criteriaOperator) => {\n this.criteriaOperator = criteriaOperator.leftPart;\n };\n this.assignRightPart = (criteriaOperator) => {\n this.operands = [].concat(criteriaOperator.rightPart);\n };\n this.operatorType = 'In';\n this.type = 'in';\n this.operands = [];\n this.criteriaOperator = criteriaOperator || criteriaCreator.process('default');\n (operands || []).forEach(operand => this.operands.push(operand));\n }\n get leftPart() {\n return this.criteriaOperator;\n }\n get rightPart() {\n return this.operands;\n }\n get displayType() {\n return 'In';\n }\n get enumType() {\n return InOperator;\n }\n accept(visitor) {\n return visitor.visitInOperator\n ? visitor.visitInOperator(this)\n : new InOperator(this.criteriaOperator && this.criteriaOperator.accept(visitor), this.operands && this.operands.map(op => op.accept(visitor)));\n }\n}\ncriteriaCreator.register('in', (options) => {\n return new InOperator(options.criteriaOperator, options.operands);\n}, (operatorType) => criteriaCreator.process('in', {\n criteriaOperator: criteriaCreator.process('property'),\n operands: [criteriaCreator.process('value')]\n}));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\join.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CriteriaOperator } from './criteriaOperator';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nexport class JoinOperand extends CriteriaOperator {\n constructor(joinTypeName, condition, type, aggregated) {\n super();\n this.type = 'join';\n this.joinTypeName = joinTypeName;\n this.condition = condition;\n this.operatorType = type;\n this.aggregatedExpression = aggregated;\n }\n static joinOrAggregate(collectionProperty, condition, type, aggregated) {\n if (collectionProperty === null || collectionProperty.propertyName.length < 2 || collectionProperty.propertyName[0] != '<' || collectionProperty.propertyName[collectionProperty.propertyName.length - 1] != '>') {\n return criteriaCreator.process('aggregate', {\n property: collectionProperty,\n aggregatedExpression: aggregated,\n aggregateType: type,\n condition: condition\n });\n }\n else {\n return criteriaCreator.process('join', {\n joinTypeName: collectionProperty.propertyName.substring(1, collectionProperty.propertyName.length - 2),\n condition: condition,\n type: type,\n aggregated: aggregated\n });\n }\n }\n accept(visitor) {\n return visitor.visitJoinOperand\n ? visitor.visitJoinOperand(this)\n : new JoinOperand(this.joinTypeName, this.condition && this.condition.accept(visitor), this.operatorType, this.aggregatedExpression && this.aggregatedExpression.accept(visitor));\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\options\\binary.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var BinaryOperatorType;\n(function (BinaryOperatorType) {\n BinaryOperatorType[BinaryOperatorType[\"Equal\"] = 0] = \"Equal\";\n BinaryOperatorType[BinaryOperatorType[\"NotEqual\"] = 1] = \"NotEqual\";\n BinaryOperatorType[BinaryOperatorType[\"Greater\"] = 2] = \"Greater\";\n BinaryOperatorType[BinaryOperatorType[\"Less\"] = 3] = \"Less\";\n BinaryOperatorType[BinaryOperatorType[\"LessOrEqual\"] = 4] = \"LessOrEqual\";\n BinaryOperatorType[BinaryOperatorType[\"GreaterOrEqual\"] = 5] = \"GreaterOrEqual\";\n BinaryOperatorType[BinaryOperatorType[\"Like\"] = 6] = \"Like\";\n BinaryOperatorType[BinaryOperatorType[\"BitwiseAnd\"] = 7] = \"BitwiseAnd\";\n BinaryOperatorType[BinaryOperatorType[\"BitwiseOr\"] = 8] = \"BitwiseOr\";\n BinaryOperatorType[BinaryOperatorType[\"BitwiseXor\"] = 9] = \"BitwiseXor\";\n BinaryOperatorType[BinaryOperatorType[\"Divide\"] = 10] = \"Divide\";\n BinaryOperatorType[BinaryOperatorType[\"Modulo\"] = 11] = \"Modulo\";\n BinaryOperatorType[BinaryOperatorType[\"Multiply\"] = 12] = \"Multiply\";\n BinaryOperatorType[BinaryOperatorType[\"Plus\"] = 13] = \"Plus\";\n BinaryOperatorType[BinaryOperatorType[\"Minus\"] = 14] = \"Minus\";\n})(BinaryOperatorType || (BinaryOperatorType = {}));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\options\\function.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var FunctionOperatorType;\n(function (FunctionOperatorType) {\n FunctionOperatorType[FunctionOperatorType[\"None\"] = 0] = \"None\";\n FunctionOperatorType[FunctionOperatorType[\"Custom\"] = 1] = \"Custom\";\n FunctionOperatorType[FunctionOperatorType[\"CustomNonDeterministic\"] = 2] = \"CustomNonDeterministic\";\n FunctionOperatorType[FunctionOperatorType[\"Iif\"] = 3] = \"Iif\";\n FunctionOperatorType[FunctionOperatorType[\"InRange\"] = 4] = \"InRange\";\n FunctionOperatorType[FunctionOperatorType[\"IsNull\"] = 5] = \"IsNull\";\n FunctionOperatorType[FunctionOperatorType[\"IsNullOrEmpty\"] = 6] = \"IsNullOrEmpty\";\n FunctionOperatorType[FunctionOperatorType[\"Trim\"] = 7] = \"Trim\";\n FunctionOperatorType[FunctionOperatorType[\"Len\"] = 8] = \"Len\";\n FunctionOperatorType[FunctionOperatorType[\"Substring\"] = 9] = \"Substring\";\n FunctionOperatorType[FunctionOperatorType[\"Upper\"] = 10] = \"Upper\";\n FunctionOperatorType[FunctionOperatorType[\"Lower\"] = 11] = \"Lower\";\n FunctionOperatorType[FunctionOperatorType[\"Concat\"] = 12] = \"Concat\";\n FunctionOperatorType[FunctionOperatorType[\"Ascii\"] = 13] = \"Ascii\";\n FunctionOperatorType[FunctionOperatorType[\"Char\"] = 14] = \"Char\";\n FunctionOperatorType[FunctionOperatorType[\"ToStr\"] = 15] = \"ToStr\";\n FunctionOperatorType[FunctionOperatorType[\"Replace\"] = 16] = \"Replace\";\n FunctionOperatorType[FunctionOperatorType[\"Reverse\"] = 17] = \"Reverse\";\n FunctionOperatorType[FunctionOperatorType[\"Insert\"] = 18] = \"Insert\";\n FunctionOperatorType[FunctionOperatorType[\"CharIndex\"] = 19] = \"CharIndex\";\n FunctionOperatorType[FunctionOperatorType[\"Remove\"] = 20] = \"Remove\";\n FunctionOperatorType[FunctionOperatorType[\"Abs\"] = 21] = \"Abs\";\n FunctionOperatorType[FunctionOperatorType[\"Sqr\"] = 22] = \"Sqr\";\n FunctionOperatorType[FunctionOperatorType[\"Cos\"] = 23] = \"Cos\";\n FunctionOperatorType[FunctionOperatorType[\"Sin\"] = 24] = \"Sin\";\n FunctionOperatorType[FunctionOperatorType[\"Atn\"] = 25] = \"Atn\";\n FunctionOperatorType[FunctionOperatorType[\"Exp\"] = 26] = \"Exp\";\n FunctionOperatorType[FunctionOperatorType[\"Log\"] = 27] = \"Log\";\n FunctionOperatorType[FunctionOperatorType[\"Rnd\"] = 28] = \"Rnd\";\n FunctionOperatorType[FunctionOperatorType[\"Tan\"] = 29] = \"Tan\";\n FunctionOperatorType[FunctionOperatorType[\"Power\"] = 30] = \"Power\";\n FunctionOperatorType[FunctionOperatorType[\"Sign\"] = 31] = \"Sign\";\n FunctionOperatorType[FunctionOperatorType[\"Round\"] = 32] = \"Round\";\n FunctionOperatorType[FunctionOperatorType[\"Ceiling\"] = 33] = \"Ceiling\";\n FunctionOperatorType[FunctionOperatorType[\"Floor\"] = 34] = \"Floor\";\n FunctionOperatorType[FunctionOperatorType[\"Max\"] = 35] = \"Max\";\n FunctionOperatorType[FunctionOperatorType[\"Min\"] = 36] = \"Min\";\n FunctionOperatorType[FunctionOperatorType[\"Acos\"] = 37] = \"Acos\";\n FunctionOperatorType[FunctionOperatorType[\"Asin\"] = 38] = \"Asin\";\n FunctionOperatorType[FunctionOperatorType[\"Atn2\"] = 39] = \"Atn2\";\n FunctionOperatorType[FunctionOperatorType[\"BigMul\"] = 40] = \"BigMul\";\n FunctionOperatorType[FunctionOperatorType[\"Cosh\"] = 41] = \"Cosh\";\n FunctionOperatorType[FunctionOperatorType[\"Log10\"] = 42] = \"Log10\";\n FunctionOperatorType[FunctionOperatorType[\"Sinh\"] = 43] = \"Sinh\";\n FunctionOperatorType[FunctionOperatorType[\"Tanh\"] = 44] = \"Tanh\";\n FunctionOperatorType[FunctionOperatorType[\"PadLeft\"] = 45] = \"PadLeft\";\n FunctionOperatorType[FunctionOperatorType[\"PadRight\"] = 46] = \"PadRight\";\n FunctionOperatorType[FunctionOperatorType[\"StartsWith\"] = 47] = \"StartsWith\";\n FunctionOperatorType[FunctionOperatorType[\"EndsWith\"] = 48] = \"EndsWith\";\n FunctionOperatorType[FunctionOperatorType[\"Contains\"] = 49] = \"Contains\";\n FunctionOperatorType[FunctionOperatorType[\"ToInt\"] = 50] = \"ToInt\";\n FunctionOperatorType[FunctionOperatorType[\"ToLong\"] = 51] = \"ToLong\";\n FunctionOperatorType[FunctionOperatorType[\"ToFloat\"] = 52] = \"ToFloat\";\n FunctionOperatorType[FunctionOperatorType[\"ToDouble\"] = 53] = \"ToDouble\";\n FunctionOperatorType[FunctionOperatorType[\"ToDecimal\"] = 54] = \"ToDecimal\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeThisYear\"] = 55] = \"LocalDateTimeThisYear\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeThisMonth\"] = 56] = \"LocalDateTimeThisMonth\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeLastWeek\"] = 57] = \"LocalDateTimeLastWeek\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeThisWeek\"] = 58] = \"LocalDateTimeThisWeek\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeYesterday\"] = 59] = \"LocalDateTimeYesterday\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeToday\"] = 60] = \"LocalDateTimeToday\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeNow\"] = 61] = \"LocalDateTimeNow\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeTomorrow\"] = 62] = \"LocalDateTimeTomorrow\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeDayAfterTomorrow\"] = 63] = \"LocalDateTimeDayAfterTomorrow\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeNextWeek\"] = 64] = \"LocalDateTimeNextWeek\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeTwoWeeksAway\"] = 65] = \"LocalDateTimeTwoWeeksAway\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeNextMonth\"] = 66] = \"LocalDateTimeNextMonth\";\n FunctionOperatorType[FunctionOperatorType[\"LocalDateTimeNextYear\"] = 67] = \"LocalDateTimeNextYear\";\n FunctionOperatorType[FunctionOperatorType[\"InDateRange\"] = 68] = \"InDateRange\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalBeyondThisYear\"] = 69] = \"IsOutlookIntervalBeyondThisYear\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalLaterThisYear\"] = 70] = \"IsOutlookIntervalLaterThisYear\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalLaterThisMonth\"] = 71] = \"IsOutlookIntervalLaterThisMonth\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalNextWeek\"] = 72] = \"IsOutlookIntervalNextWeek\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalLaterThisWeek\"] = 73] = \"IsOutlookIntervalLaterThisWeek\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalTomorrow\"] = 74] = \"IsOutlookIntervalTomorrow\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalToday\"] = 75] = \"IsOutlookIntervalToday\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalYesterday\"] = 76] = \"IsOutlookIntervalYesterday\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalEarlierThisWeek\"] = 77] = \"IsOutlookIntervalEarlierThisWeek\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalLastWeek\"] = 78] = \"IsOutlookIntervalLastWeek\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalEarlierThisMonth\"] = 79] = \"IsOutlookIntervalEarlierThisMonth\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalEarlierThisYear\"] = 80] = \"IsOutlookIntervalEarlierThisYear\";\n FunctionOperatorType[FunctionOperatorType[\"IsOutlookIntervalPriorThisYear\"] = 81] = \"IsOutlookIntervalPriorThisYear\";\n FunctionOperatorType[FunctionOperatorType[\"IsLastMonth\"] = 82] = \"IsLastMonth\";\n FunctionOperatorType[FunctionOperatorType[\"IsLastYear\"] = 83] = \"IsLastYear\";\n FunctionOperatorType[FunctionOperatorType[\"IsNextMonth\"] = 84] = \"IsNextMonth\";\n FunctionOperatorType[FunctionOperatorType[\"IsNextYear\"] = 85] = \"IsNextYear\";\n FunctionOperatorType[FunctionOperatorType[\"IsThisWeek\"] = 86] = \"IsThisWeek\";\n FunctionOperatorType[FunctionOperatorType[\"IsThisMonth\"] = 87] = \"IsThisMonth\";\n FunctionOperatorType[FunctionOperatorType[\"IsThisYear\"] = 88] = \"IsThisYear\";\n FunctionOperatorType[FunctionOperatorType[\"IsJanuary\"] = 89] = \"IsJanuary\";\n FunctionOperatorType[FunctionOperatorType[\"IsFebruary\"] = 90] = \"IsFebruary\";\n FunctionOperatorType[FunctionOperatorType[\"IsMarch\"] = 91] = \"IsMarch\";\n FunctionOperatorType[FunctionOperatorType[\"IsApril\"] = 92] = \"IsApril\";\n FunctionOperatorType[FunctionOperatorType[\"IsMay\"] = 93] = \"IsMay\";\n FunctionOperatorType[FunctionOperatorType[\"IsJune\"] = 94] = \"IsJune\";\n FunctionOperatorType[FunctionOperatorType[\"IsJuly\"] = 95] = \"IsJuly\";\n FunctionOperatorType[FunctionOperatorType[\"IsAugust\"] = 96] = \"IsAugust\";\n FunctionOperatorType[FunctionOperatorType[\"IsSeptember\"] = 97] = \"IsSeptember\";\n FunctionOperatorType[FunctionOperatorType[\"IsOctober\"] = 98] = \"IsOctober\";\n FunctionOperatorType[FunctionOperatorType[\"IsNovember\"] = 99] = \"IsNovember\";\n FunctionOperatorType[FunctionOperatorType[\"IsDecember\"] = 100] = \"IsDecember\";\n FunctionOperatorType[FunctionOperatorType[\"IsSameDay\"] = 101] = \"IsSameDay\";\n FunctionOperatorType[FunctionOperatorType[\"IsYearToDate\"] = 102] = \"IsYearToDate\";\n FunctionOperatorType[FunctionOperatorType[\"DateDiffTick\"] = 103] = \"DateDiffTick\";\n FunctionOperatorType[FunctionOperatorType[\"DateDiffSecond\"] = 104] = \"DateDiffSecond\";\n FunctionOperatorType[FunctionOperatorType[\"DateDiffMilliSecond\"] = 105] = \"DateDiffMilliSecond\";\n FunctionOperatorType[FunctionOperatorType[\"DateDiffMinute\"] = 106] = \"DateDiffMinute\";\n FunctionOperatorType[FunctionOperatorType[\"DateDiffHour\"] = 107] = \"DateDiffHour\";\n FunctionOperatorType[FunctionOperatorType[\"DateDiffDay\"] = 108] = \"DateDiffDay\";\n FunctionOperatorType[FunctionOperatorType[\"DateDiffMonth\"] = 109] = \"DateDiffMonth\";\n FunctionOperatorType[FunctionOperatorType[\"DateDiffYear\"] = 110] = \"DateDiffYear\";\n FunctionOperatorType[FunctionOperatorType[\"DateTimeFromParts\"] = 111] = \"DateTimeFromParts\";\n FunctionOperatorType[FunctionOperatorType[\"GetDate\"] = 112] = \"GetDate\";\n FunctionOperatorType[FunctionOperatorType[\"GetMilliSecond\"] = 113] = \"GetMilliSecond\";\n FunctionOperatorType[FunctionOperatorType[\"GetSecond\"] = 114] = \"GetSecond\";\n FunctionOperatorType[FunctionOperatorType[\"GetMinute\"] = 115] = \"GetMinute\";\n FunctionOperatorType[FunctionOperatorType[\"GetHour\"] = 116] = \"GetHour\";\n FunctionOperatorType[FunctionOperatorType[\"GetDay\"] = 117] = \"GetDay\";\n FunctionOperatorType[FunctionOperatorType[\"GetMonth\"] = 118] = \"GetMonth\";\n FunctionOperatorType[FunctionOperatorType[\"GetYear\"] = 119] = \"GetYear\";\n FunctionOperatorType[FunctionOperatorType[\"GetDayOfWeek\"] = 120] = \"GetDayOfWeek\";\n FunctionOperatorType[FunctionOperatorType[\"GetDayOfYear\"] = 121] = \"GetDayOfYear\";\n FunctionOperatorType[FunctionOperatorType[\"GetTimeOfDay\"] = 122] = \"GetTimeOfDay\";\n FunctionOperatorType[FunctionOperatorType[\"Now\"] = 123] = \"Now\";\n FunctionOperatorType[FunctionOperatorType[\"UtcNow\"] = 124] = \"UtcNow\";\n FunctionOperatorType[FunctionOperatorType[\"Today\"] = 125] = \"Today\";\n FunctionOperatorType[FunctionOperatorType[\"AddTimeSpan\"] = 126] = \"AddTimeSpan\";\n FunctionOperatorType[FunctionOperatorType[\"AddTicks\"] = 127] = \"AddTicks\";\n FunctionOperatorType[FunctionOperatorType[\"AddMilliSeconds\"] = 128] = \"AddMilliSeconds\";\n FunctionOperatorType[FunctionOperatorType[\"AddSeconds\"] = 129] = \"AddSeconds\";\n FunctionOperatorType[FunctionOperatorType[\"AddMinutes\"] = 130] = \"AddMinutes\";\n FunctionOperatorType[FunctionOperatorType[\"AddHours\"] = 131] = \"AddHours\";\n FunctionOperatorType[FunctionOperatorType[\"AddDays\"] = 132] = \"AddDays\";\n FunctionOperatorType[FunctionOperatorType[\"AddMonths\"] = 133] = \"AddMonths\";\n FunctionOperatorType[FunctionOperatorType[\"AddYears\"] = 134] = \"AddYears\";\n FunctionOperatorType[FunctionOperatorType[\"OrderDescToken\"] = 135] = \"OrderDescToken\";\n})(FunctionOperatorType || (FunctionOperatorType = {}));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\options\\group.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var GroupOperatorType;\n(function (GroupOperatorType) {\n GroupOperatorType[GroupOperatorType[\"And\"] = 0] = \"And\";\n GroupOperatorType[GroupOperatorType[\"Or\"] = 1] = \"Or\";\n})(GroupOperatorType || (GroupOperatorType = {}));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\options\\unary.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var UnaryOperatorType;\n(function (UnaryOperatorType) {\n UnaryOperatorType[UnaryOperatorType[\"Minus\"] = 0] = \"Minus\";\n UnaryOperatorType[UnaryOperatorType[\"Plus\"] = 1] = \"Plus\";\n UnaryOperatorType[UnaryOperatorType[\"BitwiseNot\"] = 2] = \"BitwiseNot\";\n UnaryOperatorType[UnaryOperatorType[\"Not\"] = 3] = \"Not\";\n UnaryOperatorType[UnaryOperatorType[\"IsNull\"] = 4] = \"IsNull\";\n})(UnaryOperatorType || (UnaryOperatorType = {}));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\parameter.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { OperandValue } from './value';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nexport class OperandParameter extends OperandValue {\n constructor(parameterName, value) {\n super(value);\n this.type = 'parameter';\n this.parameterName = parameterName || '';\n }\n get displayType() {\n return '?' + this.parameterName;\n }\n accept(visitor) {\n return visitor.visitOperandParameter\n ? visitor.visitOperandParameter(this)\n : new OperandParameter(this.parameterName, this.value);\n }\n}\ncriteriaCreator.register('parameter', (options) => {\n return new OperandParameter(options.parameterName, options.value);\n});\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\property.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CriteriaOperator } from './criteriaOperator';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nexport class OperandProperty extends CriteriaOperator {\n constructor(propertyName = '', startColumn = -1, startLine = -1, originalPropertyLength = 0, circumflex = false) {\n super();\n this.type = 'property';\n this.propertyName = propertyName;\n this.originalPropertyLength = originalPropertyLength;\n this.startPosition = { column: startColumn, line: startLine };\n this.circumflex = circumflex;\n }\n get displayType() {\n return '[' + this.propertyName + ']';\n }\n accept(visitor) {\n return visitor.visitOperandProperty\n ? visitor.visitOperandProperty(this)\n : criteriaCreator.process('property', { propertyName: this.propertyName });\n }\n}\ncriteriaCreator.register('property', (options) => {\n return new OperandProperty(options.propertyName, options.startColumn, options.startLine, options.originalPropertyLength, options.circumflex);\n});\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\unary.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CriteriaOperator } from './criteriaOperator';\nimport { UnaryOperatorType } from './options/unary';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nexport class UnaryOperator extends CriteriaOperator {\n constructor(operatorType, operand) {\n super();\n this.type = 'unary';\n this.operand = operand || criteriaCreator.process('default');\n this.operatorType = operatorType;\n }\n get leftPart() {\n return this.operand;\n }\n assignFrom(criteriaOperator) {\n if (this.operatorType === UnaryOperatorType.Not) {\n if (criteriaOperator instanceof UnaryOperator) {\n this.operand.assignFrom(criteriaOperator.operand);\n }\n else {\n this.operand.assignFrom(criteriaOperator);\n }\n }\n else {\n if (criteriaOperator instanceof UnaryOperator) {\n this.operand = criteriaOperator.operand.leftPart;\n }\n else {\n this.operand = (criteriaOperator.leftPart || criteriaOperator);\n }\n }\n }\n get displayType() {\n return UnaryOperatorType[this.operatorType];\n }\n get enumType() {\n return UnaryOperatorType;\n }\n accept(visitor) {\n return visitor.visitUnaryOperator\n ? visitor.visitUnaryOperator(this)\n : new UnaryOperator(this.operatorType, this.operand && this.operand.accept(visitor));\n }\n}\ncriteriaCreator.register('unary', (options) => {\n return new UnaryOperator(options.operatorType, options.operator);\n}, (operatorType) => criteriaCreator.process('unary', {\n operatorType: operatorType.value,\n operator: criteriaCreator.process('property')\n}));\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\operators\\value.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CriteriaOperator } from './criteriaOperator';\nimport { validateGuid } from '../../../property-grid/widgets/internal/_internal';\nimport { parseDate } from '../../../property-grid/localization/_localization';\nimport { criteriaCreator } from '../utils/criteriaOperatorPreprocessor';\nexport class OperandValue extends CriteriaOperator {\n constructor(value, isSomeType) {\n super();\n this.type = 'value';\n var result = value !== null && value !== undefined ? value : '';\n var isGuid = validateGuid(value);\n if (value && value['length'] && ((value[0] === \"'\" && value[value.length - 1] === \"'\") || isGuid)) {\n this.specifics = 'string';\n if (isGuid && value[0] === '{' && value[value.length - 1] === '}')\n this.specifics = 'guid';\n result = this._processStringValue(value);\n }\n else if (value && value['length'] && value[0] === '#' && value[value.length - 1] === '#' && !isSomeType) {\n result = value.slice(1, value.length - 1);\n result = parseDate(result);\n if (!result) {\n result = parseDate(value.slice(1, value.length - 1));\n }\n }\n else if (String(value).toLowerCase() === 'true' || String(value).toLowerCase() === 'false') {\n result = String(value).toLowerCase() === 'true' ? 'True' : 'False';\n }\n else if (isSomeType) {\n this.specifics = value.match(/\\#\\w+\\#/g)[0].replace(/\\#/g, '').toLowerCase();\n }\n this.value = result;\n }\n _processStringValue(value) {\n var result = value.slice(1, value.length - 1);\n result = result.replace(/''/g, \"'\");\n return result;\n }\n get displayType() {\n return this.value || '?';\n }\n}\ncriteriaCreator.register('value', (options) => {\n return new OperandValue(options === null || options === void 0 ? void 0 : options.value, options === null || options === void 0 ? void 0 : options.isSomeType);\n});\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\parser\\criteriaparser.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\n\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar criteriaCreator = require('../utils/criteriaOperatorPreprocessor').criteriaCreator;\r\nvar BinaryOperatorType = require('../operators/options/binary').BinaryOperatorType;\r\nvar UnaryOperatorType = require('../operators/options/unary').UnaryOperatorType;\r\nvar GroupOperator = require('../operators/group').GroupOperator;\r\nvar GroupOperatorType = require('../operators/options/group').GroupOperatorType;\r\nvar FunctionOperatorType = require('../operators/options/function').FunctionOperatorType;\r\nvar JoinOperand = require('../operators/join').JoinOperand;\r\n/* parser generated by jison 0.4.18 */\r\n/*\r\n Returns a Parser object of the following structure:\r\n\r\n Parser: {\r\n yy: {}\r\n }\r\n\r\n Parser.prototype: {\r\n yy: {},\r\n trace: function(),\r\n symbols_: {associative list: name ==> number},\r\n terminals_: {associative list: number ==> name},\r\n productions_: [...],\r\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\r\n table: [...],\r\n defaultActions: {...},\r\n parseError: function(str, hash),\r\n parse: function(input),\r\n\r\n lexer: {\r\n EOF: 1,\r\n parseError: function(str, hash),\r\n setInput: function(input),\r\n input: function(),\r\n unput: function(str),\r\n more: function(),\r\n less: function(n),\r\n pastInput: function(),\r\n upcomingInput: function(),\r\n showPosition: function(),\r\n test_match: function(regex_match_array, rule_index),\r\n next: function(),\r\n lex: function(),\r\n begin: function(condition),\r\n popState: function(),\r\n _currentRules: function(),\r\n topState: function(),\r\n pushState: function(condition),\r\n\r\n options: {\r\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\r\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\r\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\r\n },\r\n\r\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\r\n rules: [...],\r\n conditions: {associative list: name ==> set},\r\n }\r\n }\r\n\r\n\r\n token location info (@$, _$, etc.): {\r\n first_line: n,\r\n last_line: n,\r\n first_column: n,\r\n last_column: n,\r\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\r\n }\r\n\r\n\r\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\r\n text: (matched text)\r\n token: (the produced terminal token, if any)\r\n line: (yylineno)\r\n }\r\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\r\n loc: (yylloc)\r\n expected: (string describing the set of expected tokens)\r\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\r\n }\r\n*/\r\nvar criteriaparser = (function(){\r\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,8],$V2=[1,7],$V3=[1,24],$V4=[1,9],$V5=[1,10],$V6=[1,11],$V7=[1,12],$V8=[1,19],$V9=[1,13],$Va=[1,14],$Vb=[1,15],$Vc=[1,16],$Vd=[1,17],$Ve=[1,18],$Vf=[1,21],$Vg=[1,23],$Vh=[1,22],$Vi=[1,26],$Vj=[1,27],$Vk=[1,28],$Vl=[1,29],$Vm=[1,30],$Vn=[1,31],$Vo=[1,32],$Vp=[1,33],$Vq=[1,34],$Vr=[1,35],$Vs=[1,36],$Vt=[1,37],$Vu=[1,38],$Vv=[1,39],$Vw=[1,40],$Vx=[1,41],$Vy=[1,42],$Vz=[1,43],$VA=[1,44],$VB=[1,45],$VC=[1,46],$VD=[5,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,31,32,34,36,37,46],$VE=[5,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,31,32,34,36,37,45,46,47,51,52,53],$VF=[1,54],$VG=[5,15,16,17,20,21,22,23,24,25,26,27,28,29,31,32,34,36,37,46],$VH=[5,28,29,31,37,46],$VI=[1,93],$VJ=[1,94],$VK=[5,12,13,15,16,17,20,21,22,23,24,25,26,27,28,29,31,32,34,36,37,46],$VL=[5,20,21,26,27,28,29,31,32,37,46],$VM=[5,20,21,22,23,24,25,26,27,28,29,31,32,37,46],$VN=[31,37],$VO=[1,103],$VP=[1,105];\r\nvar parser = {trace: function trace () { },\r\nyy: {},\r\nsymbols_: {\"error\":2,\"expressions\":3,\"exp\":4,\"EOF\":5,\"const\":6,\"propertyWithAgg\":7,\"ENUM\":8,\"parameter\":9,\"*\":10,\"/\":11,\"+\":12,\"-\":13,\"%\":14,\"|\":15,\"&\":16,\"^\":17,\"!\":18,\"~\":19,\"OP_EQ\":20,\"OP_NE\":21,\"OP_GT\":22,\"OP_LT\":23,\"OP_GE\":24,\"OP_LE\":25,\"OP_LIKE\":26,\"NOT\":27,\"AND\":28,\"OR\":29,\"(\":30,\")\":31,\"IS\":32,\"NULL\":33,\"OP_IN\":34,\"arguments\":35,\"OP_BETWEEN\":36,\",\":37,\"NAME_SOFT\":38,\"STRING\":39,\"NUMBER\":40,\"OBJECT\":41,\"BOOLEAN\":42,\"GUID\":43,\"property\":44,\"[\":45,\"]\":46,\".\":47,\"agg\":48,\"Count\":49,\"Exists\":50,\"FIELD_END\":51,\"CH\":52,\"ESC_CH\":53,\"FIELD_START\":54,\"?\":55,\"commaseparated\":56,\"$accept\":0,\"$end\":1},\r\nterminals_: {2:\"error\",5:\"EOF\",8:\"ENUM\",10:\"*\",11:\"/\",12:\"+\",13:\"-\",14:\"%\",15:\"|\",16:\"&\",17:\"^\",18:\"!\",19:\"~\",20:\"OP_EQ\",21:\"OP_NE\",22:\"OP_GT\",23:\"OP_LT\",24:\"OP_GE\",25:\"OP_LE\",26:\"OP_LIKE\",27:\"NOT\",28:\"AND\",29:\"OR\",30:\"(\",31:\")\",32:\"IS\",33:\"NULL\",34:\"OP_IN\",36:\"OP_BETWEEN\",37:\",\",38:\"NAME_SOFT\",39:\"STRING\",40:\"NUMBER\",41:\"OBJECT\",42:\"BOOLEAN\",43:\"GUID\",45:\"[\",46:\"]\",47:\".\",49:\"Count\",50:\"Exists\",51:\"FIELD_END\",52:\"CH\",53:\"ESC_CH\",54:\"FIELD_START\",55:\"?\"},\r\nproductions_: [0,[3,2],[4,1],[4,1],[4,1],[4,1],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,4],[4,2],[4,3],[4,3],[4,3],[4,3],[4,4],[4,3],[4,7],[4,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[7,6],[7,5],[7,3],[7,4],[7,3],[7,1],[7,4],[48,3],[48,1],[48,1],[48,4],[44,2],[44,2],[44,2],[44,3],[44,3],[44,1],[44,1],[44,1],[9,2],[9,1],[35,2],[35,3],[56,1],[56,3]],\r\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\r\n/* this == yyval */\r\n\r\nvar $0 = $$.length - 1;\r\nswitch (yystate) {\r\ncase 1:\r\n return $$[$0-1]; \r\nbreak;\r\ncase 2:\r\n this.$ = criteriaCreator.process(\"const\", { value: $$[$0] }); \r\nbreak;\r\ncase 3: case 5: case 35: case 36: case 37: case 38: case 39:\r\n this.$ = $$[$0]; \r\nbreak;\r\ncase 4:\r\n this.$ = criteriaCreator.process(\"value\", { value: $$[$0], isSomeType: true }) \r\nbreak;\r\ncase 6:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.Multiply }); \r\nbreak;\r\ncase 7:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.Divide }); \r\nbreak;\r\ncase 8:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.Plus }); \r\nbreak;\r\ncase 9:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.Minus }); \r\nbreak;\r\ncase 10:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.Modulo }); \r\nbreak;\r\ncase 11:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.BitwiseOr }); \r\nbreak;\r\ncase 12:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.BitwiseAnd }); \r\nbreak;\r\ncase 13:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.BitwiseXor }); \r\nbreak;\r\ncase 14:\r\n this.$ = criteriaCreator.process(\"unary\", { operatorType: UnaryOperatorType.Minus, operator: $$[$0] }); \r\nbreak;\r\ncase 15:\r\n this.$ = criteriaCreator.process(\"unary\", { operatorType: UnaryOperatorType.Plus, operator: $$[$0] }); \r\nbreak;\r\ncase 16: case 26:\r\n this.$ = criteriaCreator.process(\"unary\", { operatorType: UnaryOperatorType.Not, operator: $$[$0] }); \r\nbreak;\r\ncase 17:\r\n this.$ = criteriaCreator.process(\"unary\", { operatorType: UnaryOperatorType.BitwiseNot, operator: $$[$0] }); \r\nbreak;\r\ncase 18:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.Equal }); \r\nbreak;\r\ncase 19:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.NotEqual }); \r\nbreak;\r\ncase 20:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.Greater }); \r\nbreak;\r\ncase 21:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.Less }); \r\nbreak;\r\ncase 22:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.GreaterOrEqual }); \r\nbreak;\r\ncase 23:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.LessOrEqual }); \r\nbreak;\r\ncase 24:\r\n this.$ = criteriaCreator.process(\"binary\", { left: $$[$0-2], right: $$[$0], operatorType: BinaryOperatorType.Like }); \r\nbreak;\r\ncase 25:\r\n\r\n this.$ = criteriaCreator.process(\"unary\", { \r\n operatorType: UnaryOperatorType.Not, \r\n operator: criteriaCreator.process(\"binary\", { left: $$[$0-3], right: $$[$0], operatorType: BinaryOperatorType.Like }) \r\n });\r\n \r\nbreak;\r\ncase 27:\r\n this.$ = GroupOperator.combine(GroupOperatorType.And, [$$[$0-2], $$[$0]]); \r\nbreak;\r\ncase 28:\r\n this.$ = GroupOperator.combine(GroupOperatorType.Or, [$$[$0-2], $$[$0]]); \r\nbreak;\r\ncase 29: case 52: case 63:\r\n this.$ = $$[$0-1]; \r\nbreak;\r\ncase 30:\r\n this.$ = criteriaCreator.process(\"unary\", { operatorType: UnaryOperatorType.IsNull, operator: $$[$0-2] }); \r\nbreak;\r\ncase 31:\r\n \r\n this.$ = criteriaCreator.process(\"unary\", { \r\n operatorType: UnaryOperatorType.Not,\r\n operator: criteriaCreator.process(\"unary\", { operatorType: UnaryOperatorType.IsNull, operator: $$[$0-3] })\r\n }); \r\n \r\nbreak;\r\ncase 32:\r\n this.$ = criteriaCreator.process(\"in\", { criteriaOperator: $$[$0-2], operands: $$[$0] }); \r\nbreak;\r\ncase 33:\r\n this.$ = criteriaCreator.process(\"between\", { property: $$[$0-6], begin: $$[$0-3], end: $$[$0-1] }); \r\nbreak;\r\ncase 34:\r\n this.$ = criteriaCreator.process(\"function\", { operatorType: FunctionOperatorType[$$[$0-1]] || $$[$0-1], operands: $$[$0] }); \r\nbreak;\r\ncase 40:\r\n this.$ = null; \r\nbreak;\r\ncase 41:\r\n \r\n this.$ = JoinOperand.joinOrAggregate(\r\n criteriaCreator.process(\"property\", { propertyName: $$[$0-5].name, startColumn: $$[$0-5].col, circumflex: $$[$0-5].circumflex, startLine: $$[$0-5].line, originalPropertyLength: _$[$0-5].last_column - _$[$0-5].first_column + 1 }), \r\n $$[$0-3], $$[$0].type, $$[$0].expr\r\n );\r\n \r\nbreak;\r\ncase 42:\r\n \r\n this.$ = JoinOperand.joinOrAggregate(\r\n criteriaCreator.process(\"property\", { propertyName: $$[$0-4].name, startColumn: $$[$0-4].col, circumflex: $$[$0-4].circumflex, startLine: $$[$0-4].line, originalPropertyLength: _$[$0-4].last_column - _$[$0-4].first_column + 1 }), \r\n null, $$[$0].type, $$[$0].expr\r\n );\r\n \r\nbreak;\r\ncase 43:\r\n \r\n this.$ = JoinOperand.joinOrAggregate(\r\n criteriaCreator.process(\"property\", { propertyName: $$[$0-2].name, startColumn: $$[$0-2].col, circumflex: $$[$0-2].circumflex, startLine: $$[$0-2].line, originalPropertyLength: _$[$0-2].last_column - _$[$0-2].first_column }), \r\n null, $$[$0].type, $$[$0].expr\r\n );\r\n \r\nbreak;\r\ncase 44:\r\n \r\n this.$ = JoinOperand.joinOrAggregate(\r\n criteriaCreator.process(\"property\", { propertyName: $$[$0-3].name, startColumn: $$[$0-3].col, circumflex: $$[$0-3].circumflex, startLine: $$[$0-3].line, originalPropertyLength: _$[$0-3].last_column - _$[$0-3].first_column + 1 }), \r\n $$[$0-1], 'Exists', null\r\n );\r\n \r\nbreak;\r\ncase 45:\r\n \r\n this.$ = JoinOperand.joinOrAggregate(\r\n criteriaCreator.process(\"property\", { propertyName: $$[$0-2].name, startColumn: $$[$0-2].col, circumflex: $$[$0-2].circumflex, startLine: $$[$0-2].line, originalPropertyLength: _$[$0-2].last_column - _$[$0-2].first_column + 1 }), \r\n null, 'Exists', null);\r\n \r\nbreak;\r\ncase 46:\r\n \r\n this.$ = criteriaCreator.process(\"property\", { propertyName: $$[$0].name, startColumn: $$[$0].col, circumflex: $$[$0].circumflex, startLine: $$[$0].line, originalPropertyLength: _$[$0].last_column - _$[$0].first_column });\r\n \r\nbreak;\r\ncase 47:\r\n \r\n this.$ = JoinOperand.joinOrAggregate(\r\n criteriaCreator.process(\"property\", { }), \r\n null, $$[$0].type, $$[$0].expr\r\n ); \r\n \r\nbreak;\r\ncase 48:\r\n this.$ = { type: $$[$0-2] }; \r\nbreak;\r\ncase 49:\r\n this.$ = { type: 'Count' }; \r\nbreak;\r\ncase 50:\r\n this.$ = { type: 'Exists' }; \r\nbreak;\r\ncase 51:\r\n this.$ = { type: $$[$0-3], expr: $$[$0-1] }; \r\nbreak;\r\ncase 53:\r\n this.$ = { name: $$[$0-1].name + $$[$0], line: $$[$0-1].line, circumflex: $$[$0-1].circumflex, col: $$[$0-1].col }; \r\nbreak;\r\ncase 54:\r\n this.$ = { name: $$[$0-1].name + $$[$0].substr(1), line: $$[$0-1].line, circumflex: $$[$0-1].circumflex, col: $$[$0-1].col }; \r\nbreak;\r\ncase 55:\r\n \r\n if($$[$0-2].circumflex && $$[$0-2].started) {\r\n this.$ = { name: '', line: $$[$0-2].line, circumflex: $$[$0-2].circumflex, col: $$[$0-2].col + 2 }; \r\n } else \r\n this.$ = { name: $$[$0-2].name + '.', line: $$[$0-2].line, circumflex: $$[$0-2].circumflex, col: $$[$0-2].col }; \r\n \r\nbreak;\r\ncase 56:\r\n \r\n if($$[$0-2].circumflex && $$[$0-2].started){ \r\n this.$ = { name: $$[$0], line: $$[$0-2].line, circumflex: $$[$0-2].circumflex, col: $$[$0-2].col + 1 }; \r\n } else \r\n this.$ = { name: $$[$0-2].name + '.' + $$[$0], line: $$[$0-2].line, circumflex: $$[$0-2].circumflex, col: $$[$0-2].col }; \r\n \r\nbreak;\r\ncase 57:\r\n this.$ = { name: \"\", line: _$[$0].first_line - 1, col: _$[$0].first_column + 1 }; \r\nbreak;\r\ncase 58:\r\n this.$ = { name: $$[$0], line: _$[$0].first_line - 1, col: _$[$0].first_column }; \r\nbreak;\r\ncase 59:\r\n this.$ = { circumflex: true, started: true, name: \"\", line: _$[$0].first_line - 1, col: _$[$0].first_column + 1 }; \r\nbreak;\r\ncase 60:\r\n this.$ = criteriaCreator.process(\"parameter\", { parameterName: $$[$0] }); \r\nbreak;\r\ncase 61:\r\n this.$ = criteriaCreator.process(\"value\", { }); \r\nbreak;\r\ncase 62:\r\n this.$ = []; \r\nbreak;\r\ncase 64:\r\n this.$ = [$$[$0]]; \r\nbreak;\r\ncase 65:\r\n this.$ = $$[$0-2].concat($$[$0]); \r\nbreak;\r\n}\r\n},\r\ntable: [{3:1,4:2,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{1:[3]},{5:[1,25],10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,27:$Vx,28:$Vy,29:$Vz,32:$VA,34:$VB,36:$VC},o($VD,[2,2]),o($VD,[2,3]),o($VD,[2,4]),o($VD,[2,5]),{4:47,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:48,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:49,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:50,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:51,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:52,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},o($VE,[2,58],{35:53,30:$VF}),o($VD,[2,35]),o($VD,[2,36]),o($VD,[2,37]),o($VD,[2,38]),o($VD,[2,39]),o($VD,[2,40]),o($VD,[2,46],{45:[1,55],47:[1,56],51:[1,57],52:[1,58],53:[1,59]}),{46:[1,60]},o($VD,[2,61],{38:[1,61]}),o($VE,[2,57]),o($VE,[2,59]),{1:[2,1]},{4:62,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:63,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:64,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:65,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:66,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:67,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:68,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:69,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:70,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:71,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:72,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:73,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:74,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:75,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:76,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{26:[1,77]},{4:78,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{4:79,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},{27:[1,81],33:[1,80]},{30:$VF,35:82},{30:[1,83]},o($VD,[2,14]),o($VD,[2,15]),o($VD,[2,16]),o($VG,[2,17],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm}),o($VH,[2,26],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,32:$VA,34:$VB,36:$VC}),{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,27:$Vx,28:$Vy,29:$Vz,31:[1,84],32:$VA,34:$VB,36:$VC},o($VD,[2,34]),{4:87,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,31:[1,85],33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh,56:86},{4:88,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,46:[1,89],54:$Vg,55:$Vh},{38:[1,92],48:90,49:$VI,50:$VJ,54:[1,91]},o($VE,[2,52]),o($VE,[2,53]),o($VE,[2,54]),{47:[1,95]},o($VD,[2,60]),o($VD,[2,6]),o($VD,[2,7]),o($VK,[2,8],{10:$Vi,11:$Vj,14:$Vm}),o($VK,[2,9],{10:$Vi,11:$Vj,14:$Vm}),o($VD,[2,10]),o([5,15,20,21,22,23,24,25,26,27,28,29,31,32,34,36,37,46],[2,11],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,16:$Vo,17:$Vp}),o($VG,[2,12],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm}),o([5,15,17,20,21,22,23,24,25,26,27,28,29,31,32,34,36,37,46],[2,13],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,16:$Vo}),o($VL,[2,18],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,22:$Vs,23:$Vt,24:$Vu,25:$Vv,34:$VB,36:$VC}),o($VL,[2,19],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,22:$Vs,23:$Vt,24:$Vu,25:$Vv,34:$VB,36:$VC}),o($VM,[2,20],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,34:$VB,36:$VC}),o($VM,[2,21],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,34:$VB,36:$VC}),o($VM,[2,22],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,34:$VB,36:$VC}),o($VM,[2,23],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,34:$VB,36:$VC}),o($VL,[2,24],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,22:$Vs,23:$Vt,24:$Vu,25:$Vv,34:$VB,36:$VC}),{4:96,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},o($VH,[2,27],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,27:$Vx,32:$VA,34:$VB,36:$VC}),o([5,29,31,37,46],[2,28],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,27:$Vx,28:$Vy,32:$VA,34:$VB,36:$VC}),o($VD,[2,30]),{33:[1,97]},o($VD,[2,32]),{4:98,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},o($VD,[2,29]),o($VD,[2,62]),{31:[1,99],37:[1,100]},o($VN,[2,64],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,27:$Vx,28:$Vy,29:$Vz,32:$VA,34:$VB,36:$VC}),{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,27:$Vx,28:$Vy,29:$Vz,32:$VA,34:$VB,36:$VC,46:[1,101]},o($VD,[2,45],{47:[1,102]}),o($VD,[2,43]),o($VE,[2,55]),o($VE,[2,56],{30:$VO}),o($VD,[2,49]),o($VD,[2,50]),{38:$VP,48:104,49:$VI,50:$VJ},o($VL,[2,25],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,22:$Vs,23:$Vt,24:$Vu,25:$Vv,34:$VB,36:$VC}),o($VD,[2,31]),{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,27:$Vx,28:$Vy,29:$Vz,32:$VA,34:$VB,36:$VC,37:[1,106]},o($VD,[2,63]),{4:107,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},o($VD,[2,44],{47:[1,108]}),{38:$VP,48:109,49:$VI,50:$VJ},{4:111,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,31:[1,110],33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},o($VD,[2,47]),{30:$VO},{4:112,6:3,7:4,8:$V0,9:6,12:$V1,13:$V2,17:$V3,18:$V4,19:$V5,27:$V6,30:$V7,33:$V8,38:$V9,39:$Va,40:$Vb,41:$Vc,42:$Vd,43:$Ve,44:20,45:$Vf,54:$Vg,55:$Vh},o($VN,[2,65],{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,27:$Vx,28:$Vy,29:$Vz,32:$VA,34:$VB,36:$VC}),{38:$VP,48:113,49:$VI,50:$VJ},o($VD,[2,42]),o($VD,[2,48]),{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,27:$Vx,28:$Vy,29:$Vz,31:[1,114],32:$VA,34:$VB,36:$VC},{10:$Vi,11:$Vj,12:$Vk,13:$Vl,14:$Vm,15:$Vn,16:$Vo,17:$Vp,20:$Vq,21:$Vr,22:$Vs,23:$Vt,24:$Vu,25:$Vv,26:$Vw,27:$Vx,28:$Vy,29:$Vz,31:[1,115],32:$VA,34:$VB,36:$VC},o($VD,[2,41]),o($VD,[2,51]),o($VD,[2,33])],\r\ndefaultActions: {25:[2,1]},\r\nparseError: function parseError (str, hash) {\r\n if (hash.recoverable) {\r\n this.trace(str);\r\n } else {\r\n var error = new Error(str);\r\n error.hash = hash;\r\n throw error;\r\n }\r\n},\r\nparse: function parse(input) {\r\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\r\n var args = lstack.slice.call(arguments, 1);\r\n var lexer = Object.create(this.lexer);\r\n var sharedState = { yy: {} };\r\n for (var k in this.yy) {\r\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\r\n sharedState.yy[k] = this.yy[k];\r\n }\r\n }\r\n lexer.setInput(input, sharedState.yy);\r\n sharedState.yy.lexer = lexer;\r\n sharedState.yy.parser = this;\r\n if (typeof lexer.yylloc == 'undefined') {\r\n lexer.yylloc = {};\r\n }\r\n var yyloc = lexer.yylloc;\r\n lstack.push(yyloc);\r\n var ranges = lexer.options && lexer.options.ranges;\r\n if (typeof sharedState.yy.parseError === 'function') {\r\n this.parseError = sharedState.yy.parseError;\r\n } else {\r\n this.parseError = Object.getPrototypeOf(this).parseError;\r\n }\r\n function popStack(n) {\r\n stack.length = stack.length - 2 * n;\r\n vstack.length = vstack.length - n;\r\n lstack.length = lstack.length - n;\r\n }\r\n _token_stack:\r\n var lex = function () {\r\n var token;\r\n token = lexer.lex() || EOF;\r\n if (typeof token !== 'number') {\r\n token = self.symbols_[token] || token;\r\n }\r\n return token;\r\n };\r\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\r\n while (true) {\r\n state = stack[stack.length - 1];\r\n if (this.defaultActions[state]) {\r\n action = this.defaultActions[state];\r\n } else {\r\n if (symbol === null || typeof symbol == 'undefined') {\r\n symbol = lex();\r\n }\r\n action = table[state] && table[state][symbol];\r\n }\r\n if (typeof action === 'undefined' || !action.length || !action[0]) {\r\n var errStr = '';\r\n expected = [];\r\n for (p in table[state]) {\r\n if (this.terminals_[p] && p > TERROR) {\r\n expected.push('\\'' + this.terminals_[p] + '\\'');\r\n }\r\n }\r\n if (lexer.showPosition) {\r\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\r\n } else {\r\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\r\n }\r\n this.parseError(errStr, {\r\n text: lexer.match,\r\n token: this.terminals_[symbol] || symbol,\r\n line: lexer.yylineno,\r\n loc: yyloc,\r\n expected: expected\r\n });\r\n }\r\n if (action[0] instanceof Array && action.length > 1) {\r\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\r\n }\r\n switch (action[0]) {\r\n case 1:\r\n stack.push(symbol);\r\n vstack.push(lexer.yytext);\r\n lstack.push(lexer.yylloc);\r\n stack.push(action[1]);\r\n symbol = null;\r\n if (!preErrorSymbol) {\r\n yyleng = lexer.yyleng;\r\n yytext = lexer.yytext;\r\n yylineno = lexer.yylineno;\r\n yyloc = lexer.yylloc;\r\n if (recovering > 0) {\r\n recovering--;\r\n }\r\n } else {\r\n symbol = preErrorSymbol;\r\n preErrorSymbol = null;\r\n }\r\n break;\r\n case 2:\r\n len = this.productions_[action[1]][1];\r\n yyval.$ = vstack[vstack.length - len];\r\n yyval._$ = {\r\n first_line: lstack[lstack.length - (len || 1)].first_line,\r\n last_line: lstack[lstack.length - 1].last_line,\r\n first_column: lstack[lstack.length - (len || 1)].first_column,\r\n last_column: lstack[lstack.length - 1].last_column\r\n };\r\n if (ranges) {\r\n yyval._$.range = [\r\n lstack[lstack.length - (len || 1)].range[0],\r\n lstack[lstack.length - 1].range[1]\r\n ];\r\n }\r\n r = this.performAction.apply(yyval, [\r\n yytext,\r\n yyleng,\r\n yylineno,\r\n sharedState.yy,\r\n action[1],\r\n vstack,\r\n lstack\r\n ].concat(args));\r\n if (typeof r !== 'undefined') {\r\n return r;\r\n }\r\n if (len) {\r\n stack = stack.slice(0, -1 * len * 2);\r\n vstack = vstack.slice(0, -1 * len);\r\n lstack = lstack.slice(0, -1 * len);\r\n }\r\n stack.push(this.productions_[action[1]][0]);\r\n vstack.push(yyval.$);\r\n lstack.push(yyval._$);\r\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\r\n stack.push(newState);\r\n break;\r\n case 3:\r\n return true;\r\n }\r\n }\r\n return true;\r\n}};\r\n/* generated by jison-lex 0.3.4 */\r\nvar lexer = (function(){\r\nvar lexer = ({\r\n\r\nEOF:1,\r\n\r\nparseError:function parseError(str, hash) {\r\n if (this.yy.parser) {\r\n this.yy.parser.parseError(str, hash);\r\n } else {\r\n throw new Error(str);\r\n }\r\n },\r\n\r\n// resets the lexer, sets new input\r\nsetInput:function (input, yy) {\r\n this.yy = yy || this.yy || {};\r\n this._input = input;\r\n this._more = this._backtrack = this.done = false;\r\n this.yylineno = this.yyleng = 0;\r\n this.yytext = this.matched = this.match = '';\r\n this.conditionStack = ['INITIAL'];\r\n this.yylloc = {\r\n first_line: 1,\r\n first_column: 0,\r\n last_line: 1,\r\n last_column: 0\r\n };\r\n if (this.options.ranges) {\r\n this.yylloc.range = [0,0];\r\n }\r\n this.offset = 0;\r\n return this;\r\n },\r\n\r\n// consumes and returns one char from the input\r\ninput:function () {\r\n var ch = this._input[0];\r\n this.yytext += ch;\r\n this.yyleng++;\r\n this.offset++;\r\n this.match += ch;\r\n this.matched += ch;\r\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\r\n if (lines) {\r\n this.yylineno++;\r\n this.yylloc.last_line++;\r\n } else {\r\n this.yylloc.last_column++;\r\n }\r\n if (this.options.ranges) {\r\n this.yylloc.range[1]++;\r\n }\r\n\r\n this._input = this._input.slice(1);\r\n return ch;\r\n },\r\n\r\n// unshifts one char (or a string) into the input\r\nunput:function (ch) {\r\n var len = ch.length;\r\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\r\n\r\n this._input = ch + this._input;\r\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\r\n //this.yyleng -= len;\r\n this.offset -= len;\r\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\r\n this.match = this.match.substr(0, this.match.length - 1);\r\n this.matched = this.matched.substr(0, this.matched.length - 1);\r\n\r\n if (lines.length - 1) {\r\n this.yylineno -= lines.length - 1;\r\n }\r\n var r = this.yylloc.range;\r\n\r\n this.yylloc = {\r\n first_line: this.yylloc.first_line,\r\n last_line: this.yylineno + 1,\r\n first_column: this.yylloc.first_column,\r\n last_column: lines ?\r\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\r\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\r\n this.yylloc.first_column - len\r\n };\r\n\r\n if (this.options.ranges) {\r\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\r\n }\r\n this.yyleng = this.yytext.length;\r\n return this;\r\n },\r\n\r\n// When called from action, caches matched text and appends it on next action\r\nmore:function () {\r\n this._more = true;\r\n return this;\r\n },\r\n\r\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\r\nreject:function () {\r\n if (this.options.backtrack_lexer) {\r\n this._backtrack = true;\r\n } else {\r\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\r\n text: \"\",\r\n token: null,\r\n line: this.yylineno\r\n });\r\n\r\n }\r\n return this;\r\n },\r\n\r\n// retain first n characters of the match\r\nless:function (n) {\r\n this.unput(this.match.slice(n));\r\n },\r\n\r\n// displays already matched input, i.e. for error messages\r\npastInput:function () {\r\n var past = this.matched.substr(0, this.matched.length - this.match.length);\r\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\r\n },\r\n\r\n// displays upcoming input, i.e. for error messages\r\nupcomingInput:function () {\r\n var next = this.match;\r\n if (next.length < 20) {\r\n next += this._input.substr(0, 20-next.length);\r\n }\r\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\r\n },\r\n\r\n// displays the character position where the lexing error occurred, i.e. for error messages\r\nshowPosition:function () {\r\n var pre = this.pastInput();\r\n var c = new Array(pre.length + 1).join(\"-\");\r\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\r\n },\r\n\r\n// test the lexed token: return FALSE when not a match, otherwise return token\r\ntest_match:function(match, indexed_rule) {\r\n var token,\r\n lines,\r\n backup;\r\n\r\n if (this.options.backtrack_lexer) {\r\n // save context\r\n backup = {\r\n yylineno: this.yylineno,\r\n yylloc: {\r\n first_line: this.yylloc.first_line,\r\n last_line: this.last_line,\r\n first_column: this.yylloc.first_column,\r\n last_column: this.yylloc.last_column\r\n },\r\n yytext: this.yytext,\r\n match: this.match,\r\n matches: this.matches,\r\n matched: this.matched,\r\n yyleng: this.yyleng,\r\n offset: this.offset,\r\n _more: this._more,\r\n _input: this._input,\r\n yy: this.yy,\r\n conditionStack: this.conditionStack.slice(0),\r\n done: this.done\r\n };\r\n if (this.options.ranges) {\r\n backup.yylloc.range = this.yylloc.range.slice(0);\r\n }\r\n }\r\n\r\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\r\n if (lines) {\r\n this.yylineno += lines.length;\r\n }\r\n this.yylloc = {\r\n first_line: this.yylloc.last_line,\r\n last_line: this.yylineno + 1,\r\n first_column: this.yylloc.last_column,\r\n last_column: lines ?\r\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\r\n this.yylloc.last_column + match[0].length\r\n };\r\n this.yytext += match[0];\r\n this.match += match[0];\r\n this.matches = match;\r\n this.yyleng = this.yytext.length;\r\n if (this.options.ranges) {\r\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\r\n }\r\n this._more = false;\r\n this._backtrack = false;\r\n this._input = this._input.slice(match[0].length);\r\n this.matched += match[0];\r\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\r\n if (this.done && this._input) {\r\n this.done = false;\r\n }\r\n if (token) {\r\n return token;\r\n } else if (this._backtrack) {\r\n // recover context\r\n for (var k in backup) {\r\n this[k] = backup[k];\r\n }\r\n return false; // rule action called reject() implying the next rule should be tested instead.\r\n }\r\n return false;\r\n },\r\n\r\n// return next match in input\r\nnext:function () {\r\n if (this.done) {\r\n return this.EOF;\r\n }\r\n if (!this._input) {\r\n this.done = true;\r\n }\r\n\r\n var token,\r\n match,\r\n tempMatch,\r\n index;\r\n if (!this._more) {\r\n this.yytext = '';\r\n this.match = '';\r\n }\r\n var rules = this._currentRules();\r\n for (var i = 0; i < rules.length; i++) {\r\n tempMatch = this._input.match(this.rules[rules[i]]);\r\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\r\n match = tempMatch;\r\n index = i;\r\n if (this.options.backtrack_lexer) {\r\n token = this.test_match(tempMatch, rules[i]);\r\n if (token !== false) {\r\n return token;\r\n } else if (this._backtrack) {\r\n match = false;\r\n continue; // rule action called reject() implying a rule MISmatch.\r\n } else {\r\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\r\n return false;\r\n }\r\n } else if (!this.options.flex) {\r\n break;\r\n }\r\n }\r\n }\r\n if (match) {\r\n token = this.test_match(match, rules[index]);\r\n if (token !== false) {\r\n return token;\r\n }\r\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\r\n return false;\r\n }\r\n if (this._input === \"\") {\r\n return this.EOF;\r\n } else {\r\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\r\n text: \"\",\r\n token: null,\r\n line: this.yylineno\r\n });\r\n }\r\n },\r\n\r\n// return next match that has a token\r\nlex:function lex () {\r\n var r = this.next();\r\n if (r) {\r\n return r;\r\n } else {\r\n return this.lex();\r\n }\r\n },\r\n\r\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\r\nbegin:function begin (condition) {\r\n this.conditionStack.push(condition);\r\n },\r\n\r\n// pop the previously active lexer condition state off the condition stack\r\npopState:function popState () {\r\n var n = this.conditionStack.length - 1;\r\n if (n > 0) {\r\n return this.conditionStack.pop();\r\n } else {\r\n return this.conditionStack[0];\r\n }\r\n },\r\n\r\n// produce the lexer rule set which is active for the currently active lexer condition state\r\n_currentRules:function _currentRules () {\r\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\r\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\r\n } else {\r\n return this.conditions[\"INITIAL\"].rules;\r\n }\r\n },\r\n\r\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\r\ntopState:function topState (n) {\r\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\r\n if (n >= 0) {\r\n return this.conditionStack[n];\r\n } else {\r\n return \"INITIAL\";\r\n }\r\n },\r\n\r\n// alias for begin(condition)\r\npushState:function pushState (condition) {\r\n this.begin(condition);\r\n },\r\n\r\n// return the number of states currently on the stack\r\nstateStackSize:function stateStackSize() {\r\n return this.conditionStack.length;\r\n },\r\noptions: {\"case-insensitive\":true},\r\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\r\nvar YYSTATE=YY_START;\r\nswitch($avoiding_name_collisions) {\r\ncase 0: this.begin('INITIAL'); return 45; \r\nbreak;\r\ncase 1: this.begin('INITIAL'); return 51; \r\nbreak;\r\ncase 2:return 53;\r\nbreak;\r\ncase 3:return 52;\r\nbreak;\r\ncase 4:return 'INVALID';\r\nbreak;\r\ncase 5:return 39\r\nbreak;\r\ncase 6:return 43\r\nbreak;\r\ncase 7:return 8\r\nbreak;\r\ncase 8:return 41\r\nbreak;\r\ncase 9:return 40\r\nbreak;\r\ncase 10:return 42\r\nbreak;\r\ncase 11:return 42\r\nbreak;\r\ncase 12:/* skip whitespace */\r\nbreak;\r\ncase 13:return 36\r\nbreak;\r\ncase 14:return 34\r\nbreak;\r\ncase 15:return 27\r\nbreak;\r\ncase 16:return 32\r\nbreak;\r\ncase 17:return 33\r\nbreak;\r\ncase 18:return 10\r\nbreak;\r\ncase 19:return 11\r\nbreak;\r\ncase 20:return 13\r\nbreak;\r\ncase 21:return 12\r\nbreak;\r\ncase 22:return 17\r\nbreak;\r\ncase 23:return 19\r\nbreak;\r\ncase 24:return 21\r\nbreak;\r\ncase 25:return 18\r\nbreak;\r\ncase 26:return 14\r\nbreak;\r\ncase 27:return 21\r\nbreak;\r\ncase 28:return 24\r\nbreak;\r\ncase 29:return 25\r\nbreak;\r\ncase 30:return 22\r\nbreak;\r\ncase 31:return 23\r\nbreak;\r\ncase 32:return 29\r\nbreak;\r\ncase 33:return 28\r\nbreak;\r\ncase 34:return 20\r\nbreak;\r\ncase 35:return 20\r\nbreak;\r\ncase 36:return 26\r\nbreak;\r\ncase 37:return 28\r\nbreak;\r\ncase 38:return 29\r\nbreak;\r\ncase 39:return 16\r\nbreak;\r\ncase 40:return 15\r\nbreak;\r\ncase 41: this.begin('fieldname'); return 54; \r\nbreak;\r\ncase 42:return 46;\r\nbreak;\r\ncase 43:return 30\r\nbreak;\r\ncase 44:return 31\r\nbreak;\r\ncase 45:return 47\r\nbreak;\r\ncase 46:return 37\r\nbreak;\r\ncase 47:return 55\r\nbreak;\r\ncase 48:return 38\r\nbreak;\r\ncase 49:return 'INVALID'\r\nbreak;\r\ncase 50:return 5\r\nbreak;\r\n}\r\n},\r\nrules: [/^(?:\\]\\s*\\[)/i,/^(?:\\])/i,/^(?:\\\\.)/i,/^(?:.)/i,/^(?:$)/i,/^(?:'(?:[^\\']|(?:('')))*')/i,/^(?:\\{[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}\\})/i,/^(?:##\\w+#(?:[^\\#]|(?:\\.))*#)/i,/^(?:#(?:[^\\\\\\#]|(?:\\\\.))*#)/i,/^(?:[0-9]+(\\.[0-9]+([mfMF]{1})?|[bsiluBSILU]{1})?)/i,/^(?:True\\b)/i,/^(?:False\\b)/i,/^(?:\\s+)/i,/^(?:Between\\b)/i,/^(?:In\\b)/i,/^(?:Not\\b)/i,/^(?:Is\\b)/i,/^(?:Null\\b)/i,/^(?:\\*)/i,/^(?:\\/)/i,/^(?:-)/i,/^(?:\\+)/i,/^(?:\\^)/i,/^(?:~)/i,/^(?:!=)/i,/^(?:!)/i,/^(?:%)/i,/^(?:<>)/i,/^(?:>=)/i,/^(?:<=)/i,/^(?:>)/i,/^(?:<)/i,/^(?:\\|\\|)/i,/^(?:&&)/i,/^(?:==)/i,/^(?:=)/i,/^(?:Like\\b)/i,/^(?:And\\b)/i,/^(?:Or\\b)/i,/^(?:&)/i,/^(?:\\|)/i,/^(?:\\[)/i,/^(?:\\])/i,/^(?:\\()/i,/^(?:\\))/i,/^(?:\\.)/i,/^(?:,)/i,/^(?:\\?)/i,/^(?:[_\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376-\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E-\\u066F\\u0671-\\u06D3\\u06D5\\u06E5-\\u06E6\\u06EE-\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4-\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC-\\u09DD\\u09DF-\\u09E1\\u09F0-\\u09F1\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0-\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F-\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60-\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0-\\u0CE1\\u0CF1-\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E46\\u0E81-\\u0E82\\u0E84\\u0E87-\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA-\\u0EAB\\u0EAD-\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065-\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE-\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5-\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183-\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3006\\u3031-\\u3035\\u303B-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A-\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AD\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5-\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40-\\uFB41\\uFB43-\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC][\\d_\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376-\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E-\\u066F\\u0671-\\u06D3\\u06D5\\u06E5-\\u06E6\\u06EE-\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4-\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC-\\u09DD\\u09DF-\\u09E1\\u09F0-\\u09F1\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0-\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F-\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60-\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0-\\u0CE1\\u0CF1-\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E46\\u0E81-\\u0E82\\u0E84\\u0E87-\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA-\\u0EAB\\u0EAD-\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065-\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE-\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5-\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183-\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3006\\u3031-\\u3035\\u303B-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A-\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AD\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5-\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40-\\uFB41\\uFB43-\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]*)/i,/^(?:.)/i,/^(?:$)/i],\r\nconditions: {\"fieldname\":{\"rules\":[0,1,2,3,4],\"inclusive\":false},\"INITIAL\":{\"rules\":[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],\"inclusive\":true}}\r\n});\r\nreturn lexer;\r\n})();\r\nparser.lexer = lexer;\r\nfunction Parser () {\r\n this.yy = {};\r\n}\r\nParser.prototype = parser;parser.Parser = Parser;\r\nreturn new Parser;\r\n})();\r\nexports.criteriaparser = criteriaparser;\r\nexports.parse = function(test) { return criteriaparser.parse(test) };\r\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\utils\\criteriaEnumeration.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { AggregateOperand } from '../operators/aggregate';\nexport function criteriaForEach(operator, callback, path = '') {\n callback(operator, path);\n if (operator instanceof AggregateOperand) {\n operator.leftPart && criteriaForEach(operator.leftPart, callback, path);\n if (operator.leftPart && operator.leftPart['propertyName']) {\n path = path ? [path, operator.leftPart['propertyName']].join('.') : operator.leftPart['propertyName'];\n }\n }\n operator.children().forEach(item => criteriaForEach(item, callback, path));\n}\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\utils\\criteriaOperatorPreprocessor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { UnaryOperatorType } from '../operators/options/unary';\nexport class CriteriaOperatorPreprocessor {\n constructor() {\n this._func = [];\n this._factory = {};\n this._changeTypeFactory = {};\n }\n addListener(func) {\n var index = this._func.indexOf(func);\n if (index === -1) {\n this._func.push(func);\n }\n }\n removeListener(func) {\n var index = this._func.indexOf(func);\n if (index !== -1) {\n this._func.splice(index, 1);\n }\n }\n register(operatorType, create, changeType) {\n this._factory[operatorType] = create;\n if (changeType)\n this._changeTypeFactory[operatorType] = (changeOperator) => {\n var operand = changeType(changeOperator);\n if (changeOperator.reverse) {\n operand = this.process('unary', {\n operator: operand,\n operatorType: UnaryOperatorType.Not\n });\n }\n return operand;\n };\n }\n process(operatorType, options = {}) {\n var operand = operatorType in this._factory ? this._factory[operatorType](options) : this._factory['default']();\n this._func.forEach(func => { operand = func(operand, { operatorType: operatorType, options: options || {} }); });\n return operand;\n }\n changeByType(value) {\n if (this._changeTypeFactory[value._type]) {\n return this._changeTypeFactory[value._type](value);\n }\n return null;\n }\n}\nexport var criteriaCreator = new CriteriaOperatorPreprocessor();\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\utils\\criteriaOperatorStateMachine.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { stringReplace } from '../../../property-grid/widgets/internal/_utils';\nimport { parse } from '../parser/criteriaparser';\nexport class MachineState {\n constructor(tokenName, alphabet, startTerm, endTerm) {\n this.tokenName = tokenName;\n this.alphabet = alphabet;\n this.startTerm = startTerm;\n this.endTerm = endTerm;\n this.tokenLength = 0;\n this.isActiveState = false;\n this.tokens = [];\n }\n _isSubline(pos, term) {\n var result = (pos + term.length - 1 < this.alphabet.length);\n for (var i = pos; i < (pos + term.length) && result; i++)\n result = this.alphabet[i] == term[i - pos];\n return result;\n }\n _getToken(pos) {\n var token = {\n type: this.tokenName, start: pos - this.tokenLength + 1, end: pos + this.endTerm.length\n };\n token.val = this.alphabet.substring(token.start, token.end);\n return token;\n }\n processTransitionFunction(pos) {\n if (this.isActiveState) {\n this.tokenLength++;\n }\n if (this._isSubline(pos, this.startTerm) && !this.isActiveState) {\n this.isActiveState = true;\n this.tokenLength += this.startTerm.length;\n return this.startTerm.length - 1;\n }\n else if (this.isActiveState && this._isSubline(pos, this.endTerm)) {\n this.isActiveState = false;\n this.tokens.push(this._getToken(pos));\n this.tokenLength = 0;\n return this.endTerm.length - 1;\n }\n return 0;\n }\n}\nexport class CriteriaOperatorStateMachine {\n constructor(stringCriteria) {\n this.stringCriteria = stringCriteria;\n this.machineStates = [];\n this.machineStates.push(new MachineState('field', stringCriteria, '[', ']'));\n this.machineStates.push(new MachineState('value', stringCriteria, \"'\", \"'\"));\n this.machineStates.push(new MachineState('comment', stringCriteria, '/*', '*/'));\n this._inputStringCriteria = stringCriteria;\n }\n static parse(stringCriteria, saveOriginalStringLength = false) {\n if (stringCriteria && stringCriteria !== '') {\n if (saveOriginalStringLength)\n return new CriteriaOperatorStateMachine(stringCriteria).replaceCommentsToChar(' ').getCriteria();\n return new CriteriaOperatorStateMachine(stringCriteria).replaceCommentsToChar().getCriteria();\n }\n return null;\n }\n _tokenize() {\n for (var i = 0; i < this.stringCriteria.length; i++) {\n var step = 0;\n this.machineStates.forEach(state => {\n if (step)\n return;\n var anotherMachines = this.machineStates.filter(a => a != state && a.isActiveState);\n if (!anotherMachines.length)\n step = state.processTransitionFunction(i);\n });\n i += step;\n }\n var resultTokens = [];\n this.machineStates.forEach((state) => {\n resultTokens = resultTokens.concat(state.tokens);\n state.tokens = [];\n });\n return resultTokens;\n }\n _replaceTokenToAnotherToken(tokens, newTokenChar, tokenName) {\n var tempCriteria = this.stringCriteria;\n tokens = tokens.filter(a => a.type == tokenName).sort(a => a.start).reverse();\n tokens.forEach(token => {\n var lines = token.val.split('\\n');\n var start = token.start;\n var end = token.end;\n lines.forEach(line => {\n if (line.length + start !== token.end) {\n end = start + line.length;\n }\n else {\n end = token.end;\n }\n tempCriteria = stringReplace(tempCriteria, start, end - start, newTokenChar);\n start = (line.length * newTokenChar.length) + 1;\n });\n });\n return tempCriteria;\n }\n replaceCommentsToChar(char = '') {\n this._inputStringCriteria = this._replaceTokenToAnotherToken(this._tokenize(), char, 'comment');\n return this;\n }\n getCriteria() {\n return parse(this._inputStringCriteria);\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\criteria\\utils\\operatorTokens.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var operatorTokens = {\n 'Plus': '+',\n 'Minus': '-',\n 'Equal': '=',\n 'NotEqual': '<>',\n 'Greater': '>',\n 'Less': '<',\n 'LessOrEqual': '<=',\n 'GreaterOrEqual': '>='\n};\n","/**\r\n* DevExpress Analytics (widgets\\expressioneditor\\_expressioneditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nexport var RangeSpecific = 'range';\nexport function createExpressionEditorCollectionToolOptions(collectionItems, toolName, displayToolName, showDescription) {\n return {\n displayName: getLocalization(toolName, displayToolName),\n content: {\n showDescription: showDescription,\n isSelected: ko.observable(false),\n data: {\n items: collectionItems,\n selectedItem: ko.observable(null)\n },\n name: 'dx-expressioneditor-collection'\n },\n dispose: () => void 0\n };\n}\nexport function wrapExpressionValue(path, value, converter, subscriptions) {\n if (!(converter && path))\n return value;\n var _displayValue = ko.observable(value());\n converter.toDisplayExpression(path(), value()).done((result) => {\n _displayValue(result);\n }).fail(() => {\n _displayValue(value());\n });\n var valueSubscription = value.subscribe((newValue) => {\n converter.toDisplayExpression(path(), newValue).done((result) => {\n _displayValue(result);\n }).fail(() => {\n _displayValue(newValue);\n });\n });\n var pathSubscription = path.subscribe(newPath => {\n converter.toDisplayExpression(newPath, value())\n .done(result => { _displayValue(result); })\n .fail(_ => { _displayValue(value()); });\n });\n var displayValue = ko.pureComputed({\n read: () => _displayValue(),\n write: (newValue) => {\n _displayValue(newValue);\n converter.toRealExpression(path(), newValue).done((result) => {\n value(result);\n }).fail(() => {\n value(newValue);\n });\n }\n });\n if (subscriptions)\n [displayValue, valueSubscription, pathSubscription].forEach(x => subscriptions.push(x));\n return displayValue;\n}\n","/**\r\n* DevExpress Analytics (widgets\\expressioneditor\\bindings.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { ExpressionEditor } from './expressioneditor';\nimport { addDisposeCallback } from '../../serializer/_internal';\nko.bindingHandlers['dxExpressionEditor'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var $element = $.fn.constructor(element);\n $element.children().remove();\n var values = valueAccessor();\n $.fn.constructor(element).addClass(values.wrapper ? 'dx-expressioneditor-content' : 'dx-popup-general');\n var templateName = values.editorTemplateName || 'dx-expressioneditor';\n var optionSubscription = null;\n var editor = new ExpressionEditor(ko.unwrap(values.options), values.fieldListProvider, viewModel.disabled, $.fn.constructor(element).closest('.dx-rtl').length > 0, values.displayNameProvider, values.popupVisible, viewModel.editorInputId);\n if (ko.isSubscribable(values.options)) {\n optionSubscription = values.options.subscribe(newOptions => {\n newOptions && editor.koOptions(newOptions);\n });\n }\n values.wrapper && values.wrapper.editor(editor);\n var childContext = bindingContext.createChildContext(editor);\n var child = document.createElement('div'), $element = $element.append(child);\n ko.renderTemplate(templateName, childContext, {}, child, 'replaceNode');\n var callback = () => {\n editor.dispose();\n editor = null;\n values.wrapper && values.wrapper.editor(null);\n optionSubscription && optionSubscription.dispose();\n };\n addDisposeCallback(element, callback);\n return { controlsDescendantBindings: true };\n }\n};\n","/**\r\n* DevExpress Analytics (widgets\\expressioneditor\\expressioneditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport * as ko from 'knockout';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nimport { StringId } from '../../property-grid/localization/_localizationStringIds';\nimport { Disposable } from '../../serializer/utils';\nimport { aceAvailable } from '../ace/_ace-available';\nimport { CodeCompletor } from '../common/_codeCompletor';\nimport { DisplayExpressionConverter } from '../common/_displayNameProvider';\nimport { CriteriaOperatorStateMachine } from '../criteria/utils/criteriaOperatorStateMachine';\nimport { ResizeHelper } from '../internal/_resizeHelper';\nimport { getParentContainer, isList, setCursorInFunctionParameter } from '../_utils';\nimport { Tools } from './tools/_tools';\nimport { ExpressionEditorParametersTreeListController, ExpressionEditorTreeListController } from './tools/_treeListControllers';\nimport { RangeSpecific, wrapExpressionValue } from './_expressioneditor';\nexport function getNotValidRange(value, errorMessage) {\n var start = 0;\n var end = 0;\n var parts = errorMessage.split('\\n');\n var errorText = parts[1];\n var errorLength = parts[2].length;\n if (errorText.indexOf('...') === 0) {\n errorText = errorText.split('...')[1];\n }\n var start = value.indexOf(errorText);\n var end = start + errorLength;\n return { start: start, end: end };\n}\nfunction createExpressionEditorFieldListProvider(originalProvider, fieldName) {\n return ko.computed(() => {\n var provider = ko.unwrap(originalProvider);\n var unwrappedFieldName = ko.unwrap(fieldName);\n return !unwrappedFieldName ? provider : {\n getItems: (path) => {\n var $deferred = $.Deferred();\n provider.getItems(path)\n .done((data) => {\n $deferred.resolve(data.filter(field => field.name !== unwrappedFieldName));\n })\n .fail(() => $deferred.reject());\n return $deferred.promise();\n },\n getValues: (path) => {\n return provider.getValues(path);\n }\n };\n });\n}\nexport class ExpressionEditor extends Disposable {\n constructor(options, fieldListProvider, disabled = ko.observable(false), rtl = false, _displayNameProvider, popupVisible = ko.observable(false), editorInputId) {\n super();\n this.options = options;\n this._displayNameProvider = _displayNameProvider;\n this.popupVisible = popupVisible;\n this._updateTextAreaValue = (item, element) => {\n var textArea = this._getTextArea(element), textAreaValue = this.textAreaValue().toString(), cursorPosition = textArea && textArea.selectionStart || textAreaValue.length, newAddedText = textAreaValue[cursorPosition - 1] == ' ' ? (item.val || item.text || item) + ' ' : ' ' + (item.val || item.text || item) + ' ';\n this.textAreaValue([textAreaValue.slice(0, cursorPosition), newAddedText, textAreaValue.slice(cursorPosition)].join(''));\n if (textArea && textArea.setSelectionRange) {\n textArea.focus();\n var posisition = cursorPosition + (newAddedText.indexOf('(') !== -1 ? newAddedText.indexOf('(') + 1 : newAddedText.length);\n textArea.setSelectionRange(posisition, posisition);\n }\n };\n this._updateAceValue = (item, element) => {\n var editor = this.editorContainer(), { row, column: col } = editor.getCursorPosition(), insertion = (item.val || item.text || item) + ' ';\n if (col && editor.getSession().getValue().split('\\n')[row][col - 1] !== ' ')\n insertion = ' ' + insertion;\n editor.insert(insertion);\n editor.focus();\n setCursorInFunctionParameter(item.paramCount, editor, insertion);\n };\n this._updateValue = (item, element) => {\n this.aceAvailable ? this._updateAceValue(item, $.fn.constructor(element)) : this._updateTextAreaValue(item, $.fn.constructor(element));\n };\n this.patchFieldName = (fieldName) => fieldName;\n this._parametersPutSelectionHandler = (selectedItemPath, element) => {\n var pathParts = selectedItemPath.split('.');\n var newAddedString = '?' + this.patchFieldName(pathParts[pathParts.length - 1]);\n this._updateValue(newAddedString, element);\n };\n this._fieldsPutSelectionHandler = (selectedItemPath, element) => {\n var path = this.koOptions.peek().path.peek();\n var proposedFieldName = selectedItemPath.substring(path.length + 1);\n var newAddedString = '[' + this.patchFieldName(proposedFieldName) + ']';\n if (this._displayNameProvider) {\n this.displayExpressionConverter.toDisplayExpression(path, newAddedString)\n .done((result) => { this._updateValue(result, element); })\n .fail(() => { this._updateValue(newAddedString, element); });\n }\n else {\n this._updateValue(newAddedString, element);\n }\n };\n this.aceAvailable = aceAvailable();\n this.title = () => getLocalization('Expression Editor', 'AnalyticsCoreStringId.ExpressionEditor_ExpressionCaption');\n this.value = ko.observable('');\n this.textAreaValue = ko.observable('');\n this.languageHelper = {\n getLanguageMode: () => 'ace/mode/criteria',\n createCompleters: (editor, bindingContext, viewModel) => {\n var path = ko.computed(() => { return viewModel.koOptions() && ko.unwrap(viewModel.koOptions().path) || ''; }), functions = ko.computed(() => { return viewModel.koOptions() && ko.unwrap(viewModel.koOptions().functions) || []; }), completor = new CodeCompletor({\n editor,\n bindingContext,\n fieldListProvider: viewModel.fieldListProvider,\n path,\n functions,\n rootItems: viewModel.options.rootItems,\n getRealExpression: (path, member) => {\n return this.displayExpressionConverter && this.displayExpressionConverter.toRealExpression(path, member) || $.Deferred().resolve(member).promise();\n }\n });\n [path, functions].forEach(x => completor._disposables.push(x));\n return [completor];\n }\n };\n this.aceOptions = {\n showLineNumbers: false,\n showPrintMargin: false,\n enableBasicAutocompletion: true,\n enableLiveAutocompletion: true,\n showFoldWidgets: false,\n highlightActiveLine: false\n };\n this.additionalOptions = {\n onChange: (session) => {\n var value = session.getValue();\n try {\n var operator = CriteriaOperatorStateMachine.parse(value);\n if (this.koOptions().validate) {\n this.isValid(this.koOptions().validate(operator));\n }\n session.clearAnnotations();\n }\n catch (exception) {\n var row = exception.hash && exception.hash.line || 0;\n var column = 0;\n var lines = exception.message.split('\\n');\n var text = lines[1] + '\\n' + lines[2];\n session.setAnnotations([{ row, column, text, 'type': 'error' }]);\n }\n }\n };\n this.callbacks = {\n focus: $.noop\n };\n this.koOptions = ko.observable(null);\n this.editorContainer = ko.observable();\n this.isValid = ko.observable(true);\n this.buttonItems = [];\n this.rtl = false;\n this.modelValueValid = ko.computed(() => {\n var options = this.koOptions();\n return options && ko.isObservable(options.isValid) ? options.isValid() : true;\n });\n this.modelValueWarning = ko.computed(() => {\n var options = this.koOptions();\n return options && ko.unwrap(options.warningMessage) || '';\n });\n this.getPopupContainer = getParentContainer;\n this.koOptions(options);\n this.patchFieldName = (fieldName) => {\n return this.koOptions().patchFieldName && this.koOptions().patchFieldName(fieldName) || fieldName;\n };\n this.theme = this.koOptions() && this.koOptions().theme;\n this._disposables.push(this.value = ko.computed({\n read: () => {\n var value = this.koOptions() && ko.unwrap(this.koOptions().value);\n return (value && value.toString()) || '';\n },\n write: (newVal) => this.koOptions() && this.koOptions().value(newVal)\n }));\n if (_displayNameProvider && options.path) {\n this.displayExpressionConverter = new DisplayExpressionConverter(_displayNameProvider);\n var pathFunc = ko.pureComputed(() => this.koOptions() && this.koOptions().path && this.koOptions().path());\n this.displayValue = wrapExpressionValue(pathFunc, this.value, this.displayExpressionConverter, this._disposables);\n this._disposables.push(pathFunc);\n }\n else {\n this.displayValue = this.value;\n }\n this.rtl = rtl;\n this.validate = (value, sender) => {\n try {\n CriteriaOperatorStateMachine.parse(value);\n this.isValid(true);\n return true;\n }\n catch (exception) {\n var result = getNotValidRange(value, exception.message);\n var textArea = this._getTextArea(sender && sender.element);\n textArea && textArea.setSelectionRange(result.start, result.end);\n this.isValid(false);\n }\n };\n this._disposables.push(this.popupVisible.subscribe((newVal) => {\n if (!newVal) {\n this.editorContainer(null);\n return;\n }\n this.initDisplayValue();\n }));\n var fieldName = ko.computed(() => { return this.koOptions() && this.koOptions().fieldName && this.koOptions().fieldName(); });\n this._disposables.push(this.fieldListProvider = createExpressionEditorFieldListProvider(fieldListProvider, fieldName));\n this.disabled = disabled;\n var self = this;\n this.save = (sender) => {\n var value = this.getValue();\n if (this.validate(value, sender)) {\n this.displayValue(value);\n this.popupVisible(false);\n }\n };\n var selectedItem = null;\n var selectionHandler = (item) => {\n var selectedItemType = ko.unwrap(item.data['type']);\n if (selectedItem)\n selectedItem.isSelected(false);\n selectedItem = item;\n item.isSelected(true);\n };\n var fieldsTreeListOptions = ko.pureComputed(() => {\n return this.koOptions() && this.koOptions().path && this.koOptions().path() && this._createToolsOptions(this.koOptions().path(), this.fieldListProvider(), new ExpressionEditorTreeListController(fieldName, (data, element) => { this._fieldsPutSelectionHandler(data.path, element); }, selectionHandler));\n });\n this.parametersTreeListController = new ExpressionEditorParametersTreeListController(this._parametersCustomFilter, this._parametersPutSelectionHandler, selectionHandler);\n var parametersTreeListOptions = ko.pureComputed(() => {\n return this._createToolsOptions('', this.fieldListProvider(), this.parametersTreeListController);\n });\n this._disposables.push(this.tools = new Tools(this._updateValue, parametersTreeListOptions, this.koOptions, fieldsTreeListOptions));\n this._disposables.push(this.modelValueValid, this.modelValueWarning);\n this._createMainPopupButtons();\n [fieldName, fieldsTreeListOptions, parametersTreeListOptions].forEach(x => this._disposables.push(x));\n this.resizeHelper = new ResizeHelper({\n onResize: () => this.resizeAceEditor()\n });\n this.editorInputId = editorInputId;\n }\n dispose() {\n super.dispose();\n this.koOptions(null);\n this.editorContainer(null);\n this.options = null;\n }\n _createMainPopupButtons() {\n var self = this;\n this.buttonItems = [\n { toolbar: 'bottom', location: 'after', widget: 'dxButton', options: { text: getLocalization('OK', StringId.DataAccessBtnOK), type: 'default', stylingMode: 'contained', onClick: function (sender) { self.save(sender); } } },\n { toolbar: 'bottom', location: 'after', widget: 'dxButton', options: { text: getLocalization('Cancel', StringId.DataAccessBtnCancel), type: 'normal', stylingMode: 'contained', onClick: function () { self.popupVisible(false); } } }\n ];\n }\n _getTextArea(element) {\n var $el = $.fn.constructor(element);\n return ($el && $el.parents('.dx-expressioneditor').find(':input')[0]);\n }\n _createToolsOptions(path, fieldListProvider, treeListController) {\n return {\n itemsProvider: fieldListProvider,\n selectedPath: ko.observable(''),\n path: ko.observable(path),\n templateName: 'dx-ee-treelist-item',\n treeListController: treeListController,\n rtl: this.rtl\n };\n }\n _parametersCustomFilter(item) {\n return item.specifics === 'parameters' || item.specifics === RangeSpecific || !isList(item);\n }\n onShown() {\n this.callbacks.focus();\n }\n onHiding(e) {\n var options = this.koOptions();\n return options && options.onHiding && options.onHiding(e);\n }\n onShowing(e) {\n var options = this.koOptions();\n return options && options.onShowing && options.onShowing(e);\n }\n onContentReady(e) {\n var options = this.koOptions();\n return options && options.onContentReady && options.onContentReady(e);\n }\n resizeAceEditor() {\n if (this.aceAvailable && this.editorContainer()) {\n this.editorContainer().resize();\n }\n }\n initDisplayValue() {\n this.tools.resetCategoriesSelection && this.tools.resetCategoriesSelection();\n this.textAreaValue(this.displayValue());\n if (!this.aceAvailable) {\n this.validate(this.value());\n }\n else {\n var editor = this.editorContainer();\n var session = editor && editor.getSession();\n session && session.setValue(this.textAreaValue());\n }\n }\n getValue() {\n var value = this.textAreaValue();\n if (this.aceAvailable) {\n var editor = this.editorContainer();\n var session = editor && editor.getSession();\n value = session && session.getValue();\n }\n return value;\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\expressioneditor\\tools\\_functions.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { extend } from '../../../serializer/_utils';\nimport { createGlobalModuleVariableFunc } from '../../../serializer/_internal';\nvar defaultFunctionDisplay = [\n {\n display: 'Aggregate',\n localizationId: 'DataAccessStringId.ExpressionEditor_FunctionCategory_Aggregate',\n category: 'Aggregate',\n items: {\n Avg: [{ paramCount: 1, text: '[].Avg()', displayName: 'Avg()', descriptionStringId: 'ExpressionEditorStringId.Function_AvgAggregate' }],\n Count: [{ paramCount: 1, text: '[].Count()', displayName: 'Count()', descriptionStringId: 'ExpressionEditorStringId.Function_CountAggregate' }],\n Exists: [{ paramCount: 1, text: '[].Exists()', displayName: 'Exists()', descriptionStringId: 'ExpressionEditorStringId.Function_ExistsAggregate' }],\n Max: [{ paramCount: 1, text: '[].Max()', displayName: 'Max()', descriptionStringId: 'ExpressionEditorStringId.Function_MaxAggregate' }],\n Min: [{ paramCount: 1, text: '[].Min()', displayName: 'Min()', descriptionStringId: 'ExpressionEditorStringId.Function_MinAggregate' }],\n Single: [{ paramCount: 1, text: '[].Single()', displayName: 'Single()', descriptionStringId: 'ExpressionEditorStringId.Function_SingleAggregate' }],\n Sum: [{ paramCount: 1, text: '[].Sum()', displayName: 'Sum()', descriptionStringId: 'ExpressionEditorStringId.Function_SumAggregate' }],\n }\n }, {\n display: 'Date-Time',\n localizationId: 'DataAccessStringId.ExpressionEditor_FunctionCategory_DateTime',\n items: {\n LocalDateTimeThisYear: [{ paramCount: 0, text: 'LocalDateTimeThisYear()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeThisYear' }],\n LocalDateTimeThisMonth: [{ paramCount: 0, text: 'LocalDateTimeThisMonth()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeThisMonth' }],\n LocalDateTimeLastMonth: [{ paramCount: 0, text: 'LocalDateTimeLastMonth()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeLastMonth' }],\n LocalDateTimeLastWeek: [{ paramCount: 0, text: 'LocalDateTimeLastWeek()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeLastWeek' }],\n LocalDateTimeLastYear: [{ paramCount: 0, text: 'LocalDateTimeLastYear()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeLastYear' }],\n LocalDateTimeThisWeek: [{ paramCount: 0, text: 'LocalDateTimeThisWeek()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeThisWeek' }],\n LocalDateTimeYesterday: [{ paramCount: 0, text: 'LocalDateTimeYesterday()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeYesterday' }],\n LocalDateTimeToday: [{ paramCount: 0, text: 'LocalDateTimeToday()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeToday' }],\n LocalDateTimeNow: [{ paramCount: 0, text: 'LocalDateTimeNow()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeNow' }],\n LocalDateTimeTomorrow: [{ paramCount: 0, text: 'LocalDateTimeTomorrow()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeTomorrow' }],\n LocalDateTimeDayAfterTomorrow: [{ paramCount: 0, text: 'LocalDateTimeDayAfterTomorrow()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeDayAfterTomorrow' }],\n LocalDateTimeNextWeek: [{ paramCount: 0, text: 'LocalDateTimeNextWeek()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeNextWeek' }],\n LocalDateTimeTwoMonthsAway: [{ paramCount: 0, text: 'LocalDateTimeTwoMonthsAway()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeTwoMonthsAway' }],\n LocalDateTimeTwoYearsAway: [{ paramCount: 0, text: 'LocalDateTimeTwoYearsAway()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeTwoYearsAway' }],\n LocalDateTimeTwoWeeksAway: [{ paramCount: 0, text: 'LocalDateTimeTwoWeeksAway()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeTwoWeeksAway' }],\n LocalDateTimeNextMonth: [{ paramCount: 0, text: 'LocalDateTimeNextMonth()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeNextMonth' }],\n LocalDateTimeNextYear: [{ paramCount: 0, text: 'LocalDateTimeNextYear()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeNextYear' }],\n LocalDateTimeYearBeforeToday: [{ paramCount: 0, text: 'LocalDateTimeYearBeforeToday()', descriptionStringId: 'ExpressionEditorStringId.Function_LocalDateTimeYearBeforeToday' }],\n InDateRange: [{ paramCount: 3, text: 'InDateRange(, , )', descriptionStringId: 'ExpressionEditorStringId.Function_InDateRange' }],\n IsOutlookIntervalBeyondThisYear: null,\n IsOutlookIntervalNextWeek: null,\n IsOutlookIntervalTomorrow: null,\n IsOutlookIntervalToday: null,\n IsOutlookIntervalYesterday: null,\n IsOutlookIntervalLastWeek: null,\n IsOutlookIntervalPriorThisYear: null,\n IsLastMonth: [{ paramCount: 1, text: 'IsLastMonth()', descriptionStringId: 'ExpressionEditorStringId.Function_IsLastMonth' }],\n IsLastYear: [{ paramCount: 1, text: 'IsLastYear()', descriptionStringId: 'ExpressionEditorStringId.Function_IsLastYear' }],\n IsNextMonth: [{ paramCount: 1, text: 'IsNextMonth()', descriptionStringId: 'ExpressionEditorStringId.Function_IsNextMonth' }],\n IsNextYear: [{ paramCount: 1, text: 'IsNextYear()', descriptionStringId: 'ExpressionEditorStringId.Function_IsNextYear' }],\n IsThisWeek: [{ paramCount: 1, text: 'IsThisWeek()', descriptionStringId: 'ExpressionEditorStringId.Function_IsThisWeek' }],\n IsThisMonth: [{ paramCount: 1, text: 'IsThisMonth()', descriptionStringId: 'ExpressionEditorStringId.Function_IsThisMonth' }],\n IsThisYear: [{ paramCount: 1, text: 'IsThisYear()', descriptionStringId: 'ExpressionEditorStringId.Function_IsThisYear' }],\n IsJanuary: [{ paramCount: 1, text: 'IsJanuary()', descriptionStringId: 'ExpressionEditorStringId.Function_IsJanuary' }],\n IsFebruary: [{ paramCount: 1, text: 'IsFebruary()', descriptionStringId: 'ExpressionEditorStringId.Function_IsFebruary' }],\n IsMarch: [{ paramCount: 1, text: 'IsMarch()', descriptionStringId: 'ExpressionEditorStringId.Function_IsMarch' }],\n IsApril: [{ paramCount: 1, text: 'IsApril()', descriptionStringId: 'ExpressionEditorStringId.Function_IsApril' }],\n IsMay: [{ paramCount: 1, text: 'IsMay()', descriptionStringId: 'ExpressionEditorStringId.Function_IsMay' }],\n IsJune: [{ paramCount: 1, text: 'IsJune()', descriptionStringId: 'ExpressionEditorStringId.Function_IsJune' }],\n IsJuly: [{ paramCount: 1, text: 'IsJuly()', descriptionStringId: 'ExpressionEditorStringId.Function_IsJuly' }],\n IsAugust: [{ paramCount: 1, text: 'IsAugust()', descriptionStringId: 'ExpressionEditorStringId.Function_IsAugust' }],\n IsSeptember: [{ paramCount: 1, text: 'IsSeptember()', descriptionStringId: 'ExpressionEditorStringId.Function_IsSeptember' }],\n IsOctober: [{ paramCount: 1, text: 'IsOctober()', descriptionStringId: 'ExpressionEditorStringId.Function_IsOctober' }],\n IsNovember: [{ paramCount: 1, text: 'IsNovember()', descriptionStringId: 'ExpressionEditorStringId.Function_IsNovember' }],\n IsDecember: [{ paramCount: 1, text: 'IsDecember()', descriptionStringId: 'ExpressionEditorStringId.Function_IsDecember' }],\n IsSameDay: [{ paramCount: 2, text: 'IsSameDay(, )', descriptionStringId: 'ExpressionEditorStringId.Function_IsSameDay' }],\n IsYearToDate: [{ paramCount: 1, text: 'IsYearToDate()', descriptionStringId: 'ExpressionEditorStringId.Function_IsYearToDate' }],\n DateDiffTick: [{ paramCount: 2, text: 'DateDiffTick(, )', descriptionStringId: 'ExpressionEditorStringId.Function_DateDiffTick' }],\n DateDiffSecond: [{ paramCount: 2, text: 'DateDiffSecond(, )', descriptionStringId: 'ExpressionEditorStringId.Function_DateDiffSecond' }],\n DateDiffMilliSecond: [{ paramCount: 2, text: 'DateDiffMilliSecond(, )', descriptionStringId: 'ExpressionEditorStringId.Function_DateDiffMilliSecond' }],\n DateDiffMinute: [{ paramCount: 2, text: 'DateDiffMinute(, )', descriptionStringId: 'ExpressionEditorStringId.Function_DateDiffMinute' }],\n DateDiffHour: [{ paramCount: 2, text: 'DateDiffHour(, )', descriptionStringId: 'ExpressionEditorStringId.Function_DateDiffHour' }],\n DateDiffDay: [{ paramCount: 2, text: 'DateDiffDay(, )', descriptionStringId: 'ExpressionEditorStringId.Function_DateDiffDay' }],\n DateDiffMonth: [{ paramCount: 2, text: 'DateDiffMonth(, )', descriptionStringId: 'ExpressionEditorStringId.Function_DateDiffMonth' }],\n DateDiffYear: [{ paramCount: 2, text: 'DateDiffYear(, )', descriptionStringId: 'ExpressionEditorStringId.Function_DateDiffYear' }],\n DateTimeFromParts: [\n { paramCount: 3, text: 'DateTimeFromParts(, , )', descriptionStringId: 'ExpressionEditorStringId.Function_DateTimeFromParts3' },\n { paramCount: 4, text: 'DateTimeFromParts(, , , )', descriptionStringId: 'ExpressionEditorStringId.Function_DateTimeFromParts4' },\n { paramCount: 5, text: 'DateTimeFromParts(, , , , )', descriptionStringId: 'ExpressionEditorStringId.Function_DateTimeFromParts5' },\n { paramCount: 6, text: 'DateTimeFromParts(, , , , , )', descriptionStringId: 'ExpressionEditorStringId.Function_DateTimeFromParts6' }\n ],\n GetDate: [{ paramCount: 1, text: 'GetDate()', descriptionStringId: 'ExpressionEditorStringId.Function_GetDate' }],\n GetMilliSecond: [{ paramCount: 1, text: 'GetMilliSecond()', descriptionStringId: 'ExpressionEditorStringId.Function_GetMilliSecond' }],\n GetSecond: [{ paramCount: 1, text: 'GetSecond()', descriptionStringId: 'ExpressionEditorStringId.Function_GetSecond' }],\n GetMinute: [{ paramCount: 1, text: 'GetMinute()', descriptionStringId: 'ExpressionEditorStringId.Function_GetMinute' }],\n GetHour: [{ paramCount: 1, text: 'GetHour()', descriptionStringId: 'ExpressionEditorStringId.Function_GetHour' }],\n GetDay: [{ paramCount: 1, text: 'GetDay()', descriptionStringId: 'ExpressionEditorStringId.Function_GetDay' }],\n GetMonth: [{ paramCount: 1, text: 'GetMonth()', descriptionStringId: 'ExpressionEditorStringId.Function_GetMonth' }],\n GetYear: [{ paramCount: 1, text: 'GetYear()', descriptionStringId: 'ExpressionEditorStringId.Function_GetYear' }],\n GetDayOfWeek: [{ paramCount: 1, text: 'GetDayOfWeek()', descriptionStringId: 'ExpressionEditorStringId.Function_GetDayOfWeek' }],\n GetDayOfYear: [{ paramCount: 1, text: 'GetDayOfYear()', descriptionStringId: 'ExpressionEditorStringId.Function_GetDayOfYear' }],\n GetTimeOfDay: [{ paramCount: 1, text: 'GetTimeOfDay()', descriptionStringId: 'ExpressionEditorStringId.Function_GetTimeOfDay' }],\n Now: [{ paramCount: 0, text: 'Now()', descriptionStringId: 'ExpressionEditorStringId.Function_Now' }],\n UtcNow: [{ paramCount: 0, text: 'UtcNow()', descriptionStringId: 'ExpressionEditorStringId.Function_UtcNow' }],\n Today: [{ paramCount: 0, text: 'Today()', descriptionStringId: 'ExpressionEditorStringId.Function_Today' }],\n AddTimeSpan: [{ paramCount: 2, text: 'AddTimeSpan(, )', descriptionStringId: 'ExpressionEditorStringId.Function_AddTimeSpan' }],\n AddTicks: [{ paramCount: 2, text: 'AddTicks(, )', descriptionStringId: 'ExpressionEditorStringId.Function_AddTicks' }],\n AddMilliSeconds: [{ paramCount: 2, text: 'AddMilliSeconds(, )', descriptionStringId: 'ExpressionEditorStringId.Function_AddMilliSeconds' }],\n AddSeconds: [{ paramCount: 2, text: 'AddSeconds(, )', descriptionStringId: 'ExpressionEditorStringId.Function_AddSeconds' }],\n AddMinutes: [{ paramCount: 2, text: 'AddMinutes(, )', descriptionStringId: 'ExpressionEditorStringId.Function_AddMinutes' }],\n AddHours: [{ paramCount: 2, text: 'AddHours(, )', descriptionStringId: 'ExpressionEditorStringId.Function_AddHours' }],\n AddDays: [{ paramCount: 2, text: 'AddDays(, )', descriptionStringId: 'ExpressionEditorStringId.Function_AddDays' }],\n AddMonths: [{ paramCount: 2, text: 'AddMonths(, )', descriptionStringId: 'ExpressionEditorStringId.Function_AddMonths' }],\n AddYears: [{ paramCount: 2, text: 'AddYears(, )', descriptionStringId: 'ExpressionEditorStringId.Function_AddYears' }],\n },\n }, {\n display: 'Logical',\n localizationId: 'DataAccessStringId.ExpressionEditor_FunctionCategory_Logical',\n items: {\n Iif: [{ paramCount: 3, text: 'Iif(, , )', descriptionStringId: 'ExpressionEditorStringId.Function_Iif' }],\n InRange: [{ paramCount: 3, text: 'InRange(, , )', descriptionStringId: 'ExpressionEditorStringId.Function_InRange' }],\n IsNull: [{ paramCount: 1, text: 'IsNull()', descriptionStringId: 'ExpressionEditorStringId.Function_IsNull' }],\n IsNullOrEmpty: [{ paramCount: 1, text: 'IsNullOrEmpty()', descriptionStringId: 'ExpressionEditorStringId.Function_IsNullOrEmpty' }],\n }\n }, {\n display: 'Math',\n localizationId: 'DataAccessStringId.ExpressionEditor_FunctionCategory_Math',\n items: {\n Abs: [{ paramCount: 1, text: 'Abs()', descriptionStringId: 'ExpressionEditorStringId.Function_Abs' }],\n Sqr: [{ paramCount: 1, text: 'Sqr()', descriptionStringId: 'ExpressionEditorStringId.Function_Sqr' }],\n Cos: [{ paramCount: 1, text: 'Cos()', descriptionStringId: 'ExpressionEditorStringId.Function_Cos' }],\n Sin: [{ paramCount: 1, text: 'Sin()', descriptionStringId: 'ExpressionEditorStringId.Function_Sin' }],\n Atn: [{ paramCount: 1, text: 'Atn()', descriptionStringId: 'ExpressionEditorStringId.Function_Atn' }],\n Exp: [{ paramCount: 1, text: 'Exp()', descriptionStringId: 'ExpressionEditorStringId.Function_Exp' }],\n Log: [\n { paramCount: 1, text: 'Log()', descriptionStringId: 'ExpressionEditorStringId.Function_Log' },\n { paramCount: 2, text: 'Log(, )', descriptionStringId: 'ExpressionEditorStringId.Function_Log_2' },\n ],\n Rnd: [{ paramCount: 0, text: 'Rnd()', descriptionStringId: 'ExpressionEditorStringId.Function_Rnd' }],\n Tan: [{ paramCount: 1, text: 'Tan()', descriptionStringId: 'ExpressionEditorStringId.Function_Tan' }],\n Power: [{ paramCount: 2, text: 'Power(, )', descriptionStringId: 'ExpressionEditorStringId.Function_Power' }],\n Sign: [{ paramCount: 1, text: 'Sign()', descriptionStringId: 'ExpressionEditorStringId.Function_Sign' }],\n Round: [\n { paramCount: 1, text: 'Round()', descriptionStringId: 'ExpressionEditorStringId.Function_Round' },\n { paramCount: 2, text: 'Round(, )', descriptionStringId: 'ExpressionEditorStringId.Function_Round_2' },\n ],\n Ceiling: [{ paramCount: 1, text: 'Ceiling()', descriptionStringId: 'ExpressionEditorStringId.Function_Ceiling' }],\n Floor: [{ paramCount: 1, text: 'Floor()', descriptionStringId: 'ExpressionEditorStringId.Function_Floor' }],\n Max: [{ paramCount: 2, text: 'Max(, )', descriptionStringId: 'ExpressionEditorStringId.Function_Max' }],\n Min: [{ paramCount: 2, text: 'Min(, )', descriptionStringId: 'ExpressionEditorStringId.Function_Min' }],\n Acos: [{ paramCount: 1, text: 'Acos()', descriptionStringId: 'ExpressionEditorStringId.Function_Acos' }],\n Asin: [{ paramCount: 1, text: 'Asin()', descriptionStringId: 'ExpressionEditorStringId.Function_Asin' }],\n Atn2: [{ paramCount: 2, text: 'Atn2(, )', descriptionStringId: 'ExpressionEditorStringId.Function_Atn2' }],\n BigMul: [{ paramCount: 2, text: 'BigMul(, )', descriptionStringId: 'ExpressionEditorStringId.Function_BigMul' }],\n Cosh: [{ paramCount: 1, text: 'Cosh()', descriptionStringId: 'ExpressionEditorStringId.Function_Cosh' }],\n Log10: [{ paramCount: 1, text: 'Log10()', descriptionStringId: 'ExpressionEditorStringId.Function_Log10' }],\n Sinh: [{ paramCount: 1, text: 'Sinh()', descriptionStringId: 'ExpressionEditorStringId.Function_Sinh' }],\n Tanh: [{ paramCount: 1, text: 'Tanh()', descriptionStringId: 'ExpressionEditorStringId.Function_Tanh' }],\n ToInt: [{ paramCount: 1, text: 'ToInt()', descriptionStringId: 'ExpressionEditorStringId.Function_ToInt' }],\n ToLong: [{ paramCount: 1, text: 'ToLong()', descriptionStringId: 'ExpressionEditorStringId.Function_ToLong' }],\n ToFloat: [{ paramCount: 1, text: 'ToFloat()', descriptionStringId: 'ExpressionEditorStringId.Function_ToFloat' }],\n ToDouble: [{ paramCount: 1, text: 'ToDouble()', descriptionStringId: 'ExpressionEditorStringId.Function_ToDouble' }],\n ToDecimal: [{ paramCount: 1, text: 'ToDecimal()', descriptionStringId: 'ExpressionEditorStringId.Function_ToDecimal' }],\n }\n }, {\n display: 'String',\n localizationId: 'DataAccessStringId.ExpressionEditor_FunctionCategory_Text',\n items: {\n Trim: [{ paramCount: 1, text: 'Trim()', descriptionStringId: 'ExpressionEditorStringId.Function_Trim' }],\n Len: [{ paramCount: 1, text: 'Len()', descriptionStringId: 'ExpressionEditorStringId.Function_Len' }],\n Substring: [\n { paramCount: 3, text: \"Substring('', , )\", descriptionStringId: 'ExpressionEditorStringId.Function_Substring_3' },\n { paramCount: 2, text: \"Substring('', )\", descriptionStringId: 'ExpressionEditorStringId.Function_Substring' }\n ],\n Upper: [{ paramCount: 1, text: 'Upper()', descriptionStringId: 'ExpressionEditorStringId.Function_Upper' }],\n Lower: [{ paramCount: 1, text: 'Lower()', descriptionStringId: 'ExpressionEditorStringId.Function_Lower' }],\n Concat: [{ paramCount: Infinity, text: 'Concat(, )', descriptionStringId: 'ExpressionEditorStringId.Function_Concat' }],\n Ascii: [{ paramCount: 1, text: \"Ascii('')\", descriptionStringId: 'ExpressionEditorStringId.Function_Ascii' }],\n Char: [{ paramCount: 1, text: 'Char()', descriptionStringId: 'ExpressionEditorStringId.Function_Char' }],\n ToStr: [{ paramCount: 1, text: 'ToStr()', descriptionStringId: 'ExpressionEditorStringId.Function_ToStr' }],\n Replace: [{ paramCount: 3, text: \"Replace('','', '')\", descriptionStringId: 'ExpressionEditorStringId.Function_Replace' }],\n Reverse: [{ paramCount: 1, text: \"Reverse('')\", descriptionStringId: 'ExpressionEditorStringId.Function_Reverse' }],\n Insert: [{ paramCount: 3, text: \"Insert('', , '')\", descriptionStringId: 'ExpressionEditorStringId.Function_Insert' }],\n CharIndex: [\n { paramCount: 2, text: \"CharIndex('','')\", descriptionStringId: 'ExpressionEditorStringId.Function_CharIndex' },\n { paramCount: 3, text: \"CharIndex('','', )\", descriptionStringId: 'ExpressionEditorStringId.Function_CharIndex_3' }\n ],\n Remove: [\n { paramCount: 2, text: \"Remove('', )\", descriptionStringId: 'ExpressionEditorStringId.Function_Remove' },\n { paramCount: 3, text: \"Remove('', , )\", descriptionStringId: 'ExpressionEditorStringId.Function_Remove_3' }\n ],\n PadLeft: [\n { paramCount: 2, text: 'PadLeft(, )', descriptionStringId: 'ExpressionEditorStringId.Function_PadLeft' },\n { paramCount: 3, text: \"PadLeft(, , '')\", descriptionStringId: 'ExpressionEditorStringId.Function_PadLeft_3' }\n ],\n PadRight: [\n { paramCount: 2, text: 'PadRight(, )', descriptionStringId: 'ExpressionEditorStringId.Function_PadRight' },\n { paramCount: 3, text: \"PadRight(, , '')\", descriptionStringId: 'ExpressionEditorStringId.Function_PadRight_3' }\n ],\n StartsWith: [{ paramCount: 2, text: \"StartsWith('', '')\", descriptionStringId: 'ExpressionEditorStringId.Function_StartsWith' }],\n EndsWith: [{ paramCount: 2, text: \"EndsWith('', '')\", descriptionStringId: 'ExpressionEditorStringId.Function_EndsWith' }],\n Contains: [{ paramCount: 0, text: \"Contains('', '')\", descriptionStringId: 'ExpressionEditorStringId.Function_Contains' }],\n Join: [\n { paramCount: 1, text: 'Join()', descriptionStringId: 'ExpressionEditorStringId.Function_Join' },\n { paramCount: 2, text: \"Join(, '')\", descriptionStringId: 'ExpressionEditorStringId.Function_Join_2' }\n ],\n }\n }\n];\nexport var insertOrUpdateFunctions = (functions, addins) => {\n if (Array.isArray(addins)) {\n addins.forEach(addin => {\n const func = functions.find(x => x.display === addin.display);\n if (!!func) {\n func.items = Object.assign(Object.assign({}, func.items), addin.items);\n }\n else {\n functions.push(addin);\n }\n });\n return functions;\n }\n var result = [];\n functions.forEach(cat => {\n var ext = addins[cat.display];\n var items = extend({}, cat.items, ext);\n if (!Object.keys(items).length)\n return;\n result.push(ext ? {\n display: cat.display, category: cat.category, localizationId: cat.localizationId,\n items: items\n } : cat);\n });\n return result;\n};\nexport var functionDisplay = createGlobalModuleVariableFunc(defaultFunctionDisplay);\nexport var resetFunctionDisplay = () => functionDisplay(defaultFunctionDisplay);\nexport function combineFunctionDisplay(addins) {\n var functions = extend(true, [], functionDisplay());\n return insertOrUpdateFunctions(functions, addins);\n}\n","/**\r\n* DevExpress Analytics (widgets\\expressioneditor\\tools\\_operatorNames.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var operatorNames = [\n { text: '+', image: 'addition', descriptionStringId: 'ExpressionEditorStringId.Operator_Plus' },\n { text: '-', image: 'subtraction', descriptionStringId: 'ExpressionEditorStringId.Operator_Minus' },\n { text: '*', image: 'multiplication', descriptionStringId: 'ExpressionEditorStringId.Operator_Multiply' },\n { text: '/', image: 'division', descriptionStringId: 'ExpressionEditorStringId.Operator_Divide' },\n { text: '%', image: 'modulus', hasSeparator: true, descriptionStringId: 'ExpressionEditorStringId.Operator_Modulo' },\n { text: '()', image: 'parenthesis', hasSeparator: true },\n { text: '|', descriptionStringId: 'ExpressionEditorStringId.Operator_BitwiseOr' },\n { text: '&', descriptionStringId: 'ExpressionEditorStringId.Operator_BitwiseAnd' },\n { text: '^', descriptionStringId: 'ExpressionEditorStringId.Operator_BitwiseXor' },\n { text: '==', image: 'equal', descriptionStringId: 'ExpressionEditorStringId.Operator_Equal' },\n { text: '!=', image: 'not_equal', descriptionStringId: 'ExpressionEditorStringId.Operator_NotEqual' },\n { text: '<', image: 'less', descriptionStringId: 'ExpressionEditorStringId.Operator_Less' },\n { text: '<=', image: 'less_or_equal', descriptionStringId: 'ExpressionEditorStringId.Operator_LessOrEqual' },\n { text: '>=', image: 'greater_or_equal', descriptionStringId: 'ExpressionEditorStringId.Operator_GreaterOrEqual' },\n { text: '>', hasSeparator: true, image: 'greater', descriptionStringId: 'ExpressionEditorStringId.Operator_Greater' },\n { text: 'In', descriptionStringId: 'ExpressionEditorStringId.Operator_In' },\n { text: 'Like', descriptionStringId: 'ExpressionEditorStringId.Operator_Like' },\n { text: 'Between', descriptionStringId: 'ExpressionEditorStringId.Operator_Between' },\n { text: 'And', image: 'and', descriptionStringId: 'ExpressionEditorStringId.Operator_And' },\n { text: 'Or', image: 'or', descriptionStringId: 'ExpressionEditorStringId.Operator_Or' },\n { text: 'Not', image: 'not', descriptionStringId: 'ExpressionEditorStringId.Operator_Not' }\n];\n","/**\r\n* DevExpress Analytics (widgets\\expressioneditor\\tools\\_tools.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport * as ko from 'knockout';\nimport { getLocalization } from '../../../property-grid/localization/localization_utils';\nimport { searchPlaceholder } from '../../../property-grid/localization/_localization';\nimport { findMatchesInString } from '../../../property-grid/widgets/internal/_utils';\nimport { Disposable } from '../../../serializer/utils';\nimport { createExpressionEditorCollectionToolOptions } from '../_expressioneditor';\nimport { functionDisplay } from './_functions';\nimport { operatorNames } from './_operatorNames';\nexport class Tools extends Disposable {\n constructor(onClick, parametersOptions, options, fieldListOptions) {\n super();\n this.searchPlaceholder = () => searchPlaceholder();\n this._categories = ko.observableArray([]);\n this.toolBox = [];\n this.description = ko.observable();\n this._defaultClick = onClick;\n operatorNames.filter((item) => { return !!item.descriptionStringId; }).forEach(item => this._initDescription(item));\n var functionGroups = ko.computed(() => {\n return options() && ko.unwrap(options().functions) || functionDisplay();\n }), functions = ko.computed(() => {\n return functionGroups().map((funtionGroup) => {\n return this._createFunctionsCategoryItem(funtionGroup.items, getLocalization(funtionGroup.display, funtionGroup.localizationId));\n });\n }), createDefaultCategories = () => {\n return [\n this._createFieldsCategory(fieldListOptions, parametersOptions),\n this._createConstantCategory(),\n this._createFunctionsCategory(functions),\n this._createOperatorsCategory(operatorNames)\n ];\n }, selectedContent = ko.observable(null), resetCategoriesSelection = () => {\n var firstItem = this._categories()[0].content;\n selectedContent() && selectedContent().isSelected(false);\n selectedContent(firstItem);\n firstItem.isSelected(true);\n }, updateCategories = (newOptions) => {\n this._disposeCategories();\n var defaultCategories = createDefaultCategories();\n newOptions && newOptions.customizeCategories && newOptions.customizeCategories(this, defaultCategories, onClick);\n this._categories(defaultCategories);\n resetCategoriesSelection();\n };\n this.resetCategoriesSelection = resetCategoriesSelection;\n [functionGroups, functions].forEach(x => this._disposables.push(x));\n this._disposables.push(options.subscribe((newOptions) => {\n updateCategories(newOptions);\n }));\n updateCategories(options());\n this._disposables.push(this.showDescription = ko.computed(() => { return selectedContent() && selectedContent().showDescription; }));\n this.toolBox = [\n this._generateTab(this._categories, 'dx-expressioneditor-categories', (item) => {\n if (item.data && item.data.selectedItem && item.data.selectedItem() && item.data.items.indexOf(item.data.selectedItem()) !== -1) {\n var contentItem = item.data.selectedItem();\n this.description(this._localizedExpressionEditorItem(contentItem));\n }\n else {\n this.description(undefined);\n }\n if (selectedContent() === item)\n return;\n selectedContent().isSelected(false);\n item.isSelected(true);\n selectedContent(item);\n }),\n this._generateTab(selectedContent, 'dx-expressioneditor-selectedcontent', (item) => { this.description(this._localizedExpressionEditorItem(item)); }, this._defaultClick),\n this._generateTab(this.description, 'dx-expressioneditor-description', undefined, undefined, this.showDescription)\n ];\n }\n _generateTab(content, templateName = null, click, dblclick, visible) {\n return {\n templateName,\n content,\n click,\n dblclick,\n visible: visible || true\n };\n }\n _localizedExpressionEditorItem(item) {\n return item.descriptionStringId ? getLocalization(item.text, item.descriptionStringId) : item.description ? item.description : item.text;\n }\n _initDescription(expressionEditorItem) {\n expressionEditorItem.description = this._localizedExpressionEditorItem(expressionEditorItem);\n }\n _createFieldsCategory(fields, parameters) {\n var category = {\n displayName: getLocalization('Fields', 'AnalyticsCoreStringId.ExpressionEditor_ItemInfo_Fields'),\n content: {\n showDescription: false,\n isSelected: ko.observable(false),\n data: { fields, parameters },\n name: 'dx-expressioneditor-fields'\n },\n dispose: () => void 0\n };\n return category;\n }\n _createConstantCategory() {\n var items = [\n { text: '?', descriptionStringId: 'ExpressionEditorStringId.Constant_Null' },\n { text: 'False', descriptionStringId: 'ExpressionEditorStringId.Constant_False' },\n { text: 'True', descriptionStringId: 'ExpressionEditorStringId.Constant_True' }\n ];\n return createExpressionEditorCollectionToolOptions(items, 'Constants', 'DataAccessStringId.ExpressionEditor_DocumentationCategory_Constants', true);\n }\n _createOperatorsCategory(data) {\n return createExpressionEditorCollectionToolOptions(data, 'Operators', 'DataAccessStringId.ExpressionEditor_DocumentationCategory_Operators', true);\n }\n _createFunctionsCategoryContent(textToSearch, isSelected, items) {\n return {\n showDescription: true,\n isSelected,\n data: {\n textToSearch,\n items,\n availableItems: ko.observableArray(items),\n selectedItem: ko.observable(null)\n },\n name: 'dx-expressioneditor-collection-function',\n };\n }\n _createFunctionsCategoryItem(functions, display) {\n var result = {\n display,\n isSelected: ko.observable(false),\n data: [],\n name: 'dx-expressioneditor-collection-function',\n };\n $.map(functions, (item => {\n if (item) {\n item.forEach((functionItem) => {\n this._initDescription(functionItem);\n result.data.push(functionItem);\n });\n }\n }));\n return result;\n }\n _createFunctionsCategory(items) {\n var textToSearch = ko.observable(''), disposables = [], isSelected = ko.observable(false), timeout = null, allItems = ko.computed(() => [].concat(...items().map(x => x.data))), content = this._createFunctionsCategoryContent(textToSearch, isSelected, allItems()), category = {\n displayName: getLocalization('Functions', 'DataAccessStringId.ExpressionEditor_DocumentationCategory_Functions'),\n items, allItems, isSelected, content,\n collapsed: ko.observable(true),\n updateContent: (items, isSelected) => {\n content.isSelected && content.isSelected(false);\n content.isSelected = isSelected;\n content.isSelected(true);\n content.data.items = items;\n content.data.availableItems(content.data.items.filter(x => !!findMatchesInString(x.text, textToSearch())));\n },\n templateName: 'dx-expressioneditor-category-accordion',\n dispose: () => {\n disposables.forEach(x => x.dispose());\n disposables.splice(0, disposables.length);\n }\n };\n disposables.push(allItems);\n disposables.push(textToSearch.subscribe((newVal) => {\n timeout && clearTimeout(timeout);\n timeout = setTimeout(() => {\n category.content.data.availableItems(category.content.data.items.filter(x => !!findMatchesInString(x.text, newVal)));\n }, 150);\n }));\n return category;\n }\n _disposeCategories() {\n this._categories().forEach(category => category.dispose && category.dispose());\n }\n dispose() {\n super.dispose();\n this._disposeCategories();\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\expressioneditor\\tools\\_treeListControllers.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport { TreeListController } from '../../treelist/_treelistController';\nexport class ExpressionEditorTreeListController extends TreeListController {\n constructor(fieldName, putSelectionHandler, selectionHandler, customFilter) {\n super();\n this.fieldName = fieldName;\n this.putSelectionHandler = putSelectionHandler;\n this.selectionHandler = selectionHandler;\n this.customFilter = customFilter;\n }\n itemsFilter(item, path) {\n return item.specifics !== 'none' && item.name !== 'ReportItems' && (!this.customFilter || this.customFilter(path));\n }\n select(value) {\n if (this.selectionHandler)\n this.selectionHandler(value);\n else\n super.select(value);\n }\n getActions(item) {\n return [{ clickAction: (element) => this.putSelectionHandler(item, $.fn.constructor(element)) }];\n }\n canSelect(value) {\n return true;\n }\n}\nexport class ExpressionEditorParametersTreeListController extends TreeListController {\n constructor(customFilter, putSelectionHandler, selectionHandler) {\n super();\n this.customFilter = customFilter;\n this.putSelectionHandler = putSelectionHandler;\n this.selectionHandler = selectionHandler;\n }\n itemsFilter(item) {\n return item.specifics !== 'none' && (!this.customFilter || this.customFilter(item));\n }\n select(value) {\n this.selectionHandler(value);\n }\n getActions(item) {\n return [{\n clickAction: (element) => {\n if (item && !item.hasItems)\n this.putSelectionHandler(item.path, $.fn.constructor(element));\n }\n }];\n }\n canSelect(value) {\n return true;\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\filtereditoroptions.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { DefaultFilterEditorHelper } from './helpers/helper';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nexport class FilterStringOptions {\n constructor(filterString, dataMember, disabled, title) {\n this.popupContainer = '.dx-designer-viewport';\n this.itemsProvider = null;\n this.resetValue = () => {\n this.value('');\n };\n this.title = ko.pureComputed({\n read: () => {\n var title = this._title();\n return getLocalization(title.text, title.localizationId);\n },\n write: (value) => {\n this._title({ text: value });\n }\n });\n this.value = filterString;\n this.path = dataMember || ko.observable('');\n this.disabled = disabled || ko.observable(false);\n var filterEditorHelperType = DefaultFilterEditorHelper();\n this.helper = new filterEditorHelperType();\n this._title = ko.observable(title || { text: getLocalization('Filter Editor', 'DataAccessUIStringId.FiltersView') });\n }\n}\nexport class FilterStringPlainOptions extends FilterStringOptions {\n constructor() {\n super(...arguments);\n this.realTimeUpdate = true;\n this.advancedModePosition = 'TopRight';\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\helpers\\_addon.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../../serializer/utils';\nimport { searchPlaceholder } from '../../../property-grid/localization/_localization';\nexport class FilterEditorAddOn extends Disposable {\n constructor(criteria, popupService, action, propertyName, templateName) {\n super();\n this._filterPlaceHolder = searchPlaceholder();\n this.showPopup = (_, element) => {\n this.dispose();\n this._disposables.splice(0);\n this._popupService.title('');\n this.target.isSelected(true);\n this._updateActions(this.target);\n this._popupService.target(element);\n setTimeout(() => {\n this._popupService.visible(true);\n }, 10);\n };\n this.popupContentTemplate = 'dx-filtereditor-popup-common';\n this.filterString = ko.observable('');\n this.isFiltered = ko.observable(false);\n this.target = criteria;\n this._action = action;\n this.propertyName = propertyName;\n this._popupService = popupService;\n this.popupContentTemplate = templateName || this.popupContentTemplate;\n }\n _updateActions(viewModel) {\n this._popupService.data(null);\n if (viewModel) {\n this._disposables.push(this._popupService.visible.subscribe((newVal) => {\n this.target.isSelected(newVal);\n this.filterString('');\n }));\n this._popupService['viewModel'] = viewModel;\n var data = viewModel[this.propertyName];\n this.isFiltered(false);\n if (data && data.length > 10) {\n this.isFiltered(true);\n this._disposables.push(data = ko.pureComputed(() => {\n if (!this.filterString())\n return viewModel[this.propertyName];\n return viewModel[this.propertyName].filter(x => (x.displayText || x.name).toLocaleLowerCase().indexOf(this.filterString().toLocaleLowerCase()) != -1);\n }));\n }\n this._popupService.data({\n data: data,\n template: this.popupContentTemplate,\n click: (data) => {\n viewModel[this._action](data);\n this._popupService.visible(false);\n },\n isFiltered: this.isFiltered,\n filterString: this.filterString,\n searchPlaceholder: () => searchPlaceholder()\n });\n }\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\helpers\\_codeCompletor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { CodeCompletor, createFunctionCompletion } from '../../common/_codeCompletor';\nimport { FilterEditorHelper } from './helper';\nimport { AggregateOperand } from '../../criteria/operators/aggregate';\nimport { FunctionOperatorType } from '../../criteria/operators/options/function';\nexport class FilterEditorCodeCompletor extends CodeCompletor {\n constructor(options) {\n super(options);\n var helper = new FilterEditorHelper();\n var functions = [];\n var aggregate = [];\n var operators = [];\n var groups = Object.keys(helper.filterEditorOperators);\n groups.forEach((groupName) => {\n helper.filterEditorOperators[groupName].forEach((operator) => {\n if (operator.insertVal) {\n var name = operator.name, insertVal = operator.insertVal, paramCount = operator.paramCount;\n if (operator.type === FunctionOperatorType && functions.filter(x => x.name === name).length === 0) {\n functions.push({ name: name, insertVal: insertVal });\n }\n else if (operator.type === AggregateOperand && aggregate.filter(x => x.name === name).length === 0) {\n aggregate.push({ name: name, insertVal: insertVal });\n }\n else if (operator.type !== AggregateOperand && operator.type !== FunctionOperatorType && operators.filter(x => x.name === name).length === 0) {\n operators.push({ name: name, insertVal: insertVal, paramCount: paramCount });\n }\n }\n });\n });\n this.filterEditorAvailable = { operators, aggregate, functions };\n }\n getFunctionsCompletions() {\n var functions = [];\n this.filterEditorAvailable.functions.forEach(funcItem => {\n functions.push(createFunctionCompletion({ text: funcItem.name, paramCount: funcItem.insertVal.split(',').length }, funcItem.insertVal, funcItem.insertVal));\n });\n return functions;\n }\n getAggregateCompletions() {\n var functions = [];\n this.filterEditorAvailable.aggregate.forEach(funcItem => {\n functions.push(createFunctionCompletion({ text: funcItem.name, paramCount: 0 }, funcItem.insertVal, funcItem.insertVal));\n });\n return functions;\n }\n getOperatorCompletions(prefix) {\n var operators = [];\n this.filterEditorAvailable.operators.forEach(operator => {\n operators.push((operator.insertVal.match(new RegExp('\\\\([^\\\\(\\\\)]*\\\\)', 'g'))) ?\n createFunctionCompletion({ text: operator.name, paramCount: operator.paramCount || operator.insertVal.split(',').length }, operator.insertVal, operator.insertVal) :\n { caption: operator.insertVal, snippet: prefix + operator.insertVal, meta: 'operator' });\n });\n return operators;\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\helpers\\_helper.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { getLocalization } from '../../../property-grid/localization/localization_utils';\nexport function initDisplayText(object) {\n object.displayText = getLocalization(object.name, object.localizationId);\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\helpers\\_serializer.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport { GroupOperator } from '../../criteria/operators/group';\nimport { AggregateOperand } from '../../criteria/operators/aggregate';\nimport { OperandProperty } from '../../criteria/operators/property';\nimport { trimBrackets } from '../../common/_codeCompletor';\nimport { OperandValue } from '../../criteria/operators/value';\nimport { validateGuid } from '../../../property-grid/widgets/internal/_internal';\nimport { serializeDate } from '../../../serializer/utils';\nimport { OperandParameter } from '../../criteria/operators/parameter';\nimport { BetweenOperator } from '../../criteria/operators/between';\nimport { InOperator } from '../../criteria/operators/in';\nimport { BinaryOperator } from '../../criteria/operators/binary';\nimport { UnaryOperator } from '../../criteria/operators/unary';\nimport { FunctionOperator } from '../../criteria/operators/function';\nimport { operatorTokens as iOperatorTokens } from '../../criteria/utils/operatorTokens';\nimport { ConstantValue } from '../../criteria/operators/constant';\nimport { CriteriaOperatorStateMachine } from '../../criteria/utils/criteriaOperatorStateMachine';\nimport { BinaryOperatorType } from '../../criteria/operators/options/binary';\nimport { UnaryOperatorType } from '../../criteria/operators/options/unary';\nimport { GroupOperatorType } from '../../criteria/operators/options/group';\nexport class FilterEditorSerializer {\n constructor(operatorTokens = iOperatorTokens, custom) {\n this.operatorTokens = operatorTokens;\n this.custom = custom;\n }\n serializeGroupOperand(groupOperator, reverse) {\n var result = groupOperator.operands.map((operand) => {\n if (operand instanceof GroupOperator) {\n return '(' + this.serialize(operand) + ')';\n }\n else {\n return this.serialize(operand);\n }\n }).filter((serialize) => { return serialize !== '' && serialize !== '()'; }).join(' ' + (this.operatorTokens[groupOperator.displayType] || groupOperator.displayType) + ' ');\n return reverse && result ? 'Not(' + result + ')' : result;\n }\n serializeAggregateOperand(aggregateOperand, reverse) {\n var operatorTypeSuffix = aggregateOperand.operatorType === 'Exists' ? '' : '.' + aggregateOperand.operatorType;\n var condition = aggregateOperand.condition ? this.serialize(aggregateOperand.condition) : '';\n var propertyResult = this.serialize(aggregateOperand.property);\n var conditionResult = '[' + condition + ']';\n var aggregateSuffix = aggregateOperand.operatorType !== 'Exists' ?\n '(' + (aggregateOperand.aggregatedExpression && this.serialize(aggregateOperand.aggregatedExpression) || '') + ')' : '';\n var result = propertyResult;\n if (!condition && !aggregateSuffix || condition) {\n result += conditionResult;\n }\n return result + operatorTypeSuffix + aggregateSuffix;\n }\n serializeOperandProperty(operandProperty) {\n if (!operandProperty.propertyName) {\n return operandProperty.circumflex ? '^' : '[]';\n }\n var value = operandProperty.displayType;\n if (value.length - trimBrackets(value).length === 2) {\n value = '[' + trimBrackets(value).replace(/\\\\/g, '\\\\\\\\').replace(/\\]/g, '\\\\]') + ']';\n }\n return operandProperty.circumflex ? '^.' + value : value;\n }\n serializeOperandValue(operandValue) {\n var result = operandValue.value;\n if (result !== null && result !== undefined && ($.isNumeric(result) || String(result).toLowerCase() === 'true' || String(result).toLowerCase() === 'false')) {\n if (operandValue.specifics === 'string')\n return \"'\" + result + \"'\";\n if (operandValue.specifics === 'guid' && validateGuid(result))\n return '{' + result + '}';\n return result;\n }\n else if (result && operandValue.value instanceof Date) {\n return '#' + serializeDate(result, '-') + '#';\n }\n else if (operandValue.specifics === 'integer' || operandValue.specifics === 'integer') {\n return result || '?';\n }\n else if (operandValue.specifics === 'guid' && validateGuid(result)) {\n return '{' + result + '}';\n }\n else if (operandValue.specifics === 'string') {\n result = result.replace(/'/g, \"''\");\n return result ? \"'\" + result + \"'\" : '?';\n }\n return result ? result : '?';\n }\n serializeOperandParameter(operandParameter) {\n return operandParameter.displayType;\n }\n serializeBetweenOperator(betweenOperator, reverse) {\n var result = this.serialize(betweenOperator.property) + ' ' + betweenOperator.displayType +\n '(' + this.serialize(betweenOperator.begin) + ', ' + this.serialize(betweenOperator.end) + ')';\n return reverse ? 'Not ' + result : result;\n }\n serializeInOperator(inOperator, reverse) {\n var result = this.serialize(inOperator.criteriaOperator) + ' ' + inOperator.displayType + '(' +\n inOperator.operands.map((operand) => { return this.serialize(operand); }).join(', ') + ')';\n return reverse ? 'Not ' + result : result;\n }\n serializeBinaryOperator(binaryOperator, reverse) {\n if (binaryOperator.operatorType === BinaryOperatorType.Like) {\n var separator = reverse ? ' Not ' : ' ';\n return this.serialize(binaryOperator.leftOperand) + separator + (this.operatorTokens[binaryOperator.displayType] || binaryOperator.displayType) + ' ' + this.serialize(binaryOperator.rightOperand);\n }\n return (reverse ? 'Not ' : '') + this.serialize(binaryOperator.leftOperand) + ' ' + (this.operatorTokens[binaryOperator.displayType] || binaryOperator.displayType) + ' ' + this.serialize(binaryOperator.rightOperand);\n }\n serializeUnaryOperator(unaryOperator, reverse) {\n if (unaryOperator.operatorType === UnaryOperatorType.IsNull) {\n var separator = reverse ? ' Not ' : ' ';\n return this.serialize(unaryOperator.operand) + ' Is' + separator + 'Null';\n }\n else if (unaryOperator.operatorType === UnaryOperatorType.Not) {\n return this.serialize(unaryOperator.operand, true);\n }\n var result = (this.operatorTokens[unaryOperator.displayType] || unaryOperator.displayType) + this.serialize(unaryOperator.operand);\n return reverse ? 'Not ' + result : result;\n }\n serializeFunctionOperator(functionOperator, reverse) {\n var result = (this.operatorTokens[functionOperator.displayType] || functionOperator.displayType) + '(' + functionOperator.operands.map((operand) => {\n return this.serialize(operand);\n }).join(', ') + ')';\n return reverse ? 'Not ' + result : result;\n }\n serialize(criteriaOperator, reverse = false) {\n if (criteriaOperator instanceof AggregateOperand) {\n return this.serializeAggregateOperand(criteriaOperator, reverse);\n }\n if (criteriaOperator instanceof BetweenOperator) {\n return this.serializeBetweenOperator(criteriaOperator, reverse);\n }\n if (criteriaOperator instanceof BinaryOperator) {\n return this.serializeBinaryOperator(criteriaOperator, reverse);\n }\n if (criteriaOperator instanceof ConstantValue) {\n return this.serializeOperandValue(criteriaOperator);\n }\n if (criteriaOperator instanceof FunctionOperator) {\n return this.serializeFunctionOperator(criteriaOperator, reverse);\n }\n if (criteriaOperator instanceof GroupOperator) {\n return this.serializeGroupOperand(criteriaOperator, reverse);\n }\n if (criteriaOperator instanceof InOperator) {\n return this.serializeInOperator(criteriaOperator, reverse);\n }\n if (criteriaOperator instanceof OperandParameter) {\n return this.serializeOperandParameter(criteriaOperator);\n }\n if (criteriaOperator instanceof OperandProperty) {\n return this.serializeOperandProperty(criteriaOperator);\n }\n if (criteriaOperator instanceof OperandValue) {\n return this.serializeOperandValue(criteriaOperator);\n }\n if (criteriaOperator instanceof UnaryOperator) {\n return this.serializeUnaryOperator(criteriaOperator, reverse);\n }\n if (this.custom) {\n return this.custom(criteriaOperator, reverse);\n }\n throw Error('Undefined type criteria operator');\n }\n deserialize(stringCriteria) {\n return this.deserializeOperand(CriteriaOperatorStateMachine.parse(stringCriteria));\n }\n deserializeOperand(operand) {\n if (operand instanceof GroupOperator) {\n return operand;\n }\n else if (operand instanceof UnaryOperator && operand.operatorType === UnaryOperatorType.Not) {\n var child = operand['operand'];\n if (child instanceof GroupOperator || child instanceof FunctionOperator || child instanceof BetweenOperator || child instanceof InOperator) {\n return operand;\n }\n else if (child instanceof UnaryOperator && operand.operatorType === UnaryOperatorType.Not\n && !(child.operand instanceof OperandProperty)) {\n return this.deserializeOperand(child.operand);\n }\n return new UnaryOperator(UnaryOperatorType.Not, new GroupOperator(GroupOperatorType.And, child ? [child] : []));\n }\n return new GroupOperator(GroupOperatorType.And, operand ? [operand] : []);\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\helpers\\_treelistController.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { TreeListController } from '../../treelist/_treelistController';\nexport class FilterEditorTreeListController extends TreeListController {\n constructor(selectedItem) {\n super();\n this.selectedItem = selectedItem;\n }\n itemsFilter(item) {\n return true;\n }\n hasItems(item) {\n return item.specifics !== 'none' && (item.specifics !== 'List' && item.isList === true);\n }\n canSelect(value) {\n return !value.data.isList || (value.data.isList === true && value.data.specifics === 'List');\n }\n select(value) {\n if (this.canSelect(value)) {\n this.selectedItem(value.data);\n value.isSelected(true);\n }\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\helpers\\_validator.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { OperandProperty } from '../../criteria/operators/property';\nimport { OperandParameter } from '../../criteria/operators/parameter';\nimport { OperandValue } from '../../criteria/operators/value';\nimport { ConstantValue } from '../../criteria/operators/constant';\nimport { UnaryOperator } from '../../criteria/operators/unary';\nimport { AggregateOperand } from '../../criteria/operators/aggregate';\nimport { GroupOperator } from '../../criteria/operators/group';\nexport var CriteriaSurfaceValidatorState;\n(function (CriteriaSurfaceValidatorState) {\n CriteriaSurfaceValidatorState[CriteriaSurfaceValidatorState[\"Left\"] = 0] = \"Left\";\n CriteriaSurfaceValidatorState[CriteriaSurfaceValidatorState[\"Right\"] = 1] = \"Right\";\n CriteriaSurfaceValidatorState[CriteriaSurfaceValidatorState[\"Unary\"] = 2] = \"Unary\";\n})(CriteriaSurfaceValidatorState || (CriteriaSurfaceValidatorState = {}));\nexport class CriteriaSurfaceValidator {\n customValidate(operator, from) {\n return false;\n }\n checkLeftPart(leftPart) {\n return leftPart instanceof OperandProperty || this.customValidate(leftPart, CriteriaSurfaceValidatorState.Left);\n }\n _checkRightPart(criteriaOperator) {\n return criteriaOperator instanceof OperandProperty\n || criteriaOperator instanceof OperandParameter\n || criteriaOperator instanceof OperandValue\n || criteriaOperator instanceof ConstantValue\n || (criteriaOperator instanceof UnaryOperator && this._checkRightPart(criteriaOperator.operand))\n || this.customValidate(criteriaOperator, CriteriaSurfaceValidatorState.Right);\n }\n checkRightPart(rigthPart) {\n if (Array.isArray(rigthPart)) {\n for (var i = 0; i < rigthPart.length; i++) {\n if (!this._checkRightPart(rigthPart[i])) {\n return false;\n }\n }\n return true;\n }\n else {\n return this._checkRightPart(rigthPart);\n }\n }\n aggregateIsValid(criteriaOperator) {\n return this.checkLeftPart(criteriaOperator.leftPart)\n && this.validateModel(criteriaOperator.condition)\n && (!!criteriaOperator.aggregatedExpression ?\n (criteriaOperator.aggregatedExpression instanceof OperandProperty ||\n this.validateModel(criteriaOperator.aggregatedExpression))\n : true);\n }\n commonOperandValid(criteriaOperator) {\n return criteriaOperator.leftPart instanceof AggregateOperand ?\n this.validateModel(criteriaOperator.leftPart) : this.checkLeftPart(criteriaOperator.leftPart)\n && this.checkRightPart(criteriaOperator.rightPart);\n }\n groupIsValid(criteriaOperator) {\n for (var i = 0; i < criteriaOperator.operands.length; i++) {\n if (!this.validateModel(criteriaOperator.operands[i])) {\n return false;\n }\n }\n return true;\n }\n unaryIsValid(criteriaOperator) {\n return criteriaOperator.operand instanceof OperandProperty || this.validateModel(criteriaOperator.operand) || this.customValidate(criteriaOperator.operand, CriteriaSurfaceValidatorState.Unary);\n }\n validateModel(criteriaOperator) {\n if (criteriaOperator instanceof AggregateOperand) {\n return this.aggregateIsValid(criteriaOperator);\n }\n else if (criteriaOperator instanceof GroupOperator) {\n return this.groupIsValid(criteriaOperator);\n }\n else if (criteriaOperator instanceof UnaryOperator) {\n return this.unaryIsValid(criteriaOperator);\n }\n else {\n return this.commonOperandValid(criteriaOperator);\n }\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\helpers\\helper.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport * as ko from 'knockout';\nimport { getLocalization } from '../../../property-grid/localization/localization_utils';\nimport { createGlobalModuleVariableFunc } from '../../../serializer/_internal';\nimport { AggregateOperand } from '../../criteria/operators/aggregate';\nimport { BetweenOperator } from '../../criteria/operators/between';\nimport { InOperator } from '../../criteria/operators/in';\nimport { BinaryOperatorType } from '../../criteria/operators/options/binary';\nimport { FunctionOperatorType } from '../../criteria/operators/options/function';\nimport { GroupOperatorType } from '../../criteria/operators/options/group';\nimport { UnaryOperatorType } from '../../criteria/operators/options/unary';\nimport { AggregateOperandSurface } from '../operators/aggregateOperandSurface';\nimport { BetweenOperandSurface } from '../operators/betweenOperandSurface';\nimport { BinaryOperandSurface } from '../operators/binaryOperandSurface';\nimport { CriteriaOperatorSurface } from '../operators/criteriaOperatorSurface';\nimport { FunctionOperandSurface } from '../operators/functionOperandSurface';\nimport { GroupOperandSurface } from '../operators/groupOperandSurface';\nimport { InOperandSurface } from '../operators/inOperandSurface';\nimport { OperandParameterSurface } from '../operators/operandParameterSurface';\nimport { OperandPropertySurface } from '../operators/operandPropertySurface';\nimport { OperandValueSurface } from '../operators/operandValueSurface';\nimport { UnaryOperandSurface } from '../operators/unaryOperandSurface';\nimport { FilterEditorAddOn } from './_addon';\nimport { initDisplayText } from './_helper';\nimport { FilterEditorSerializer } from './_serializer';\nimport { FilterEditorTreeListController } from './_treelistController';\nimport { CriteriaSurfaceValidator } from './_validator';\nexport class FilterEditorHelper {\n constructor(serializer) {\n this.rtl = false;\n this.parameters = ko.observable([]);\n this.canSelectLists = true;\n this.canCreateParameters = false;\n this.canChoiceParameters = true;\n this.canChoiceProperty = true;\n this.criteriaTreeValidator = new CriteriaSurfaceValidator();\n this.filterEditorOperators = {\n _common: [\n { name: 'Equals', _type: 'binary', insertVal: '==', value: BinaryOperatorType.Equal, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseEquals' },\n { name: 'Does not equal', _type: 'binary', hidden: true, reverse: true, value: BinaryOperatorType.Equal, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseDoesNotEqual' },\n { name: 'Does not equal', _type: 'binary', insertVal: '!=', value: BinaryOperatorType.NotEqual, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseDoesNotEqual' },\n { name: 'Equals', _type: 'binary', reverse: true, hidden: true, value: BinaryOperatorType.NotEqual, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseEquals' },\n { name: 'Is greater than', _type: 'binary', insertVal: '>', value: BinaryOperatorType.Greater, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseGreater' },\n { name: 'Is less than or equal to', _type: 'binary', hidden: true, reverse: true, value: BinaryOperatorType.Greater, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseGreater' },\n { name: 'Is greater than or equal to', _type: 'binary', insertVal: '>=', value: BinaryOperatorType.GreaterOrEqual, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseGreaterOrEqual' },\n { name: 'Is less than', _type: 'binary', hidden: true, reverse: true, value: BinaryOperatorType.GreaterOrEqual, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseLess' },\n { name: 'Is less than', _type: 'binary', insertVal: '<', value: BinaryOperatorType.Less, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseLess' },\n { name: 'Is greater than or equal to', _type: 'binary', reverse: true, hidden: true, value: BinaryOperatorType.Less, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseGreaterOrEqual' },\n { name: 'Is less than or equal to', _type: 'binary', insertVal: '<=', value: BinaryOperatorType.LessOrEqual, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseLessOrEqual' },\n { name: 'Is greater than', _type: 'binary', reverse: true, hidden: true, value: BinaryOperatorType.LessOrEqual, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseGreater' },\n { name: 'Is between', _type: 'between', value: 'Between', insertVal: 'Between(, )', paramCount: 1, type: BetweenOperator, localizationId: 'StringId.FilterClauseBetween' },\n { name: 'Is not between', _type: 'between', value: 'Between', insertVal: 'Between(, )', paramCount: 1, type: BetweenOperator, reverse: true, localizationId: 'StringId.FilterClauseNotBetween' }\n ],\n string: [],\n guid: [],\n integer: [],\n float: [],\n date: [],\n list: [],\n group: [],\n bool: []\n };\n this.onChange = () => { };\n this.onEditorFocusOut = (criteria) => { };\n this.onSave = (criteria) => { };\n this.onClosing = () => { };\n this.handlers = {\n create: (criteria, popupService) => {\n return {\n data: new FilterEditorAddOn(criteria, popupService, 'create', 'createItems'),\n templateName: 'dx-filtereditor-create'\n };\n },\n change: (criteria, popupService) => {\n return {\n data: new FilterEditorAddOn(criteria, popupService, 'change', 'items'),\n templateName: 'dx-filtereditor-change'\n };\n },\n changeProperty: (criteria, popupService) => {\n return {\n data: new FilterEditorAddOn(criteria, popupService, 'changeProperty', 'items', 'dx-filtereditor-popup-treelist'),\n templateName: 'dx-filtereditor-changeProperty'\n };\n },\n changeValueType: (criteria, popupService) => {\n return {\n data: new FilterEditorAddOn(criteria, popupService, 'changeValueType', 'changeTypeItems'),\n templateName: 'dx-filtereditor-changeValueType'\n };\n },\n changeParameter: (criteria, popupService) => {\n return {\n data: new FilterEditorAddOn(criteria, popupService, 'changeParameter', 'items'),\n templateName: 'dx-filtereditor-changeParameter'\n };\n }\n };\n this.mapper = {\n aggregate: AggregateOperandSurface,\n property: OperandPropertySurface,\n parameter: OperandParameterSurface,\n value: OperandValueSurface,\n group: GroupOperandSurface,\n between: BetweenOperandSurface,\n binary: BinaryOperandSurface,\n function: FunctionOperandSurface,\n in: InOperandSurface,\n unary: UnaryOperandSurface,\n default: CriteriaOperatorSurface\n };\n this.serializer = serializer || new FilterEditorSerializer();\n this.filterEditorOperators.string = [].concat(this.filterEditorOperators._common, [\n { name: 'Contains', _type: 'function', insertVal: 'Contains(, )', value: FunctionOperatorType.Contains, type: FunctionOperatorType, localizationId: 'StringId.FilterClauseContains' },\n { name: 'Does not contain', _type: 'function', value: FunctionOperatorType.Contains, type: FunctionOperatorType, reverse: true, localizationId: 'StringId.FilterClauseDoesNotContain' },\n { name: 'Begins with', _type: 'function', insertVal: 'StartsWith(, )', value: FunctionOperatorType.StartsWith, type: FunctionOperatorType, localizationId: 'StringId.FilterClauseBeginsWith' },\n { name: 'Ends with', _type: 'function', insertVal: 'StartsWith(, )', value: FunctionOperatorType.EndsWith, type: FunctionOperatorType, localizationId: 'StringId.FilterClauseEndsWith' },\n { name: 'Is like', _type: 'binary', insertVal: 'Like', value: BinaryOperatorType.Like, type: BinaryOperatorType, localizationId: 'StringId.FilterClauseLike' },\n { name: 'Is not like', _type: 'binary', insertVal: 'Not Like', value: BinaryOperatorType.Like, type: BinaryOperatorType, reverse: true, localizationId: 'StringId.FilterClauseNotLike' },\n { name: 'Is any of', _type: 'in', value: 'In', insertVal: 'In()', paramCount: 1, type: InOperator, localizationId: 'StringId.FilterClauseAnyOf' },\n { name: 'Is none of', _type: 'in', value: 'In', type: InOperator, reverse: true, localizationId: 'StringId.FilterClauseNoneOf' },\n { name: 'Is blank', _type: 'function', insertVal: 'IsNullOrEmpty()', emptyRightPart: true, value: FunctionOperatorType.IsNullOrEmpty, type: FunctionOperatorType, localizationId: 'StringId.FilterClauseIsNullOrEmpty' },\n { name: 'Is not blank', _type: 'function', insertVal: 'Not IsNullOrEmpty()', emptyRightPart: true, value: FunctionOperatorType.IsNullOrEmpty, type: FunctionOperatorType, reverse: true, localizationId: 'StringId.FilterClauseIsNotNullOrEmpty' }\n ]);\n this.filterEditorOperators.guid = this.filterEditorOperators.string;\n this.filterEditorOperators.integer = [].concat(this.filterEditorOperators._common, [\n { name: 'Is null', _type: 'unary', insertVal: 'Is Null', value: UnaryOperatorType.IsNull, type: UnaryOperatorType, localizationId: 'StringId.FilterClauseIsNull' },\n { name: 'Is not null', _type: 'unary', insertVal: 'Is Not Null', value: UnaryOperatorType.IsNull, type: UnaryOperatorType, reverse: true, localizationId: 'StringId.FilterClauseIsNotNull' },\n { name: 'Is any of', _type: 'in', value: 'In', insertVal: 'In()', paramCount: 1, type: InOperator, localizationId: 'StringId.FilterClauseAnyOf' },\n { name: 'Is none of', _type: 'in', value: 'In', type: InOperator, reverse: true, localizationId: 'StringId.FilterClauseNoneOf' },\n ]);\n this.filterEditorOperators.float = this.filterEditorOperators.integer;\n this.filterEditorOperators.bool = this.filterEditorOperators.integer;\n this.filterEditorOperators.date = [].concat(this.filterEditorOperators._common, [\n { name: 'Is null', _type: 'unary', insertVal: 'Is Null', value: UnaryOperatorType.IsNull, type: UnaryOperatorType, localizationId: 'StringId.FilterClauseIsNull' },\n { name: 'Is not null', _type: 'unary', insertVal: 'Is Not Null', value: UnaryOperatorType.IsNull, type: UnaryOperatorType, reverse: true, localizationId: 'StringId.FilterClauseIsNotNull' },\n { name: 'Is any of', _type: 'in', value: 'In', insertVal: 'In()', type: InOperator, localizationId: 'StringId.FilterClauseAnyOf' },\n { name: 'Is none of', _type: 'in', value: 'In', type: InOperator, reverse: true, localizationId: 'StringId.FilterClauseNoneOf' },\n { name: 'Is beyond this year', _type: 'function', insertVal: 'IsOutlookIntervalBeyondThisYear()', emptyRightPart: true, value: FunctionOperatorType.IsOutlookIntervalBeyondThisYear, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsOutlookIntervalBeyondThisYear' },\n { name: 'Is next week', _type: 'function', insertVal: 'IsOutlookIntervalNextWeek()', emptyRightPart: true, value: FunctionOperatorType.IsOutlookIntervalNextWeek, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsOutlookIntervalNextWeek' },\n { name: 'Is tomorrow', _type: 'function', insertVal: 'IsOutlookIntervalTomorrow()', emptyRightPart: true, value: FunctionOperatorType.IsOutlookIntervalTomorrow, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsOutlookIntervalTomorrow' },\n { name: 'Is today', _type: 'function', insertVal: 'IsOutlookIntervalToday()', emptyRightPart: true, value: FunctionOperatorType.IsOutlookIntervalToday, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsOutlookIntervalToday' },\n { name: 'Is yesterday', _type: 'function', insertVal: 'IsOutlookIntervalYesterday()', emptyRightPart: true, value: FunctionOperatorType.IsOutlookIntervalYesterday, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsOutlookIntervalYesterday' },\n { name: 'Is last week', _type: 'function', insertVal: 'IsOutlookIntervalLastWeek()', emptyRightPart: true, value: FunctionOperatorType.IsOutlookIntervalLastWeek, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsOutlookIntervalLastWeek' },\n { name: 'Is prior this year', _type: 'function', insertVal: 'IsOutlookIntervalPriorThisYear()', emptyRightPart: true, value: FunctionOperatorType.IsOutlookIntervalPriorThisYear, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsOutlookIntervalPriorThisYear' },\n { name: 'Is same day', _type: 'function', insertVal: 'IsSameDay(, )', value: FunctionOperatorType.IsSameDay, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsSameDay' },\n { name: 'Is this month', _type: 'function', insertVal: 'IsThisMonth()', emptyRightPart: true, value: FunctionOperatorType.IsThisMonth, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsThisMonth' },\n { name: 'Is this week', _type: 'function', insertVal: 'IsThisWeek()', emptyRightPart: true, value: FunctionOperatorType.IsThisWeek, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsThisWeek' },\n { name: 'Is this year', _type: 'function', insertVal: 'IsThisYear()', emptyRightPart: true, value: FunctionOperatorType.IsThisYear, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsThisYear' },\n { name: 'Is next month', _type: 'function', insertVal: 'IsNextMonth', emptyRightPart: true, value: FunctionOperatorType.IsNextMonth, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsNextMonth' },\n { name: 'Is next year', _type: 'function', insertVal: 'IsNextYear()', emptyRightPart: true, value: FunctionOperatorType.IsNextYear, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsNextYear' },\n { name: 'Is last month', _type: 'function', insertVal: 'IsLastMonth()', emptyRightPart: true, value: FunctionOperatorType.IsLastMonth, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsLastMonth' },\n { name: 'Is last year', _type: 'function', insertVal: 'IsLastYear()', emptyRightPart: true, value: FunctionOperatorType.IsLastYear, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsLastYear' },\n { name: 'Is the year-to-date period', _type: 'function', insertVal: 'IsYearToDate()', emptyRightPart: true, value: FunctionOperatorType.IsYearToDate, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsYearToDate' },\n { name: 'Is January', _type: 'function', insertVal: 'IsJanuary()', emptyRightPart: true, value: FunctionOperatorType.IsJanuary, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsJanuary' },\n { name: 'Is February', _type: 'function', insertVal: 'IsFebruary()', emptyRightPart: true, value: FunctionOperatorType.IsFebruary, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsFebruary' },\n { name: 'Is March', _type: 'function', insertVal: 'IsMarch()', emptyRightPart: true, value: FunctionOperatorType.IsMarch, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsMarch' },\n { name: 'Is April', _type: 'function', insertVal: 'IsApril()', emptyRightPart: true, value: FunctionOperatorType.IsApril, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsApril' },\n { name: 'Is May', _type: 'function', insertVal: 'IsMay()', emptyRightPart: true, value: FunctionOperatorType.IsMay, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsMay' },\n { name: 'Is June', _type: 'function', insertVal: 'IsJune()', emptyRightPart: true, value: FunctionOperatorType.IsJune, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsJune' },\n { name: 'Is July', _type: 'function', insertVal: 'IsJuly()', emptyRightPart: true, value: FunctionOperatorType.IsJuly, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsJuly' },\n { name: 'Is August', _type: 'function', insertVal: 'IsAugust()', emptyRightPart: true, value: FunctionOperatorType.IsAugust, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsAugust' },\n { name: 'Is September', _type: 'function', insertVal: 'IsSeptember()', emptyRightPart: true, value: FunctionOperatorType.IsSeptember, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsSeptember' },\n { name: 'Is October', _type: 'function', insertVal: 'IsOctober()', emptyRightPart: true, value: FunctionOperatorType.IsOctober, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsOctober' },\n { name: 'Is November', _type: 'function', insertVal: 'IsNovember()', emptyRightPart: true, value: FunctionOperatorType.IsNovember, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsNovember' },\n { name: 'Is December', _type: 'function', insertVal: 'IsDecember()', emptyRightPart: true, value: FunctionOperatorType.IsDecember, type: FunctionOperatorType, localizationId: 'StringId.FilterCriteriaToStringFunctionIsDecember' },\n ]);\n this.filterEditorOperators.list = [\n { name: 'Exists', _type: 'aggregate', value: 'Exists', insertVal: 'Exists()', type: AggregateOperand, localizationId: 'StringId.FilterAggregateExists' },\n { name: 'Count', _type: 'aggregate', value: 'Count', insertVal: 'Count()', type: AggregateOperand, localizationId: 'StringId.FilterAggregateCount' },\n { name: 'Max', _type: 'aggregate', value: 'Max', insertVal: 'Max()', type: AggregateOperand, localizationId: 'StringId.FilterAggregateMax' },\n { name: 'Min', _type: 'aggregate', value: 'Min', insertVal: 'Min()', type: AggregateOperand, localizationId: 'StringId.FilterAggregateMin' },\n { name: 'Sum', _type: 'aggregate', value: 'Sum', insertVal: 'Sum()', type: AggregateOperand, localizationId: 'StringId.FilterAggregateSum' },\n { name: 'Avg', _type: 'aggregate', value: 'Avg', insertVal: 'Avg()', type: AggregateOperand, localizationId: 'StringId.FilterAggregateAvg' }\n ];\n this.filterEditorOperators.group = [\n { name: 'And', _type: 'group', insertVal: 'And', value: GroupOperatorType.And, type: GroupOperatorType, localizationId: 'StringId.FilterGroupAnd' },\n { name: 'Or', _type: 'group', insertVal: 'Or', value: GroupOperatorType.Or, type: GroupOperatorType, localizationId: 'StringId.FilterGroupOr' },\n { name: 'Not And', _type: 'group', value: GroupOperatorType.And, reverse: true, type: GroupOperatorType, localizationId: 'StringId.FilterGroupNotAnd' },\n { name: 'Not Or', _type: 'group', value: GroupOperatorType.Or, reverse: true, type: GroupOperatorType, localizationId: 'StringId.FilterGroupNotOr' },\n ];\n this._initDisplayText();\n }\n get _allFilterEditorOperators() {\n var operators = [];\n Object.keys(this.filterEditorOperators).forEach(propertyName => {\n operators.push(...this.filterEditorOperators[propertyName]);\n });\n return operators;\n }\n _getFilterEditorOperator(item, items, reverse) {\n return items.filter(x => x.value === item.operatorType && x.type === item.enumType && x.reverse === reverse)[0];\n }\n _initDisplayText() {\n Object.keys(this.filterEditorOperators).forEach(specific => {\n this.filterEditorOperators[specific].forEach(initDisplayText);\n });\n }\n registrateOperator(specific, targetEnum, value, name, opreatorType = 'function', reverse = false, localizationId) {\n if (this.filterEditorOperators[specific]) {\n if (!targetEnum[value]) {\n var maxNumber = 0;\n var index = 0;\n $.each(targetEnum, (name, _) => {\n index = parseInt(name);\n if (!isNaN(index) && maxNumber < index) {\n maxNumber = index;\n }\n });\n maxNumber++;\n targetEnum[maxNumber] = value;\n targetEnum[value] = maxNumber;\n }\n var newOperator = { name: name, value: targetEnum[value], type: targetEnum, _type: opreatorType, reverse: reverse, displayText: getLocalization(name, localizationId) };\n this.filterEditorOperators[specific].push(newOperator);\n }\n }\n generateTreelistOptions(fieldListProvider, path) {\n var treeListOptions = ko.observable(null);\n var selected = ko.observable(null);\n return {\n subscription: ko.computed(() => {\n treeListOptions({\n itemsProvider: ko.unwrap(fieldListProvider),\n selectedPath: ko.observable(''),\n selected: selected,\n path: ko.unwrap(path),\n treeListController: new FilterEditorTreeListController(selected),\n rtl: this.rtl\n });\n }),\n options: treeListOptions\n };\n }\n}\nexport var DefaultFilterEditorHelper = createGlobalModuleVariableFunc(FilterEditorHelper);\nexport function _setDefaultFilterEditorHelper(helperType) {\n DefaultFilterEditorHelper(helperType);\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\aggregateOperandSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { CriteriaOperatorSurface } from './criteriaOperatorSurface';\nimport { UnaryOperandSurface } from './unaryOperandSurface';\nexport class AggregateOperandSurface extends CriteriaOperatorSurface {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this.contentTemplateName = 'dx-filtereditor-aggregate';\n this.property = ko.observable(null);\n this.aggregatedExpression = ko.observable(null);\n this.condition = ko.observable(null);\n this.property(this._createLeftPartProperty(operator.property));\n var childPath = ko.computed(() => {\n return this.path() + '.' + this.property().propertyName();\n });\n this._disposables.push(childPath);\n if (operator.aggregatedExpression) {\n this.aggregatedExpression(this.createChildSurface(operator.aggregatedExpression, childPath));\n this.templateName = 'dx-filtereditor-aggregate-common';\n }\n if (operator.operatorType === 'Count') {\n this.templateName = 'dx-filtereditor-aggregate-common';\n }\n var surface = this.createChildSurface(operator.condition, childPath);\n surface.canRemove = false;\n if (surface instanceof UnaryOperandSurface) {\n surface.operand().canRemove = false;\n }\n this.condition(surface);\n this.change = (type, surface) => {\n if (surface) {\n var newModel = this.model.change(type, surface.model);\n var condition = this.createChildSurface(newModel, childPath);\n condition.canRemove = false;\n if (condition instanceof UnaryOperandSurface) {\n condition.operand().canRemove = false;\n }\n this.condition(condition);\n }\n else {\n if (this.operatorType() === 'Exists' || this.operatorType() === 'Count') {\n this.parent.change(type, this);\n }\n else {\n if (type && (type.value === 'Exists' || type.value === 'Count')) {\n this.parent.change(type, this);\n }\n else {\n super.change(type, surface);\n }\n }\n }\n this.helper.onChange();\n };\n }\n get leftPart() {\n return this.property && this.property();\n }\n get rightPart() {\n return this.aggregatedExpression();\n }\n dispose() {\n this.property().dispose();\n this.condition().dispose();\n this.aggregatedExpression() && this.aggregatedExpression().dispose();\n super.dispose();\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\betweenOperandSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { CriteriaOperatorSurface } from './criteriaOperatorSurface';\nexport class BetweenOperandSurface extends CriteriaOperatorSurface {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this.property = ko.observable(null);\n this.end = ko.observable(null);\n this.begin = ko.observable(null);\n this.contentTemplateName = 'dx-filtereditor-between';\n this.property(this._createLeftPartProperty(operator.property));\n this.begin(this.createChildSurface(operator.begin));\n this.end(this.createChildSurface(operator.end));\n }\n get leftPart() {\n return this.property && this.property();\n }\n get rightPart() {\n return [this.begin(), this.end()];\n }\n dispose() {\n this.property().dispose();\n this.begin().dispose();\n this.end().dispose();\n super.dispose();\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\binaryOperandSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { CriteriaOperatorSurface } from './criteriaOperatorSurface';\nexport class BinaryOperandSurface extends CriteriaOperatorSurface {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this.contentTemplateName = 'dx-filtereditor-binary';\n this.leftOperand = ko.observable(null);\n this.rightOperand = ko.observable(null);\n this.leftOperand(this._createLeftPartProperty(operator.leftOperand));\n this.rightOperand(this.createChildSurface(operator.rightOperand));\n }\n get leftPart() {\n return this.leftOperand();\n }\n get rightPart() {\n return this.rightOperand();\n }\n dispose() {\n this.leftOperand().dispose();\n this.rightOperand().dispose();\n super.dispose();\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\criteriaOperatorSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { Disposable } from '../../../serializer/utils';\nimport { OperandProperty } from '../../criteria/operators/property';\nimport { getLocalization } from '../../../property-grid/localization/localization_utils';\nimport { FunctionOperatorType } from '../../criteria/operators/options/function';\nexport class CriteriaOperatorSurface extends Disposable {\n constructor(operator, parent, fieldListProvider, path) {\n super();\n this.isUpdated = ko.observable(false);\n this.canRemove = true;\n this.operatorType = ko.observable(null);\n this.templateName = 'dx-filtereditor-common';\n this.isSelected = ko.observable(false);\n this.operatorClass = 'criteria-operator-item-operator dxd-filter-editor-operator-back-color dxd-filter-editor-text-color';\n this.popupService = parent.popupService || { visible: ko.observable(false) };\n this.model = operator;\n this.helper = parent.helper;\n this.fieldListProvider = fieldListProvider;\n this.path = path;\n this.parent = parent;\n this.operatorType(operator.operatorType);\n this._disposables.push(this.operatorType.subscribe((newVal) => {\n this.model.assignType(newVal);\n }));\n }\n _createLeftPartProperty(value) {\n if (value instanceof OperandProperty) {\n var surface = this.createChildSurface(value);\n }\n else {\n var surface = this.createChildSurface(value);\n var specifics = Object.keys(this.helper.filterEditorOperators).reduce((key, value) => {\n if (value !== '_common' && key === 'integer'\n && !!this.helper._getFilterEditorOperator(this.model, this.helper.filterEditorOperators[value], this.reverse)) {\n key = value;\n }\n return key;\n }, 'integer');\n surface.specifics = surface.specifics || ko.observable(specifics);\n }\n surface['canChange'] = false;\n surface.canRemove = false;\n if (surface && surface.model.type === 'aggregate') {\n this.specifics = ko.computed(() => {\n return surface['aggregatedExpression']() && surface['aggregatedExpression']().specifics() || 'integer';\n });\n this.dataType = ko.computed(() => {\n return surface['aggregatedExpression']() && surface['aggregatedExpression']().dataType() || 'integer';\n });\n this._disposables.push(this.specifics);\n this._disposables.push(this.dataType);\n }\n else {\n this.specifics = surface.specifics;\n this.dataType = surface.dataType;\n }\n this.isUpdated = surface.isUpdated;\n return surface;\n }\n createChildSurface(item, path, actions) {\n return new this.helper.mapper[item.type](item, this, this.fieldListProvider, path || this.path);\n }\n getDisplayType() {\n var type = this.operatorType && this.operatorType() || '';\n var item = this.helper._getFilterEditorOperator(this.model, this.items, this.reverse);\n return item && item.name && (item.displayText || getLocalization(item.name, item.localizationId)) || this.model.displayType || type;\n }\n get items() {\n return this.helper.filterEditorOperators[this.specifics()] || this.helper.filterEditorOperators._common;\n }\n get displayType() {\n return this.getDisplayType();\n }\n get leftPart() {\n return null;\n }\n get rightPart() {\n return null;\n }\n get css() {\n return this.operatorClass + (this.isSelected() ? ' selected' : '');\n }\n change(type, surface) {\n if (!surface && type && this.model.enumType === type.type && this.reverse === type.reverse && type.type !== FunctionOperatorType) {\n this.operatorType(type.value);\n }\n else {\n this.parent.change(type, this);\n }\n this.helper.onChange();\n }\n remove(surface) {\n this.parent.remove(this);\n this.helper.onChange();\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\functionOperandSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { OperandSurfaceBase } from './operandSurfaceBase';\nimport { UnaryOperandSurface } from './unaryOperandSurface';\nimport { getLocalization } from '../../../property-grid/localization/localization_utils';\nimport { FunctionOperatorType } from '../../criteria/operators/options/function';\nexport class FunctionOperandSurface extends OperandSurfaceBase {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this.canRemove = true;\n this.contentTemplateName = 'dx-filtereditor-function';\n this.operands = ko.observableArray([]);\n if (operator.operands.length === 0) {\n if (parent instanceof UnaryOperandSurface) {\n this.specifics = parent.parent.specifics;\n }\n else {\n this.specifics = parent.specifics;\n }\n this.contentTemplateName = 'dx-filtereditor-function-lightweight';\n this.canRemove = false;\n }\n else {\n this.operands.push(this._createLeftPartProperty(operator.operands[0]));\n for (var i = 1; i < operator.operands.length; i++) {\n this.operands.push(this.createChildSurface(operator.operands[i]));\n }\n }\n }\n get leftPart() {\n return this.operands && this.operands()[0];\n }\n get rightPart() {\n return this.operands && this.operands().filter((_, index) => { return index !== 0; });\n }\n get displayType() {\n var item = this.items.filter((item) => { return this.operatorType() === item.value && this.reverse === item.reverse && this.model.enumType === item.type; })[0];\n if (item && item.name) {\n return item.displayText || getLocalization(item.name, item.localizationId);\n }\n else {\n if (!isNaN(parseInt(this.operatorType()))) {\n return FunctionOperatorType[this.operatorType()];\n }\n else {\n return this.operatorType() || '';\n }\n }\n }\n dispose() {\n this.operands().forEach(x => x.dispose());\n super.dispose();\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\groupOperandSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { CriteriaOperatorSurface } from './criteriaOperatorSurface';\nimport { initDisplayText } from '../helpers/_helper';\nimport { AggregateOperandSurface } from './aggregateOperandSurface';\nimport { OperandProperty } from '../../criteria/operators/property';\nexport class GroupOperandSurface extends CriteriaOperatorSurface {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this.templateName = 'dx-filtereditor-group';\n this.operatorClass = 'criteria-operator-item-group dxd-filter-editor-group-back-color dxd-filter-editor-text-color';\n this.operands = ko.observableArray([]);\n this.createItems = null;\n this.createItems = [\n { name: 'Add group', value: true, localizationId: 'StringId.FilterMenuGroupAdd' },\n { name: 'Add condition', value: false, localizationId: 'StringId.FilterMenuConditionAdd' }\n ];\n this.createItems.forEach(initDisplayText);\n this.operands((operator.operands || []).map((operand) => {\n return this.createChildSurface(operand);\n }));\n this.specifics = ko.observable('group');\n }\n change(type, surface) {\n if (surface) {\n var specifics = surface.specifics() || 'integer';\n var operators = this.helper.filterEditorOperators[specifics] || this.helper.filterEditorOperators._common;\n if (!type) {\n var item = operators.filter((item) => {\n return surface.operatorType() === item.value && surface.reverse === item.reverse && surface.model.enumType === item.type;\n })[0];\n if (item) {\n type = item;\n }\n else {\n type = operators[0];\n }\n }\n var newModel = this.model.change(type, surface.model, surface.leftPart instanceof AggregateOperandSurface && surface.leftPart.leftPart.specifics() !== 'list');\n var position = this.operands().indexOf(surface);\n var operand = this.createChildSurface(newModel);\n this.operands()[position].dispose();\n this.operands.splice(position, 1, operand);\n }\n else {\n super.change(type, surface);\n }\n this.helper.onChange();\n }\n remove(surface) {\n if (surface) {\n this.model.remove(surface.model);\n this.operands.remove(surface);\n surface.dispose();\n }\n else {\n this.parent.remove(this);\n this.dispose();\n }\n this.helper.onChange();\n }\n create(type) {\n var newModel = this.model.create(type.value, new OperandProperty());\n this.operands.push(this.createChildSurface(newModel));\n this.helper.onChange();\n }\n get rightPart() {\n return this.operands();\n }\n dispose() {\n this.operands().forEach(x => x.dispose());\n super.dispose();\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\inOperandSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { CriteriaOperatorSurface } from './criteriaOperatorSurface';\nimport { OperandValue } from '../../criteria/operators/value';\nexport class InOperandSurface extends CriteriaOperatorSurface {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this.contentTemplateName = 'dx-filtereditor-in';\n this.operands = ko.observableArray([]);\n this.criteriaOperator = ko.observable(null);\n this.criteriaOperator(this._createLeftPartProperty(operator.criteriaOperator));\n this.operands((operator.operands || []).map((operand) => {\n return this.createChildSurface(operand);\n }));\n this.addValue = () => {\n var value = new OperandValue(null);\n this.model.operands.push(value);\n this.operands.push(this.createChildSurface(value));\n };\n }\n get leftPart() {\n return this.criteriaOperator();\n }\n get rightPart() {\n return this.operands();\n }\n dispose() {\n this.criteriaOperator().dispose();\n this.operands().forEach(x => x.dispose());\n super.dispose();\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\operandParameterSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { OperandSurfaceBase } from './operandSurfaceBase';\nexport class OperandParameterSurface extends OperandSurfaceBase {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this.changeParameter = (item) => {\n this.model.parameterName = item.name;\n this.parameterName(item.name);\n this.helper.onChange();\n };\n this.operatorClass = 'criteria-operator-item-parameter dxd-filter-editor-parameter-back-color dxd-filter-editor-text-color';\n this.parameterName = ko.observable('');\n this.templateName = 'dx-filtereditor-parameter';\n this.specifics = parent.specifics;\n this.parameterName(operator.parameterName);\n if (!this.parameterName() && this.items.length > 0) {\n this.changeParameter(this.items[0]);\n }\n this.specifics && this._disposables.push(this.specifics.subscribe((newVal) => {\n if (this.items.filter(x => ko.unwrap(x.name) == this.parameterName()).length == 0)\n this.items.length > 0 ? this.changeParameter(this.items[0]) : this.changeParameter({ name: '' });\n }));\n }\n get items() {\n return this.getConvertableParameters(this.specifics());\n }\n get displayType() {\n return null;\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\operandPropertySurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { OperandSurfaceBase } from './operandSurfaceBase';\nimport { PathRequest } from '../../common/pathRequest';\nexport class OperandPropertySurface extends OperandSurfaceBase {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this._displayName = ko.observable('');\n this.propertyName = ko.observable('');\n this.specifics = ko.observable('integer');\n this.dataType = ko.observable('');\n this.valueType = ko.observable('');\n this.changeProperty = (item) => {\n this.fieldsOptions().selected(item);\n };\n this.templateName = 'dx-filtereditor-property';\n this.operatorClass = 'criteria-operator-item-field dxd-filter-editor-field-back-color dxd-filter-editor-field-back-color dxd-filter-editor-text-color';\n this.propertyName(operator.propertyName);\n var options = this.helper.generateTreelistOptions(fieldListProvider, path);\n if (options.options && options.subscription) {\n this.fieldsOptions = options.options;\n this._disposables.push(options.subscription);\n }\n else {\n this.fieldsOptions = options;\n }\n this._disposables.push(this.fieldsOptions().selectedPath.subscribe((newVal) => {\n var realName = this.fieldsOptions().selectedPath().substr(this.path && this.path().length > 0 ? this.path().length + 1 : 0);\n this.propertyName(realName);\n this.model.propertyName = realName;\n this.popupService.visible(false);\n }));\n this._disposables.push(this.fieldsOptions().selected.subscribe((newVal) => {\n this._updateDisplayName(path, this.propertyName(), newVal.displayName);\n var specifics = newVal.specifics.toLowerCase();\n if (specifics.indexOf('calc') === 0) {\n specifics = specifics.split('calc')[1];\n }\n if (this.specifics() !== specifics || this.dataType() !== newVal.dataType) {\n this.specifics(specifics);\n this.dataType(newVal.dataType);\n this.parent.change();\n }\n this.helper.onChange();\n }));\n this.fieldsOptions().selectedPath(this.path && !!ko.unwrap(this.path) ? [ko.unwrap(this.path), this.propertyName()].join('.') : this.propertyName());\n this._updateSpecifics();\n this._disposables.push(this.displayName = ko.computed(() => {\n return this._displayName() || this.propertyName();\n }));\n }\n _updateDisplayName(path, propertyName, displayName) {\n if (!!this.helper.getDisplayPropertyName) {\n this.helper.getDisplayPropertyName(ko.unwrap(path), propertyName).done((newVal) => {\n this._displayName(newVal);\n });\n }\n else {\n this._displayName(displayName);\n }\n }\n _updateSpecifics() {\n var self = this;\n var propertyPath = this.propertyName().split('.');\n var realPropertyName = propertyPath.pop();\n if (ko.unwrap(this.fieldsOptions).itemsProvider) {\n this.isUpdated(true);\n ko.unwrap(this.fieldsOptions).itemsProvider.getItems(new PathRequest([this.path()].concat(propertyPath).join('.'))).done((result) => {\n var notListProperties = result.filter((item) => { return item.specifics !== 'List' && !item.isList; });\n if (!this.propertyName() && notListProperties.length > 0) {\n this.model.propertyName = notListProperties[0].name;\n this.propertyName(notListProperties[0].name);\n realPropertyName = notListProperties[0].name;\n }\n var item = result.filter((item) => { return item.name === realPropertyName; })[0];\n if (item) {\n var specifics = item.specifics.toLowerCase();\n if (specifics.indexOf('calc') === 0) {\n specifics = specifics.split('calc')[1];\n }\n this.specifics(specifics);\n this.dataType(item.dataType);\n this._updateDisplayName(this.path, this.propertyName(), item.displayName);\n }\n }).always(() => {\n this.isUpdated(false);\n });\n }\n }\n get items() {\n return this.fieldsOptions;\n }\n get displayType() {\n return null;\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\operandSurfaceBase.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { CriteriaOperatorSurface } from './criteriaOperatorSurface';\nimport { UnaryOperandSurface } from './unaryOperandSurface';\nimport { OperandValue } from '../../criteria/operators/value';\nimport { OperandProperty } from '../../criteria/operators/property';\nimport { OperandParameter } from '../../criteria/operators/parameter';\nimport { initDisplayText } from '../helpers/_helper';\nexport class OperandSurfaceBase extends CriteriaOperatorSurface {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this.canChange = true;\n this.canRemove = false;\n this.changeValueType = (type) => {\n var parent = this.getRealParent(this.parent);\n var property = this.getRealProperty(this);\n var propertyLocation = this.getPropertyName(parent, property);\n var model = parent.model.changeValueType(type.instance, propertyLocation);\n if (propertyLocation.index !== null) {\n parent[propertyLocation.name]()[propertyLocation.index].dispose();\n parent[propertyLocation.name].splice(propertyLocation.index, 1, parent.createChildSurface(model));\n }\n else {\n parent[propertyLocation.name]().dispose();\n parent[propertyLocation.name](parent.createChildSurface(model));\n }\n this.helper.onChange();\n };\n }\n getRealParent(parent) {\n if (parent instanceof UnaryOperandSurface) {\n return this.getRealParent(parent.parent);\n }\n else {\n return parent;\n }\n }\n getRealProperty(property) {\n if (property.parent instanceof UnaryOperandSurface) {\n return this.getRealProperty(property.parent);\n }\n else {\n return property;\n }\n }\n getPropertyName(parent, searchProperty) {\n var position = null;\n var name = null;\n $.each(parent, (propertyName, property) => {\n if (Array.isArray(ko.unwrap(property)) && ko.isObservable(property)) {\n var index = ko.unwrap(property).indexOf(searchProperty);\n if (index > -1) {\n position = index;\n name = propertyName;\n return;\n }\n }\n else if (searchProperty === ko.unwrap(property) && ko.isObservable(property)) {\n name = propertyName;\n return;\n }\n });\n return { index: position, name: name };\n }\n getConvertableParameters(destinationSpecifics) {\n if (!this.helper.parameters())\n return [];\n return this.helper.parameters().filter((item) => {\n var sourceSpecifics = item.specifics && item.specifics.toLowerCase();\n if (sourceSpecifics == null || destinationSpecifics == null)\n return false;\n if (sourceSpecifics === destinationSpecifics)\n return true;\n if (destinationSpecifics === 'default')\n return true;\n if (destinationSpecifics === 'string')\n return true;\n if (destinationSpecifics === 'float')\n return sourceSpecifics === 'integer';\n if (destinationSpecifics === 'enum')\n return sourceSpecifics === 'integer' || sourceSpecifics === 'string';\n return false;\n });\n }\n get changeTypeItems() {\n var items = [{ name: 'Value', instance: OperandValue, localizationId: 'AnalyticsCoreStringId.FilterEditor_Operand_Type_Value' }];\n if (this.helper.canChoiceProperty) {\n items.push({ name: 'Property', instance: OperandProperty, localizationId: 'AnalyticsCoreStringId.FilterEditor_Operand_Type_Property' });\n }\n if (this.helper.canChoiceParameters && (this.getConvertableParameters(this.parent.specifics()).length > 0 || this.helper.canCreateParameters)) {\n items.push({ name: 'Parameter', instance: OperandParameter, localizationId: 'AnalyticsCoreStringId.FilterEditor_Operand_Type_Parameter' });\n }\n items.forEach(initDisplayText);\n return items;\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\operandValueSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport DataSource from 'devextreme/data/data_source';\nimport dxScrollView from 'devextreme/ui/scroll_view';\nimport * as ko from 'knockout';\nimport { getLocalization } from '../../../property-grid/localization/localization_utils';\nimport { formatDate } from '../../../property-grid/localization/_localization';\nimport { PathRequest } from '../../common/pathRequest';\nimport { UnaryOperatorType } from '../../criteria/operators/options/unary';\nimport { ValueEditorHelper } from '../../internal/_valueEditorHelper';\nimport { isNullOrEmptyString } from '../../_utils';\nimport { OperandPropertySurface } from './operandPropertySurface';\nimport { OperandSurfaceBase } from './operandSurfaceBase';\nimport { UnaryOperandSurface } from './unaryOperandSurface';\nexport class OperandValueSurface extends OperandSurfaceBase {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this._value = ko.observable(null);\n this._scroll = null;\n this._updateDate = function (specifics) {\n if (specifics === 'date') {\n if (!(this._value() instanceof Date)) {\n this._value(new Date(new Date().setHours(0, 0, 0, 0)));\n }\n }\n else {\n this._value('');\n }\n };\n this.changeValue = () => {\n var parent = this.getRealParent(this.parent);\n var property = this.getRealProperty(this);\n var propertyLocation = this.getPropertyName(parent, property);\n var model = parent.model.changeValue(this.model, this.reverse, propertyLocation);\n if (propertyLocation.index !== null) {\n parent[propertyLocation.name]()[propertyLocation.index].dispose();\n parent[propertyLocation.name].splice(propertyLocation.index, 1, parent.createChildSurface(model));\n }\n else {\n parent[propertyLocation.name]().dispose();\n parent[propertyLocation.name](parent.createChildSurface(model));\n }\n };\n this.dataType = ko.observable('');\n this.values = ko.observable([]);\n this.isEditable = ko.observable(false);\n this.templateName = 'dx-filtereditor-value';\n this._getBaseOptions = (element) => {\n return {\n value: this._value,\n onFocusOut: () => this.isEditable(false),\n onFocusIn: () => this.scrollTo(element)\n };\n };\n this.getNumberEditorOptions = (element) => {\n return ValueEditorHelper.getNumberEditorOptions(this.dataType(), this.specifics(), this._getBaseOptions(element));\n };\n this.getStringEditorOptions = (element) => {\n return this._getBaseOptions(element);\n };\n this.getBoolEditorOptions = (element, $root) => {\n return Object.assign({ dataSource: [\n { val: 'True', text: 'Yes', localizationId: 'AnalyticsCoreStringId.ParametersPanel_True' },\n { val: 'False', text: 'No', localizationId: 'AnalyticsCoreStringId.ParametersPanel_False' }\n ], valueExpr: 'val', displayExpr: 'text', dropDownOptions: { container: $root.getPopupContainer(element) } }, this._getBaseOptions(element));\n };\n this.getDateEditorOptions = (element, $root) => {\n return Object.assign({ closeOnValueChange: true, type: 'date', dropDownOptions: { container: $root.getPopupContainer(element) } }, this._getBaseOptions(element));\n };\n this.getListEditOptions = (element, $root) => {\n var isCustomValue = typeof this.items[0] !== 'object';\n return Object.assign({ dataSource: this.dataSource, acceptCustomValue: isCustomValue, valueExpr: !isCustomValue ? 'value' : undefined, displayExpr: !isCustomValue ? 'display' : undefined, useItemTextAsTitle: true, searchEnabled: true, dropDownOptions: { container: $root.getPopupContainer(element) } }, this._getBaseOptions(element));\n };\n var dataSource = null;\n this._disposables.push(this.dataSource = ko.computed(() => {\n dataSource && dataSource.dispose();\n dataSource = new DataSource({\n store: this.values(),\n paginate: this.values().length > 200,\n pageSize: 100\n });\n return dataSource;\n }));\n if (parent instanceof UnaryOperandSurface) {\n this.specifics = parent.parent.specifics;\n this.isUpdated = parent.parent.isUpdated;\n this.dataType = parent.parent.dataType;\n if (parent.model.operatorType === UnaryOperatorType.Minus) {\n this.reverse = true;\n }\n }\n else {\n this.specifics = parent.specifics;\n this.isUpdated = parent.isUpdated;\n this.dataType = parent.dataType;\n }\n if (operator.specifics && ko.isWritableObservable(this.specifics))\n this.specifics(operator.specifics);\n this._disposables.push(this.specifics.subscribe((newVal) => {\n if (!this.isUpdated || !this.isUpdated()) {\n operator.specifics = newVal;\n this._updateDate(newVal);\n }\n }));\n this._value(operator.value);\n this._disposables.push(this._value.subscribe((newVal) => {\n this.model.value = newVal;\n this.helper.onChange();\n }));\n if (isNullOrEmptyString(this._value())) {\n this._updateDate(this.specifics());\n }\n this._disposables.push(this.value = ko.computed({\n read: () => {\n var value = this._value();\n if (value instanceof Date) {\n value = formatDate(value);\n }\n if (this.items.length > 0) {\n var result = this.items.filter((item) => { return String(item.value) === String(value); })[0];\n if (result) {\n return result.display;\n }\n }\n if (this.reverse) {\n value = '-' + value;\n }\n return value !== null && value !== undefined && value !== '' ? value : this.getDefaultValue();\n },\n write: (newVal) => {\n if (newVal > 0 && !this.reverse || newVal < 0 && this.reverse) {\n this._value(newVal);\n }\n else if (newVal > 0 && this.reverse || newVal < 0 && !this.reverse) {\n this.reverse = !this.reverse;\n this._value(newVal < 0 ? ('' + newVal).substring(1) : newVal);\n this.changeValue();\n }\n }\n }));\n this._disposables.push(ko.computed(() => {\n var itemsProvider = ko.unwrap(fieldListProvider);\n if (itemsProvider && itemsProvider.getValues && this.parent.leftPart instanceof OperandPropertySurface) {\n if (this.parent.leftPart.propertyName()) {\n itemsProvider.getValues(new PathRequest(ko.unwrap(this.path) + '.' + this.parent.leftPart.propertyName())).done((result) => {\n this.values(result);\n });\n }\n }\n }));\n operator.specifics = this.specifics();\n }\n get items() {\n return this.values();\n }\n get displayType() {\n return null;\n }\n isDefaultDisplay() {\n return this.value() === this.getDefaultValue();\n }\n getDefaultValue() {\n return OperandValueSurface._defaultValue ? OperandValueSurface._defaultValue :\n OperandValueSurface._defaultValue = getLocalization('Enter a value', 'StringId.FilterEmptyEnter');\n }\n scrollTo(element) {\n if (!this._scroll) {\n var scrollElement = element.closest('.dx-filtereditor-tree');\n this._scroll = dxScrollView.getInstance(scrollElement);\n }\n this._scroll.scrollToElement(element);\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\filtereditor\\operators\\unaryOperandSurface.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport { CriteriaOperatorSurface } from './criteriaOperatorSurface';\nimport { GroupOperator } from '../../criteria/operators/group';\nimport { UnaryOperatorType } from '../../criteria/operators/options/unary';\nimport { GroupOperatorType } from '../../criteria/operators/options/group';\nexport class UnaryOperandSurface extends CriteriaOperatorSurface {\n constructor(operator, parent, fieldListProvider, path) {\n super(operator, parent, fieldListProvider, path);\n this.contentTemplateName = 'dx-filtereditor-unary';\n this.operand = ko.observable(null);\n var operand = this.createChildSurface(operator.operand);\n if (operator.operatorType === UnaryOperatorType.Not) {\n this.templateName = 'dx-filtereditor-not';\n operand.reverse = true;\n this.specifics = operand.specifics;\n }\n else {\n operand.dispose();\n operand = this._createLeftPartProperty(operator.operand);\n }\n this.operand(operand);\n }\n get leftPart() {\n var leftPart = this.operand();\n if (this.operand() && this.operand().reverse && this.operand().leftPart) {\n leftPart = this.operand().leftPart;\n }\n return leftPart;\n }\n get rightPart() {\n return this.operand() && this.operand().reverse ? this.operand().rightPart : null;\n }\n createChildSurface(item, path, actions) {\n if (this.operatorType() === UnaryOperatorType.Not && !this.helper._getFilterEditorOperator(item, this.helper._allFilterEditorOperators, true)) {\n this.model.operand = new GroupOperator(GroupOperatorType.And, [item]);\n }\n return super.createChildSurface(this.model.operand, path, actions);\n }\n dispose() {\n this.operand().dispose();\n super.dispose();\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\formatstring\\_patterns.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport var formatStringStandardPatterns = {\n 'DateTime': { type: 'System.DateTime', value: new Date(Date.now()), patterns: [] },\n 'Number': { type: 'System.Int32', value: '123456789', patterns: ['#.00', '#,#', '0.E+0.0', '0.e+0.0', 'n', 'n1', 'n2', 'e', 'e1', 'f', 'f1'] },\n 'Percent': { type: 'System.Int32', value: '100', patterns: ['0.00%', '0%'] },\n 'Currency': { type: 'System.Int32', value: '100', patterns: ['$0.00', '$0', 'c', 'c1', 'c2'] },\n 'Special': { type: 'System.Int32', value: '123456789', patterns: ['(###) ### - ####', '### - ## - ####'] },\n 'General': { type: 'System.String', value: '', patterns: ['General format have no specific number format'] }\n};\n","/**\r\n* DevExpress Analytics (widgets\\formatstring\\binding.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { FormatStringEditor } from './formatstringeditor';\nimport { addDisposeCallback } from '../../serializer/_internal';\nimport { getTemplate } from '../../property-grid/widgets/templateUtils';\nko.bindingHandlers['dxFormatEditor'] = {\n init: function (element, valueAccessor) {\n $.fn.constructor(element).children().remove();\n $.fn.constructor(element).addClass('dx-popup-general');\n var templateHtml = getTemplate('dx-format-string'), $element = $.fn.constructor(element).append(templateHtml), values = valueAccessor();\n var formatEditor = new FormatStringEditor(values.value, values['disabled'], values['standardPatterns'], values['customPatterns'], values['actions'], values['rtl'], values['popupContainer']);\n ko.applyBindings(formatEditor, $element.children()[0]);\n addDisposeCallback(element, function () {\n formatEditor.dispose();\n });\n return { controlsDescendantBindings: true };\n }\n};\n","/**\r\n* DevExpress Analytics (widgets\\formatstring\\formatstringeditor.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { Disposable } from '../../serializer/utils';\nimport { formatStringStandardPatterns } from './_patterns';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nimport { StringId } from '../../property-grid/localization/_localizationStringIds';\nimport { PopupService } from '../../property-grid/internal/_popupService';\nimport dxScrollView from 'devextreme/ui/scroll_view';\nexport class FormatStringEditor extends Disposable {\n constructor(value, disabled, defaultPatterns, customPatterns, actions, rtl, popupContainer) {\n super();\n this._isDisabled = ko.observable(false);\n this._timeout = null;\n this.currentType = ko.observable();\n this.patternList = ko.observableArray([]);\n this.canAddCustomFormat = ko.observable(false);\n this.formatPrefix = ko.observable('');\n this.formatSuffix = ko.observable('');\n this.previewString = ko.observable('Preview string');\n this.formatResult = ko.observable('');\n this.selectedFormats = ko.observable([]);\n this.selectedTypes = ko.observable([]);\n this.popupVisible = ko.observable(false);\n this.localizationIdMap = {\n 'title': { text: 'FormatString Editor', localizationId: 'AnalyticsCoreStringId.FormatStringEditor_Title' },\n 'category': { text: 'Category', localizationId: 'AnalyticsCoreStringId.Category' },\n 'preview': { text: 'Preview', localizationId: 'AnalyticsCoreStringId.TooltipButtons_Preview' },\n 'types': { text: 'Types', localizationId: 'AnalyticsCoreStringId.FormatStringEditor_Types' },\n 'add': { text: 'Add', localizationId: 'DataAccessUIStringId.Button_Add' },\n 'prefix': { text: 'Prefix', localizationId: 'AnalyticsCoreStringId.Prefix' },\n 'suffix': { text: 'Suffix', localizationId: 'AnalyticsCoreStringId.FormatStringEditor_Suffix' }\n };\n this.option('value', value);\n this.option('disabled', disabled || false);\n this.option('rtl', rtl || false);\n this.option('popupContainer', popupContainer || '.dx-designer-viewport');\n var self = this;\n this.popupService = new PopupService();\n this._standardPatternSource = defaultPatterns || formatStringStandardPatterns;\n this._customPatternSource = customPatterns || {};\n this.types = this._convertArray(Object.keys(this._standardPatternSource));\n this._disposables.push(this.currentType.subscribe((newVal) => {\n if (self.isGeneralType) {\n self.formatResult('');\n self.selectedFormats([]);\n }\n else {\n self._updateFormatList();\n }\n }));\n this.currentType(this.types[0].name);\n this._disposables.push(this.formatResult.subscribe((newVal) => {\n self._updateCanAddCustomFormat(newVal);\n self._updatePreview();\n }));\n this._disposables.push(this.formatPrefix.subscribe((newVal) => {\n self._updatePreview();\n }));\n this._disposables.push(this.formatSuffix.subscribe((newVal) => {\n self._updatePreview();\n }));\n this._disposables.push(this.popupVisible.subscribe((newVal) => {\n if (!newVal)\n return;\n self._initEditor(value());\n self.selectedTypes(self.types.filter((item) => { return item.name === self.currentType(); }));\n }));\n this._createMainPopupButtons();\n actions && actions.updatePreview && (this.updatePreview = actions.updatePreview);\n this.setType = (e) => {\n self.currentType(e.itemData.name);\n self._updateSelection();\n };\n this.setFormat = (e) => {\n self.formatResult(e.itemData.name);\n };\n this.addCustomFormat = () => {\n if (self.formatResult() && self.canAddCustomFormat()) {\n self.customPatterns.push(self.formatResult());\n self._updateFormatList();\n self._scrollToBottom();\n actions && actions.saveCustomPattern(self.currentType(), self.formatResult());\n self._updateSelection(self.patternList().length - 1);\n self.canAddCustomFormat(false);\n }\n };\n this.removeCustomFormat = (data) => {\n var currentSelection = self.selectedFormats()[0];\n var patternList = self.patternList();\n var removedItemIndex = patternList.map((item) => { return item.name; }).indexOf(data.name);\n self.customPatterns.splice(self.customPatterns.indexOf(data.name), 1);\n self._updateFormatList();\n actions && actions.removeCustomPattern(self.currentType(), data.name);\n if (currentSelection.name === data.name) {\n self._updateSelection(removedItemIndex === (patternList.length - 1) ? (self.patternList().length - 1) : removedItemIndex);\n }\n else {\n self.selectedFormats(self.patternList().filter((item) => { return item.name === currentSelection.name; }));\n }\n };\n }\n okAction() {\n var result = this.isGeneralType ? this._getGeneralPreview('{0}') : this._wrapFormat();\n this.option('value', result);\n this.popupVisible(false);\n }\n _createMainPopupButtons() {\n var self = this;\n this.buttonItems = [\n { toolbar: 'bottom', location: 'after', widget: 'dxButton', options: { text: getLocalization('OK', StringId.DataAccessBtnOK), type: 'default', stylingMode: 'contained', disabled: this._isDisabled, onClick: function () { self.okAction(); } } },\n { toolbar: 'bottom', location: 'after', widget: 'dxButton', options: { text: getLocalization('Cancel', StringId.DataAccessBtnCancel), type: 'normal', stylingMode: 'contained', onClick: function () { self.popupVisible(false); } } }\n ];\n }\n _convertArray(array, canRemove) {\n return array.map(item => { return { name: item, displayName: getLocalization(item), canRemove: !!canRemove }; });\n }\n _scrollToBottom() {\n var $scrollView = $.fn.constructor('.dx-format-string .dx-format-string-formats').find('.dx-scrollview').filter(':visible');\n var scrollViewInstance = dxScrollView.getInstance($scrollView.get(0));\n scrollViewInstance && scrollViewInstance['scrollTo'] && scrollViewInstance['scrollTo'](scrollViewInstance['scrollHeight']());\n }\n _updateFormatList() {\n this.selectedFormats([]);\n var currentTypeInfo = this._standardPatternSource[this.currentType()];\n this.patternList(this._convertArray(currentTypeInfo.patterns).concat(this._convertArray(this.customPatterns, true)));\n }\n _updateSelection(selectedItemIndex) {\n var currectFormat = this.patternList()[selectedItemIndex || 0];\n if (currectFormat) {\n this.selectedFormats([currectFormat]);\n this.formatResult(currectFormat.name);\n }\n }\n _setPreviewString(previewString) {\n this.previewString(previewString);\n this._isDisabled(false);\n }\n _setErrorMessage(setDisabled) {\n this.previewString(getLocalization('Preview string is not available', 'AnalyticsCoreStringId.FormatStringEditor_PreviewNotAvailable_Text'));\n this._isDisabled(setDisabled);\n }\n _updatePreview() {\n this._timeout && clearTimeout(this._timeout);\n this._timeout = setTimeout(() => {\n if (this.isGeneralType) {\n this.previewString(this._getGeneralPreview(undefined));\n return;\n }\n var category = this._standardPatternSource[this.currentType()];\n var updatedPreviewPromise = this.updatePreview(category.value, category.type, this._wrapFormat());\n this._lastUpdatePreviewPromise = updatedPreviewPromise;\n updatedPreviewPromise\n .done((previewResult) => {\n if (this._lastUpdatePreviewPromise === updatedPreviewPromise) {\n if (previewResult.Result)\n this._setPreviewString(previewResult.Result);\n else\n this._setErrorMessage(previewResult.IsError);\n }\n }).fail((error) => {\n if (this._lastUpdatePreviewPromise === updatedPreviewPromise)\n this.previewString(getLocalization('Preview string is not available', 'AnalyticsCoreStringId.FormatStringEditor_PreviewNotAvailable_Text'));\n });\n }, 100);\n }\n _getGeneralPreview(value = '###') {\n return this.formatPrefix() + value + this.formatSuffix();\n }\n _wrapFormat(format) {\n var pattern = format || this.formatResult();\n if (pattern && pattern.indexOf('{0:') !== -1) {\n return pattern;\n }\n return pattern ? '{0:' + pattern + '}' : '';\n }\n _updateCanAddCustomFormat(newFormat) {\n if (!newFormat) {\n this.canAddCustomFormat(false);\n return;\n }\n var canAddCustomFormat = true;\n Object.keys(this._standardPatternSource).some((name) => {\n canAddCustomFormat = this._standardPatternSource[name].patterns.indexOf(newFormat) === -1;\n return !canAddCustomFormat;\n });\n this.canAddCustomFormat(canAddCustomFormat ? this.customPatterns.indexOf(newFormat) === -1 : canAddCustomFormat);\n }\n _initEditor(formatStringValue) {\n if (!formatStringValue) {\n this.setType({ itemData: this.types[0] });\n return;\n }\n if (formatStringValue.indexOf('{0}') !== -1) {\n this.currentType('General');\n this.formatPrefix(formatStringValue.substring(0, formatStringValue.indexOf('{0}')));\n this.formatSuffix(formatStringValue.substring(formatStringValue.indexOf('{0}') + 3));\n return;\n }\n var startIndex = formatStringValue.indexOf('{0:'), closingBracketIndex = formatStringValue.indexOf('}', startIndex), formatPattern = formatStringValue.substring(startIndex + 3, closingBracketIndex), isFormatPatternFind;\n var selectTypePatternPair = (name) => {\n this.currentType(name);\n if (startIndex === 0 && closingBracketIndex === (formatStringValue.length - 1)) {\n this.selectedFormats(this.patternList().filter((item) => { return item.name === formatPattern; }));\n this.formatResult(formatPattern);\n isFormatPatternFind = true;\n }\n };\n Object.keys(this._standardPatternSource).some((name) => {\n if (this._standardPatternSource[name].patterns.indexOf(formatPattern) !== -1) {\n selectTypePatternPair(name);\n return true;\n }\n var customPatterns = this._customPatternSource[this._standardPatternSource[name].type];\n if (customPatterns && customPatterns.indexOf(formatPattern) !== -1) {\n selectTypePatternPair(name);\n return true;\n }\n return false;\n });\n if (!isFormatPatternFind) {\n this.currentType(this.types[0].name);\n this.selectedFormats([]);\n this.formatResult(formatStringValue);\n }\n }\n updateInputText(propertyName, componentInstance) {\n this[propertyName](componentInstance.option('text'));\n }\n option(name, value) {\n if (value !== void 0) {\n if (ko.isObservable(this[name])) {\n this[name](value);\n }\n else {\n this[name] = value;\n }\n }\n return ko.unwrap(this[name]);\n }\n updatePreview(value, category, pattern) {\n return $.Deferred().resolve({ Result: value || 'preview string' }).promise();\n }\n get customPatterns() {\n var currentTypeInfo = this._standardPatternSource[this.currentType()];\n return this._customPatternSource[currentTypeInfo.type] = this._customPatternSource[currentTypeInfo.type] || [];\n }\n get isGeneralType() {\n return this.currentType() === 'General';\n }\n getDisplayText(key) {\n return getLocalization(this.localizationIdMap[key].text, this.localizationIdMap[key].localizationId);\n }\n getPopupContainer(el) {\n return $.fn.constructor(el).closest(this.option('popupContainer'));\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\internal\\_resizeHelper.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { extend } from '../../serializer/_utils';\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nexport class ResizeHelper {\n constructor(options = {}) {\n this.options = options;\n this._resize = (deltaWidth, deltaHeight, oldDelta, element) => {\n if (this.options.resultSize) {\n this.options.resultSize(this.options.resultSize() - (deltaWidth || deltaHeight) + oldDelta);\n }\n else {\n if (element) {\n if (deltaWidth) {\n const newWidth = element.offsetWidth - deltaWidth + oldDelta;\n element.style.width = `${newWidth}px`;\n }\n else if (deltaHeight) {\n const newHeight = element.offsetHeight + deltaHeight - oldDelta;\n element.style.height = `${newHeight}px`;\n }\n }\n }\n return deltaWidth || deltaHeight;\n };\n }\n resizable(resizeHandler, handles) {\n if (!resizeHandler)\n resizeHandler = { starting: () => { }, stopped: () => { } };\n var oldDelta = 0;\n return extend({}, resizeHandler, {\n handles: handles,\n $selectedNodes: $.fn.constructor(),\n stopped: () => { oldDelta = 0; },\n resize: (event, element, boundsDiff) => {\n oldDelta = this._resize(-boundsDiff.width, boundsDiff.height, oldDelta, element);\n this.options.onResize && this.options.onResize();\n },\n handleClassName: 'dxd-back-secondary',\n disabled: this.options.disabled || ko.observable(false)\n });\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\internal\\_valueEditorHelper.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport { extend } from '../../serializer/_utils';\nexport class ValueEditorHelper {\n static _getCharFromKeyCode(e) {\n if (e.ctrlKey === false && e.key.length === 1)\n return e.key;\n return null;\n }\n static _getCaretPosition(el) {\n var start = -1, end = -1, normalizedValue, range, textInputRange, len, endRange;\n try {\n if (typeof el.selectionStart == 'number' && typeof el.selectionEnd == 'number') {\n start = el.selectionStart;\n end = el.selectionEnd;\n }\n else if (document['selection']) {\n range = document['selection'].createRange();\n if (range && range.parentElement() == el) {\n len = el.value.length;\n normalizedValue = el.value.replace(/\\r\\n/g, '\\n');\n textInputRange = el.createTextRange();\n textInputRange.moveToBookmark(range.getBookmark());\n endRange = el.createTextRange();\n endRange.collapse(false);\n if (textInputRange.compareEndPoints('StartToEnd', endRange) > -1) {\n start = end = len;\n }\n else {\n start = -textInputRange.moveStart('character', -len);\n start += normalizedValue.slice(0, start).split('\\n').length - 1;\n if (textInputRange.compareEndPoints('EndToEnd', endRange) > -1) {\n end = len;\n }\n else {\n end = -textInputRange.moveEnd('character', -len);\n end += normalizedValue.slice(0, end).split('\\n').length - 1;\n }\n }\n }\n }\n }\n catch (e) {\n }\n return {\n start: start,\n end: end\n };\n }\n static _validate(value, minValue, maxValue) {\n if (!/^(0|(-?(([1-9]\\d*)|(0\\.\\d+)|([1-9]\\d*\\.\\d+)|(\\d*\\.\\d+[eE][+\\-]?\\d+))))$/.test(value))\n return false;\n if (!maxValue)\n return true;\n var negative = value[0] === '-';\n var valModulo = negative ? value.substring(1) : value;\n if (negative && !minValue)\n return false;\n var boundModulo = negative ? minValue.substring(1) : maxValue;\n var valMantissa, valExp, boundMantissa, boundExp;\n [valMantissa, valExp] = valModulo.toLowerCase().split('e');\n [boundMantissa, boundExp] = boundModulo.toLowerCase().split('e');\n var valIntPart, valFracPart, boundIntPart, boundFracPart;\n [valIntPart, valFracPart] = valMantissa.split('.');\n [boundIntPart, boundFracPart] = boundMantissa.split('.');\n valIntPart = (valIntPart || '').replace(/^0+/, '');\n boundIntPart = (boundIntPart || '').replace(/^0+/, '');\n var valOrder = valIntPart.length;\n if (valExp)\n valOrder += parseInt(valExp);\n var boundOrder = boundIntPart.length;\n if (boundExp)\n boundOrder += parseInt(boundExp);\n if (valOrder < boundOrder)\n return true;\n if (valOrder > boundOrder)\n return false;\n valFracPart = valFracPart || '0';\n boundFracPart = boundFracPart || '0';\n if (valIntPart + valFracPart > boundIntPart + boundFracPart)\n return false;\n return true;\n }\n static validateWidgetValue(e, validate, defaultVal) {\n var currentValue = e.component.option('value');\n if (!validate(currentValue)) {\n e.component.option('value', defaultVal);\n }\n }\n static getNumberEditorOptions(id, specifics, extendOptions = {}) {\n var editorOptions = ValueEditorHelper.editors[id] || ValueEditorHelper.editors[specifics];\n return editorOptions ? ValueEditorHelper.getValueEditorOptions(editorOptions.regExpEditing, (value) => {\n return ValueEditorHelper._validate(value, editorOptions.minValue, editorOptions.maxValue);\n }, '', extendOptions) : extendOptions;\n }\n static getValueEditorOptions(regExpEditing, validate, defaultVal, extendOptions = {}) {\n var options = {\n onFocusIn: e => {\n ValueEditorHelper.validateWidgetValue(e, validate, defaultVal);\n ValueEditorHelper._invokeStandardHandler(extendOptions, 'onFocusIn', e);\n },\n onKeyDown: e => {\n var char = ValueEditorHelper._getCharFromKeyCode(e.event);\n if (!char)\n return;\n var $input = $.fn.constructor(e.element).find('input').eq(0);\n var caretPosition = ValueEditorHelper._getCaretPosition($input.get(0));\n var currentValue = $input.val();\n if (caretPosition.start < 0) {\n caretPosition = currentValue ? currentValue.length : 0;\n }\n var result = [currentValue.slice(0, caretPosition.start), char, currentValue.slice(caretPosition.end)].join('');\n if (!regExpEditing.test(result))\n e.event.preventDefault();\n $input = null;\n ValueEditorHelper._invokeStandardHandler(extendOptions, 'onKeyDown', e);\n },\n onPaste: e => {\n var clipboardData = e.event.originalEvent.clipboardData || window['clipboardData'] || {};\n var pastedData = clipboardData.getData && clipboardData.getData('Text');\n if (typeof pastedData !== 'string')\n return;\n var $input = $.fn.constructor(e.element).find('input').eq(0);\n var caretPosition = ValueEditorHelper._getCaretPosition($input.get(0));\n var currentValue = $input.val();\n if (caretPosition.start < 0) {\n caretPosition.end = caretPosition.start = currentValue ? currentValue.length : 0;\n }\n var result = [\n currentValue.slice(0, caretPosition.start), pastedData, currentValue.slice(caretPosition.end)\n ].join('');\n if (!regExpEditing.test(result))\n e.event.preventDefault();\n $input = null;\n ValueEditorHelper._invokeStandardHandler(extendOptions, 'onPaste', e);\n },\n onValueChanged: e => {\n if (e.value !== defaultVal)\n this.validateWidgetValue(e, validate, e.previousValue);\n ValueEditorHelper._invokeStandardHandler(extendOptions, 'onValueChanged', e);\n }\n };\n return extend({}, extendOptions, options);\n }\n static isValid(id, specifics, value) {\n var editorOptions = ValueEditorHelper.editors[id] || ValueEditorHelper.editors[specifics];\n return editorOptions.regExpEditing.test(value) && ValueEditorHelper._validate(value, editorOptions.minValue, editorOptions.maxValue);\n }\n static _invokeStandardHandler(extendOptions, name, e) {\n if ($.isFunction(extendOptions[name]))\n extendOptions[name](e);\n }\n}\nValueEditorHelper.editors = {\n 'integer': {\n regExpEditing: /^-?\\d*$/\n },\n 'float': {\n regExpEditing: /^-?(\\d+\\.?\\d*)?([eE][+\\-]?\\d+)?$/\n },\n 'System.Byte': {\n regExpEditing: /^\\d*$/,\n minValue: null,\n maxValue: '255'\n },\n 'System.SByte': {\n regExpEditing: /^-?\\d*$/,\n minValue: '-128',\n maxValue: '127'\n },\n 'System.Int16': {\n regExpEditing: /^-?\\d*$/,\n minValue: '-32768',\n maxValue: '32767'\n },\n 'System.UInt16': {\n regExpEditing: /^\\d*$/,\n minValue: null,\n maxValue: '65535'\n },\n 'System.Int32': {\n regExpEditing: /^-?\\d*$/,\n minValue: '-2147483648',\n maxValue: '2147483647'\n },\n 'System.UInt32': {\n regExpEditing: /^\\d*$/,\n minValue: null,\n maxValue: '4294967295'\n },\n 'System.Int64': {\n regExpEditing: /^-?\\d*$/,\n minValue: '-9223372036854775808',\n maxValue: '9223372036854775807'\n },\n 'System.UInt64': {\n regExpEditing: /^\\d*$/,\n minValue: null,\n maxValue: '18446744073709551615'\n },\n 'System.Single': {\n regExpEditing: /^-?(\\d+\\.?\\d*)?([eE][+\\-]?\\d*)?$/,\n minValue: '-3.40282347e+38',\n maxValue: '3.40282347e+38'\n },\n 'System.Double': {\n regExpEditing: /^-?(\\d+\\.?\\d*)?([eE][+\\-]?\\d*)?$/,\n minValue: '-1.7976931348623157e+308',\n maxValue: '1.7976931348623157e+308'\n },\n 'System.Decimal': {\n regExpEditing: /^-?(\\d+\\.?\\d*)?([eE][+\\-]?\\d*)?$/,\n minValue: '-79228162514264337593543950335',\n maxValue: '79228162514264337593543950335'\n }\n};\n","/**\r\n* DevExpress Analytics (widgets\\treelist\\_binding.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { DefaultTreeListItemFactory } from './_treelistItem';\nimport { TreeListController } from './_treelistController';\nimport { TreeListSearchOptions, TreeListSearchViewModel } from './_treeListSearchViewModel';\nimport dxScrollView from 'devextreme/ui/scroll_view';\nimport { extend } from '../../serializer/_utils';\nimport { getTemplate } from '../../property-grid/widgets/templateUtils';\nko.bindingHandlers['treelist'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var treeListViewModel = null;\n var childContext = null;\n var callback = null;\n var values = valueAccessor(), options = ko.unwrap(values), pathArray, updateScrollBar = () => {\n var options = ko.unwrap(values);\n var scrollViewElt = $.fn.constructor(element).closest('.dx-scrollview').get(0);\n var scrollView = scrollViewElt && dxScrollView.getInstance(scrollViewElt);\n scrollView && scrollView['update']();\n if (options.onItemsVisibilityChanged) {\n options.onItemsVisibilityChanged();\n }\n }, updateTreeList = (options) => {\n pathArray && pathArray.dispose();\n var treeListController = options.treeListController || new TreeListController();\n options.treeListController = treeListController;\n treeListController.dragDropHandler = treeListController.dragDropHandler || bindingContext.$root.fieldDragHandler;\n options.factory = options.factory || new DefaultTreeListItemFactory();\n options.itemsProvider = ko.unwrap(options.itemsProvider);\n options.pageSize = options.pageSize || -1;\n treeListViewModel && treeListViewModel.dispose();\n if (!options || !options.itemsProvider)\n return;\n if (!options.rtl) {\n options.rtl = $.fn.constructor(element).closest('.dx-rtl').length > 0;\n }\n pathArray = ko.computed(() => {\n var result = ko.unwrap(options.path);\n if (!Array.isArray(result)) {\n return !!result ? result.split('.') : [];\n }\n return result;\n });\n treeListViewModel = options.factory.createRootItem(options, pathArray, updateScrollBar, options.rtl);\n var treeListTemplate = options.templateHtml || getTemplate('dx-treelist');\n if (treeListController.root) {\n treeListController.searchEnabled = true;\n treeListController.searchOptions = treeListController.searchOptions || new TreeListSearchOptions();\n treeListController.root(treeListViewModel);\n }\n var $element = $.fn.constructor(element).html(treeListTemplate);\n childContext = bindingContext.createChildContext(treeListViewModel);\n ko.applyBindings(childContext, $element.children()[0]);\n callback && ko.utils.domNodeDisposal.removeDisposeCallback(element, callback);\n callback = function () {\n treeListViewModel && treeListViewModel.dispose();\n treeListViewModel = null;\n subscription && subscription.dispose();\n pathArray && pathArray.dispose();\n callback = null;\n ko.utils.domNodeDisposal.removeDisposeCallback(element, callback);\n };\n ko.utils.domNodeDisposal.addDisposeCallback(element, callback);\n };\n updateTreeList(extend({}, options));\n var subscription = null;\n if (ko.isSubscribable(values)) {\n subscription = values.subscribe((newValue) => {\n newValue && updateTreeList(extend({}, newValue));\n });\n }\n else if (ko.isSubscribable(values.itemsProvider)) {\n subscription = values.itemsProvider.subscribe((newValue) => {\n newValue && updateTreeList(extend({}, values));\n });\n }\n return { controlsDescendantBindings: true };\n }\n};\nko.bindingHandlers['treeListSearchPanel'] = {\n init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var values = valueAccessor();\n var template = ko.unwrap(values.template);\n var modelType = ko.unwrap(values.modelType);\n var controllers = ko.unwrap(values.controllers);\n if (!Array.isArray(controllers))\n controllers = [controllers];\n TreeListSearchViewModel.createController(element, controllers, modelType, template);\n return { controlsDescendantBindings: true };\n }\n};\n","/**\r\n* DevExpress Analytics (widgets\\treelist\\_treeListSearchViewModel.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as ko from 'knockout';\nimport * as $ from 'jquery';\nimport { SearchMode, findMatchesInString } from '../../property-grid/widgets/internal/_utils';\nimport { Disposable } from '../../serializer/utils';\nimport { searchPlaceholder } from '../../property-grid/localization/_localization';\nimport { getTemplate } from '../../property-grid/widgets/templateUtils';\nexport class TreeListSearchOptions {\n constructor() {\n this.globalMatch = true;\n this.autoLoadItems = true;\n this.canUseRegex = false;\n this.caseSensitive = false;\n this.searchMode = SearchMode.contains;\n this.searchTimeout = 500;\n this.searchExpr = 'displayName';\n this.searchBoxTemplate = 'dx-treelist-searchbox';\n }\n}\nexport class TreeListSearchViewModel extends Disposable {\n constructor() {\n super();\n this._processedNodes = [];\n this._currentProcess = [];\n this.searchTimeout = 500;\n this._roots = [];\n this.searchPlaceholder = () => searchPlaceholder();\n var _textToSearch = ko.observable('');\n var timeout = null;\n this._disposables.push(this.value = ko.computed({\n read: () => _textToSearch(),\n write: (newVal) => {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n _textToSearch(newVal);\n }, this.searchTimeout);\n }\n }));\n this._disposables.push(this.value.subscribe((newValue) => this.valueChanged(newValue)));\n }\n static createController(element, controllers, modelType = TreeListSearchViewModel, templateName = 'dx-treelist-search-panel') {\n var model = new modelType();\n var $element = $.fn.constructor(element);\n var subscriptions = [];\n controllers.forEach((controller) => {\n if (!controller)\n return;\n controller.root = controller.root || ko.observable();\n subscriptions.push(controller.root.subscribe((newRoot) => {\n model.addController(newRoot);\n model.valueChanged('');\n }));\n });\n model._disposables.push({\n dispose: () => {\n controllers.forEach(controller => {\n if (controller) {\n controller.root(null);\n delete controller.root;\n }\n });\n }\n });\n var template = getTemplate(templateName);\n $element.addClass('dxrd-treelist-search-panel-container').addClass('dxd-border-primary');\n $element.children().remove();\n $element.append(template);\n ko.cleanNode($element.children()[0]);\n ko.applyBindings(model, $element.children()[0]);\n var disposeCallback = () => {\n subscriptions.forEach(x => x.dispose());\n model && model.dispose();\n ko.utils.domNodeDisposal.removeDisposeCallback(element, disposeCallback);\n };\n ko.utils.domNodeDisposal.addDisposeCallback(element, disposeCallback);\n }\n dispose() {\n super.dispose();\n this.clearProcess();\n }\n clearProcess() {\n this._currentProcess.forEach(x => x.stop && x.stop());\n this._currentProcess = [];\n this._processedNodes = [];\n }\n valueChanged(newValue) {\n if (!newValue)\n this._processedNodes.forEach(x => x.setVisible(true));\n this.clearProcess();\n this._roots.forEach((root) => {\n root.treeListController.textToSearch(newValue);\n if (newValue) {\n this._currentProcess.push(root.walkOnTree((node) => {\n var regexResult = findMatchesInString(node.data[root.treeListController.searchOptions.searchExpr], newValue, root.treeListController.searchOptions);\n this._processedNodes.push(node);\n node.setVisible(!!regexResult);\n regexResult && this._collapseTreeBranch(node);\n }));\n }\n else {\n root.items.valueHasMutated();\n }\n });\n }\n _collapseTreeBranch(node) {\n if (node.parent) {\n if (node.parent.collapsed())\n node.parent.toggleCollapsed();\n this._collapseTreeBranch(node.parent);\n }\n }\n addController(root) {\n this._roots = this._roots.filter((a) => !a.isDisposing);\n root.treeListController.textToSearch = root.treeListController.textToSearch || ko.observable('');\n if (this._roots.indexOf(root) === -1)\n this._roots.push(root);\n this.searchTimeout = Math.max.apply(Math, this._roots.map(x => x.treeListController.searchOptions.searchTimeout)) || 500;\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\treelist\\_treelistController.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nexport class TreeListController {\n constructor() {\n this.selectedItem = null;\n }\n dispose() {\n this.selectedItem = null;\n }\n itemsFilter(item, path) {\n return true;\n }\n hasItems(item) {\n return item.specifics !== 'none' && (item.specifics === 'List' || item.specifics === 'ListSource' || item.isList === true);\n }\n canSelect(value) {\n return !value.hasItems;\n }\n select(value) {\n if (this.canSelect(value)) {\n this.selectedItem && this.selectedItem.isSelected(false);\n this.selectedItem = value;\n value.isSelected(true);\n }\n }\n isDraggable(item) {\n return false;\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\treelist\\_treelistItem.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport * as $ from 'jquery';\nimport * as ko from 'knockout';\nimport { CodeResolver } from '../../property-grid/internal/_codeResolver';\nimport { getLocalization } from '../../property-grid/localization/localization_utils';\nimport { SvgTemplatesEngine } from '../../property-grid/widgets/internal/_svgTemplateEngine';\nimport { Disposable } from '../../serializer/utils';\nimport { createGlobalModuleVariableFunc } from '../../serializer/_internal';\nimport { PathRequest } from '../common/pathRequest';\nimport { LoadChildItemsForCollapsedNodes } from './options';\nexport var maxSearchLevel = createGlobalModuleVariableFunc(5);\nexport var treeListEditAction = {\n templateName: 'dx-treelist-edit-action',\n imageClassName: '',\n text: 'Edit',\n clickAction: $.noop,\n displayText: () => getLocalization('Edit', 'AnalyticsCoreStringId.Group_Edit')\n};\nexport class DefaultTreeListItemFactory {\n createRootItem(options, path, onItemsVisibilityChanged, rtl) {\n return new TreeListRootItemViewModel(options, path, onItemsVisibilityChanged, rtl);\n }\n createItem(options, path, onItemsVisibilityChanged, rtl, resolver) {\n return new TreeListItemViewModel(options, path, onItemsVisibilityChanged, rtl, resolver);\n }\n}\nexport class TreeListEllipsisButton {\n constructor(_availableItemsCount, padding, pageSize) {\n this._availableItemsCount = _availableItemsCount;\n this.padding = padding;\n this.pageSize = pageSize;\n this.templateName = 'dx-treelist-item-ellipsis';\n this.collapsed = () => true;\n this.visibleItems = () => [];\n this.text = () => getLocalization('Show more...', 'AnalyticsCoreStringId.QueryBuilder_Tables_ShowMore');\n }\n renderNext() {\n this._availableItemsCount(this._availableItemsCount() + this.pageSize);\n }\n}\nexport class TreeListItemViewModel extends Disposable {\n constructor(options, path = [], onItemsVisibilityChanged = $.noop, rtl = false, resolver = new CodeResolver()) {\n super();\n this.resolver = resolver;\n this._rtl = false;\n this._data = ko.observable(null);\n this._actions = ko.observable([]);\n this._isVisible = ko.observable(true);\n this._pageSize = -1;\n this._walkCallback = null;\n this._isLoaded = ko.observable(false);\n this._actionsSubscription = null;\n this._subscriptions = [];\n this._visibleItemsCount = ko.observable(0);\n this._iconName = () => (ko.unwrap((this.data && this.data.icon) || (this.data && this.data.specifics)) || 'default').split('.').join('_').toLowerCase();\n this._nodeIsLocked = false;\n this.level = -1;\n this.items = ko.observableArray();\n this.collapsed = ko.observable(true);\n this.isSelected = ko.observable(false);\n this.isHovered = ko.observable(false);\n this.isMultiSelected = ko.observable(false);\n this.templates = {\n accordionItem: 'dx-treelist-accordion-item',\n headerItem: 'dx-treelist-header-item',\n headerItemContent: 'dx-treelist-header-item-caption-content',\n itemTextContent: 'dx-treelist-item-text-content',\n actionsContainer: 'dx-treelist-item-actions-container',\n };\n this._pageSize = options.pageSize || -1;\n this._path = path;\n this._rtl = rtl;\n if ('loadChildItemsForCollapsedNodes' in options)\n this._loadChildItemsForCollapsedNodes = options.loadChildItemsForCollapsedNodes;\n this._factory = options.factory || new DefaultTreeListItemFactory();\n this._treeListController = options.treeListController;\n this._templateName = options.templateName;\n this._onItemsVisibilityChanged = onItemsVisibilityChanged;\n this.dragDropHandler = options.treeListController.dragDropHandler;\n this._onItemsChangedCallback = options.onItemsChanged;\n this._visible = ko.computed(() => {\n if (this.data && this._treeListController.itemsFilter && !this._treeListController.itemsFilter(this.data, this.path, this))\n return false;\n return this._isVisible();\n });\n this.getItems = () => {\n if (this.items().length > 0)\n return $.Deferred().resolve(this.items()).promise();\n return this._loadItems(options);\n };\n this._initPaginate();\n this.toggleSelected = (_, event) => {\n if (event && (event.shiftKey || event.ctrlKey || event.metaKey) && this.selectedItems().length > 0 && this._treeListController.canMultiSelect && this._treeListController.canMultiSelect(this)) {\n options.selectedPath('');\n this._treeListController.multiSelect(this, event.shiftKey, event.ctrlKey || event.metaKey);\n }\n else if (this._treeListController.canSelect(this)) {\n options.treeListController.clickHandler && options.treeListController.clickHandler(this);\n options.selectedPath(this.path);\n }\n };\n if (options.treeListController.dblClickHandler) {\n this.dblClickHandler = (item) => {\n options.treeListController.dblClickHandler && options.treeListController.dblClickHandler(item);\n };\n }\n this.toggleCollapsed = () => {\n if (this.hasItems) {\n this.collapsed(!this.collapsed.peek());\n if (!this.collapsed.peek() && this.items().length === 0) {\n this._loadItems(options, this._getLoadChildItemsForCollapsedNodes()).always(() => { onItemsVisibilityChanged(); });\n }\n else if (this._getLoadChildItemsForCollapsedNodes()) {\n this.items().forEach((item) => {\n item._treeListController.hasItems(item.data) && item.items().length === 0 && item._loadItems(options);\n });\n onItemsVisibilityChanged();\n }\n }\n };\n this.nodeImageClass = this._getNodeImageClassName();\n this._subscriptions.push(this._visible.subscribe((newValue) => this._updataParentItemsVisibilityCount(newValue)));\n }\n _equal(obj1, obj2) {\n var ignore = ['innerActions', 'noDragable', 'dragData'];\n if (obj2 === obj1)\n return true;\n return Object.keys(obj2).filter(key => ignore.indexOf(key) === -1).every((key) => {\n return obj2[key] === obj1[key];\n });\n }\n _getImageClassName(showIcon) {\n return ko.computed(() => {\n return 'dx-image-fieldlist-'\n + this._iconName()\n + (!showIcon ? ' dx-treelist-image-empty' : '');\n });\n }\n _getImageTemplateName() {\n return ko.computed(() => {\n var _templateName = 'dxrd-svg-fieldlist-' + this._iconName();\n return SvgTemplatesEngine.getExistingTemplate(_templateName);\n });\n }\n _getNodeImageClassName() {\n return ko.computed({\n read: () => {\n var result = 'dx-collapsing-image';\n if (!this.hasItems) {\n return 'dx-image-leaf-node';\n }\n if (!this.collapsed())\n result += ' dx-image-expanded';\n return result;\n }\n });\n }\n _createItemsObj(items) {\n var obj = {};\n for (var i = 0; i < items.length; i++) {\n obj[items[i].name] = { item: items[i], index: i };\n }\n return obj;\n }\n _loadItems(options, loadInnerItems = false) {\n var deferred = $.Deferred();\n if (this._loader) {\n this._loader.dispose();\n }\n this._disposables.reverse().forEach(x => x.dispose && x.dispose());\n this._disposables.splice(0);\n var promise = ko.observable();\n var subscription = promise.subscribe((value) => {\n if (!value)\n return;\n value.done((data) => {\n if (this.isDisposing) {\n deferred.reject();\n return;\n }\n this._isLoaded(true);\n var _data = data;\n var items = this.items.peek();\n var dataObj = this._createItemsObj(_data);\n var isMutated = false;\n var splicedItems = 0;\n var tempItems = [].concat.apply([], items);\n for (var i = 0; i < tempItems.length; i++) {\n if (!dataObj[tempItems[i].data.name]) {\n tempItems[i].dispose();\n items.splice(i - splicedItems, 1);\n splicedItems++;\n isMutated = true;\n }\n }\n this._visibleItemsCount(this._visibleItemsCount() - splicedItems);\n var itemsObj = this._createItemsObj(items);\n var resorted = false;\n var showIconsForChildItems = !this._treeListController.showIconsForChildItems || this._treeListController.showIconsForChildItems(this);\n var showIconTemplate = this._treeListController.showIconsForChildItems && this._treeListController.showIconsForChildItems(this);\n _data.forEach((d, index) => {\n var currentItem = itemsObj[d.name];\n if (!currentItem) {\n isMutated = true;\n var newItem = this._factory.createItem(options, this.pathParts, this._onItemsVisibilityChanged, this._rtl, this.resolver);\n newItem.data = d;\n newItem.level = this.level + 1;\n newItem.parent = this;\n newItem.visible && this._visibleItemsCount(this._visibleItemsCount() + 1);\n newItem.padding = this._applyPadding(this._rtl ? 'right' : 'left', 20 * newItem.level + 12);\n newItem.imageClassName = newItem._getImageClassName(showIconsForChildItems);\n newItem.imageTemplateName = newItem._getImageTemplateName();\n newItem.showIcon = showIconTemplate;\n items.splice(index, 0, newItem);\n itemsObj[d.name] = { item: newItem, index: index };\n this._walkCallback && this._walkCallback(newItem);\n }\n else {\n if (!this._equal(d, currentItem.item.data))\n currentItem.item.data = d;\n if (!resorted)\n resorted = currentItem.index !== index;\n }\n });\n this._walkCallback = null;\n if (resorted) {\n var index = items.reduce((acc, x, index) => {\n var max = Math.abs(index - (dataObj[x.data.name] ? dataObj[x.data.name].index : -1));\n if (!acc || acc.max < max) {\n return { max, index };\n }\n return acc;\n }, null).index;\n var curItem = items[index];\n items.splice(index, 1);\n items.splice(dataObj[curItem.data.name] ? dataObj[curItem.data.name].index : -1, 0, curItem);\n isMutated = true;\n }\n dataObj = null;\n itemsObj = null;\n if (isMutated) {\n this.items.valueHasMutated();\n this._onItemsChanged();\n }\n if (!this.collapsed() || loadInnerItems) {\n var condition = (item) => item._treeListController.hasItems(item.data);\n if (this._loadChildItemsForCollapsedNodes !== undefined)\n condition = (item) => (!item.collapsed() || loadInnerItems) && item._treeListController.hasItems(item.data);\n this.items().forEach(item => {\n if (condition(item)) {\n item._loadItems(options);\n }\n });\n }\n deferred.resolve(this.items.peek());\n var selectedPath = options.selectedPath.peek();\n if (selectedPath) {\n var item2Select = this.items.peek().filter(item => { return selectedPath.indexOf(item.path) === 0; })[0];\n if (item2Select) {\n this._selectItem(item2Select.name + selectedPath.substring(item2Select.path.length));\n }\n }\n });\n });\n this._disposables.push({\n dispose: () => {\n subscription.dispose();\n promise(null);\n }\n });\n this._disposables.push(this._loader = ko.computed(() => {\n promise(options.itemsProvider.getItems(new PathRequest(this.path, this.pathParts)));\n }));\n return deferred.promise();\n }\n _onItemsChanged() {\n if (this._onItemsChangedCallback)\n this._onItemsChangedCallback(this.items());\n }\n _getTemplateName() {\n return this._templateName || this.data && this.data.templateName || 'dx-treelist-item';\n }\n _selectItem(itemPath) {\n if (!this.hasItems) {\n return;\n }\n var selectItemDelegate = () => {\n this._find(itemPath);\n if (this.collapsed.peek()) {\n this.toggleCollapsed();\n }\n };\n if (this.items.peek().length === 0) {\n this.getItems().done((items) => {\n selectItemDelegate();\n });\n }\n else {\n selectItemDelegate();\n }\n }\n _find(itemPath) {\n var item = itemPath && this.items.peek().filter(childItem => itemPath === childItem.name\n || itemPath.indexOf(childItem.name) === 0 && itemPath[childItem.name.length] === '.')[0];\n if (item) {\n if (itemPath.length > item.name.length) {\n item._selectItem(itemPath.substr(item.name.length + 1));\n }\n else {\n this._treeListController.select(item);\n }\n }\n }\n _getItemsWithLock() {\n var deffered = $.Deferred();\n if (this._nodeIsLocked)\n return deffered.reject().promise();\n this._nodeIsLocked = true;\n this.getItems().done(result => {\n this._nodeIsLocked = false;\n deffered.resolve(result);\n }).fail(() => {\n this._nodeIsLocked = false;\n deffered.reject();\n });\n return deffered.promise();\n }\n _applyPadding(position, value) {\n var padding = {};\n padding['padding-' + position] = value;\n return padding;\n }\n _getLoadChildItemsForCollapsedNodes() {\n return this._loadChildItemsForCollapsedNodes !== undefined ?\n this._loadChildItemsForCollapsedNodes : LoadChildItemsForCollapsedNodes();\n }\n _initPaginate() {\n if (this._pageSize === -1)\n return;\n this.maxItemsCount = ko.observable(this._pageSize);\n this.visibleItems = ko.computed(() => {\n if (this.items().length === 0)\n return [];\n var result = this.items().filter(x => x._isVisible.peek());\n if (result.length > this.maxItemsCount()) {\n result = result.slice(0, this.maxItemsCount());\n result.push(new TreeListEllipsisButton(this.maxItemsCount, result[0].padding, this._pageSize));\n }\n return result;\n });\n }\n _updataParentItemsVisibilityCount(visible) {\n var _a, _b;\n visible ? (_a = this.parent) === null || _a === void 0 ? void 0 : _a._visibleItemsCount(this.parent._visibleItemsCount() + 1)\n : (_b = this.parent) === null || _b === void 0 ? void 0 : _b._visibleItemsCount(Math.max(this.parent._visibleItemsCount() - 1, 0));\n }\n get hasItems() {\n if (!this.data) {\n return true;\n }\n var hasItems = this._treeListController.hasItems(this.data);\n if (this._loadChildItemsForCollapsedNodes != undefined) {\n return this._isLoaded() ?\n hasItems && this._visibleItemsCount() > 0 :\n hasItems;\n }\n return LoadChildItemsForCollapsedNodes() ?\n hasItems && this._visibleItemsCount() > 0 :\n hasItems;\n }\n get data() {\n return this._data();\n }\n set data(newVal) {\n this._data(newVal);\n this._actionsSubscription && this._actionsSubscription.dispose();\n this._actionsSubscription = ko.computed(() => {\n this._actions(this._treeListController && this._treeListController.getActions ? this._treeListController.getActions(this) : []);\n });\n }\n get name() {\n return ko.unwrap(this.data && this.data.name);\n }\n get path() {\n return this.pathParts.join('.');\n }\n get pathParts() {\n if (this.name) {\n return (ko.unwrap(this._path) || []).concat([this.name]);\n }\n else {\n return ko.unwrap(this._path);\n }\n }\n get text() {\n return this.data && this.data.displayName;\n }\n get templateName() {\n return this._getTemplateName();\n }\n actionsTemplate() {\n return this.data && ko.unwrap(this.data['actionsTemplate']) || 'dx-treelist-item-actions-with-edit';\n }\n treeListEditAction() {\n return treeListEditAction;\n }\n get hasContent() {\n return this.data && this.data['contenttemplate'];\n }\n get actions() {\n return this._actions();\n }\n get isDraggable() {\n if (this.data && this.data['dragData']) {\n return !this.data['dragData'].noDragable;\n }\n if (this._treeListController.isDraggable) {\n return this._treeListController.isDraggable(this);\n }\n return false;\n }\n get treeListController() {\n return this._treeListController;\n }\n dispose() {\n super.dispose();\n this._actions([]);\n this.visibleItems && this.visibleItems.dispose();\n this._actionsSubscription && this._actionsSubscription.dispose();\n this.disposeObservableArray(this.items);\n this.resetObservableArray(this.items);\n this._visibleItemsCount(0);\n this.parent = null;\n this._subscriptions.forEach(x => x.dispose());\n this._walkCallback = null;\n this._visible.dispose();\n }\n get visible() {\n return this._visible();\n }\n setVisible(value) {\n this._isVisible(value);\n if (value && this.parent && !this.parent.visible)\n this.parent.setVisible(true);\n }\n getCssRules() {\n return {\n 'dx-treelist-item-selected dxd-state-selected': this.isSelected() || this.isMultiSelected()\n };\n }\n mouseenter() {\n this.isHovered(true);\n }\n mouseleave() {\n this.isHovered(false);\n }\n selectedItems() {\n return this._treeListController.selectedItems && this._treeListController.selectedItems() || [];\n }\n}\nexport class TreeListRootItemViewModel extends TreeListItemViewModel {\n constructor(_options, path = [], onItemsVisibilityChanged = $.noop, rtl = false) {\n super(_options, path, onItemsVisibilityChanged, rtl);\n this._options = _options;\n this._resolver = new CodeResolver();\n this._selectedPathSubscription = null;\n this.resolver.done(() => {\n onItemsVisibilityChanged();\n });\n this._selectedPathSubscription = _options.selectedPath.subscribe((newPath) => {\n this._selectItem(!!this.path ? newPath.substr(this.path.length + 1) : newPath);\n });\n this._selectItem(!!this.path ? this.path + '.' + _options.selectedPath() : _options.selectedPath());\n }\n dispose() {\n super.dispose();\n this._resolver.clear();\n if (this._selectedPathSubscription) {\n this._selectedPathSubscription.dispose();\n this._selectedPathSubscription = null;\n }\n }\n walkOnTree(walkCallBack) {\n this._resolver.clear();\n this._visitNextNode(this, walkCallBack);\n if (this['_pageSize'] != -1)\n this._resolver.doneOnce(() => this.items.valueHasMutated());\n return { stop: () => this._resolver.clear() };\n }\n _visitNextNode(item, walkCallback = (_item) => { }) {\n var _a;\n if (item.data && !item.data.specifics)\n throw new Error('Specific should be set');\n if (item.level >= maxSearchLevel())\n return;\n var processItemsFunc = null;\n if (item.items().length > 0) {\n processItemsFunc = () => item.items().forEach(node => {\n walkCallback(node);\n this._visitNextNode(node, walkCallback);\n });\n }\n else if (!item.data || item.treeListController.hasItems(item.data)) {\n if ((_a = item.treeListController.searchOptions) === null || _a === void 0 ? void 0 : _a.autoLoadItems) {\n processItemsFunc = () => item._getItemsWithLock().done(result => {\n result.forEach((node) => {\n walkCallback(node);\n this._visitNextNode(node, walkCallback);\n });\n });\n }\n else {\n item['_walkCallback'] = (node) => {\n walkCallback(node);\n this._visitNextNode(node, walkCallback);\n };\n }\n }\n if (processItemsFunc)\n this._resolver.execute(processItemsFunc, 1);\n }\n _onItemsChanged() {\n if (this._options.expandRootItems)\n this.items().forEach(item => {\n item.collapsed(false);\n });\n super._onItemsChanged();\n }\n}\n","/**\r\n* DevExpress Analytics (widgets\\treelist\\options.js)\r\n* Version: 23.1.4\r\n* Build date: Jul 18, 2023\r\n* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n* License: https://www.devexpress.com/Support/EULAs/universal.xml\r\n*/\r\nimport { createGlobalModuleVariableFunc } from '../../serializer/_internal';\nexport var LoadChildItemsForCollapsedNodes = createGlobalModuleVariableFunc(true);\n","export const InfernoEffectHost = {\n lockCount: 0,\n lock() {\n this.lockCount++;\n },\n callbacks: [],\n callEffects() {\n this.lockCount--;\n if (this.lockCount < 0) {\n throw new Error('Unexpected Effect Call');\n }\n if (this.lockCount === 0) {\n const effects = this.callbacks;\n this.callbacks = [];\n effects.forEach((callback) => callback());\n }\n },\n};\n","import { Component, findDOMfromVNode } from 'inferno';\nimport { InfernoEffectHost } from './effect_host';\nconst areObjectsEqual = (firstObject, secondObject) => {\n const bothAreObjects = firstObject instanceof Object && secondObject instanceof Object;\n if (!bothAreObjects) {\n return firstObject === secondObject;\n }\n const firstObjectKeys = Object.keys(firstObject);\n const secondObjectKeys = Object.keys(secondObject);\n if (firstObjectKeys.length !== secondObjectKeys.length) {\n return false;\n }\n const hasDifferentElement = firstObjectKeys.some((key) => firstObject[key] !== secondObject[key]);\n return !hasDifferentElement;\n};\nexport class BaseInfernoComponent extends Component {\n constructor() {\n super(...arguments);\n this._pendingContext = this.context;\n }\n componentWillReceiveProps(_, context) {\n this._pendingContext = context !== null && context !== void 0 ? context : {};\n }\n shouldComponentUpdate(nextProps, nextState) {\n return (!areObjectsEqual(this.props, nextProps)\n || !areObjectsEqual(this.state, nextState)\n || !areObjectsEqual(this.context, this._pendingContext));\n }\n}\nexport class InfernoComponent extends BaseInfernoComponent {\n constructor() {\n super(...arguments);\n this._effects = [];\n }\n createEffects() {\n return [];\n }\n updateEffects() { }\n componentWillMount() {\n InfernoEffectHost.lock();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n componentWillUpdate(_nextProps, _nextState, _context) {\n InfernoEffectHost.lock();\n }\n componentDidMount() {\n InfernoEffectHost.callbacks.push(() => { this._effects = this.createEffects(); });\n InfernoEffectHost.callEffects();\n }\n componentDidUpdate() {\n InfernoEffectHost.callbacks.push(() => this.updateEffects());\n InfernoEffectHost.callEffects();\n }\n destroyEffects() {\n this._effects.forEach((e) => e.dispose());\n }\n componentWillUnmount() {\n this.destroyEffects();\n }\n}\nexport class InfernoWrapperComponent extends InfernoComponent {\n constructor() {\n super(...arguments);\n this.vDomElement = null;\n }\n vDomUpdateClasses() {\n const el = this.vDomElement;\n const currentClasses = el.className.length\n ? el.className.split(' ')\n : [];\n const addedClasses = currentClasses.filter((className) => el.dxClasses.previous.indexOf(className) < 0);\n const removedClasses = el.dxClasses.previous.filter((className) => currentClasses.indexOf(className) < 0);\n addedClasses.forEach((value) => {\n const indexInRemoved = el.dxClasses.removed.indexOf(value);\n if (indexInRemoved > -1) {\n el.dxClasses.removed.splice(indexInRemoved, 1);\n }\n else {\n el.dxClasses.added.push(value);\n }\n });\n removedClasses.forEach((value) => {\n const indexInAdded = el.dxClasses.added.indexOf(value);\n if (indexInAdded > -1) {\n el.dxClasses.added.splice(indexInAdded, 1);\n }\n else {\n el.dxClasses.removed.push(value);\n }\n });\n }\n componentDidMount() {\n const el = findDOMfromVNode(this.$LI, true);\n this.vDomElement = el;\n super.componentDidMount();\n el.dxClasses = el.dxClasses || {\n removed: [], added: [], previous: [],\n };\n el.dxClasses.previous = (el === null || el === void 0 ? void 0 : el.className.length) ? el.className.split(' ')\n : [];\n }\n componentDidUpdate() {\n super.componentDidUpdate();\n const el = this.vDomElement;\n if (el !== null) {\n el.dxClasses.added.forEach((className) => el.classList.add(className));\n el.dxClasses.removed.forEach((className) => el.classList.remove(className));\n el.dxClasses.previous = el.className.length\n ? el.className.split(' ')\n : [];\n }\n }\n shouldComponentUpdate(nextProps, nextState) {\n const shouldUpdate = super.shouldComponentUpdate(nextProps, nextState);\n if (shouldUpdate) {\n this.vDomUpdateClasses();\n }\n return shouldUpdate;\n }\n}\n","import { Component } from 'inferno';\nlet contextId = 0;\nexport const createContext = function (defaultValue) {\n const id = contextId++;\n return {\n id,\n defaultValue,\n Provider: class extends Component {\n getChildContext() {\n return Object.assign(Object.assign({}, this.context), { [id]: this.props.value || defaultValue });\n }\n render() {\n return this.props.children;\n }\n },\n };\n};\n","export class InfernoEffect {\n constructor(effect, dependency) {\n this.dependency = dependency;\n this.effect = effect;\n this.destroy = effect();\n }\n update(dependency) {\n const currentDependency = this.dependency;\n if (dependency) {\n this.dependency = dependency;\n }\n if (!dependency || dependency.some((d, i) => currentDependency[i] !== d)) {\n this.dispose();\n this.destroy = this.effect();\n }\n }\n dispose() {\n if (this.destroy) {\n this.destroy();\n }\n }\n}\n","import { rerender as reRender } from 'inferno';\nimport { InfernoEffect } from './effect';\nexport const createReRenderEffect = () => new InfernoEffect(() => {\n reRender();\n}, []);\n","export const ERROR_MSG = 'a runtime error occured! Use Inferno in development environment to find the error.';\nexport function isNullOrUndef(o) {\n return o === void 0 || o === null;\n}\nexport function isInvalid(o) {\n return o === null || o === false || o === true || o === void 0;\n}\nexport function isFunction(o) {\n return typeof o === 'function';\n}\nexport function isNull(o) {\n return o === null;\n}\nexport function throwError(message) {\n if (!message) {\n message = ERROR_MSG;\n }\n throw new Error(`Inferno Error: ${message}`);\n}\n","import { _CI, _HI, _M, _MCCC, _ME, _MFCC, _MP, _MR, EMPTY_OBJ, render, _RFC as renderFunctionalComponent, } from 'inferno';\nimport { isFunction, isInvalid, isNull, isNullOrUndef, throwError, } from './shared';\nfunction isSameInnerHTML(dom, innerHTML) {\n const tempdom = document.createElement('i');\n tempdom.innerHTML = innerHTML;\n return tempdom.innerHTML === dom.innerHTML;\n}\nfunction findLastDOMFromVNode(vNode) {\n let flags;\n let children;\n while (vNode) {\n flags = vNode.flags;\n if (flags & 2033 /* DOMRef */) {\n return vNode.dom;\n }\n children = vNode.children;\n if (flags & 8192 /* Fragment */) {\n vNode = vNode.childFlags === 2 /* HasVNodeChildren */ ? children : children[children.length - 1];\n }\n else if (flags & 4 /* ComponentClass */) {\n vNode = children.$LI;\n }\n else {\n vNode = children;\n }\n }\n return null;\n}\nfunction isSamePropsInnerHTML(dom, props) {\n return Boolean(props && props.dangerouslySetInnerHTML && props.dangerouslySetInnerHTML.__html && isSameInnerHTML(dom, props.dangerouslySetInnerHTML.__html));\n}\nfunction hydrateComponent(vNode, parentDOM, dom, context, isSVG, isClass, lifecycle) {\n const type = vNode.type;\n const ref = vNode.ref;\n const props = vNode.props || EMPTY_OBJ;\n let currentNode;\n if (isClass) {\n const instance = _CI(vNode, type, props, context, isSVG, lifecycle);\n const input = instance.$LI;\n currentNode = hydrateVNode(input, parentDOM, dom, instance.$CX, isSVG, lifecycle);\n _MCCC(ref, instance, lifecycle);\n }\n else {\n const input = _HI(renderFunctionalComponent(vNode, context));\n currentNode = hydrateVNode(input, parentDOM, dom, context, isSVG, lifecycle);\n vNode.children = input;\n _MFCC(vNode, lifecycle);\n }\n return currentNode;\n}\nfunction hydrateChildren(parentVNode, parentNode, currentNode, context, isSVG, lifecycle) {\n const childFlags = parentVNode.childFlags;\n const children = parentVNode.children;\n const props = parentVNode.props;\n const flags = parentVNode.flags;\n if (childFlags !== 1 /* HasInvalidChildren */) {\n if (childFlags === 2 /* HasVNodeChildren */) {\n if (isNull(currentNode)) {\n _M(children, parentNode, context, isSVG, null, lifecycle);\n }\n else {\n currentNode = hydrateVNode(children, parentNode, currentNode, context, isSVG, lifecycle);\n currentNode = currentNode ? currentNode.nextSibling : null;\n }\n }\n else if (childFlags === 16 /* HasTextChildren */) {\n if (isNull(currentNode)) {\n parentNode.appendChild(document.createTextNode(children));\n }\n else if (parentNode.childNodes.length !== 1 || currentNode.nodeType !== 3) {\n parentNode.textContent = children;\n }\n else if (currentNode.nodeValue !== children) {\n currentNode.nodeValue = children;\n }\n currentNode = null;\n }\n else if (childFlags & 12 /* MultipleChildren */) {\n let prevVNodeIsTextNode = false;\n for (let i = 0, len = children.length; i < len; ++i) {\n const child = children[i];\n if (isNull(currentNode) || (prevVNodeIsTextNode && (child.flags & 16 /* Text */) > 0)) {\n _M(child, parentNode, context, isSVG, currentNode, lifecycle);\n }\n else {\n currentNode = hydrateVNode(child, parentNode, currentNode, context, isSVG, lifecycle);\n currentNode = currentNode ? currentNode.nextSibling : null;\n }\n prevVNodeIsTextNode = (child.flags & 16 /* Text */) > 0;\n }\n }\n // clear any other DOM nodes, there should be only a single entry for the root\n if ((flags & 8192 /* Fragment */) === 0) {\n let nextSibling = null;\n while (currentNode) {\n nextSibling = currentNode.nextSibling;\n parentNode.removeChild(currentNode);\n currentNode = nextSibling;\n }\n }\n }\n else if (!isNull(parentNode.firstChild) && !isSamePropsInnerHTML(parentNode, props)) {\n parentNode.textContent = ''; // dom has content, but VNode has no children remove everything from DOM\n if (flags & 448 /* FormElement */) {\n // If element is form element, we need to clear defaultValue also\n parentNode.defaultValue = '';\n }\n }\n}\nfunction hydrateElement(vNode, parentDOM, dom, context, isSVG, lifecycle) {\n const props = vNode.props;\n const className = vNode.className;\n const flags = vNode.flags;\n const ref = vNode.ref;\n isSVG = isSVG || (flags & 32 /* SvgElement */) > 0;\n if (dom.nodeType !== 1) {\n _ME(vNode, null, context, isSVG, null, lifecycle);\n parentDOM.replaceChild(vNode.dom, dom);\n }\n else {\n vNode.dom = dom;\n hydrateChildren(vNode, dom, dom.firstChild, context, isSVG, lifecycle);\n if (!isNull(props)) {\n _MP(vNode, flags, props, dom, isSVG);\n }\n if (isNullOrUndef(className)) {\n if (dom.className !== '') {\n dom.removeAttribute('class');\n }\n }\n else if (isSVG) {\n dom.setAttribute('class', className);\n }\n else {\n dom.className = className;\n }\n _MR(ref, dom, lifecycle);\n }\n return vNode.dom;\n}\nfunction hydrateText(vNode, parentDOM, dom) {\n if (dom.nodeType !== 3) {\n parentDOM.replaceChild((vNode.dom = document.createTextNode(vNode.children)), dom);\n }\n else {\n const text = vNode.children;\n if (dom.nodeValue !== text) {\n dom.nodeValue = text;\n }\n vNode.dom = dom;\n }\n return vNode.dom;\n}\nfunction hydrateFragment(vNode, parentDOM, dom, context, isSVG, lifecycle) {\n const children = vNode.children;\n if (vNode.childFlags === 2 /* HasVNodeChildren */) {\n hydrateText(children, parentDOM, dom);\n return children.dom;\n }\n hydrateChildren(vNode, parentDOM, dom, context, isSVG, lifecycle);\n return findLastDOMFromVNode(children[children.length - 1]);\n}\nfunction hydrateVNode(vNode, parentDOM, currentDom, context, isSVG, lifecycle) {\n const flags = (vNode.flags |= 16384 /* InUse */);\n if (flags & 14 /* Component */) {\n return hydrateComponent(vNode, parentDOM, currentDom, context, isSVG, (flags & 4 /* ComponentClass */) > 0, lifecycle);\n }\n if (flags & 481 /* Element */) {\n return hydrateElement(vNode, parentDOM, currentDom, context, isSVG, lifecycle);\n }\n if (flags & 16 /* Text */) {\n return hydrateText(vNode, parentDOM, currentDom);\n }\n if (flags & 512 /* Void */) {\n return (vNode.dom = currentDom);\n }\n if (flags & 8192 /* Fragment */) {\n return hydrateFragment(vNode, parentDOM, currentDom, context, isSVG, lifecycle);\n }\n throwError();\n return null;\n}\nexport function hydrate(input, parentDOM, callback) {\n let dom = parentDOM.firstChild;\n if (isNull(dom)) {\n render(input, parentDOM, callback);\n }\n else {\n const lifecycle = [];\n if (!isInvalid(input)) {\n dom = hydrateVNode(input, parentDOM, dom, {}, false, lifecycle);\n }\n // clear any other DOM nodes, there should be only a single entry for the root\n while (dom && (dom = dom.nextSibling)) {\n parentDOM.removeChild(dom);\n }\n if (lifecycle.length > 0) {\n let listener;\n while ((listener = lifecycle.shift()) !== undefined) {\n listener();\n }\n }\n }\n parentDOM.$V = input;\n if (isFunction(callback)) {\n callback();\n }\n}\n","import { render } from 'inferno';\nimport { createElement } from 'inferno-create-element';\nconst getContainer = (props) => { var _a, _b; return ((_a = props.container) === null || _a === void 0 ? void 0 : _a.get(0)) || ((_b = props.item) === null || _b === void 0 ? void 0 : _b.get(0)); };\nexport function renderTemplate(template, props, _component) {\n setTimeout(() => {\n render(createElement(template, props), getContainer(props));\n }, 0);\n}\nexport const hasTemplate = (name, properties, _component) => {\n const value = properties[name];\n return !!value && typeof value !== 'string';\n};\n","const NUMBER_STYLES = new Set([\n 'animationIterationCount',\n 'borderImageOutset',\n 'borderImageSlice',\n 'border-imageWidth',\n 'boxFlex',\n 'boxFlexGroup',\n 'boxOrdinalGroup',\n 'columnCount',\n 'fillOpacity',\n 'flex',\n 'flexGrow',\n 'flexNegative',\n 'flexOrder',\n 'flexPositive',\n 'flexShrink',\n 'floodOpacity',\n 'fontWeight',\n 'gridColumn',\n 'gridRow',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'stopOpacity',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n]);\nconst isNumeric = (value) => {\n if (typeof value === 'number')\n return true;\n return !Number.isNaN(Number(value));\n};\nconst getNumberStyleValue = (style, value) => (NUMBER_STYLES.has(style) ? value : `${value}px`);\nconst uppercasePattern = /[A-Z]/g;\nconst kebabCase = (str) => str.replace(uppercasePattern, '-$&').toLowerCase();\nexport function normalizeStyles(styles) {\n if (!(styles instanceof Object)) {\n return undefined;\n }\n return Object\n .entries(styles)\n .reduce((acc, [key, value]) => {\n acc[kebabCase(key)] = isNumeric(value)\n ? getNumberStyleValue(key, value)\n : value;\n return acc;\n }, {});\n}\n","/**\n * http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist\n * @param locales\n */\nexport function CanonicalizeLocaleList(locales) {\n // TODO\n return Intl.getCanonicalLocales(locales);\n}\n","/**\n * https://tc39.es/ecma402/#sec-canonicalizetimezonename\n * @param tz\n */\nexport function CanonicalizeTimeZoneName(tz, _a) {\n var tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;\n var uppercasedTz = tz.toUpperCase();\n var uppercasedZones = Object.keys(tzData).reduce(function (all, z) {\n all[z.toUpperCase()] = z;\n return all;\n }, {});\n var ianaTimeZone = uppercaseLinks[uppercasedTz] || uppercasedZones[uppercasedTz];\n if (ianaTimeZone === 'Etc/UTC' || ianaTimeZone === 'Etc/GMT') {\n return 'UTC';\n }\n return ianaTimeZone;\n}\n","/**\n * https://tc39.es/ecma262/#sec-tostring\n */\nexport function ToString(o) {\n // Only symbol is irregular...\n if (typeof o === 'symbol') {\n throw TypeError('Cannot convert a Symbol value to a string');\n }\n return String(o);\n}\n/**\n * https://tc39.es/ecma262/#sec-tonumber\n * @param val\n */\nexport function ToNumber(val) {\n if (val === undefined) {\n return NaN;\n }\n if (val === null) {\n return +0;\n }\n if (typeof val === 'boolean') {\n return val ? 1 : +0;\n }\n if (typeof val === 'number') {\n return val;\n }\n if (typeof val === 'symbol' || typeof val === 'bigint') {\n throw new TypeError('Cannot convert symbol/bigint to number');\n }\n return Number(val);\n}\n/**\n * https://tc39.es/ecma262/#sec-tointeger\n * @param n\n */\nfunction ToInteger(n) {\n var number = ToNumber(n);\n if (isNaN(number) || SameValue(number, -0)) {\n return 0;\n }\n if (isFinite(number)) {\n return number;\n }\n var integer = Math.floor(Math.abs(number));\n if (number < 0) {\n integer = -integer;\n }\n if (SameValue(integer, -0)) {\n return 0;\n }\n return integer;\n}\n/**\n * https://tc39.es/ecma262/#sec-timeclip\n * @param time\n */\nexport function TimeClip(time) {\n if (!isFinite(time)) {\n return NaN;\n }\n if (Math.abs(time) > 8.64 * 1e15) {\n return NaN;\n }\n return ToInteger(time);\n}\n/**\n * https://tc39.es/ecma262/#sec-toobject\n * @param arg\n */\nexport function ToObject(arg) {\n if (arg == null) {\n throw new TypeError('undefined/null cannot be converted to object');\n }\n return Object(arg);\n}\n/**\n * https://www.ecma-international.org/ecma-262/11.0/index.html#sec-samevalue\n * @param x\n * @param y\n */\nexport function SameValue(x, y) {\n if (Object.is) {\n return Object.is(x, y);\n }\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n }\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n}\n/**\n * https://www.ecma-international.org/ecma-262/11.0/index.html#sec-arraycreate\n * @param len\n */\nexport function ArrayCreate(len) {\n return new Array(len);\n}\n/**\n * https://www.ecma-international.org/ecma-262/11.0/index.html#sec-hasownproperty\n * @param o\n * @param prop\n */\nexport function HasOwnProperty(o, prop) {\n return Object.prototype.hasOwnProperty.call(o, prop);\n}\n/**\n * https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type\n * @param x\n */\nexport function Type(x) {\n if (x === null) {\n return 'Null';\n }\n if (typeof x === 'undefined') {\n return 'Undefined';\n }\n if (typeof x === 'function' || typeof x === 'object') {\n return 'Object';\n }\n if (typeof x === 'number') {\n return 'Number';\n }\n if (typeof x === 'boolean') {\n return 'Boolean';\n }\n if (typeof x === 'string') {\n return 'String';\n }\n if (typeof x === 'symbol') {\n return 'Symbol';\n }\n if (typeof x === 'bigint') {\n return 'BigInt';\n }\n}\nvar MS_PER_DAY = 86400000;\n/**\n * https://www.ecma-international.org/ecma-262/11.0/index.html#eqn-modulo\n * @param x\n * @param y\n * @return k of the same sign as y\n */\nfunction mod(x, y) {\n return x - Math.floor(x / y) * y;\n}\n/**\n * https://tc39.es/ecma262/#eqn-Day\n * @param t\n */\nexport function Day(t) {\n return Math.floor(t / MS_PER_DAY);\n}\n/**\n * https://tc39.es/ecma262/#sec-week-day\n * @param t\n */\nexport function WeekDay(t) {\n return mod(Day(t) + 4, 7);\n}\n/**\n * https://tc39.es/ecma262/#sec-year-number\n * @param y\n */\nexport function DayFromYear(y) {\n return Date.UTC(y, 0) / MS_PER_DAY;\n}\n/**\n * https://tc39.es/ecma262/#sec-year-number\n * @param y\n */\nexport function TimeFromYear(y) {\n return Date.UTC(y, 0);\n}\n/**\n * https://tc39.es/ecma262/#sec-year-number\n * @param t\n */\nexport function YearFromTime(t) {\n return new Date(t).getUTCFullYear();\n}\nexport function DaysInYear(y) {\n if (y % 4 !== 0) {\n return 365;\n }\n if (y % 100 !== 0) {\n return 366;\n }\n if (y % 400 !== 0) {\n return 365;\n }\n return 366;\n}\nexport function DayWithinYear(t) {\n return Day(t) - DayFromYear(YearFromTime(t));\n}\nexport function InLeapYear(t) {\n return DaysInYear(YearFromTime(t)) === 365 ? 0 : 1;\n}\n/**\n * https://tc39.es/ecma262/#sec-month-number\n * @param t\n */\nexport function MonthFromTime(t) {\n var dwy = DayWithinYear(t);\n var leap = InLeapYear(t);\n if (dwy >= 0 && dwy < 31) {\n return 0;\n }\n if (dwy < 59 + leap) {\n return 1;\n }\n if (dwy < 90 + leap) {\n return 2;\n }\n if (dwy < 120 + leap) {\n return 3;\n }\n if (dwy < 151 + leap) {\n return 4;\n }\n if (dwy < 181 + leap) {\n return 5;\n }\n if (dwy < 212 + leap) {\n return 6;\n }\n if (dwy < 243 + leap) {\n return 7;\n }\n if (dwy < 273 + leap) {\n return 8;\n }\n if (dwy < 304 + leap) {\n return 9;\n }\n if (dwy < 334 + leap) {\n return 10;\n }\n if (dwy < 365 + leap) {\n return 11;\n }\n throw new Error('Invalid time');\n}\nexport function DateFromTime(t) {\n var dwy = DayWithinYear(t);\n var mft = MonthFromTime(t);\n var leap = InLeapYear(t);\n if (mft === 0) {\n return dwy + 1;\n }\n if (mft === 1) {\n return dwy - 30;\n }\n if (mft === 2) {\n return dwy - 58 - leap;\n }\n if (mft === 3) {\n return dwy - 89 - leap;\n }\n if (mft === 4) {\n return dwy - 119 - leap;\n }\n if (mft === 5) {\n return dwy - 150 - leap;\n }\n if (mft === 6) {\n return dwy - 180 - leap;\n }\n if (mft === 7) {\n return dwy - 211 - leap;\n }\n if (mft === 8) {\n return dwy - 242 - leap;\n }\n if (mft === 9) {\n return dwy - 272 - leap;\n }\n if (mft === 10) {\n return dwy - 303 - leap;\n }\n if (mft === 11) {\n return dwy - 333 - leap;\n }\n throw new Error('Invalid time');\n}\nvar HOURS_PER_DAY = 24;\nvar MINUTES_PER_HOUR = 60;\nvar SECONDS_PER_MINUTE = 60;\nvar MS_PER_SECOND = 1e3;\nvar MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;\nvar MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;\nexport function HourFromTime(t) {\n return mod(Math.floor(t / MS_PER_HOUR), HOURS_PER_DAY);\n}\nexport function MinFromTime(t) {\n return mod(Math.floor(t / MS_PER_MINUTE), MINUTES_PER_HOUR);\n}\nexport function SecFromTime(t) {\n return mod(Math.floor(t / MS_PER_SECOND), SECONDS_PER_MINUTE);\n}\nfunction IsCallable(fn) {\n return typeof fn === 'function';\n}\n/**\n * The abstract operation OrdinaryHasInstance implements\n * the default algorithm for determining if an object O\n * inherits from the instance object inheritance path\n * provided by constructor C.\n * @param C class\n * @param O object\n * @param internalSlots internalSlots\n */\nexport function OrdinaryHasInstance(C, O, internalSlots) {\n if (!IsCallable(C)) {\n return false;\n }\n if (internalSlots === null || internalSlots === void 0 ? void 0 : internalSlots.boundTargetFunction) {\n var BC = internalSlots === null || internalSlots === void 0 ? void 0 : internalSlots.boundTargetFunction;\n return O instanceof BC;\n }\n if (typeof O !== 'object') {\n return false;\n }\n var P = C.prototype;\n if (typeof P !== 'object') {\n throw new TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.');\n }\n return Object.prototype.isPrototypeOf.call(P, O);\n}\nexport function msFromTime(t) {\n return mod(t, MS_PER_SECOND);\n}\n","import { ToObject } from './262';\n/**\n * https://tc39.es/ecma402/#sec-coerceoptionstoobject\n * @param options\n * @returns\n */\nexport function CoerceOptionsToObject(options) {\n if (typeof options === 'undefined') {\n return Object.create(null);\n }\n return ToObject(options);\n}\n","export function DefaultNumberOption(val, min, max, fallback) {\n if (val !== undefined) {\n val = Number(val);\n if (isNaN(val) || val < min || val > max) {\n throw new RangeError(\"\".concat(val, \" is outside of range [\").concat(min, \", \").concat(max, \"]\"));\n }\n return Math.floor(val);\n }\n return fallback;\n}\n","/**\n * https://tc39.es/ecma402/#sec-getnumberoption\n * @param options\n * @param property\n * @param min\n * @param max\n * @param fallback\n */\nimport { DefaultNumberOption } from './DefaultNumberOption';\nexport function GetNumberOption(options, property, minimum, maximum, fallback) {\n var val = options[property];\n // @ts-expect-error\n return DefaultNumberOption(val, minimum, maximum, fallback);\n}\n","import { ToString } from './262';\n/**\n * https://tc39.es/ecma402/#sec-getoption\n * @param opts\n * @param prop\n * @param type\n * @param values\n * @param fallback\n */\nexport function GetOption(opts, prop, type, values, fallback) {\n if (typeof opts !== 'object') {\n throw new TypeError('Options must be an object');\n }\n var value = opts[prop];\n if (value !== undefined) {\n if (type !== 'boolean' && type !== 'string') {\n throw new TypeError('invalid type');\n }\n if (type === 'boolean') {\n value = Boolean(value);\n }\n if (type === 'string') {\n value = ToString(value);\n }\n if (values !== undefined && !values.filter(function (val) { return val == value; }).length) {\n throw new RangeError(\"\".concat(value, \" is not within \").concat(values.join(', ')));\n }\n return value;\n }\n return fallback;\n}\n","/**\n * https://tc39.es/ecma402/#sec-getoptionsobject\n * @param options\n * @returns\n */\nexport function GetOptionsObject(options) {\n if (typeof options === 'undefined') {\n return Object.create(null);\n }\n if (typeof options === 'object') {\n return options;\n }\n throw new TypeError('Options must be an object');\n}\n","/**\n * https://tc39.es/ecma402/#table-sanctioned-simple-unit-identifiers\n */\nexport var SANCTIONED_UNITS = [\n 'angle-degree',\n 'area-acre',\n 'area-hectare',\n 'concentr-percent',\n 'digital-bit',\n 'digital-byte',\n 'digital-gigabit',\n 'digital-gigabyte',\n 'digital-kilobit',\n 'digital-kilobyte',\n 'digital-megabit',\n 'digital-megabyte',\n 'digital-petabyte',\n 'digital-terabit',\n 'digital-terabyte',\n 'duration-day',\n 'duration-hour',\n 'duration-millisecond',\n 'duration-minute',\n 'duration-month',\n 'duration-second',\n 'duration-week',\n 'duration-year',\n 'length-centimeter',\n 'length-foot',\n 'length-inch',\n 'length-kilometer',\n 'length-meter',\n 'length-mile-scandinavian',\n 'length-mile',\n 'length-millimeter',\n 'length-yard',\n 'mass-gram',\n 'mass-kilogram',\n 'mass-ounce',\n 'mass-pound',\n 'mass-stone',\n 'temperature-celsius',\n 'temperature-fahrenheit',\n 'volume-fluid-ounce',\n 'volume-gallon',\n 'volume-liter',\n 'volume-milliliter',\n];\n// In CLDR, the unit name always follows the form `namespace-unit` pattern.\n// For example: `digital-bit` instead of `bit`. This function removes the namespace prefix.\nexport function removeUnitNamespace(unit) {\n return unit.slice(unit.indexOf('-') + 1);\n}\n/**\n * https://tc39.es/ecma402/#table-sanctioned-simple-unit-identifiers\n */\nexport var SIMPLE_UNITS = SANCTIONED_UNITS.map(removeUnitNamespace);\n/**\n * https://tc39.es/ecma402/#sec-issanctionedsimpleunitidentifier\n */\nexport function IsSanctionedSimpleUnitIdentifier(unitIdentifier) {\n return SIMPLE_UNITS.indexOf(unitIdentifier) > -1;\n}\n","/**\n * https://tc39.es/ecma402/#sec-isvalidtimezonename\n * @param tz\n * @param implDetails implementation details\n */\nexport function IsValidTimeZoneName(tz, _a) {\n var tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;\n var uppercasedTz = tz.toUpperCase();\n var zoneNames = new Set();\n var linkNames = new Set();\n Object.keys(tzData)\n .map(function (z) { return z.toUpperCase(); })\n .forEach(function (z) { return zoneNames.add(z); });\n Object.keys(uppercaseLinks).forEach(function (linkName) {\n linkNames.add(linkName.toUpperCase());\n zoneNames.add(uppercaseLinks[linkName].toUpperCase());\n });\n return zoneNames.has(uppercasedTz) || linkNames.has(uppercasedTz);\n}\n","/**\n * This follows https://tc39.es/ecma402/#sec-case-sensitivity-and-case-mapping\n * @param str string to convert\n */\nfunction toUpperCase(str) {\n return str.replace(/([a-z])/g, function (_, c) { return c.toUpperCase(); });\n}\nvar NOT_A_Z_REGEX = /[^A-Z]/;\n/**\n * https://tc39.es/ecma402/#sec-iswellformedcurrencycode\n */\nexport function IsWellFormedCurrencyCode(currency) {\n currency = toUpperCase(currency);\n if (currency.length !== 3) {\n return false;\n }\n if (NOT_A_Z_REGEX.test(currency)) {\n return false;\n }\n return true;\n}\n","import { IsSanctionedSimpleUnitIdentifier } from './IsSanctionedSimpleUnitIdentifier';\n/**\n * This follows https://tc39.es/ecma402/#sec-case-sensitivity-and-case-mapping\n * @param str string to convert\n */\nfunction toLowerCase(str) {\n return str.replace(/([A-Z])/g, function (_, c) { return c.toLowerCase(); });\n}\n/**\n * https://tc39.es/ecma402/#sec-iswellformedunitidentifier\n * @param unit\n */\nexport function IsWellFormedUnitIdentifier(unit) {\n unit = toLowerCase(unit);\n if (IsSanctionedSimpleUnitIdentifier(unit)) {\n return true;\n }\n var units = unit.split('-per-');\n if (units.length !== 2) {\n return false;\n }\n var numerator = units[0], denominator = units[1];\n if (!IsSanctionedSimpleUnitIdentifier(numerator) ||\n !IsSanctionedSimpleUnitIdentifier(denominator)) {\n return false;\n }\n return true;\n}\n","/**\n * The abstract operation ComputeExponentForMagnitude computes an exponent by which to scale a\n * number of the given magnitude (power of ten of the most significant digit) according to the\n * locale and the desired notation (scientific, engineering, or compact).\n */\nexport function ComputeExponentForMagnitude(numberFormat, magnitude, _a) {\n var getInternalSlots = _a.getInternalSlots;\n var internalSlots = getInternalSlots(numberFormat);\n var notation = internalSlots.notation, dataLocaleData = internalSlots.dataLocaleData, numberingSystem = internalSlots.numberingSystem;\n switch (notation) {\n case 'standard':\n return 0;\n case 'scientific':\n return magnitude;\n case 'engineering':\n return Math.floor(magnitude / 3) * 3;\n default: {\n // Let exponent be an implementation- and locale-dependent (ILD) integer by which to scale a\n // number of the given magnitude in compact notation for the current locale.\n var compactDisplay = internalSlots.compactDisplay, style = internalSlots.style, currencyDisplay = internalSlots.currencyDisplay;\n var thresholdMap = void 0;\n if (style === 'currency' && currencyDisplay !== 'name') {\n var currency = dataLocaleData.numbers.currency[numberingSystem] ||\n dataLocaleData.numbers.currency[dataLocaleData.numbers.nu[0]];\n thresholdMap = currency.short;\n }\n else {\n var decimal = dataLocaleData.numbers.decimal[numberingSystem] ||\n dataLocaleData.numbers.decimal[dataLocaleData.numbers.nu[0]];\n thresholdMap = compactDisplay === 'long' ? decimal.long : decimal.short;\n }\n if (!thresholdMap) {\n return 0;\n }\n var num = String(Math.pow(10, magnitude));\n var thresholds = Object.keys(thresholdMap); // TODO: this can be pre-processed\n if (num < thresholds[0]) {\n return 0;\n }\n if (num > thresholds[thresholds.length - 1]) {\n return thresholds[thresholds.length - 1].length - 1;\n }\n var i = thresholds.indexOf(num);\n if (i === -1) {\n return 0;\n }\n // See https://unicode.org/reports/tr35/tr35-numbers.html#Compact_Number_Formats\n // Special handling if the pattern is precisely `0`.\n var magnitudeKey = thresholds[i];\n // TODO: do we need to handle plural here?\n var compactPattern = thresholdMap[magnitudeKey].other;\n if (compactPattern === '0') {\n return 0;\n }\n // Example: in zh-TW, `10000000` maps to `0000萬`. So we need to return 8 - 4 = 4 here.\n return (magnitudeKey.length -\n thresholdMap[magnitudeKey].other.match(/0+/)[0].length);\n }\n }\n}\n","import { repeat, getMagnitude } from '../utils';\nexport function ToRawPrecision(x, minPrecision, maxPrecision) {\n var p = maxPrecision;\n var m;\n var e;\n var xFinal;\n if (x === 0) {\n m = repeat('0', p);\n e = 0;\n xFinal = 0;\n }\n else {\n var xToString = x.toString();\n // If xToString is formatted as scientific notation, the number is either very small or very\n // large. If the precision of the formatted string is lower that requested max precision, we\n // should still infer them from the formatted string, otherwise the formatted result might have\n // precision loss (e.g. 1e41 will not have 0 in every trailing digits).\n var xToStringExponentIndex = xToString.indexOf('e');\n var _a = xToString.split('e'), xToStringMantissa = _a[0], xToStringExponent = _a[1];\n var xToStringMantissaWithoutDecimalPoint = xToStringMantissa.replace('.', '');\n if (xToStringExponentIndex >= 0 &&\n xToStringMantissaWithoutDecimalPoint.length <= p) {\n e = +xToStringExponent;\n m =\n xToStringMantissaWithoutDecimalPoint +\n repeat('0', p - xToStringMantissaWithoutDecimalPoint.length);\n xFinal = x;\n }\n else {\n e = getMagnitude(x);\n var decimalPlaceOffset = e - p + 1;\n // n is the integer containing the required precision digits. To derive the formatted string,\n // we will adjust its decimal place in the logic below.\n var n = Math.round(adjustDecimalPlace(x, decimalPlaceOffset));\n // The rounding caused the change of magnitude, so we should increment `e` by 1.\n if (adjustDecimalPlace(n, p - 1) >= 10) {\n e = e + 1;\n // Divide n by 10 to swallow one precision.\n n = Math.floor(n / 10);\n }\n m = n.toString();\n // Equivalent of n * 10 ** (e - p + 1)\n xFinal = adjustDecimalPlace(n, p - 1 - e);\n }\n }\n var int;\n if (e >= p - 1) {\n m = m + repeat('0', e - p + 1);\n int = e + 1;\n }\n else if (e >= 0) {\n m = \"\".concat(m.slice(0, e + 1), \".\").concat(m.slice(e + 1));\n int = e + 1;\n }\n else {\n m = \"0.\".concat(repeat('0', -e - 1)).concat(m);\n int = 1;\n }\n if (m.indexOf('.') >= 0 && maxPrecision > minPrecision) {\n var cut = maxPrecision - minPrecision;\n while (cut > 0 && m[m.length - 1] === '0') {\n m = m.slice(0, -1);\n cut--;\n }\n if (m[m.length - 1] === '.') {\n m = m.slice(0, -1);\n }\n }\n return { formattedString: m, roundedNumber: xFinal, integerDigitsCount: int };\n // x / (10 ** magnitude), but try to preserve as much floating point precision as possible.\n function adjustDecimalPlace(x, magnitude) {\n return magnitude < 0 ? x * Math.pow(10, -magnitude) : x / Math.pow(10, magnitude);\n }\n}\n","import { repeat } from '../utils';\n/**\n * TODO: dedup with intl-pluralrules and support BigInt\n * https://tc39.es/ecma402/#sec-torawfixed\n * @param x a finite non-negative Number or BigInt\n * @param minFraction and integer between 0 and 20\n * @param maxFraction and integer between 0 and 20\n */\nexport function ToRawFixed(x, minFraction, maxFraction) {\n var f = maxFraction;\n var n = Math.round(x * Math.pow(10, f));\n var xFinal = n / Math.pow(10, f);\n // n is a positive integer, but it is possible to be greater than 1e21.\n // In such case we will go the slow path.\n // See also: https://tc39.es/ecma262/#sec-numeric-types-number-tostring\n var m;\n if (n < 1e21) {\n m = n.toString();\n }\n else {\n m = n.toString();\n var _a = m.split('e'), mantissa = _a[0], exponent = _a[1];\n m = mantissa.replace('.', '');\n m = m + repeat('0', Math.max(+exponent - m.length + 1, 0));\n }\n var int;\n if (f !== 0) {\n var k = m.length;\n if (k <= f) {\n var z = repeat('0', f + 1 - k);\n m = z + m;\n k = f + 1;\n }\n var a = m.slice(0, k - f);\n var b = m.slice(k - f);\n m = \"\".concat(a, \".\").concat(b);\n int = a.length;\n }\n else {\n int = m.length;\n }\n var cut = maxFraction - minFraction;\n while (cut > 0 && m[m.length - 1] === '0') {\n m = m.slice(0, -1);\n cut--;\n }\n if (m[m.length - 1] === '.') {\n m = m.slice(0, -1);\n }\n return { formattedString: m, roundedNumber: xFinal, integerDigitsCount: int };\n}\n","import { SameValue } from '../262';\nimport { ToRawPrecision } from './ToRawPrecision';\nimport { repeat } from '../utils';\nimport { ToRawFixed } from './ToRawFixed';\n/**\n * https://tc39.es/ecma402/#sec-formatnumberstring\n */\nexport function FormatNumericToString(intlObject, x) {\n var isNegative = x < 0 || SameValue(x, -0);\n if (isNegative) {\n x = -x;\n }\n var result;\n var rourndingType = intlObject.roundingType;\n switch (rourndingType) {\n case 'significantDigits':\n result = ToRawPrecision(x, intlObject.minimumSignificantDigits, intlObject.maximumSignificantDigits);\n break;\n case 'fractionDigits':\n result = ToRawFixed(x, intlObject.minimumFractionDigits, intlObject.maximumFractionDigits);\n break;\n default:\n result = ToRawPrecision(x, 1, 2);\n if (result.integerDigitsCount > 1) {\n result = ToRawFixed(x, 0, 0);\n }\n break;\n }\n x = result.roundedNumber;\n var string = result.formattedString;\n var int = result.integerDigitsCount;\n var minInteger = intlObject.minimumIntegerDigits;\n if (int < minInteger) {\n var forwardZeros = repeat('0', minInteger - int);\n string = forwardZeros + string;\n }\n if (isNegative) {\n x = -x;\n }\n return { roundedNumber: x, formattedString: string };\n}\n","import { getMagnitude } from '../utils';\nimport { ComputeExponentForMagnitude } from './ComputeExponentForMagnitude';\nimport { FormatNumericToString } from './FormatNumericToString';\n/**\n * The abstract operation ComputeExponent computes an exponent (power of ten) by which to scale x\n * according to the number formatting settings. It handles cases such as 999 rounding up to 1000,\n * requiring a different exponent.\n *\n * NOT IN SPEC: it returns [exponent, magnitude].\n */\nexport function ComputeExponent(numberFormat, x, _a) {\n var getInternalSlots = _a.getInternalSlots;\n if (x === 0) {\n return [0, 0];\n }\n if (x < 0) {\n x = -x;\n }\n var magnitude = getMagnitude(x);\n var exponent = ComputeExponentForMagnitude(numberFormat, magnitude, {\n getInternalSlots: getInternalSlots,\n });\n // Preserve more precision by doing multiplication when exponent is negative.\n x = exponent < 0 ? x * Math.pow(10, -exponent) : x / Math.pow(10, exponent);\n var formatNumberResult = FormatNumericToString(getInternalSlots(numberFormat), x);\n if (formatNumberResult.roundedNumber === 0) {\n return [exponent, magnitude];\n }\n var newMagnitude = getMagnitude(formatNumberResult.roundedNumber);\n if (newMagnitude === magnitude - exponent) {\n return [exponent, magnitude];\n }\n return [\n ComputeExponentForMagnitude(numberFormat, magnitude + 1, {\n getInternalSlots: getInternalSlots,\n }),\n magnitude + 1,\n ];\n}\n","import { HasOwnProperty } from '../262';\n/**\n * https://tc39.es/ecma402/#sec-currencydigits\n */\nexport function CurrencyDigits(c, _a) {\n var currencyDigitsData = _a.currencyDigitsData;\n return HasOwnProperty(currencyDigitsData, c)\n ? currencyDigitsData[c]\n : 2;\n}\n","export var digitMapping = { \"adlm\": [\"𞥐\", \"𞥑\", \"𞥒\", \"𞥓\", \"𞥔\", \"𞥕\", \"𞥖\", \"𞥗\", \"𞥘\", \"𞥙\"], \"ahom\": [\"𑜰\", \"𑜱\", \"𑜲\", \"𑜳\", \"𑜴\", \"𑜵\", \"𑜶\", \"𑜷\", \"𑜸\", \"𑜹\"], \"arab\": [\"٠\", \"١\", \"٢\", \"٣\", \"٤\", \"٥\", \"٦\", \"٧\", \"٨\", \"٩\"], \"arabext\": [\"۰\", \"۱\", \"۲\", \"۳\", \"۴\", \"۵\", \"۶\", \"۷\", \"۸\", \"۹\"], \"bali\": [\"᭐\", \"᭑\", \"᭒\", \"᭓\", \"᭔\", \"᭕\", \"᭖\", \"᭗\", \"᭘\", \"᭙\"], \"beng\": [\"০\", \"১\", \"২\", \"৩\", \"৪\", \"৫\", \"৬\", \"৭\", \"৮\", \"৯\"], \"bhks\": [\"𑱐\", \"𑱑\", \"𑱒\", \"𑱓\", \"𑱔\", \"𑱕\", \"𑱖\", \"𑱗\", \"𑱘\", \"𑱙\"], \"brah\": [\"𑁦\", \"𑁧\", \"𑁨\", \"𑁩\", \"𑁪\", \"𑁫\", \"𑁬\", \"𑁭\", \"𑁮\", \"𑁯\"], \"cakm\": [\"𑄶\", \"𑄷\", \"𑄸\", \"𑄹\", \"𑄺\", \"𑄻\", \"𑄼\", \"𑄽\", \"𑄾\", \"𑄿\"], \"cham\": [\"꩐\", \"꩑\", \"꩒\", \"꩓\", \"꩔\", \"꩕\", \"꩖\", \"꩗\", \"꩘\", \"꩙\"], \"deva\": [\"०\", \"१\", \"२\", \"३\", \"४\", \"५\", \"६\", \"७\", \"८\", \"९\"], \"diak\": [\"𑥐\", \"𑥑\", \"𑥒\", \"𑥓\", \"𑥔\", \"𑥕\", \"𑥖\", \"𑥗\", \"𑥘\", \"𑥙\"], \"fullwide\": [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"], \"gong\": [\"𑶠\", \"𑶡\", \"𑶢\", \"𑶣\", \"𑶤\", \"𑶥\", \"𑶦\", \"𑶧\", \"𑶨\", \"𑶩\"], \"gonm\": [\"𑵐\", \"𑵑\", \"𑵒\", \"𑵓\", \"𑵔\", \"𑵕\", \"𑵖\", \"𑵗\", \"𑵘\", \"𑵙\"], \"gujr\": [\"૦\", \"૧\", \"૨\", \"૩\", \"૪\", \"૫\", \"૬\", \"૭\", \"૮\", \"૯\"], \"guru\": [\"੦\", \"੧\", \"੨\", \"੩\", \"੪\", \"੫\", \"੬\", \"੭\", \"੮\", \"੯\"], \"hanidec\": [\"〇\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\", \"七\", \"八\", \"九\"], \"hmng\": [\"𖭐\", \"𖭑\", \"𖭒\", \"𖭓\", \"𖭔\", \"𖭕\", \"𖭖\", \"𖭗\", \"𖭘\", \"𖭙\"], \"hmnp\": [\"𞅀\", \"𞅁\", \"𞅂\", \"𞅃\", \"𞅄\", \"𞅅\", \"𞅆\", \"𞅇\", \"𞅈\", \"𞅉\"], \"java\": [\"꧐\", \"꧑\", \"꧒\", \"꧓\", \"꧔\", \"꧕\", \"꧖\", \"꧗\", \"꧘\", \"꧙\"], \"kali\": [\"꤀\", \"꤁\", \"꤂\", \"꤃\", \"꤄\", \"꤅\", \"꤆\", \"꤇\", \"꤈\", \"꤉\"], \"khmr\": [\"០\", \"១\", \"២\", \"៣\", \"៤\", \"៥\", \"៦\", \"៧\", \"៨\", \"៩\"], \"knda\": [\"೦\", \"೧\", \"೨\", \"೩\", \"೪\", \"೫\", \"೬\", \"೭\", \"೮\", \"೯\"], \"lana\": [\"᪀\", \"᪁\", \"᪂\", \"᪃\", \"᪄\", \"᪅\", \"᪆\", \"᪇\", \"᪈\", \"᪉\"], \"lanatham\": [\"᪐\", \"᪑\", \"᪒\", \"᪓\", \"᪔\", \"᪕\", \"᪖\", \"᪗\", \"᪘\", \"᪙\"], \"laoo\": [\"໐\", \"໑\", \"໒\", \"໓\", \"໔\", \"໕\", \"໖\", \"໗\", \"໘\", \"໙\"], \"lepc\": [\"᪐\", \"᪑\", \"᪒\", \"᪓\", \"᪔\", \"᪕\", \"᪖\", \"᪗\", \"᪘\", \"᪙\"], \"limb\": [\"᥆\", \"᥇\", \"᥈\", \"᥉\", \"᥊\", \"᥋\", \"᥌\", \"᥍\", \"᥎\", \"᥏\"], \"mathbold\": [\"𝟎\", \"𝟏\", \"𝟐\", \"𝟑\", \"𝟒\", \"𝟓\", \"𝟔\", \"𝟕\", \"𝟖\", \"𝟗\"], \"mathdbl\": [\"𝟘\", \"𝟙\", \"𝟚\", \"𝟛\", \"𝟜\", \"𝟝\", \"𝟞\", \"𝟟\", \"𝟠\", \"𝟡\"], \"mathmono\": [\"𝟶\", \"𝟷\", \"𝟸\", \"𝟹\", \"𝟺\", \"𝟻\", \"𝟼\", \"𝟽\", \"𝟾\", \"𝟿\"], \"mathsanb\": [\"𝟬\", \"𝟭\", \"𝟮\", \"𝟯\", \"𝟰\", \"𝟱\", \"𝟲\", \"𝟳\", \"𝟴\", \"𝟵\"], \"mathsans\": [\"𝟢\", \"𝟣\", \"𝟤\", \"𝟥\", \"𝟦\", \"𝟧\", \"𝟨\", \"𝟩\", \"𝟪\", \"𝟫\"], \"mlym\": [\"൦\", \"൧\", \"൨\", \"൩\", \"൪\", \"൫\", \"൬\", \"൭\", \"൮\", \"൯\"], \"modi\": [\"𑙐\", \"𑙑\", \"𑙒\", \"𑙓\", \"𑙔\", \"𑙕\", \"𑙖\", \"𑙗\", \"𑙘\", \"𑙙\"], \"mong\": [\"᠐\", \"᠑\", \"᠒\", \"᠓\", \"᠔\", \"᠕\", \"᠖\", \"᠗\", \"᠘\", \"᠙\"], \"mroo\": [\"𖩠\", \"𖩡\", \"𖩢\", \"𖩣\", \"𖩤\", \"𖩥\", \"𖩦\", \"𖩧\", \"𖩨\", \"𖩩\"], \"mtei\": [\"꯰\", \"꯱\", \"꯲\", \"꯳\", \"꯴\", \"꯵\", \"꯶\", \"꯷\", \"꯸\", \"꯹\"], \"mymr\": [\"၀\", \"၁\", \"၂\", \"၃\", \"၄\", \"၅\", \"၆\", \"၇\", \"၈\", \"၉\"], \"mymrshan\": [\"႐\", \"႑\", \"႒\", \"႓\", \"႔\", \"႕\", \"႖\", \"႗\", \"႘\", \"႙\"], \"mymrtlng\": [\"꧰\", \"꧱\", \"꧲\", \"꧳\", \"꧴\", \"꧵\", \"꧶\", \"꧷\", \"꧸\", \"꧹\"], \"newa\": [\"𑑐\", \"𑑑\", \"𑑒\", \"𑑓\", \"𑑔\", \"𑑕\", \"𑑖\", \"𑑗\", \"𑑘\", \"𑑙\"], \"nkoo\": [\"߀\", \"߁\", \"߂\", \"߃\", \"߄\", \"߅\", \"߆\", \"߇\", \"߈\", \"߉\"], \"olck\": [\"᱐\", \"᱑\", \"᱒\", \"᱓\", \"᱔\", \"᱕\", \"᱖\", \"᱗\", \"᱘\", \"᱙\"], \"orya\": [\"୦\", \"୧\", \"୨\", \"୩\", \"୪\", \"୫\", \"୬\", \"୭\", \"୮\", \"୯\"], \"osma\": [\"𐒠\", \"𐒡\", \"𐒢\", \"𐒣\", \"𐒤\", \"𐒥\", \"𐒦\", \"𐒧\", \"𐒨\", \"𐒩\"], \"rohg\": [\"𐴰\", \"𐴱\", \"𐴲\", \"𐴳\", \"𐴴\", \"𐴵\", \"𐴶\", \"𐴷\", \"𐴸\", \"𐴹\"], \"saur\": [\"꣐\", \"꣑\", \"꣒\", \"꣓\", \"꣔\", \"꣕\", \"꣖\", \"꣗\", \"꣘\", \"꣙\"], \"segment\": [\"🯰\", \"🯱\", \"🯲\", \"🯳\", \"🯴\", \"🯵\", \"🯶\", \"🯷\", \"🯸\", \"🯹\"], \"shrd\": [\"𑇐\", \"𑇑\", \"𑇒\", \"𑇓\", \"𑇔\", \"𑇕\", \"𑇖\", \"𑇗\", \"𑇘\", \"𑇙\"], \"sind\": [\"𑋰\", \"𑋱\", \"𑋲\", \"𑋳\", \"𑋴\", \"𑋵\", \"𑋶\", \"𑋷\", \"𑋸\", \"𑋹\"], \"sinh\": [\"෦\", \"෧\", \"෨\", \"෩\", \"෪\", \"෫\", \"෬\", \"෭\", \"෮\", \"෯\"], \"sora\": [\"𑃰\", \"𑃱\", \"𑃲\", \"𑃳\", \"𑃴\", \"𑃵\", \"𑃶\", \"𑃷\", \"𑃸\", \"𑃹\"], \"sund\": [\"᮰\", \"᮱\", \"᮲\", \"᮳\", \"᮴\", \"᮵\", \"᮶\", \"᮷\", \"᮸\", \"᮹\"], \"takr\": [\"𑛀\", \"𑛁\", \"𑛂\", \"𑛃\", \"𑛄\", \"𑛅\", \"𑛆\", \"𑛇\", \"𑛈\", \"𑛉\"], \"talu\": [\"᧐\", \"᧑\", \"᧒\", \"᧓\", \"᧔\", \"᧕\", \"᧖\", \"᧗\", \"᧘\", \"᧙\"], \"tamldec\": [\"௦\", \"௧\", \"௨\", \"௩\", \"௪\", \"௫\", \"௬\", \"௭\", \"௮\", \"௯\"], \"telu\": [\"౦\", \"౧\", \"౨\", \"౩\", \"౪\", \"౫\", \"౬\", \"౭\", \"౮\", \"౯\"], \"thai\": [\"๐\", \"๑\", \"๒\", \"๓\", \"๔\", \"๕\", \"๖\", \"๗\", \"๘\", \"๙\"], \"tibt\": [\"༠\", \"༡\", \"༢\", \"༣\", \"༤\", \"༥\", \"༦\", \"༧\", \"༨\", \"༩\"], \"tirh\": [\"𑓐\", \"𑓑\", \"𑓒\", \"𑓓\", \"𑓔\", \"𑓕\", \"𑓖\", \"𑓗\", \"𑓘\", \"𑓙\"], \"vaii\": [\"ᘠ\", \"ᘡ\", \"ᘢ\", \"ᘣ\", \"ᘤ\", \"ᘥ\", \"ᘦ\", \"ᘧ\", \"ᘨ\", \"ᘩ\"], \"wara\": [\"𑣠\", \"𑣡\", \"𑣢\", \"𑣣\", \"𑣤\", \"𑣥\", \"𑣦\", \"𑣧\", \"𑣨\", \"𑣩\"], \"wcho\": [\"𞋰\", \"𞋱\", \"𞋲\", \"𞋳\", \"𞋴\", \"𞋵\", \"𞋶\", \"𞋷\", \"𞋸\", \"𞋹\"] };\n","// @generated from regex-gen.ts\nexport var S_UNICODE_REGEX = /[\\$\\+<->\\^`\\|~\\xA2-\\xA6\\xA8\\xA9\\xAC\\xAE-\\xB1\\xB4\\xB8\\xD7\\xF7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u07FE\\u07FF\\u09F2\\u09F3\\u09FA\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20BF\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2426\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2B95\\u2B97-\\u2BFF\\u2CE5-\\u2CEA\\u2E50\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u309B\\u309C\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E3\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A\\uAB6B\\uFB29\\uFBB2-\\uFBC1\\uFDFC\\uFDFD\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC\\uFFFD]|\\uD800[\\uDD37-\\uDD3F\\uDD79-\\uDD89\\uDD8C-\\uDD8E\\uDD90-\\uDD9C\\uDDA0\\uDDD0-\\uDDFC]|\\uD802[\\uDC77\\uDC78\\uDEC8]|\\uD805\\uDF3F|\\uD807[\\uDFD5-\\uDFF1]|\\uD81A[\\uDF3C-\\uDF3F\\uDF45]|\\uD82F\\uDC9C|\\uD834[\\uDC00-\\uDCF5\\uDD00-\\uDD26\\uDD29-\\uDD64\\uDD6A-\\uDD6C\\uDD83\\uDD84\\uDD8C-\\uDDA9\\uDDAE-\\uDDE8\\uDE00-\\uDE41\\uDE45\\uDF00-\\uDF56]|\\uD835[\\uDEC1\\uDEDB\\uDEFB\\uDF15\\uDF35\\uDF4F\\uDF6F\\uDF89\\uDFA9\\uDFC3]|\\uD836[\\uDC00-\\uDDFF\\uDE37-\\uDE3A\\uDE6D-\\uDE74\\uDE76-\\uDE83\\uDE85\\uDE86]|\\uD838[\\uDD4F\\uDEFF]|\\uD83B[\\uDCAC\\uDCB0\\uDD2E\\uDEF0\\uDEF1]|\\uD83C[\\uDC00-\\uDC2B\\uDC30-\\uDC93\\uDCA0-\\uDCAE\\uDCB1-\\uDCBF\\uDCC1-\\uDCCF\\uDCD1-\\uDCF5\\uDD0D-\\uDDAD\\uDDE6-\\uDE02\\uDE10-\\uDE3B\\uDE40-\\uDE48\\uDE50\\uDE51\\uDE60-\\uDE65\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDED7\\uDEE0-\\uDEEC\\uDEF0-\\uDEFC\\uDF00-\\uDF73\\uDF80-\\uDFD8\\uDFE0-\\uDFEB]|\\uD83E[\\uDC00-\\uDC0B\\uDC10-\\uDC47\\uDC50-\\uDC59\\uDC60-\\uDC87\\uDC90-\\uDCAD\\uDCB0\\uDCB1\\uDD00-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDE53\\uDE60-\\uDE6D\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6\\uDF00-\\uDF92\\uDF94-\\uDFCA]/;\n","import { ToRawFixed } from './ToRawFixed';\nimport { digitMapping } from './digit-mapping.generated';\nimport { S_UNICODE_REGEX } from '../regex.generated';\n// This is from: unicode-12.1.0/General_Category/Symbol/regex.js\n// IE11 does not support unicode flag, otherwise this is just /\\p{S}/u.\n// /^\\p{S}/u\nvar CARET_S_UNICODE_REGEX = new RegExp(\"^\".concat(S_UNICODE_REGEX.source));\n// /\\p{S}$/u\nvar S_DOLLAR_UNICODE_REGEX = new RegExp(\"\".concat(S_UNICODE_REGEX.source, \"$\"));\nvar CLDR_NUMBER_PATTERN = /[#0](?:[\\.,][#0]+)*/g;\nexport default function formatToParts(numberResult, data, pl, options) {\n var sign = numberResult.sign, exponent = numberResult.exponent, magnitude = numberResult.magnitude;\n var notation = options.notation, style = options.style, numberingSystem = options.numberingSystem;\n var defaultNumberingSystem = data.numbers.nu[0];\n // #region Part 1: partition and interpolate the CLDR number pattern.\n // ----------------------------------------------------------\n var compactNumberPattern = null;\n if (notation === 'compact' && magnitude) {\n compactNumberPattern = getCompactDisplayPattern(numberResult, pl, data, style, options.compactDisplay, options.currencyDisplay, numberingSystem);\n }\n // This is used multiple times\n var nonNameCurrencyPart;\n if (style === 'currency' && options.currencyDisplay !== 'name') {\n var byCurrencyDisplay = data.currencies[options.currency];\n if (byCurrencyDisplay) {\n switch (options.currencyDisplay) {\n case 'code':\n nonNameCurrencyPart = options.currency;\n break;\n case 'symbol':\n nonNameCurrencyPart = byCurrencyDisplay.symbol;\n break;\n default:\n nonNameCurrencyPart = byCurrencyDisplay.narrow;\n break;\n }\n }\n else {\n // Fallback for unknown currency\n nonNameCurrencyPart = options.currency;\n }\n }\n var numberPattern;\n if (!compactNumberPattern) {\n // Note: if the style is unit, or is currency and the currency display is name,\n // its unit parts will be interpolated in part 2. So here we can fallback to decimal.\n if (style === 'decimal' ||\n style === 'unit' ||\n (style === 'currency' && options.currencyDisplay === 'name')) {\n // Shortcut for decimal\n var decimalData = data.numbers.decimal[numberingSystem] ||\n data.numbers.decimal[defaultNumberingSystem];\n numberPattern = getPatternForSign(decimalData.standard, sign);\n }\n else if (style === 'currency') {\n var currencyData = data.numbers.currency[numberingSystem] ||\n data.numbers.currency[defaultNumberingSystem];\n // We replace number pattern part with `0` for easier postprocessing.\n numberPattern = getPatternForSign(currencyData[options.currencySign], sign);\n }\n else {\n // percent\n var percentPattern = data.numbers.percent[numberingSystem] ||\n data.numbers.percent[defaultNumberingSystem];\n numberPattern = getPatternForSign(percentPattern, sign);\n }\n }\n else {\n numberPattern = compactNumberPattern;\n }\n // Extract the decimal number pattern string. It looks like \"#,##0,00\", which will later be\n // used to infer decimal group sizes.\n var decimalNumberPattern = CLDR_NUMBER_PATTERN.exec(numberPattern)[0];\n // Now we start to substitute patterns\n // 1. replace strings like `0` and `#,##0.00` with `{0}`\n // 2. unquote characters (invariant: the quoted characters does not contain the special tokens)\n numberPattern = numberPattern\n .replace(CLDR_NUMBER_PATTERN, '{0}')\n .replace(/'(.)'/g, '$1');\n // Handle currency spacing (both compact and non-compact).\n if (style === 'currency' && options.currencyDisplay !== 'name') {\n var currencyData = data.numbers.currency[numberingSystem] ||\n data.numbers.currency[defaultNumberingSystem];\n // See `currencySpacing` substitution rule in TR-35.\n // Here we always assume the currencyMatch is \"[:^S:]\" and surroundingMatch is \"[:digit:]\".\n //\n // Example 1: for pattern \"#,##0.00¤\" with symbol \"US$\", we replace \"¤\" with the symbol,\n // but insert an extra non-break space before the symbol, because \"[:^S:]\" matches \"U\" in\n // \"US$\" and \"[:digit:]\" matches the latn numbering system digits.\n //\n // Example 2: for pattern \"¤#,##0.00\" with symbol \"US$\", there is no spacing between symbol\n // and number, because `$` does not match \"[:^S:]\".\n //\n // Implementation note: here we do the best effort to infer the insertion.\n // We also assume that `beforeInsertBetween` and `afterInsertBetween` will never be `;`.\n var afterCurrency = currencyData.currencySpacing.afterInsertBetween;\n if (afterCurrency && !S_DOLLAR_UNICODE_REGEX.test(nonNameCurrencyPart)) {\n numberPattern = numberPattern.replace('¤{0}', \"\\u00A4\".concat(afterCurrency, \"{0}\"));\n }\n var beforeCurrency = currencyData.currencySpacing.beforeInsertBetween;\n if (beforeCurrency && !CARET_S_UNICODE_REGEX.test(nonNameCurrencyPart)) {\n numberPattern = numberPattern.replace('{0}¤', \"{0}\".concat(beforeCurrency, \"\\u00A4\"));\n }\n }\n // The following tokens are special: `{0}`, `¤`, `%`, `-`, `+`, `{c:...}.\n var numberPatternParts = numberPattern.split(/({c:[^}]+}|\\{0\\}|[¤%\\-\\+])/g);\n var numberParts = [];\n var symbols = data.numbers.symbols[numberingSystem] ||\n data.numbers.symbols[defaultNumberingSystem];\n for (var _i = 0, numberPatternParts_1 = numberPatternParts; _i < numberPatternParts_1.length; _i++) {\n var part = numberPatternParts_1[_i];\n if (!part) {\n continue;\n }\n switch (part) {\n case '{0}': {\n // We only need to handle scientific and engineering notation here.\n numberParts.push.apply(numberParts, paritionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem, \n // If compact number pattern exists, do not insert group separators.\n !compactNumberPattern && options.useGrouping, decimalNumberPattern));\n break;\n }\n case '-':\n numberParts.push({ type: 'minusSign', value: symbols.minusSign });\n break;\n case '+':\n numberParts.push({ type: 'plusSign', value: symbols.plusSign });\n break;\n case '%':\n numberParts.push({ type: 'percentSign', value: symbols.percentSign });\n break;\n case '¤':\n // Computed above when handling currency spacing.\n numberParts.push({ type: 'currency', value: nonNameCurrencyPart });\n break;\n default:\n if (/^\\{c:/.test(part)) {\n numberParts.push({\n type: 'compact',\n value: part.substring(3, part.length - 1),\n });\n }\n else {\n // literal\n numberParts.push({ type: 'literal', value: part });\n }\n break;\n }\n }\n // #endregion\n // #region Part 2: interpolate unit pattern if necessary.\n // ----------------------------------------------\n switch (style) {\n case 'currency': {\n // `currencyDisplay: 'name'` has similar pattern handling as units.\n if (options.currencyDisplay === 'name') {\n var unitPattern = (data.numbers.currency[numberingSystem] ||\n data.numbers.currency[defaultNumberingSystem]).unitPattern;\n // Select plural\n var unitName = void 0;\n var currencyNameData = data.currencies[options.currency];\n if (currencyNameData) {\n unitName = selectPlural(pl, numberResult.roundedNumber * Math.pow(10, exponent), currencyNameData.displayName);\n }\n else {\n // Fallback for unknown currency\n unitName = options.currency;\n }\n // Do {0} and {1} substitution\n var unitPatternParts = unitPattern.split(/(\\{[01]\\})/g);\n var result = [];\n for (var _a = 0, unitPatternParts_1 = unitPatternParts; _a < unitPatternParts_1.length; _a++) {\n var part = unitPatternParts_1[_a];\n switch (part) {\n case '{0}':\n result.push.apply(result, numberParts);\n break;\n case '{1}':\n result.push({ type: 'currency', value: unitName });\n break;\n default:\n if (part) {\n result.push({ type: 'literal', value: part });\n }\n break;\n }\n }\n return result;\n }\n else {\n return numberParts;\n }\n }\n case 'unit': {\n var unit = options.unit, unitDisplay = options.unitDisplay;\n var unitData = data.units.simple[unit];\n var unitPattern = void 0;\n if (unitData) {\n // Simple unit pattern\n unitPattern = selectPlural(pl, numberResult.roundedNumber * Math.pow(10, exponent), data.units.simple[unit][unitDisplay]);\n }\n else {\n // See: http://unicode.org/reports/tr35/tr35-general.html#perUnitPatterns\n // If cannot find unit in the simple pattern, it must be \"per\" compound pattern.\n // Implementation note: we are not following TR-35 here because we need to format to parts!\n var _b = unit.split('-per-'), numeratorUnit = _b[0], denominatorUnit = _b[1];\n unitData = data.units.simple[numeratorUnit];\n var numeratorUnitPattern = selectPlural(pl, numberResult.roundedNumber * Math.pow(10, exponent), data.units.simple[numeratorUnit][unitDisplay]);\n var perUnitPattern = data.units.simple[denominatorUnit].perUnit[unitDisplay];\n if (perUnitPattern) {\n // perUnitPattern exists, combine it with numeratorUnitPattern\n unitPattern = perUnitPattern.replace('{0}', numeratorUnitPattern);\n }\n else {\n // get compoundUnit pattern (e.g. \"{0} per {1}\"), repalce {0} with numerator pattern and {1} with\n // the denominator pattern in singular form.\n var perPattern = data.units.compound.per[unitDisplay];\n var denominatorPattern = selectPlural(pl, 1, data.units.simple[denominatorUnit][unitDisplay]);\n unitPattern = unitPattern = perPattern\n .replace('{0}', numeratorUnitPattern)\n .replace('{1}', denominatorPattern.replace('{0}', ''));\n }\n }\n var result = [];\n // We need spacing around \"{0}\" because they are not treated as \"unit\" parts, but \"literal\".\n for (var _c = 0, _d = unitPattern.split(/(\\s*\\{0\\}\\s*)/); _c < _d.length; _c++) {\n var part = _d[_c];\n var interpolateMatch = /^(\\s*)\\{0\\}(\\s*)$/.exec(part);\n if (interpolateMatch) {\n // Space before \"{0}\"\n if (interpolateMatch[1]) {\n result.push({ type: 'literal', value: interpolateMatch[1] });\n }\n // \"{0}\" itself\n result.push.apply(result, numberParts);\n // Space after \"{0}\"\n if (interpolateMatch[2]) {\n result.push({ type: 'literal', value: interpolateMatch[2] });\n }\n }\n else if (part) {\n result.push({ type: 'unit', value: part });\n }\n }\n return result;\n }\n default:\n return numberParts;\n }\n // #endregion\n}\n// A subset of https://tc39.es/ecma402/#sec-partitionnotationsubpattern\n// Plus the exponent parts handling.\nfunction paritionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem, useGrouping, \n/**\n * This is the decimal number pattern without signs or symbols.\n * It is used to infer the group size when `useGrouping` is true.\n *\n * A typical value looks like \"#,##0.00\" (primary group size is 3).\n * Some locales like Hindi has secondary group size of 2 (e.g. \"#,##,##0.00\").\n */\ndecimalNumberPattern) {\n var result = [];\n // eslint-disable-next-line prefer-const\n var n = numberResult.formattedString, x = numberResult.roundedNumber;\n if (isNaN(x)) {\n return [{ type: 'nan', value: n }];\n }\n else if (!isFinite(x)) {\n return [{ type: 'infinity', value: n }];\n }\n var digitReplacementTable = digitMapping[numberingSystem];\n if (digitReplacementTable) {\n n = n.replace(/\\d/g, function (digit) { return digitReplacementTable[+digit] || digit; });\n }\n // TODO: Else use an implementation dependent algorithm to map n to the appropriate\n // representation of n in the given numbering system.\n var decimalSepIndex = n.indexOf('.');\n var integer;\n var fraction;\n if (decimalSepIndex > 0) {\n integer = n.slice(0, decimalSepIndex);\n fraction = n.slice(decimalSepIndex + 1);\n }\n else {\n integer = n;\n }\n // #region Grouping integer digits\n // The weird compact and x >= 10000 check is to ensure consistency with Node.js and Chrome.\n // Note that `de` does not have compact form for thousands, but Node.js does not insert grouping separator\n // unless the rounded number is greater than 10000:\n // NumberFormat('de', {notation: 'compact', compactDisplay: 'short'}).format(1234) //=> \"1234\"\n // NumberFormat('de').format(1234) //=> \"1.234\"\n if (useGrouping && (notation !== 'compact' || x >= 10000)) {\n var groupSepSymbol = symbols.group;\n var groups = [];\n // > There may be two different grouping sizes: The primary grouping size used for the least\n // > significant integer group, and the secondary grouping size used for more significant groups.\n // > If a pattern contains multiple grouping separators, the interval between the last one and the\n // > end of the integer defines the primary grouping size, and the interval between the last two\n // > defines the secondary grouping size. All others are ignored.\n var integerNumberPattern = decimalNumberPattern.split('.')[0];\n var patternGroups = integerNumberPattern.split(',');\n var primaryGroupingSize = 3;\n var secondaryGroupingSize = 3;\n if (patternGroups.length > 1) {\n primaryGroupingSize = patternGroups[patternGroups.length - 1].length;\n }\n if (patternGroups.length > 2) {\n secondaryGroupingSize = patternGroups[patternGroups.length - 2].length;\n }\n var i = integer.length - primaryGroupingSize;\n if (i > 0) {\n // Slice the least significant integer group\n groups.push(integer.slice(i, i + primaryGroupingSize));\n // Then iteratively push the more signicant groups\n // TODO: handle surrogate pairs in some numbering system digits\n for (i -= secondaryGroupingSize; i > 0; i -= secondaryGroupingSize) {\n groups.push(integer.slice(i, i + secondaryGroupingSize));\n }\n groups.push(integer.slice(0, i + secondaryGroupingSize));\n }\n else {\n groups.push(integer);\n }\n while (groups.length > 0) {\n var integerGroup = groups.pop();\n result.push({ type: 'integer', value: integerGroup });\n if (groups.length > 0) {\n result.push({ type: 'group', value: groupSepSymbol });\n }\n }\n }\n else {\n result.push({ type: 'integer', value: integer });\n }\n // #endregion\n if (fraction !== undefined) {\n result.push({ type: 'decimal', value: symbols.decimal }, { type: 'fraction', value: fraction });\n }\n if ((notation === 'scientific' || notation === 'engineering') &&\n isFinite(x)) {\n result.push({ type: 'exponentSeparator', value: symbols.exponential });\n if (exponent < 0) {\n result.push({ type: 'exponentMinusSign', value: symbols.minusSign });\n exponent = -exponent;\n }\n var exponentResult = ToRawFixed(exponent, 0, 0);\n result.push({\n type: 'exponentInteger',\n value: exponentResult.formattedString,\n });\n }\n return result;\n}\nfunction getPatternForSign(pattern, sign) {\n if (pattern.indexOf(';') < 0) {\n pattern = \"\".concat(pattern, \";-\").concat(pattern);\n }\n var _a = pattern.split(';'), zeroPattern = _a[0], negativePattern = _a[1];\n switch (sign) {\n case 0:\n return zeroPattern;\n case -1:\n return negativePattern;\n default:\n return negativePattern.indexOf('-') >= 0\n ? negativePattern.replace(/-/g, '+')\n : \"+\".concat(zeroPattern);\n }\n}\n// Find the CLDR pattern for compact notation based on the magnitude of data and style.\n//\n// Example return value: \"¤ {c:laki}000;¤{c:laki} -0\" (`sw` locale):\n// - Notice the `{c:...}` token that wraps the compact literal.\n// - The consecutive zeros are normalized to single zero to match CLDR_NUMBER_PATTERN.\n//\n// Returning null means the compact display pattern cannot be found.\nfunction getCompactDisplayPattern(numberResult, pl, data, style, compactDisplay, currencyDisplay, numberingSystem) {\n var _a;\n var roundedNumber = numberResult.roundedNumber, sign = numberResult.sign, magnitude = numberResult.magnitude;\n var magnitudeKey = String(Math.pow(10, magnitude));\n var defaultNumberingSystem = data.numbers.nu[0];\n var pattern;\n if (style === 'currency' && currencyDisplay !== 'name') {\n var byNumberingSystem = data.numbers.currency;\n var currencyData = byNumberingSystem[numberingSystem] ||\n byNumberingSystem[defaultNumberingSystem];\n // NOTE: compact notation ignores currencySign!\n var compactPluralRules = (_a = currencyData.short) === null || _a === void 0 ? void 0 : _a[magnitudeKey];\n if (!compactPluralRules) {\n return null;\n }\n pattern = selectPlural(pl, roundedNumber, compactPluralRules);\n }\n else {\n var byNumberingSystem = data.numbers.decimal;\n var byCompactDisplay = byNumberingSystem[numberingSystem] ||\n byNumberingSystem[defaultNumberingSystem];\n var compactPlaralRule = byCompactDisplay[compactDisplay][magnitudeKey];\n if (!compactPlaralRule) {\n return null;\n }\n pattern = selectPlural(pl, roundedNumber, compactPlaralRule);\n }\n // See https://unicode.org/reports/tr35/tr35-numbers.html#Compact_Number_Formats\n // > If the value is precisely “0”, either explicit or defaulted, then the normal number format\n // > pattern for that sort of object is supplied.\n if (pattern === '0') {\n return null;\n }\n pattern = getPatternForSign(pattern, sign)\n // Extract compact literal from the pattern\n .replace(/([^\\s;\\-\\+\\d¤]+)/g, '{c:$1}')\n // We replace one or more zeros with a single zero so it matches `CLDR_NUMBER_PATTERN`.\n .replace(/0+/, '0');\n return pattern;\n}\nfunction selectPlural(pl, x, rules) {\n return rules[pl.select(x)] || rules.other;\n}\n","import { FormatNumericToString } from './FormatNumericToString';\nimport { SameValue } from '../262';\nimport { ComputeExponent } from './ComputeExponent';\nimport formatToParts from './format_to_parts';\n/**\n * https://tc39.es/ecma402/#sec-formatnumberstring\n */\nexport function PartitionNumberPattern(numberFormat, x, _a) {\n var _b;\n var getInternalSlots = _a.getInternalSlots;\n var internalSlots = getInternalSlots(numberFormat);\n var pl = internalSlots.pl, dataLocaleData = internalSlots.dataLocaleData, numberingSystem = internalSlots.numberingSystem;\n var symbols = dataLocaleData.numbers.symbols[numberingSystem] ||\n dataLocaleData.numbers.symbols[dataLocaleData.numbers.nu[0]];\n var magnitude = 0;\n var exponent = 0;\n var n;\n if (isNaN(x)) {\n n = symbols.nan;\n }\n else if (!isFinite(x)) {\n n = symbols.infinity;\n }\n else {\n if (internalSlots.style === 'percent') {\n x *= 100;\n }\n ;\n _b = ComputeExponent(numberFormat, x, {\n getInternalSlots: getInternalSlots,\n }), exponent = _b[0], magnitude = _b[1];\n // Preserve more precision by doing multiplication when exponent is negative.\n x = exponent < 0 ? x * Math.pow(10, -exponent) : x / Math.pow(10, exponent);\n var formatNumberResult = FormatNumericToString(internalSlots, x);\n n = formatNumberResult.formattedString;\n x = formatNumberResult.roundedNumber;\n }\n // Based on https://tc39.es/ecma402/#sec-getnumberformatpattern\n // We need to do this before `x` is rounded.\n var sign;\n var signDisplay = internalSlots.signDisplay;\n switch (signDisplay) {\n case 'never':\n sign = 0;\n break;\n case 'auto':\n if (SameValue(x, 0) || x > 0 || isNaN(x)) {\n sign = 0;\n }\n else {\n sign = -1;\n }\n break;\n case 'always':\n if (SameValue(x, 0) || x > 0 || isNaN(x)) {\n sign = 1;\n }\n else {\n sign = -1;\n }\n break;\n default:\n // x === 0 -> x is 0 or x is -0\n if (x === 0 || isNaN(x)) {\n sign = 0;\n }\n else if (x > 0) {\n sign = 1;\n }\n else {\n sign = -1;\n }\n }\n return formatToParts({ roundedNumber: x, formattedString: n, exponent: exponent, magnitude: magnitude, sign: sign }, internalSlots.dataLocaleData, pl, internalSlots);\n}\n","import { PartitionNumberPattern } from './PartitionNumberPattern';\nimport { ArrayCreate } from '../262';\nexport function FormatNumericToParts(nf, x, implDetails) {\n var parts = PartitionNumberPattern(nf, x, implDetails);\n var result = ArrayCreate(0);\n for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {\n var part = parts_1[_i];\n result.push({\n type: part.type,\n value: part.value,\n });\n }\n return result;\n}\n","import { GetOption } from '../GetOption';\nimport { IsWellFormedCurrencyCode } from '../IsWellFormedCurrencyCode';\nimport { IsWellFormedUnitIdentifier } from '../IsWellFormedUnitIdentifier';\n/**\n * https://tc39.es/ecma402/#sec-setnumberformatunitoptions\n */\nexport function SetNumberFormatUnitOptions(nf, options, _a) {\n if (options === void 0) { options = Object.create(null); }\n var getInternalSlots = _a.getInternalSlots;\n var internalSlots = getInternalSlots(nf);\n var style = GetOption(options, 'style', 'string', ['decimal', 'percent', 'currency', 'unit'], 'decimal');\n internalSlots.style = style;\n var currency = GetOption(options, 'currency', 'string', undefined, undefined);\n if (currency !== undefined && !IsWellFormedCurrencyCode(currency)) {\n throw RangeError('Malformed currency code');\n }\n if (style === 'currency' && currency === undefined) {\n throw TypeError('currency cannot be undefined');\n }\n var currencyDisplay = GetOption(options, 'currencyDisplay', 'string', ['code', 'symbol', 'narrowSymbol', 'name'], 'symbol');\n var currencySign = GetOption(options, 'currencySign', 'string', ['standard', 'accounting'], 'standard');\n var unit = GetOption(options, 'unit', 'string', undefined, undefined);\n if (unit !== undefined && !IsWellFormedUnitIdentifier(unit)) {\n throw RangeError('Invalid unit argument for Intl.NumberFormat()');\n }\n if (style === 'unit' && unit === undefined) {\n throw TypeError('unit cannot be undefined');\n }\n var unitDisplay = GetOption(options, 'unitDisplay', 'string', ['short', 'narrow', 'long'], 'short');\n if (style === 'currency') {\n internalSlots.currency = currency.toUpperCase();\n internalSlots.currencyDisplay = currencyDisplay;\n internalSlots.currencySign = currencySign;\n }\n if (style === 'unit') {\n internalSlots.unit = unit;\n internalSlots.unitDisplay = unitDisplay;\n }\n}\n","import { GetNumberOption } from '../GetNumberOption';\nimport { DefaultNumberOption } from '../DefaultNumberOption';\n/**\n * https://tc39.es/ecma402/#sec-setnfdigitoptions\n */\nexport function SetNumberFormatDigitOptions(internalSlots, opts, mnfdDefault, mxfdDefault, notation) {\n var mnid = GetNumberOption(opts, 'minimumIntegerDigits', 1, 21, 1);\n var mnfd = opts.minimumFractionDigits;\n var mxfd = opts.maximumFractionDigits;\n var mnsd = opts.minimumSignificantDigits;\n var mxsd = opts.maximumSignificantDigits;\n internalSlots.minimumIntegerDigits = mnid;\n if (mnsd !== undefined || mxsd !== undefined) {\n internalSlots.roundingType = 'significantDigits';\n mnsd = DefaultNumberOption(mnsd, 1, 21, 1);\n mxsd = DefaultNumberOption(mxsd, mnsd, 21, 21);\n internalSlots.minimumSignificantDigits = mnsd;\n internalSlots.maximumSignificantDigits = mxsd;\n }\n else if (mnfd !== undefined || mxfd !== undefined) {\n internalSlots.roundingType = 'fractionDigits';\n mnfd = DefaultNumberOption(mnfd, 0, 20, mnfdDefault);\n var mxfdActualDefault = Math.max(mnfd, mxfdDefault);\n mxfd = DefaultNumberOption(mxfd, mnfd, 20, mxfdActualDefault);\n internalSlots.minimumFractionDigits = mnfd;\n internalSlots.maximumFractionDigits = mxfd;\n }\n else if (notation === 'compact') {\n internalSlots.roundingType = 'compactRounding';\n }\n else {\n internalSlots.roundingType = 'fractionDigits';\n internalSlots.minimumFractionDigits = mnfdDefault;\n internalSlots.maximumFractionDigits = mxfdDefault;\n }\n}\n","import { CanonicalizeLocaleList } from '../CanonicalizeLocaleList';\nimport { GetOption } from '../GetOption';\nimport { ResolveLocale } from '@formatjs/intl-localematcher';\nimport { SetNumberFormatUnitOptions } from './SetNumberFormatUnitOptions';\nimport { CurrencyDigits } from './CurrencyDigits';\nimport { SetNumberFormatDigitOptions } from './SetNumberFormatDigitOptions';\nimport { invariant } from '../utils';\nimport { CoerceOptionsToObject } from '../CoerceOptionsToObject';\n/**\n * https://tc39.es/ecma402/#sec-initializenumberformat\n */\nexport function InitializeNumberFormat(nf, locales, opts, _a) {\n var getInternalSlots = _a.getInternalSlots, localeData = _a.localeData, availableLocales = _a.availableLocales, numberingSystemNames = _a.numberingSystemNames, getDefaultLocale = _a.getDefaultLocale, currencyDigitsData = _a.currencyDigitsData;\n // @ts-ignore\n var requestedLocales = CanonicalizeLocaleList(locales);\n var options = CoerceOptionsToObject(opts);\n var opt = Object.create(null);\n var matcher = GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');\n opt.localeMatcher = matcher;\n var numberingSystem = GetOption(options, 'numberingSystem', 'string', undefined, undefined);\n if (numberingSystem !== undefined &&\n numberingSystemNames.indexOf(numberingSystem) < 0) {\n // 8.a. If numberingSystem does not match the Unicode Locale Identifier type nonterminal,\n // throw a RangeError exception.\n throw RangeError(\"Invalid numberingSystems: \".concat(numberingSystem));\n }\n opt.nu = numberingSystem;\n var r = ResolveLocale(availableLocales, requestedLocales, opt, \n // [[RelevantExtensionKeys]] slot, which is a constant\n ['nu'], localeData, getDefaultLocale);\n var dataLocaleData = localeData[r.dataLocale];\n invariant(!!dataLocaleData, \"Missing locale data for \".concat(r.dataLocale));\n var internalSlots = getInternalSlots(nf);\n internalSlots.locale = r.locale;\n internalSlots.dataLocale = r.dataLocale;\n internalSlots.numberingSystem = r.nu;\n internalSlots.dataLocaleData = dataLocaleData;\n SetNumberFormatUnitOptions(nf, options, { getInternalSlots: getInternalSlots });\n var style = internalSlots.style;\n var mnfdDefault;\n var mxfdDefault;\n if (style === 'currency') {\n var currency = internalSlots.currency;\n var cDigits = CurrencyDigits(currency, { currencyDigitsData: currencyDigitsData });\n mnfdDefault = cDigits;\n mxfdDefault = cDigits;\n }\n else {\n mnfdDefault = 0;\n mxfdDefault = style === 'percent' ? 0 : 3;\n }\n var notation = GetOption(options, 'notation', 'string', ['standard', 'scientific', 'engineering', 'compact'], 'standard');\n internalSlots.notation = notation;\n SetNumberFormatDigitOptions(internalSlots, options, mnfdDefault, mxfdDefault, notation);\n var compactDisplay = GetOption(options, 'compactDisplay', 'string', ['short', 'long'], 'short');\n if (notation === 'compact') {\n internalSlots.compactDisplay = compactDisplay;\n }\n var useGrouping = GetOption(options, 'useGrouping', 'boolean', undefined, true);\n internalSlots.useGrouping = useGrouping;\n var signDisplay = GetOption(options, 'signDisplay', 'string', ['auto', 'never', 'always', 'exceptZero'], 'auto');\n internalSlots.signDisplay = signDisplay;\n return nf;\n}\n","import { invariant } from './utils';\n/**\n * https://tc39.es/ecma402/#sec-partitionpattern\n * @param pattern\n */\nexport function PartitionPattern(pattern) {\n var result = [];\n var beginIndex = pattern.indexOf('{');\n var endIndex = 0;\n var nextIndex = 0;\n var length = pattern.length;\n while (beginIndex < pattern.length && beginIndex > -1) {\n endIndex = pattern.indexOf('}', beginIndex);\n invariant(endIndex > beginIndex, \"Invalid pattern \".concat(pattern));\n if (beginIndex > nextIndex) {\n result.push({\n type: 'literal',\n value: pattern.substring(nextIndex, beginIndex),\n });\n }\n result.push({\n type: pattern.substring(beginIndex + 1, endIndex),\n value: undefined,\n });\n nextIndex = endIndex + 1;\n beginIndex = pattern.indexOf('{', nextIndex);\n }\n if (nextIndex < length) {\n result.push({\n type: 'literal',\n value: pattern.substring(nextIndex, length),\n });\n }\n return result;\n}\n","import { ToObject } from './262';\nimport { GetOption } from './GetOption';\nimport { LookupSupportedLocales } from '@formatjs/intl-localematcher';\n/**\n * https://tc39.es/ecma402/#sec-supportedlocales\n * @param availableLocales\n * @param requestedLocales\n * @param options\n */\nexport function SupportedLocales(availableLocales, requestedLocales, options) {\n var matcher = 'best fit';\n if (options !== undefined) {\n options = ToObject(options);\n matcher = GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');\n }\n if (matcher === 'best fit') {\n return LookupSupportedLocales(availableLocales, requestedLocales);\n }\n return LookupSupportedLocales(availableLocales, requestedLocales);\n}\n","export var RangePatternType;\n(function (RangePatternType) {\n RangePatternType[\"startRange\"] = \"startRange\";\n RangePatternType[\"shared\"] = \"shared\";\n RangePatternType[\"endRange\"] = \"endRange\";\n})(RangePatternType || (RangePatternType = {}));\n","import { __extends } from \"tslib\";\nvar MissingLocaleDataError = /** @class */ (function (_super) {\n __extends(MissingLocaleDataError, _super);\n function MissingLocaleDataError() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'MISSING_LOCALE_DATA';\n return _this;\n }\n return MissingLocaleDataError;\n}(Error));\nexport function isMissingLocaleDataError(e) {\n return e.type === 'MISSING_LOCALE_DATA';\n}\n","/**\n * Cannot do Math.log(x) / Math.log(10) bc if IEEE floating point issue\n * @param x number\n */\nexport function getMagnitude(x) {\n // Cannot count string length via Number.toString because it may use scientific notation\n // for very small or very large numbers.\n return Math.floor(Math.log(x) * Math.LOG10E);\n}\nexport function repeat(s, times) {\n if (typeof s.repeat === 'function') {\n return s.repeat(times);\n }\n var arr = new Array(times);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = s;\n }\n return arr.join('');\n}\nexport function setInternalSlot(map, pl, field, value) {\n if (!map.get(pl)) {\n map.set(pl, Object.create(null));\n }\n var slots = map.get(pl);\n slots[field] = value;\n}\nexport function setMultiInternalSlots(map, pl, props) {\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\n var k = _a[_i];\n setInternalSlot(map, pl, k, props[k]);\n }\n}\nexport function getInternalSlot(map, pl, field) {\n return getMultiInternalSlots(map, pl, field)[field];\n}\nexport function getMultiInternalSlots(map, pl) {\n var fields = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n fields[_i - 2] = arguments[_i];\n }\n var slots = map.get(pl);\n if (!slots) {\n throw new TypeError(\"\".concat(pl, \" InternalSlot has not been initialized\"));\n }\n return fields.reduce(function (all, f) {\n all[f] = slots[f];\n return all;\n }, Object.create(null));\n}\nexport function isLiteralPart(patternPart) {\n return patternPart.type === 'literal';\n}\n/*\n 17 ECMAScript Standard Built-in Objects:\n Every built-in Function object, including constructors, that is not\n identified as an anonymous function has a name property whose value\n is a String.\n\n Unless otherwise specified, the name property of a built-in Function\n object, if it exists, has the attributes { [[Writable]]: false,\n [[Enumerable]]: false, [[Configurable]]: true }.\n*/\nexport function defineProperty(target, name, _a) {\n var value = _a.value;\n Object.defineProperty(target, name, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: value,\n });\n}\nexport var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\n","/**\n * https://tc39.es/ecma402/#sec-bestavailablelocale\n * @param availableLocales\n * @param locale\n */\nexport function BestAvailableLocale(availableLocales, locale) {\n var candidate = locale;\n while (true) {\n if (availableLocales.has(candidate)) {\n return candidate;\n }\n var pos = candidate.lastIndexOf('-');\n if (!~pos) {\n return undefined;\n }\n if (pos >= 2 && candidate[pos - 2] === '-') {\n pos -= 2;\n }\n candidate = candidate.slice(0, pos);\n }\n}\n","import { UNICODE_EXTENSION_SEQUENCE_REGEX } from './utils';\nimport { BestAvailableLocale } from './BestAvailableLocale';\n/**\n * https://tc39.es/ecma402/#sec-lookupsupportedlocales\n * @param availableLocales\n * @param requestedLocales\n */\nexport function LookupSupportedLocales(availableLocales, requestedLocales) {\n var subset = [];\n for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {\n var locale = requestedLocales_1[_i];\n var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');\n var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);\n if (availableLocale) {\n subset.push(availableLocale);\n }\n }\n return subset;\n}\n","import { invariant } from './utils';\n/**\n * https://tc39.es/ecma402/#sec-unicodeextensionvalue\n * @param extension\n * @param key\n */\nexport function UnicodeExtensionValue(extension, key) {\n invariant(key.length === 2, 'key must have 2 elements');\n var size = extension.length;\n var searchValue = \"-\".concat(key, \"-\");\n var pos = extension.indexOf(searchValue);\n if (pos !== -1) {\n var start = pos + 4;\n var end = start;\n var k = start;\n var done = false;\n while (!done) {\n var e = extension.indexOf('-', k);\n var len = void 0;\n if (e === -1) {\n len = size - k;\n }\n else {\n len = e - k;\n }\n if (len === 2) {\n done = true;\n }\n else if (e === -1) {\n end = size;\n done = true;\n }\n else {\n end = e;\n k = e + 1;\n }\n }\n return extension.slice(start, end);\n }\n searchValue = \"-\".concat(key);\n pos = extension.indexOf(searchValue);\n if (pos !== -1 && pos + 3 === size) {\n return '';\n }\n return undefined;\n}\n","import { LookupMatcher } from './LookupMatcher';\nimport { BestFitMatcher } from './BestFitMatcher';\nimport { invariant } from './utils';\nimport { UnicodeExtensionValue } from './UnicodeExtensionValue';\n/**\n * https://tc39.es/ecma402/#sec-resolvelocale\n */\nexport function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {\n var matcher = options.localeMatcher;\n var r;\n if (matcher === 'lookup') {\n r = LookupMatcher(availableLocales, requestedLocales, getDefaultLocale);\n }\n else {\n r = BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale);\n }\n var foundLocale = r.locale;\n var result = { locale: '', dataLocale: foundLocale };\n var supportedExtension = '-u';\n for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {\n var key = relevantExtensionKeys_1[_i];\n invariant(foundLocale in localeData, \"Missing locale data for \".concat(foundLocale));\n var foundLocaleData = localeData[foundLocale];\n invariant(typeof foundLocaleData === 'object' && foundLocaleData !== null, \"locale data \".concat(key, \" must be an object\"));\n var keyLocaleData = foundLocaleData[key];\n invariant(Array.isArray(keyLocaleData), \"keyLocaleData for \".concat(key, \" must be an array\"));\n var value = keyLocaleData[0];\n invariant(typeof value === 'string' || value === null, \"value must be string or null but got \".concat(typeof value, \" in key \").concat(key));\n var supportedExtensionAddition = '';\n if (r.extension) {\n var requestedValue = UnicodeExtensionValue(r.extension, key);\n if (requestedValue !== undefined) {\n if (requestedValue !== '') {\n if (~keyLocaleData.indexOf(requestedValue)) {\n value = requestedValue;\n supportedExtensionAddition = \"-\".concat(key, \"-\").concat(value);\n }\n }\n else if (~requestedValue.indexOf('true')) {\n value = 'true';\n supportedExtensionAddition = \"-\".concat(key);\n }\n }\n }\n if (key in options) {\n var optionsValue = options[key];\n invariant(typeof optionsValue === 'string' ||\n typeof optionsValue === 'undefined' ||\n optionsValue === null, 'optionsValue must be String, Undefined or Null');\n if (~keyLocaleData.indexOf(optionsValue)) {\n if (optionsValue !== value) {\n value = optionsValue;\n supportedExtensionAddition = '';\n }\n }\n }\n result[key] = value;\n supportedExtension += supportedExtensionAddition;\n }\n if (supportedExtension.length > 2) {\n var privateIndex = foundLocale.indexOf('-x-');\n if (privateIndex === -1) {\n foundLocale = foundLocale + supportedExtension;\n }\n else {\n var preExtension = foundLocale.slice(0, privateIndex);\n var postExtension = foundLocale.slice(privateIndex, foundLocale.length);\n foundLocale = preExtension + supportedExtension + postExtension;\n }\n foundLocale = Intl.getCanonicalLocales(foundLocale)[0];\n }\n result.locale = foundLocale;\n return result;\n}\n","import { UNICODE_EXTENSION_SEQUENCE_REGEX } from './utils';\nimport { BestAvailableLocale } from './BestAvailableLocale';\n/**\n * https://tc39.es/ecma402/#sec-lookupmatcher\n * @param availableLocales\n * @param requestedLocales\n * @param getDefaultLocale\n */\nexport function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {\n var result = { locale: '' };\n for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {\n var locale = requestedLocales_1[_i];\n var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');\n var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);\n if (availableLocale) {\n result.locale = availableLocale;\n if (locale !== noExtensionLocale) {\n result.extension = locale.slice(noExtensionLocale.length + 1, locale.length);\n }\n return result;\n }\n }\n result.locale = getDefaultLocale();\n return result;\n}\n","import { BestAvailableLocale } from './BestAvailableLocale';\nimport { UNICODE_EXTENSION_SEQUENCE_REGEX } from './utils';\n/**\n * https://tc39.es/ecma402/#sec-bestfitmatcher\n * @param availableLocales\n * @param requestedLocales\n * @param getDefaultLocale\n */\nexport function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {\n var minimizedAvailableLocaleMap = {};\n var availableLocaleMap = {};\n var canonicalizedLocaleMap = {};\n var minimizedAvailableLocales = new Set();\n availableLocales.forEach(function (locale) {\n var minimizedLocale = new Intl.Locale(locale)\n .minimize()\n .toString();\n var canonicalizedLocale = Intl.getCanonicalLocales(locale)[0] || locale;\n minimizedAvailableLocaleMap[minimizedLocale] = locale;\n availableLocaleMap[locale] = locale;\n canonicalizedLocaleMap[canonicalizedLocale] = locale;\n minimizedAvailableLocales.add(minimizedLocale);\n minimizedAvailableLocales.add(locale);\n minimizedAvailableLocales.add(canonicalizedLocale);\n });\n var foundLocale;\n for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {\n var l = requestedLocales_1[_i];\n if (foundLocale) {\n break;\n }\n var noExtensionLocale = l.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');\n if (availableLocales.has(noExtensionLocale)) {\n foundLocale = noExtensionLocale;\n break;\n }\n if (minimizedAvailableLocales.has(noExtensionLocale)) {\n foundLocale = noExtensionLocale;\n break;\n }\n var locale = new Intl.Locale(noExtensionLocale);\n var maximizedRequestedLocale = locale.maximize().toString();\n var minimizedRequestedLocale = locale.minimize().toString();\n // Check minimized locale\n if (minimizedAvailableLocales.has(minimizedRequestedLocale)) {\n foundLocale = minimizedRequestedLocale;\n break;\n }\n // Lookup algo on maximized locale\n foundLocale = BestAvailableLocale(minimizedAvailableLocales, maximizedRequestedLocale);\n }\n if (!foundLocale) {\n return { locale: getDefaultLocale() };\n }\n return {\n locale: availableLocaleMap[foundLocale] ||\n canonicalizedLocaleMap[foundLocale] ||\n minimizedAvailableLocaleMap[foundLocale] ||\n foundLocale,\n };\n}\n","export var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\n","import { CanonicalizeLocaleList } from './abstract/CanonicalizeLocaleList';\nimport { ResolveLocale } from './abstract/ResolveLocale';\nexport function match(requestedLocales, availableLocales, defaultLocale, opts) {\n var locales = availableLocales.reduce(function (all, l) {\n all.add(l);\n return all;\n }, new Set());\n return ResolveLocale(locales, CanonicalizeLocaleList(requestedLocales), {\n localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || 'best fit',\n }, [], {}, function () { return defaultLocale; }).locale;\n}\nexport { LookupSupportedLocales } from './abstract/LookupSupportedLocales';\nexport { ResolveLocale } from './abstract/ResolveLocale';\n","/**\n * http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist\n * @param locales\n */\nexport function CanonicalizeLocaleList(locales) {\n // TODO\n return Intl.getCanonicalLocales(locales);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InitializeRelativeTimeFormat = void 0;\nvar ecma402_abstract_1 = require(\"@formatjs/ecma402-abstract\");\nvar intl_localematcher_1 = require(\"@formatjs/intl-localematcher\");\nvar NUMBERING_SYSTEM_REGEX = /^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;\nfunction InitializeRelativeTimeFormat(rtf, locales, options, _a) {\n var getInternalSlots = _a.getInternalSlots, availableLocales = _a.availableLocales, relevantExtensionKeys = _a.relevantExtensionKeys, localeData = _a.localeData, getDefaultLocale = _a.getDefaultLocale;\n var internalSlots = getInternalSlots(rtf);\n internalSlots.initializedRelativeTimeFormat = true;\n var requestedLocales = (0, ecma402_abstract_1.CanonicalizeLocaleList)(locales);\n var opt = Object.create(null);\n var opts = (0, ecma402_abstract_1.CoerceOptionsToObject)(options);\n var matcher = (0, ecma402_abstract_1.GetOption)(opts, 'localeMatcher', 'string', ['best fit', 'lookup'], 'best fit');\n opt.localeMatcher = matcher;\n var numberingSystem = (0, ecma402_abstract_1.GetOption)(opts, \n // @ts-expect-error TS option is wack\n 'numberingSystem', 'string', undefined, undefined);\n if (numberingSystem !== undefined) {\n if (!NUMBERING_SYSTEM_REGEX.test(numberingSystem)) {\n throw new RangeError(\"Invalid numbering system \".concat(numberingSystem));\n }\n }\n opt.nu = numberingSystem;\n var r = (0, intl_localematcher_1.ResolveLocale)(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);\n var locale = r.locale, nu = r.nu;\n internalSlots.locale = locale;\n internalSlots.style = (0, ecma402_abstract_1.GetOption)(opts, 'style', 'string', ['long', 'narrow', 'short'], 'long');\n internalSlots.numeric = (0, ecma402_abstract_1.GetOption)(opts, 'numeric', 'string', ['always', 'auto'], 'always');\n var fields = localeData[r.dataLocale];\n (0, ecma402_abstract_1.invariant)(!!fields, \"Missing locale data for \".concat(r.dataLocale));\n internalSlots.fields = fields;\n internalSlots.numberFormat = new Intl.NumberFormat(locales);\n internalSlots.pluralRules = new Intl.PluralRules(locales);\n internalSlots.numberingSystem = nu;\n return rtf;\n}\nexports.InitializeRelativeTimeFormat = InitializeRelativeTimeFormat;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MakePartsList = void 0;\nvar ecma402_abstract_1 = require(\"@formatjs/ecma402-abstract\");\nfunction MakePartsList(pattern, unit, parts) {\n var patternParts = (0, ecma402_abstract_1.PartitionPattern)(pattern);\n var result = [];\n for (var _i = 0, patternParts_1 = patternParts; _i < patternParts_1.length; _i++) {\n var patternPart = patternParts_1[_i];\n if (patternPart.type === 'literal') {\n result.push({\n type: 'literal',\n value: patternPart.value,\n });\n }\n else {\n (0, ecma402_abstract_1.invariant)(patternPart.type === '0', \"Malformed pattern \".concat(pattern));\n for (var _a = 0, parts_1 = parts; _a < parts_1.length; _a++) {\n var part = parts_1[_a];\n result.push({\n type: part.type,\n value: part.value,\n unit: unit,\n });\n }\n }\n }\n return result;\n}\nexports.MakePartsList = MakePartsList;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PartitionRelativeTimePattern = void 0;\nvar ecma402_abstract_1 = require(\"@formatjs/ecma402-abstract\");\nvar SingularRelativeTimeUnit_1 = require(\"./SingularRelativeTimeUnit\");\nvar MakePartsList_1 = require(\"./MakePartsList\");\nfunction PartitionRelativeTimePattern(rtf, value, unit, _a) {\n var getInternalSlots = _a.getInternalSlots;\n (0, ecma402_abstract_1.invariant)((0, ecma402_abstract_1.Type)(value) === 'Number', \"value must be number, instead got \".concat(typeof value), TypeError);\n (0, ecma402_abstract_1.invariant)((0, ecma402_abstract_1.Type)(unit) === 'String', \"unit must be number, instead got \".concat(typeof value), TypeError);\n if (isNaN(value) || !isFinite(value)) {\n throw new RangeError(\"Invalid value \".concat(value));\n }\n var resolvedUnit = (0, SingularRelativeTimeUnit_1.SingularRelativeTimeUnit)(unit);\n var _b = getInternalSlots(rtf), fields = _b.fields, style = _b.style, numeric = _b.numeric, pluralRules = _b.pluralRules, numberFormat = _b.numberFormat;\n var entry = resolvedUnit;\n if (style === 'short') {\n entry = \"\".concat(resolvedUnit, \"-short\");\n }\n else if (style === 'narrow') {\n entry = \"\".concat(resolvedUnit, \"-narrow\");\n }\n if (!(entry in fields)) {\n entry = resolvedUnit;\n }\n var patterns = fields[entry];\n if (numeric === 'auto') {\n if ((0, ecma402_abstract_1.ToString)(value) in patterns) {\n return [\n {\n type: 'literal',\n value: patterns[(0, ecma402_abstract_1.ToString)(value)],\n },\n ];\n }\n }\n var tl = 'future';\n if ((0, ecma402_abstract_1.SameValue)(value, -0) || value < 0) {\n tl = 'past';\n }\n var po = patterns[tl];\n var fv = typeof numberFormat.formatToParts === 'function'\n ? numberFormat.formatToParts(Math.abs(value))\n : // TODO: If formatToParts is not supported, we assume the whole formatted\n // number is a part\n [\n {\n type: 'literal',\n value: numberFormat.format(Math.abs(value)),\n unit: unit,\n },\n ];\n var pr = pluralRules.select(value);\n var pattern = po[pr];\n return (0, MakePartsList_1.MakePartsList)(pattern, resolvedUnit, fv);\n}\nexports.PartitionRelativeTimePattern = PartitionRelativeTimePattern;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SingularRelativeTimeUnit = void 0;\nvar ecma402_abstract_1 = require(\"@formatjs/ecma402-abstract\");\n/**\n * https://tc39.es/proposal-intl-relative-time/#sec-singularrelativetimeunit\n * @param unit\n */\nfunction SingularRelativeTimeUnit(unit) {\n (0, ecma402_abstract_1.invariant)((0, ecma402_abstract_1.Type)(unit) === 'String', 'unit must be a string');\n if (unit === 'seconds')\n return 'second';\n if (unit === 'minutes')\n return 'minute';\n if (unit === 'hours')\n return 'hour';\n if (unit === 'days')\n return 'day';\n if (unit === 'weeks')\n return 'week';\n if (unit === 'months')\n return 'month';\n if (unit === 'quarters')\n return 'quarter';\n if (unit === 'years')\n return 'year';\n if (unit !== 'second' &&\n unit !== 'minute' &&\n unit !== 'hour' &&\n unit !== 'day' &&\n unit !== 'week' &&\n unit !== 'month' &&\n unit !== 'quarter' &&\n unit !== 'year') {\n throw new RangeError('invalid unit');\n }\n return unit;\n}\nexports.SingularRelativeTimeUnit = SingularRelativeTimeUnit;\n","\"use strict\";\n// Type-only circular import\n// eslint-disable-next-line import/no-cycle\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar internalSlotMap = new WeakMap();\nfunction getInternalSlots(x) {\n var internalSlots = internalSlotMap.get(x);\n if (!internalSlots) {\n internalSlots = Object.create(null);\n internalSlotMap.set(x, internalSlots);\n }\n return internalSlots;\n}\nexports.default = getInternalSlots;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\nvar ecma402_abstract_1 = require(\"@formatjs/ecma402-abstract\");\nvar InitializeRelativeTimeFormat_1 = require(\"./abstract/InitializeRelativeTimeFormat\");\nvar PartitionRelativeTimePattern_1 = require(\"./abstract/PartitionRelativeTimePattern\");\nvar get_internal_slots_1 = (0, tslib_1.__importDefault)(require(\"./get_internal_slots\"));\nvar RelativeTimeFormat = /** @class */ (function () {\n function RelativeTimeFormat(locales, options) {\n // test262/test/intl402/RelativeTimeFormat/constructor/constructor/newtarget-undefined.js\n // Cannot use `new.target` bc of IE11 & TS transpiles it to something else\n var newTarget = this && this instanceof RelativeTimeFormat ? this.constructor : void 0;\n if (!newTarget) {\n throw new TypeError(\"Intl.RelativeTimeFormat must be called with 'new'\");\n }\n return (0, InitializeRelativeTimeFormat_1.InitializeRelativeTimeFormat)(this, locales, options, {\n getInternalSlots: get_internal_slots_1.default,\n availableLocales: RelativeTimeFormat.availableLocales,\n relevantExtensionKeys: RelativeTimeFormat.relevantExtensionKeys,\n localeData: RelativeTimeFormat.localeData,\n getDefaultLocale: RelativeTimeFormat.getDefaultLocale,\n });\n }\n RelativeTimeFormat.prototype.format = function (value, unit) {\n if (typeof this !== 'object') {\n throw new TypeError('format was called on a non-object');\n }\n var internalSlots = (0, get_internal_slots_1.default)(this);\n if (!internalSlots.initializedRelativeTimeFormat) {\n throw new TypeError('format was called on a invalid context');\n }\n return (0, PartitionRelativeTimePattern_1.PartitionRelativeTimePattern)(this, Number(value), (0, ecma402_abstract_1.ToString)(unit), {\n getInternalSlots: get_internal_slots_1.default,\n })\n .map(function (el) { return el.value; })\n .join('');\n };\n RelativeTimeFormat.prototype.formatToParts = function (value, unit) {\n if (typeof this !== 'object') {\n throw new TypeError('formatToParts was called on a non-object');\n }\n var internalSlots = (0, get_internal_slots_1.default)(this);\n if (!internalSlots.initializedRelativeTimeFormat) {\n throw new TypeError('formatToParts was called on a invalid context');\n }\n return (0, PartitionRelativeTimePattern_1.PartitionRelativeTimePattern)(this, Number(value), (0, ecma402_abstract_1.ToString)(unit), { getInternalSlots: get_internal_slots_1.default });\n };\n RelativeTimeFormat.prototype.resolvedOptions = function () {\n if (typeof this !== 'object') {\n throw new TypeError('resolvedOptions was called on a non-object');\n }\n var internalSlots = (0, get_internal_slots_1.default)(this);\n if (!internalSlots.initializedRelativeTimeFormat) {\n throw new TypeError('resolvedOptions was called on a invalid context');\n }\n // test262/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/type.js\n return {\n locale: internalSlots.locale,\n style: internalSlots.style,\n numeric: internalSlots.numeric,\n numberingSystem: internalSlots.numberingSystem,\n };\n };\n RelativeTimeFormat.supportedLocalesOf = function (locales, options) {\n return (0, ecma402_abstract_1.SupportedLocales)(RelativeTimeFormat.availableLocales, (0, ecma402_abstract_1.CanonicalizeLocaleList)(locales), options);\n };\n RelativeTimeFormat.__addLocaleData = function () {\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 _b = data_1[_a], d = _b.data, locale = _b.locale;\n var minimizedLocale = new Intl.Locale(locale)\n .minimize()\n .toString();\n RelativeTimeFormat.localeData[locale] = RelativeTimeFormat.localeData[minimizedLocale] = d;\n RelativeTimeFormat.availableLocales.add(minimizedLocale);\n RelativeTimeFormat.availableLocales.add(locale);\n if (!RelativeTimeFormat.__defaultLocale) {\n RelativeTimeFormat.__defaultLocale = minimizedLocale;\n }\n }\n };\n RelativeTimeFormat.getDefaultLocale = function () {\n return RelativeTimeFormat.__defaultLocale;\n };\n RelativeTimeFormat.localeData = {};\n RelativeTimeFormat.availableLocales = new Set();\n RelativeTimeFormat.__defaultLocale = '';\n RelativeTimeFormat.relevantExtensionKeys = ['nu'];\n RelativeTimeFormat.polyfilled = true;\n return RelativeTimeFormat;\n}());\nexports.default = RelativeTimeFormat;\ntry {\n // IE11 does not have Symbol\n if (typeof Symbol !== 'undefined') {\n Object.defineProperty(RelativeTimeFormat.prototype, Symbol.toStringTag, {\n value: 'Intl.RelativeTimeFormat',\n writable: false,\n enumerable: false,\n configurable: true,\n });\n }\n // https://github.com/tc39/test262/blob/master/test/intl402/RelativeTimeFormat/constructor/length.js\n Object.defineProperty(RelativeTimeFormat.prototype.constructor, 'length', {\n value: 0,\n writable: false,\n enumerable: false,\n configurable: true,\n });\n // https://github.com/tc39/test262/blob/master/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/length.js\n Object.defineProperty(RelativeTimeFormat.supportedLocalesOf, 'length', {\n value: 1,\n writable: false,\n enumerable: false,\n configurable: true,\n });\n}\ncatch (e) {\n // Meta fix so we're test262-compliant, not important\n}\n","/* @generated */\t\n// prettier-ignore\nif (Intl.RelativeTimeFormat && typeof Intl.RelativeTimeFormat.__addLocaleData === 'function') {\n Intl.RelativeTimeFormat.__addLocaleData({\"data\":{\"nu\":[\"latn\"],\"year\":{\"0\":\"dieses Jahr\",\"1\":\"nächstes Jahr\",\"future\":{\"one\":\"in {0} Jahr\",\"other\":\"in {0} Jahren\"},\"past\":{\"one\":\"vor {0} Jahr\",\"other\":\"vor {0} Jahren\"},\"-1\":\"letztes Jahr\"},\"year-short\":{\"0\":\"dieses Jahr\",\"1\":\"nächstes Jahr\",\"future\":{\"one\":\"in {0} Jahr\",\"other\":\"in {0} Jahren\"},\"past\":{\"one\":\"vor {0} Jahr\",\"other\":\"vor {0} Jahren\"},\"-1\":\"letztes Jahr\"},\"year-narrow\":{\"0\":\"dieses Jahr\",\"1\":\"nächstes Jahr\",\"future\":{\"one\":\"in {0} Jahr\",\"other\":\"in {0} Jahren\"},\"past\":{\"one\":\"vor {0} Jahr\",\"other\":\"vor {0} Jahren\"},\"-1\":\"letztes Jahr\"},\"quarter\":{\"0\":\"dieses Quartal\",\"1\":\"nächstes Quartal\",\"future\":{\"one\":\"in {0} Quartal\",\"other\":\"in {0} Quartalen\"},\"past\":{\"one\":\"vor {0} Quartal\",\"other\":\"vor {0} Quartalen\"},\"-1\":\"letztes Quartal\"},\"quarter-short\":{\"0\":\"dieses Quartal\",\"1\":\"nächstes Quartal\",\"future\":{\"one\":\"in {0} Quart.\",\"other\":\"in {0} Quart.\"},\"past\":{\"one\":\"vor {0} Quart.\",\"other\":\"vor {0} Quart.\"},\"-1\":\"letztes Quartal\"},\"quarter-narrow\":{\"0\":\"dieses Quartal\",\"1\":\"nächstes Quartal\",\"future\":{\"one\":\"in {0} Q\",\"other\":\"in {0} Q\"},\"past\":{\"one\":\"vor {0} Q\",\"other\":\"vor {0} Q\"},\"-1\":\"letztes Quartal\"},\"month\":{\"0\":\"diesen Monat\",\"1\":\"nächsten Monat\",\"future\":{\"one\":\"in {0} Monat\",\"other\":\"in {0} Monaten\"},\"past\":{\"one\":\"vor {0} Monat\",\"other\":\"vor {0} Monaten\"},\"-1\":\"letzten Monat\"},\"month-short\":{\"0\":\"diesen Monat\",\"1\":\"nächsten Monat\",\"future\":{\"one\":\"in {0} Monat\",\"other\":\"in {0} Monaten\"},\"past\":{\"one\":\"vor {0} Monat\",\"other\":\"vor {0} Monaten\"},\"-1\":\"letzten Monat\"},\"month-narrow\":{\"0\":\"diesen Monat\",\"1\":\"nächsten Monat\",\"future\":{\"one\":\"in {0} Monat\",\"other\":\"in {0} Monaten\"},\"past\":{\"one\":\"vor {0} Monat\",\"other\":\"vor {0} Monaten\"},\"-1\":\"letzten Monat\"},\"week\":{\"0\":\"diese Woche\",\"1\":\"nächste Woche\",\"future\":{\"one\":\"in {0} Woche\",\"other\":\"in {0} Wochen\"},\"past\":{\"one\":\"vor {0} Woche\",\"other\":\"vor {0} Wochen\"},\"-1\":\"letzte Woche\"},\"week-short\":{\"0\":\"diese Woche\",\"1\":\"nächste Woche\",\"future\":{\"one\":\"in {0} Woche\",\"other\":\"in {0} Wochen\"},\"past\":{\"one\":\"vor {0} Woche\",\"other\":\"vor {0} Wochen\"},\"-1\":\"letzte Woche\"},\"week-narrow\":{\"0\":\"diese Woche\",\"1\":\"nächste Woche\",\"future\":{\"one\":\"in {0} Wo.\",\"other\":\"in {0} Wo.\"},\"past\":{\"one\":\"vor {0} Wo.\",\"other\":\"vor {0} Wo.\"},\"-1\":\"letzte Woche\"},\"day\":{\"0\":\"heute\",\"1\":\"morgen\",\"2\":\"übermorgen\",\"future\":{\"one\":\"in {0} Tag\",\"other\":\"in {0} Tagen\"},\"past\":{\"one\":\"vor {0} Tag\",\"other\":\"vor {0} Tagen\"},\"-2\":\"vorgestern\",\"-1\":\"gestern\"},\"day-short\":{\"0\":\"heute\",\"1\":\"morgen\",\"2\":\"übermorgen\",\"future\":{\"one\":\"in {0} Tag\",\"other\":\"in {0} Tagen\"},\"past\":{\"one\":\"vor {0} Tag\",\"other\":\"vor {0} Tagen\"},\"-2\":\"vorgestern\",\"-1\":\"gestern\"},\"day-narrow\":{\"0\":\"heute\",\"1\":\"morgen\",\"2\":\"übermorgen\",\"future\":{\"one\":\"in {0} Tag\",\"other\":\"in {0} Tagen\"},\"past\":{\"one\":\"vor {0} Tag\",\"other\":\"vor {0} Tagen\"},\"-2\":\"vorgestern\",\"-1\":\"gestern\"},\"hour\":{\"0\":\"in dieser Stunde\",\"future\":{\"one\":\"in {0} Stunde\",\"other\":\"in {0} Stunden\"},\"past\":{\"one\":\"vor {0} Stunde\",\"other\":\"vor {0} Stunden\"}},\"hour-short\":{\"0\":\"in dieser Stunde\",\"future\":{\"one\":\"in {0} Std.\",\"other\":\"in {0} Std.\"},\"past\":{\"one\":\"vor {0} Std.\",\"other\":\"vor {0} Std.\"}},\"hour-narrow\":{\"0\":\"in dieser Stunde\",\"future\":{\"one\":\"in {0} Std.\",\"other\":\"in {0} Std.\"},\"past\":{\"one\":\"vor {0} Std.\",\"other\":\"vor {0} Std.\"}},\"minute\":{\"0\":\"in dieser Minute\",\"future\":{\"one\":\"in {0} Minute\",\"other\":\"in {0} Minuten\"},\"past\":{\"one\":\"vor {0} Minute\",\"other\":\"vor {0} Minuten\"}},\"minute-short\":{\"0\":\"in dieser Minute\",\"future\":{\"one\":\"in {0} Min.\",\"other\":\"in {0} Min.\"},\"past\":{\"one\":\"vor {0} Min.\",\"other\":\"vor {0} Min.\"}},\"minute-narrow\":{\"0\":\"in dieser Minute\",\"future\":{\"one\":\"in {0} m\",\"other\":\"in {0} m\"},\"past\":{\"one\":\"vor {0} m\",\"other\":\"vor {0} m\"}},\"second\":{\"0\":\"jetzt\",\"future\":{\"one\":\"in {0} Sekunde\",\"other\":\"in {0} Sekunden\"},\"past\":{\"one\":\"vor {0} Sekunde\",\"other\":\"vor {0} Sekunden\"}},\"second-short\":{\"0\":\"jetzt\",\"future\":{\"one\":\"in {0} Sek.\",\"other\":\"in {0} Sek.\"},\"past\":{\"one\":\"vor {0} Sek.\",\"other\":\"vor {0} Sek.\"}},\"second-narrow\":{\"0\":\"jetzt\",\"future\":{\"one\":\"in {0} s\",\"other\":\"in {0} s\"},\"past\":{\"one\":\"vor {0} s\",\"other\":\"vor {0} s\"}}},\"locale\":\"de\"}\n)\n}","/* @generated */\t\n// prettier-ignore\nif (Intl.RelativeTimeFormat && typeof Intl.RelativeTimeFormat.__addLocaleData === 'function') {\n Intl.RelativeTimeFormat.__addLocaleData({\"data\":{\"nu\":[\"latn\"],\"year\":{\"0\":\"this year\",\"1\":\"next year\",\"future\":{\"one\":\"in {0} year\",\"other\":\"in {0} years\"},\"past\":{\"one\":\"{0} year ago\",\"other\":\"{0} years ago\"},\"-1\":\"last year\"},\"year-short\":{\"0\":\"this yr.\",\"1\":\"next yr.\",\"future\":{\"one\":\"in {0} yr.\",\"other\":\"in {0} yr.\"},\"past\":{\"one\":\"{0} yr. ago\",\"other\":\"{0} yr. ago\"},\"-1\":\"last yr.\"},\"year-narrow\":{\"0\":\"this yr.\",\"1\":\"next yr.\",\"future\":{\"one\":\"in {0} yr.\",\"other\":\"in {0} yr.\"},\"past\":{\"one\":\"{0} yr. ago\",\"other\":\"{0} yr. ago\"},\"-1\":\"last yr.\"},\"quarter\":{\"0\":\"this quarter\",\"1\":\"next quarter\",\"future\":{\"one\":\"in {0} quarter\",\"other\":\"in {0} quarters\"},\"past\":{\"one\":\"{0} quarter ago\",\"other\":\"{0} quarters ago\"},\"-1\":\"last quarter\"},\"quarter-short\":{\"0\":\"this qtr.\",\"1\":\"next qtr.\",\"future\":{\"one\":\"in {0} qtr.\",\"other\":\"in {0} qtrs.\"},\"past\":{\"one\":\"{0} qtr. ago\",\"other\":\"{0} qtrs. ago\"},\"-1\":\"last qtr.\"},\"quarter-narrow\":{\"0\":\"this qtr.\",\"1\":\"next qtr.\",\"future\":{\"one\":\"in {0} qtr.\",\"other\":\"in {0} qtrs.\"},\"past\":{\"one\":\"{0} qtr. ago\",\"other\":\"{0} qtrs. ago\"},\"-1\":\"last qtr.\"},\"month\":{\"0\":\"this month\",\"1\":\"next month\",\"future\":{\"one\":\"in {0} month\",\"other\":\"in {0} months\"},\"past\":{\"one\":\"{0} month ago\",\"other\":\"{0} months ago\"},\"-1\":\"last month\"},\"month-short\":{\"0\":\"this mo.\",\"1\":\"next mo.\",\"future\":{\"one\":\"in {0} mo.\",\"other\":\"in {0} mo.\"},\"past\":{\"one\":\"{0} mo. ago\",\"other\":\"{0} mo. ago\"},\"-1\":\"last mo.\"},\"month-narrow\":{\"0\":\"this mo.\",\"1\":\"next mo.\",\"future\":{\"one\":\"in {0} mo.\",\"other\":\"in {0} mo.\"},\"past\":{\"one\":\"{0} mo. ago\",\"other\":\"{0} mo. ago\"},\"-1\":\"last mo.\"},\"week\":{\"0\":\"this week\",\"1\":\"next week\",\"future\":{\"one\":\"in {0} week\",\"other\":\"in {0} weeks\"},\"past\":{\"one\":\"{0} week ago\",\"other\":\"{0} weeks ago\"},\"-1\":\"last week\"},\"week-short\":{\"0\":\"this wk.\",\"1\":\"next wk.\",\"future\":{\"one\":\"in {0} wk.\",\"other\":\"in {0} wk.\"},\"past\":{\"one\":\"{0} wk. ago\",\"other\":\"{0} wk. ago\"},\"-1\":\"last wk.\"},\"week-narrow\":{\"0\":\"this wk.\",\"1\":\"next wk.\",\"future\":{\"one\":\"in {0} wk.\",\"other\":\"in {0} wk.\"},\"past\":{\"one\":\"{0} wk. ago\",\"other\":\"{0} wk. ago\"},\"-1\":\"last wk.\"},\"day\":{\"0\":\"today\",\"1\":\"tomorrow\",\"future\":{\"one\":\"in {0} day\",\"other\":\"in {0} days\"},\"past\":{\"one\":\"{0} day ago\",\"other\":\"{0} days ago\"},\"-1\":\"yesterday\"},\"day-short\":{\"0\":\"today\",\"1\":\"tomorrow\",\"future\":{\"one\":\"in {0} day\",\"other\":\"in {0} days\"},\"past\":{\"one\":\"{0} day ago\",\"other\":\"{0} days ago\"},\"-1\":\"yesterday\"},\"day-narrow\":{\"0\":\"today\",\"1\":\"tomorrow\",\"future\":{\"one\":\"in {0} day\",\"other\":\"in {0} days\"},\"past\":{\"one\":\"{0} day ago\",\"other\":\"{0} days ago\"},\"-1\":\"yesterday\"},\"hour\":{\"0\":\"this hour\",\"future\":{\"one\":\"in {0} hour\",\"other\":\"in {0} hours\"},\"past\":{\"one\":\"{0} hour ago\",\"other\":\"{0} hours ago\"}},\"hour-short\":{\"0\":\"this hour\",\"future\":{\"one\":\"in {0} hr.\",\"other\":\"in {0} hr.\"},\"past\":{\"one\":\"{0} hr. ago\",\"other\":\"{0} hr. ago\"}},\"hour-narrow\":{\"0\":\"this hour\",\"future\":{\"one\":\"in {0} hr.\",\"other\":\"in {0} hr.\"},\"past\":{\"one\":\"{0} hr. ago\",\"other\":\"{0} hr. ago\"}},\"minute\":{\"0\":\"this minute\",\"future\":{\"one\":\"in {0} minute\",\"other\":\"in {0} minutes\"},\"past\":{\"one\":\"{0} minute ago\",\"other\":\"{0} minutes ago\"}},\"minute-short\":{\"0\":\"this minute\",\"future\":{\"one\":\"in {0} min.\",\"other\":\"in {0} min.\"},\"past\":{\"one\":\"{0} min. ago\",\"other\":\"{0} min. ago\"}},\"minute-narrow\":{\"0\":\"this minute\",\"future\":{\"one\":\"in {0} min.\",\"other\":\"in {0} min.\"},\"past\":{\"one\":\"{0} min. ago\",\"other\":\"{0} min. ago\"}},\"second\":{\"0\":\"now\",\"future\":{\"one\":\"in {0} second\",\"other\":\"in {0} seconds\"},\"past\":{\"one\":\"{0} second ago\",\"other\":\"{0} seconds ago\"}},\"second-short\":{\"0\":\"now\",\"future\":{\"one\":\"in {0} sec.\",\"other\":\"in {0} sec.\"},\"past\":{\"one\":\"{0} sec. ago\",\"other\":\"{0} sec. ago\"}},\"second-narrow\":{\"0\":\"now\",\"future\":{\"one\":\"in {0} sec.\",\"other\":\"in {0} sec.\"},\"past\":{\"one\":\"{0} sec. ago\",\"other\":\"{0} sec. ago\"}}},\"locale\":\"en\"}\n)\n}","/* @generated */\t\n// prettier-ignore\nif (Intl.RelativeTimeFormat && typeof Intl.RelativeTimeFormat.__addLocaleData === 'function') {\n Intl.RelativeTimeFormat.__addLocaleData({\"data\":{\"nu\":[\"latn\"],\"year\":{\"0\":\"este año\",\"1\":\"el próximo año\",\"future\":{\"one\":\"dentro de {0} año\",\"other\":\"dentro de {0} años\"},\"past\":{\"one\":\"hace {0} año\",\"other\":\"hace {0} años\"},\"-1\":\"el año pasado\"},\"year-short\":{\"0\":\"este año\",\"1\":\"el próximo año\",\"future\":{\"one\":\"dentro de {0} a\",\"other\":\"dentro de {0} a\"},\"past\":{\"one\":\"hace {0} a\",\"other\":\"hace {0} a\"},\"-1\":\"el año pasado\"},\"year-narrow\":{\"0\":\"este año\",\"1\":\"el próximo año\",\"future\":{\"one\":\"dentro de {0} a\",\"other\":\"dentro de {0} a\"},\"past\":{\"one\":\"hace {0} a\",\"other\":\"hace {0} a\"},\"-1\":\"el año pasado\"},\"quarter\":{\"0\":\"este trimestre\",\"1\":\"el próximo trimestre\",\"future\":{\"one\":\"dentro de {0} trimestre\",\"other\":\"dentro de {0} trimestres\"},\"past\":{\"one\":\"hace {0} trimestre\",\"other\":\"hace {0} trimestres\"},\"-1\":\"el trimestre pasado\"},\"quarter-short\":{\"0\":\"este trimestre\",\"1\":\"el próximo trimestre\",\"future\":{\"one\":\"dentro de {0} trim.\",\"other\":\"dentro de {0} trim.\"},\"past\":{\"one\":\"hace {0} trim.\",\"other\":\"hace {0} trim.\"},\"-1\":\"el trimestre pasado\"},\"quarter-narrow\":{\"0\":\"este trimestre\",\"1\":\"el próximo trimestre\",\"future\":{\"one\":\"dentro de {0} trim.\",\"other\":\"dentro de {0} trim.\"},\"past\":{\"one\":\"hace {0} trim.\",\"other\":\"hace {0} trim.\"},\"-1\":\"el trimestre pasado\"},\"month\":{\"0\":\"este mes\",\"1\":\"el próximo mes\",\"future\":{\"one\":\"dentro de {0} mes\",\"other\":\"dentro de {0} meses\"},\"past\":{\"one\":\"hace {0} mes\",\"other\":\"hace {0} meses\"},\"-1\":\"el mes pasado\"},\"month-short\":{\"0\":\"este mes\",\"1\":\"el próximo mes\",\"future\":{\"one\":\"dentro de {0} m\",\"other\":\"dentro de {0} m\"},\"past\":{\"one\":\"hace {0} m\",\"other\":\"hace {0} m\"},\"-1\":\"el mes pasado\"},\"month-narrow\":{\"0\":\"este mes\",\"1\":\"el próximo mes\",\"future\":{\"one\":\"dentro de {0} m\",\"other\":\"dentro de {0} m\"},\"past\":{\"one\":\"hace {0} m\",\"other\":\"hace {0} m\"},\"-1\":\"el mes pasado\"},\"week\":{\"0\":\"esta semana\",\"1\":\"la próxima semana\",\"future\":{\"one\":\"dentro de {0} semana\",\"other\":\"dentro de {0} semanas\"},\"past\":{\"one\":\"hace {0} semana\",\"other\":\"hace {0} semanas\"},\"-1\":\"la semana pasada\"},\"week-short\":{\"0\":\"esta sem.\",\"1\":\"próx. sem.\",\"future\":{\"one\":\"dentro de {0} sem.\",\"other\":\"dentro de {0} sem.\"},\"past\":{\"one\":\"hace {0} sem.\",\"other\":\"hace {0} sem.\"},\"-1\":\"sem. ant.\"},\"week-narrow\":{\"0\":\"esta sem.\",\"1\":\"próx. sem.\",\"future\":{\"one\":\"dentro de {0} sem.\",\"other\":\"dentro de {0} sem.\"},\"past\":{\"one\":\"hace {0} sem.\",\"other\":\"hace {0} sem.\"},\"-1\":\"sem. ant.\"},\"day\":{\"0\":\"hoy\",\"1\":\"mañana\",\"2\":\"pasado mañana\",\"future\":{\"one\":\"dentro de {0} día\",\"other\":\"dentro de {0} días\"},\"past\":{\"one\":\"hace {0} día\",\"other\":\"hace {0} días\"},\"-2\":\"anteayer\",\"-1\":\"ayer\"},\"day-short\":{\"0\":\"hoy\",\"1\":\"mañana\",\"2\":\"pasado mañana\",\"future\":{\"one\":\"dentro de {0} d\",\"other\":\"dentro de {0} d\"},\"past\":{\"one\":\"hace {0} d\",\"other\":\"hace {0} d\"},\"-2\":\"anteayer\",\"-1\":\"ayer\"},\"day-narrow\":{\"0\":\"hoy\",\"1\":\"mañana\",\"2\":\"pasado mañana\",\"future\":{\"one\":\"dentro de {0} d\",\"other\":\"dentro de {0} d\"},\"past\":{\"one\":\"hace {0} d\",\"other\":\"hace {0} d\"},\"-2\":\"anteayer\",\"-1\":\"ayer\"},\"hour\":{\"0\":\"esta hora\",\"future\":{\"one\":\"dentro de {0} hora\",\"other\":\"dentro de {0} horas\"},\"past\":{\"one\":\"hace {0} hora\",\"other\":\"hace {0} horas\"}},\"hour-short\":{\"0\":\"esta hora\",\"future\":{\"one\":\"dentro de {0} h\",\"other\":\"dentro de {0} h\"},\"past\":{\"one\":\"hace {0} h\",\"other\":\"hace {0} h\"}},\"hour-narrow\":{\"0\":\"esta hora\",\"future\":{\"one\":\"dentro de {0} h\",\"other\":\"dentro de {0} h\"},\"past\":{\"one\":\"hace {0} h\",\"other\":\"hace {0} h\"}},\"minute\":{\"0\":\"este minuto\",\"future\":{\"one\":\"dentro de {0} minuto\",\"other\":\"dentro de {0} minutos\"},\"past\":{\"one\":\"hace {0} minuto\",\"other\":\"hace {0} minutos\"}},\"minute-short\":{\"0\":\"este minuto\",\"future\":{\"one\":\"dentro de {0} min\",\"other\":\"dentro de {0} min\"},\"past\":{\"one\":\"hace {0} min\",\"other\":\"hace {0} min\"}},\"minute-narrow\":{\"0\":\"este minuto\",\"future\":{\"one\":\"dentro de {0} min\",\"other\":\"dentro de {0} min\"},\"past\":{\"one\":\"hace {0} min\",\"other\":\"hace {0} min\"}},\"second\":{\"0\":\"ahora\",\"future\":{\"one\":\"dentro de {0} segundo\",\"other\":\"dentro de {0} segundos\"},\"past\":{\"one\":\"hace {0} segundo\",\"other\":\"hace {0} segundos\"}},\"second-short\":{\"0\":\"ahora\",\"future\":{\"one\":\"dentro de {0} s\",\"other\":\"dentro de {0} s\"},\"past\":{\"one\":\"hace {0} s\",\"other\":\"hace {0} s\"}},\"second-narrow\":{\"0\":\"ahora\",\"future\":{\"one\":\"dentro de {0} s\",\"other\":\"dentro de {0} s\"},\"past\":{\"one\":\"hace {0} s\",\"other\":\"hace {0} s\"}}},\"locale\":\"es\"}\n)\n}","/* @generated */\t\n// prettier-ignore\nif (Intl.RelativeTimeFormat && typeof Intl.RelativeTimeFormat.__addLocaleData === 'function') {\n Intl.RelativeTimeFormat.__addLocaleData({\"data\":{\"nu\":[\"latn\"],\"year\":{\"0\":\"cette année\",\"1\":\"l’année prochaine\",\"future\":{\"one\":\"dans {0} an\",\"other\":\"dans {0} ans\"},\"past\":{\"one\":\"il y a {0} an\",\"other\":\"il y a {0} ans\"},\"-1\":\"l’année dernière\"},\"year-short\":{\"0\":\"cette année\",\"1\":\"l’année prochaine\",\"future\":{\"one\":\"dans {0} a\",\"other\":\"dans {0} a\"},\"past\":{\"one\":\"il y a {0} a\",\"other\":\"il y a {0} a\"},\"-1\":\"l’année dernière\"},\"year-narrow\":{\"0\":\"cette année\",\"1\":\"l’année prochaine\",\"future\":{\"one\":\"+{0} a\",\"other\":\"+{0} a\"},\"past\":{\"one\":\"-{0} a\",\"other\":\"-{0} a\"},\"-1\":\"l’année dernière\"},\"quarter\":{\"0\":\"ce trimestre\",\"1\":\"le trimestre prochain\",\"future\":{\"one\":\"dans {0} trimestre\",\"other\":\"dans {0} trimestres\"},\"past\":{\"one\":\"il y a {0} trimestre\",\"other\":\"il y a {0} trimestres\"},\"-1\":\"le trimestre dernier\"},\"quarter-short\":{\"0\":\"ce trimestre\",\"1\":\"le trimestre prochain\",\"future\":{\"one\":\"dans {0} trim.\",\"other\":\"dans {0} trim.\"},\"past\":{\"one\":\"il y a {0} trim.\",\"other\":\"il y a {0} trim.\"},\"-1\":\"le trimestre dernier\"},\"quarter-narrow\":{\"0\":\"ce trimestre\",\"1\":\"le trimestre prochain\",\"future\":{\"one\":\"+{0} trim.\",\"other\":\"+{0} trim.\"},\"past\":{\"one\":\"-{0} trim.\",\"other\":\"-{0} trim.\"},\"-1\":\"le trimestre dernier\"},\"month\":{\"0\":\"ce mois-ci\",\"1\":\"le mois prochain\",\"future\":{\"one\":\"dans {0} mois\",\"other\":\"dans {0} mois\"},\"past\":{\"one\":\"il y a {0} mois\",\"other\":\"il y a {0} mois\"},\"-1\":\"le mois dernier\"},\"month-short\":{\"0\":\"ce mois-ci\",\"1\":\"le mois prochain\",\"future\":{\"one\":\"dans {0} m.\",\"other\":\"dans {0} m.\"},\"past\":{\"one\":\"il y a {0} m.\",\"other\":\"il y a {0} m.\"},\"-1\":\"le mois dernier\"},\"month-narrow\":{\"0\":\"ce mois-ci\",\"1\":\"le mois prochain\",\"future\":{\"one\":\"+{0} m.\",\"other\":\"+{0} m.\"},\"past\":{\"one\":\"-{0} m.\",\"other\":\"-{0} m.\"},\"-1\":\"le mois dernier\"},\"week\":{\"0\":\"cette semaine\",\"1\":\"la semaine prochaine\",\"future\":{\"one\":\"dans {0} semaine\",\"other\":\"dans {0} semaines\"},\"past\":{\"one\":\"il y a {0} semaine\",\"other\":\"il y a {0} semaines\"},\"-1\":\"la semaine dernière\"},\"week-short\":{\"0\":\"cette semaine\",\"1\":\"la semaine prochaine\",\"future\":{\"one\":\"dans {0} sem.\",\"other\":\"dans {0} sem.\"},\"past\":{\"one\":\"il y a {0} sem.\",\"other\":\"il y a {0} sem.\"},\"-1\":\"la semaine dernière\"},\"week-narrow\":{\"0\":\"cette semaine\",\"1\":\"la semaine prochaine\",\"future\":{\"one\":\"+{0} sem.\",\"other\":\"+{0} sem.\"},\"past\":{\"one\":\"-{0} sem.\",\"other\":\"-{0} sem.\"},\"-1\":\"la semaine dernière\"},\"day\":{\"0\":\"aujourd’hui\",\"1\":\"demain\",\"2\":\"après-demain\",\"future\":{\"one\":\"dans {0} jour\",\"other\":\"dans {0} jours\"},\"past\":{\"one\":\"il y a {0} jour\",\"other\":\"il y a {0} jours\"},\"-2\":\"avant-hier\",\"-1\":\"hier\"},\"day-short\":{\"0\":\"aujourd’hui\",\"1\":\"demain\",\"2\":\"après-demain\",\"future\":{\"one\":\"dans {0} j\",\"other\":\"dans {0} j\"},\"past\":{\"one\":\"il y a {0} j\",\"other\":\"il y a {0} j\"},\"-2\":\"avant-hier\",\"-1\":\"hier\"},\"day-narrow\":{\"0\":\"aujourd’hui\",\"1\":\"demain\",\"2\":\"après-demain\",\"future\":{\"one\":\"+{0} j\",\"other\":\"+{0} j\"},\"past\":{\"one\":\"-{0} j\",\"other\":\"-{0} j\"},\"-2\":\"avant-hier\",\"-1\":\"hier\"},\"hour\":{\"0\":\"cette heure-ci\",\"future\":{\"one\":\"dans {0} heure\",\"other\":\"dans {0} heures\"},\"past\":{\"one\":\"il y a {0} heure\",\"other\":\"il y a {0} heures\"}},\"hour-short\":{\"0\":\"cette heure-ci\",\"future\":{\"one\":\"dans {0} h\",\"other\":\"dans {0} h\"},\"past\":{\"one\":\"il y a {0} h\",\"other\":\"il y a {0} h\"}},\"hour-narrow\":{\"0\":\"cette heure-ci\",\"future\":{\"one\":\"+{0} h\",\"other\":\"+{0} h\"},\"past\":{\"one\":\"-{0} h\",\"other\":\"-{0} h\"}},\"minute\":{\"0\":\"cette minute-ci\",\"future\":{\"one\":\"dans {0} minute\",\"other\":\"dans {0} minutes\"},\"past\":{\"one\":\"il y a {0} minute\",\"other\":\"il y a {0} minutes\"}},\"minute-short\":{\"0\":\"cette minute-ci\",\"future\":{\"one\":\"dans {0} min\",\"other\":\"dans {0} min\"},\"past\":{\"one\":\"il y a {0} min\",\"other\":\"il y a {0} min\"}},\"minute-narrow\":{\"0\":\"cette minute-ci\",\"future\":{\"one\":\"+{0} min\",\"other\":\"+{0} min\"},\"past\":{\"one\":\"-{0} min\",\"other\":\"-{0} min\"}},\"second\":{\"0\":\"maintenant\",\"future\":{\"one\":\"dans {0} seconde\",\"other\":\"dans {0} secondes\"},\"past\":{\"one\":\"il y a {0} seconde\",\"other\":\"il y a {0} secondes\"}},\"second-short\":{\"0\":\"maintenant\",\"future\":{\"one\":\"dans {0} s\",\"other\":\"dans {0} s\"},\"past\":{\"one\":\"il y a {0} s\",\"other\":\"il y a {0} s\"}},\"second-narrow\":{\"0\":\"maintenant\",\"future\":{\"one\":\"+{0} s\",\"other\":\"+{0} s\"},\"past\":{\"one\":\"-{0} s\",\"other\":\"-{0} s\"}}},\"locale\":\"fr\"}\n)\n}","/* @generated */\t\n// prettier-ignore\nif (Intl.RelativeTimeFormat && typeof Intl.RelativeTimeFormat.__addLocaleData === 'function') {\n Intl.RelativeTimeFormat.__addLocaleData({\"data\":{\"nu\":[\"latn\"],\"year\":{\"0\":\"今年\",\"1\":\"来年\",\"future\":{\"other\":\"{0} 年後\"},\"past\":{\"other\":\"{0} 年前\"},\"-1\":\"昨年\"},\"year-short\":{\"0\":\"今年\",\"1\":\"来年\",\"future\":{\"other\":\"{0} 年後\"},\"past\":{\"other\":\"{0} 年前\"},\"-1\":\"昨年\"},\"year-narrow\":{\"0\":\"今年\",\"1\":\"来年\",\"future\":{\"other\":\"{0}年後\"},\"past\":{\"other\":\"{0}年前\"},\"-1\":\"昨年\"},\"quarter\":{\"0\":\"今四半期\",\"1\":\"翌四半期\",\"future\":{\"other\":\"{0} 四半期後\"},\"past\":{\"other\":\"{0} 四半期前\"},\"-1\":\"前四半期\"},\"quarter-short\":{\"0\":\"今四半期\",\"1\":\"翌四半期\",\"future\":{\"other\":\"{0} 四半期後\"},\"past\":{\"other\":\"{0} 四半期前\"},\"-1\":\"前四半期\"},\"quarter-narrow\":{\"0\":\"今四半期\",\"1\":\"翌四半期\",\"future\":{\"other\":\"{0}四半期後\"},\"past\":{\"other\":\"{0}四半期前\"},\"-1\":\"前四半期\"},\"month\":{\"0\":\"今月\",\"1\":\"来月\",\"future\":{\"other\":\"{0} か月後\"},\"past\":{\"other\":\"{0} か月前\"},\"-1\":\"先月\"},\"month-short\":{\"0\":\"今月\",\"1\":\"来月\",\"future\":{\"other\":\"{0} か月後\"},\"past\":{\"other\":\"{0} か月前\"},\"-1\":\"先月\"},\"month-narrow\":{\"0\":\"今月\",\"1\":\"来月\",\"future\":{\"other\":\"{0}か月後\"},\"past\":{\"other\":\"{0}か月前\"},\"-1\":\"先月\"},\"week\":{\"0\":\"今週\",\"1\":\"来週\",\"future\":{\"other\":\"{0} 週間後\"},\"past\":{\"other\":\"{0} 週間前\"},\"-1\":\"先週\"},\"week-short\":{\"0\":\"今週\",\"1\":\"来週\",\"future\":{\"other\":\"{0} 週間後\"},\"past\":{\"other\":\"{0} 週間前\"},\"-1\":\"先週\"},\"week-narrow\":{\"0\":\"今週\",\"1\":\"来週\",\"future\":{\"other\":\"{0}週間後\"},\"past\":{\"other\":\"{0}週間前\"},\"-1\":\"先週\"},\"day\":{\"0\":\"今日\",\"1\":\"明日\",\"2\":\"明後日\",\"future\":{\"other\":\"{0} 日後\"},\"past\":{\"other\":\"{0} 日前\"},\"-2\":\"一昨日\",\"-1\":\"昨日\"},\"day-short\":{\"0\":\"今日\",\"1\":\"明日\",\"2\":\"明後日\",\"future\":{\"other\":\"{0} 日後\"},\"past\":{\"other\":\"{0} 日前\"},\"-2\":\"一昨日\",\"-1\":\"昨日\"},\"day-narrow\":{\"0\":\"今日\",\"1\":\"明日\",\"2\":\"明後日\",\"future\":{\"other\":\"{0}日後\"},\"past\":{\"other\":\"{0}日前\"},\"-2\":\"一昨日\",\"-1\":\"昨日\"},\"hour\":{\"0\":\"1 時間以内\",\"future\":{\"other\":\"{0} 時間後\"},\"past\":{\"other\":\"{0} 時間前\"}},\"hour-short\":{\"0\":\"1 時間以内\",\"future\":{\"other\":\"{0} 時間後\"},\"past\":{\"other\":\"{0} 時間前\"}},\"hour-narrow\":{\"0\":\"1 時間以内\",\"future\":{\"other\":\"{0}時間後\"},\"past\":{\"other\":\"{0}時間前\"}},\"minute\":{\"0\":\"1 分以内\",\"future\":{\"other\":\"{0} 分後\"},\"past\":{\"other\":\"{0} 分前\"}},\"minute-short\":{\"0\":\"1 分以内\",\"future\":{\"other\":\"{0} 分後\"},\"past\":{\"other\":\"{0} 分前\"}},\"minute-narrow\":{\"0\":\"1 分以内\",\"future\":{\"other\":\"{0}分後\"},\"past\":{\"other\":\"{0}分前\"}},\"second\":{\"0\":\"今\",\"future\":{\"other\":\"{0} 秒後\"},\"past\":{\"other\":\"{0} 秒前\"}},\"second-short\":{\"0\":\"今\",\"future\":{\"other\":\"{0} 秒後\"},\"past\":{\"other\":\"{0} 秒前\"}},\"second-narrow\":{\"0\":\"今\",\"future\":{\"other\":\"{0}秒後\"},\"past\":{\"other\":\"{0}秒前\"}}},\"locale\":\"ja\"}\n)\n}","/* @generated */\t\n// prettier-ignore\nif (Intl.RelativeTimeFormat && typeof Intl.RelativeTimeFormat.__addLocaleData === 'function') {\n Intl.RelativeTimeFormat.__addLocaleData({\"data\":{\"nu\":[\"latn\"],\"year\":{\"0\":\"今年\",\"1\":\"明年\",\"future\":{\"other\":\"{0}年后\"},\"past\":{\"other\":\"{0}年前\"},\"-1\":\"去年\"},\"year-short\":{\"0\":\"今年\",\"1\":\"明年\",\"future\":{\"other\":\"{0}年后\"},\"past\":{\"other\":\"{0}年前\"},\"-1\":\"去年\"},\"year-narrow\":{\"0\":\"今年\",\"1\":\"明年\",\"future\":{\"other\":\"{0}年后\"},\"past\":{\"other\":\"{0}年前\"},\"-1\":\"去年\"},\"quarter\":{\"0\":\"本季度\",\"1\":\"下季度\",\"future\":{\"other\":\"{0}个季度后\"},\"past\":{\"other\":\"{0}个季度前\"},\"-1\":\"上季度\"},\"quarter-short\":{\"0\":\"本季度\",\"1\":\"下季度\",\"future\":{\"other\":\"{0}个季度后\"},\"past\":{\"other\":\"{0}个季度前\"},\"-1\":\"上季度\"},\"quarter-narrow\":{\"0\":\"本季度\",\"1\":\"下季度\",\"future\":{\"other\":\"{0}个季度后\"},\"past\":{\"other\":\"{0}个季度前\"},\"-1\":\"上季度\"},\"month\":{\"0\":\"本月\",\"1\":\"下个月\",\"future\":{\"other\":\"{0}个月后\"},\"past\":{\"other\":\"{0}个月前\"},\"-1\":\"上个月\"},\"month-short\":{\"0\":\"本月\",\"1\":\"下个月\",\"future\":{\"other\":\"{0}个月后\"},\"past\":{\"other\":\"{0}个月前\"},\"-1\":\"上个月\"},\"month-narrow\":{\"0\":\"本月\",\"1\":\"下个月\",\"future\":{\"other\":\"{0}个月后\"},\"past\":{\"other\":\"{0}个月前\"},\"-1\":\"上个月\"},\"week\":{\"0\":\"本周\",\"1\":\"下周\",\"future\":{\"other\":\"{0}周后\"},\"past\":{\"other\":\"{0}周前\"},\"-1\":\"上周\"},\"week-short\":{\"0\":\"本周\",\"1\":\"下周\",\"future\":{\"other\":\"{0}周后\"},\"past\":{\"other\":\"{0}周前\"},\"-1\":\"上周\"},\"week-narrow\":{\"0\":\"本周\",\"1\":\"下周\",\"future\":{\"other\":\"{0}周后\"},\"past\":{\"other\":\"{0}周前\"},\"-1\":\"上周\"},\"day\":{\"0\":\"今天\",\"1\":\"明天\",\"2\":\"后天\",\"future\":{\"other\":\"{0}天后\"},\"past\":{\"other\":\"{0}天前\"},\"-2\":\"前天\",\"-1\":\"昨天\"},\"day-short\":{\"0\":\"今天\",\"1\":\"明天\",\"2\":\"后天\",\"future\":{\"other\":\"{0}天后\"},\"past\":{\"other\":\"{0}天前\"},\"-2\":\"前天\",\"-1\":\"昨天\"},\"day-narrow\":{\"0\":\"今天\",\"1\":\"明天\",\"2\":\"后天\",\"future\":{\"other\":\"{0}天后\"},\"past\":{\"other\":\"{0}天前\"},\"-2\":\"前天\",\"-1\":\"昨天\"},\"hour\":{\"0\":\"这一时间 / 此时\",\"future\":{\"other\":\"{0}小时后\"},\"past\":{\"other\":\"{0}小时前\"}},\"hour-short\":{\"0\":\"这一时间 / 此时\",\"future\":{\"other\":\"{0}小时后\"},\"past\":{\"other\":\"{0}小时前\"}},\"hour-narrow\":{\"0\":\"这一时间 / 此时\",\"future\":{\"other\":\"{0}小时后\"},\"past\":{\"other\":\"{0}小时前\"}},\"minute\":{\"0\":\"此刻\",\"future\":{\"other\":\"{0}分钟后\"},\"past\":{\"other\":\"{0}分钟前\"}},\"minute-short\":{\"0\":\"此刻\",\"future\":{\"other\":\"{0}分钟后\"},\"past\":{\"other\":\"{0}分钟前\"}},\"minute-narrow\":{\"0\":\"此刻\",\"future\":{\"other\":\"{0}分钟后\"},\"past\":{\"other\":\"{0}分钟前\"}},\"second\":{\"0\":\"现在\",\"future\":{\"other\":\"{0}秒钟后\"},\"past\":{\"other\":\"{0}秒钟前\"}},\"second-short\":{\"0\":\"现在\",\"future\":{\"other\":\"{0}秒后\"},\"past\":{\"other\":\"{0}秒前\"}},\"second-narrow\":{\"0\":\"现在\",\"future\":{\"other\":\"{0}秒后\"},\"past\":{\"other\":\"{0}秒前\"}}},\"locale\":\"zh\"}\n)\n}","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\nvar _1 = (0, tslib_1.__importDefault)(require(\"./\"));\nvar should_polyfill_1 = require(\"./should-polyfill\");\nif ((0, should_polyfill_1.shouldPolyfill)()) {\n Object.defineProperty(Intl, 'RelativeTimeFormat', {\n value: _1.default,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shouldPolyfill = void 0;\nvar intl_localematcher_1 = require(\"@formatjs/intl-localematcher\");\nvar supported_locales_1 = require(\"./supported-locales\");\nfunction supportedLocalesOf(locale) {\n if (!locale) {\n return true;\n }\n var locales = Array.isArray(locale) ? locale : [locale];\n return (Intl.RelativeTimeFormat.supportedLocalesOf(locales).length ===\n locales.length);\n}\nfunction hasResolvedOptionsNumberingSystem(locale) {\n try {\n return ('numberingSystem' in\n new Intl.RelativeTimeFormat(locale || 'en', {\n numeric: 'auto',\n }).resolvedOptions());\n }\n catch (_) {\n return false;\n }\n}\nfunction shouldPolyfill(locale) {\n if (locale === void 0) { locale = 'en'; }\n if (!('RelativeTimeFormat' in Intl) ||\n !supportedLocalesOf(locale) ||\n !hasResolvedOptionsNumberingSystem(locale)) {\n return (0, intl_localematcher_1.match)([locale], supported_locales_1.supportedLocales, 'en');\n }\n}\nexports.shouldPolyfill = shouldPolyfill;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.supportedLocales = void 0;\n// This file is generated from supported-locales-gen.ts\nexports.supportedLocales = [\"af-NA\", \"af\", \"agq\", \"ak\", \"am\", \"ar-AE\", \"ar-BH\", \"ar-DJ\", \"ar-DZ\", \"ar-EG\", \"ar-EH\", \"ar-ER\", \"ar-IL\", \"ar-IQ\", \"ar-JO\", \"ar-KM\", \"ar-KW\", \"ar-LB\", \"ar-LY\", \"ar-MA\", \"ar-MR\", \"ar-OM\", \"ar-PS\", \"ar-QA\", \"ar-SA\", \"ar-SD\", \"ar-SO\", \"ar-SS\", \"ar-SY\", \"ar-TD\", \"ar-TN\", \"ar-YE\", \"ar\", \"as\", \"asa\", \"ast\", \"az-Cyrl\", \"az-Latn\", \"az\", \"bas\", \"be-tarask\", \"be\", \"bem\", \"bez\", \"bg\", \"bm\", \"bn-IN\", \"bn\", \"bo-IN\", \"bo\", \"br\", \"brx\", \"bs-Cyrl\", \"bs-Latn\", \"bs\", \"ca-AD\", \"ca-ES-valencia\", \"ca-FR\", \"ca-IT\", \"ca\", \"ccp-IN\", \"ccp\", \"ce\", \"ceb\", \"cgg\", \"chr\", \"ckb-IR\", \"ckb\", \"cs\", \"cy\", \"da-GL\", \"da\", \"dav\", \"de-AT\", \"de-BE\", \"de-CH\", \"de-IT\", \"de-LI\", \"de-LU\", \"de\", \"dje\", \"doi\", \"dsb\", \"dua\", \"dyo\", \"dz\", \"ebu\", \"ee-TG\", \"ee\", \"el-CY\", \"el\", \"en-001\", \"en-150\", \"en-AE\", \"en-AG\", \"en-AI\", \"en-AS\", \"en-AT\", \"en-AU\", \"en-BB\", \"en-BE\", \"en-BI\", \"en-BM\", \"en-BS\", \"en-BW\", \"en-BZ\", \"en-CA\", \"en-CC\", \"en-CH\", \"en-CK\", \"en-CM\", \"en-CX\", \"en-CY\", \"en-DE\", \"en-DG\", \"en-DK\", \"en-DM\", \"en-ER\", \"en-FI\", \"en-FJ\", \"en-FK\", \"en-FM\", \"en-GB\", \"en-GD\", \"en-GG\", \"en-GH\", \"en-GI\", \"en-GM\", \"en-GU\", \"en-GY\", \"en-HK\", \"en-IE\", \"en-IL\", \"en-IM\", \"en-IN\", \"en-IO\", \"en-JE\", \"en-JM\", \"en-KE\", \"en-KI\", \"en-KN\", \"en-KY\", \"en-LC\", \"en-LR\", \"en-LS\", \"en-MG\", \"en-MH\", \"en-MO\", \"en-MP\", \"en-MS\", \"en-MT\", \"en-MU\", \"en-MW\", \"en-MY\", \"en-NA\", \"en-NF\", \"en-NG\", \"en-NL\", \"en-NR\", \"en-NU\", \"en-NZ\", \"en-PG\", \"en-PH\", \"en-PK\", \"en-PN\", \"en-PR\", \"en-PW\", \"en-RW\", \"en-SB\", \"en-SC\", \"en-SD\", \"en-SE\", \"en-SG\", \"en-SH\", \"en-SI\", \"en-SL\", \"en-SS\", \"en-SX\", \"en-SZ\", \"en-TC\", \"en-TK\", \"en-TO\", \"en-TT\", \"en-TV\", \"en-TZ\", \"en-UG\", \"en-UM\", \"en-VC\", \"en-VG\", \"en-VI\", \"en-VU\", \"en-WS\", \"en-ZA\", \"en-ZM\", \"en-ZW\", \"en\", \"eo\", \"es-419\", \"es-AR\", \"es-BO\", \"es-BR\", \"es-BZ\", \"es-CL\", \"es-CO\", \"es-CR\", \"es-CU\", \"es-DO\", \"es-EA\", \"es-EC\", \"es-GQ\", \"es-GT\", \"es-HN\", \"es-IC\", \"es-MX\", \"es-NI\", \"es-PA\", \"es-PE\", \"es-PH\", \"es-PR\", \"es-PY\", \"es-SV\", \"es-US\", \"es-UY\", \"es-VE\", \"es\", \"et\", \"eu\", \"ewo\", \"fa-AF\", \"fa\", \"ff-Adlm-BF\", \"ff-Adlm-CM\", \"ff-Adlm-GH\", \"ff-Adlm-GM\", \"ff-Adlm-GW\", \"ff-Adlm-LR\", \"ff-Adlm-MR\", \"ff-Adlm-NE\", \"ff-Adlm-NG\", \"ff-Adlm-SL\", \"ff-Adlm-SN\", \"ff-Adlm\", \"ff-Latn-BF\", \"ff-Latn-CM\", \"ff-Latn-GH\", \"ff-Latn-GM\", \"ff-Latn-GN\", \"ff-Latn-GW\", \"ff-Latn-LR\", \"ff-Latn-MR\", \"ff-Latn-NE\", \"ff-Latn-NG\", \"ff-Latn-SL\", \"ff-Latn\", \"ff\", \"fi\", \"fil\", \"fo-DK\", \"fo\", \"fr-BE\", \"fr-BF\", \"fr-BI\", \"fr-BJ\", \"fr-BL\", \"fr-CA\", \"fr-CD\", \"fr-CF\", \"fr-CG\", \"fr-CH\", \"fr-CI\", \"fr-CM\", \"fr-DJ\", \"fr-DZ\", \"fr-GA\", \"fr-GF\", \"fr-GN\", \"fr-GP\", \"fr-GQ\", \"fr-HT\", \"fr-KM\", \"fr-LU\", \"fr-MA\", \"fr-MC\", \"fr-MF\", \"fr-MG\", \"fr-ML\", \"fr-MQ\", \"fr-MR\", \"fr-MU\", \"fr-NC\", \"fr-NE\", \"fr-PF\", \"fr-PM\", \"fr-RE\", \"fr-RW\", \"fr-SC\", \"fr-SN\", \"fr-SY\", \"fr-TD\", \"fr-TG\", \"fr-TN\", \"fr-VU\", \"fr-WF\", \"fr-YT\", \"fr\", \"fur\", \"fy\", \"ga-GB\", \"ga\", \"gd\", \"gl\", \"gsw-FR\", \"gsw-LI\", \"gsw\", \"gu\", \"guz\", \"gv\", \"ha-GH\", \"ha-NE\", \"ha\", \"haw\", \"he\", \"hi\", \"hr-BA\", \"hr\", \"hsb\", \"hu\", \"hy\", \"ia\", \"id\", \"ig\", \"ii\", \"is\", \"it-CH\", \"it-SM\", \"it-VA\", \"it\", \"ja\", \"jgo\", \"jmc\", \"jv\", \"ka\", \"kab\", \"kam\", \"kde\", \"kea\", \"kgp\", \"khq\", \"ki\", \"kk\", \"kkj\", \"kl\", \"kln\", \"km\", \"kn\", \"ko-KP\", \"ko\", \"kok\", \"ks-Arab\", \"ks\", \"ksb\", \"ksf\", \"ksh\", \"ku\", \"kw\", \"ky\", \"lag\", \"lb\", \"lg\", \"lkt\", \"ln-AO\", \"ln-CF\", \"ln-CG\", \"ln\", \"lo\", \"lrc-IQ\", \"lrc\", \"lt\", \"lu\", \"luo\", \"luy\", \"lv\", \"mai\", \"mas-TZ\", \"mas\", \"mer\", \"mfe\", \"mg\", \"mgh\", \"mgo\", \"mi\", \"mk\", \"ml\", \"mn\", \"mni-Beng\", \"mni\", \"mr\", \"ms-BN\", \"ms-ID\", \"ms-SG\", \"ms\", \"mt\", \"mua\", \"my\", \"mzn\", \"naq\", \"nb-SJ\", \"nb\", \"nd\", \"nds-NL\", \"nds\", \"ne-IN\", \"ne\", \"nl-AW\", \"nl-BE\", \"nl-BQ\", \"nl-CW\", \"nl-SR\", \"nl-SX\", \"nl\", \"nmg\", \"nn\", \"nnh\", \"no\", \"nus\", \"nyn\", \"om-KE\", \"om\", \"or\", \"os-RU\", \"os\", \"pa-Arab\", \"pa-Guru\", \"pa\", \"pcm\", \"pl\", \"ps-PK\", \"ps\", \"pt-AO\", \"pt-CH\", \"pt-CV\", \"pt-GQ\", \"pt-GW\", \"pt-LU\", \"pt-MO\", \"pt-MZ\", \"pt-PT\", \"pt-ST\", \"pt-TL\", \"pt\", \"qu-BO\", \"qu-EC\", \"qu\", \"rm\", \"rn\", \"ro-MD\", \"ro\", \"rof\", \"ru-BY\", \"ru-KG\", \"ru-KZ\", \"ru-MD\", \"ru-UA\", \"ru\", \"rw\", \"rwk\", \"sa\", \"sah\", \"saq\", \"sat-Olck\", \"sat\", \"sbp\", \"sc\", \"sd-Arab\", \"sd-Deva\", \"sd\", \"se-FI\", \"se-SE\", \"se\", \"seh\", \"ses\", \"sg\", \"shi-Latn\", \"shi-Tfng\", \"shi\", \"si\", \"sk\", \"sl\", \"smn\", \"sn\", \"so-DJ\", \"so-ET\", \"so-KE\", \"so\", \"sq-MK\", \"sq-XK\", \"sq\", \"sr-Cyrl-BA\", \"sr-Cyrl-ME\", \"sr-Cyrl-XK\", \"sr-Cyrl\", \"sr-Latn-BA\", \"sr-Latn-ME\", \"sr-Latn-XK\", \"sr-Latn\", \"sr\", \"su-Latn\", \"su\", \"sv-AX\", \"sv-FI\", \"sv\", \"sw-CD\", \"sw-KE\", \"sw-UG\", \"sw\", \"ta-LK\", \"ta-MY\", \"ta-SG\", \"ta\", \"te\", \"teo-KE\", \"teo\", \"tg\", \"th\", \"ti-ER\", \"ti\", \"tk\", \"to\", \"tr-CY\", \"tr\", \"tt\", \"twq\", \"tzm\", \"ug\", \"uk\", \"und\", \"ur-IN\", \"ur\", \"uz-Arab\", \"uz-Cyrl\", \"uz-Latn\", \"uz\", \"vai-Latn\", \"vai-Vaii\", \"vai\", \"vi\", \"vun\", \"wae\", \"wo\", \"xh\", \"xog\", \"yav\", \"yi\", \"yo-BJ\", \"yo\", \"yrl-CO\", \"yrl-VE\", \"yrl\", \"yue-Hans\", \"yue-Hant\", \"yue\", \"zgh\", \"zh-Hans-HK\", \"zh-Hans-MO\", \"zh-Hans-SG\", \"zh-Hans\", \"zh-Hant-HK\", \"zh-Hant-MO\", \"zh-Hant\", \"zh\", \"zu\"];\n","/* ***** BEGIN LICENSE BLOCK *****\n * Distributed under the BSD license:\n *\n * Copyright (c) 2010, Ajax.org B.V.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * * Neither the name of Ajax.org B.V. nor the\n * names of its contributors may be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * ***** END LICENSE BLOCK ***** */\n\n/**\n * Define a module along with a payload\n * @param module a name for the payload\n * @param payload a function to call with (require, exports, module) params\n */\n\n(function() {\n\nvar ACE_NAMESPACE = \"ace\";\n\nvar global = (function() { return this; })();\nif (!global && typeof window != \"undefined\") global = window; // strict mode\n\n\nif (!ACE_NAMESPACE && typeof requirejs !== \"undefined\")\n return;\n\n\nvar define = function(module, deps, payload) {\n if (typeof module !== \"string\") {\n if (define.original)\n define.original.apply(this, arguments);\n else {\n console.error(\"dropping module because define wasn\\'t a string.\");\n console.trace();\n }\n return;\n }\n if (arguments.length == 2)\n payload = deps;\n if (!define.modules[module]) {\n define.payloads[module] = payload;\n define.modules[module] = null;\n }\n};\n\ndefine.modules = {};\ndefine.payloads = {};\n\n/**\n * Get at functionality define()ed using the function above\n */\nvar _require = function(parentId, module, callback) {\n if (typeof module === \"string\") {\n var payload = lookup(parentId, module);\n if (payload != undefined) {\n callback && callback();\n return payload;\n }\n } else if (Object.prototype.toString.call(module) === \"[object Array]\") {\n var params = [];\n for (var i = 0, l = module.length; i < l; ++i) {\n var dep = lookup(parentId, module[i]);\n if (dep == undefined && require.original)\n return;\n params.push(dep);\n }\n return callback && callback.apply(null, params) || true;\n }\n};\n\nvar require = function(module, callback) {\n var packagedModule = _require(\"\", module, callback);\n if (packagedModule == undefined && require.original)\n return require.original.apply(this, arguments);\n return packagedModule;\n};\n\nvar normalizeModule = function(parentId, moduleName) {\n // normalize plugin requires\n if (moduleName.indexOf(\"!\") !== -1) {\n var chunks = moduleName.split(\"!\");\n return normalizeModule(parentId, chunks[0]) + \"!\" + normalizeModule(parentId, chunks[1]);\n }\n // normalize relative requires\n if (moduleName.charAt(0) == \".\") {\n var base = parentId.split(\"/\").slice(0, -1).join(\"/\");\n moduleName = base + \"/\" + moduleName;\n\n while(moduleName.indexOf(\".\") !== -1 && previous != moduleName) {\n var previous = moduleName;\n moduleName = moduleName.replace(/\\/\\.\\//, \"/\").replace(/[^\\/]+\\/\\.\\.\\//, \"\");\n }\n }\n return moduleName;\n};\n\n/**\n * Internal function to lookup moduleNames and resolve them by calling the\n * definition function if needed.\n */\nvar lookup = function(parentId, moduleName) {\n moduleName = normalizeModule(parentId, moduleName);\n\n var module = define.modules[moduleName];\n if (!module) {\n module = define.payloads[moduleName];\n if (typeof module === 'function') {\n var exports = {};\n var mod = {\n id: moduleName,\n uri: '',\n exports: exports,\n packaged: true\n };\n\n var req = function(module, callback) {\n return _require(moduleName, module, callback);\n };\n\n var returnValue = module(req, exports, mod);\n exports = returnValue || mod.exports;\n define.modules[moduleName] = exports;\n delete define.payloads[moduleName];\n }\n module = define.modules[moduleName] = exports || module;\n }\n return module;\n};\n\nfunction exportAce(ns) {\n var root = global;\n if (ns) {\n if (!global[ns])\n global[ns] = {};\n root = global[ns];\n }\n\n if (!root.define || !root.define.packaged) {\n define.original = root.define;\n root.define = define;\n root.define.packaged = true;\n }\n\n if (!root.require || !root.require.packaged) {\n require.original = root.require;\n root.require = require;\n root.require.packaged = true;\n }\n}\n\nexportAce(ACE_NAMESPACE);\n\n})();\n\nace.define(\"ace/lib/es6-shim\",[\"require\",\"exports\",\"module\"], function(require, exports, module){function defineProp(obj, name, val) {\n Object.defineProperty(obj, name, {\n value: val,\n enumerable: false,\n writable: true,\n configurable: true\n });\n}\nif (!String.prototype.startsWith) {\n defineProp(String.prototype, \"startsWith\", function (searchString, position) {\n position = position || 0;\n return this.lastIndexOf(searchString, position) === position;\n });\n}\nif (!String.prototype.endsWith) {\n defineProp(String.prototype, \"endsWith\", function (searchString, position) {\n var subjectString = this;\n if (position === undefined || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n });\n}\nif (!String.prototype.repeat) {\n defineProp(String.prototype, \"repeat\", function (count) {\n var result = \"\";\n var string = this;\n while (count > 0) {\n if (count & 1)\n result += string;\n if ((count >>= 1))\n string += string;\n }\n return result;\n });\n}\nif (!String.prototype.includes) {\n defineProp(String.prototype, \"includes\", function (str, position) {\n return this.indexOf(str, position) != -1;\n });\n}\nif (!Object.assign) {\n Object.assign = function (target) {\n if (target === undefined || target === null) {\n throw new TypeError(\"Cannot convert undefined or null to object\");\n }\n var output = Object(target);\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n if (source !== undefined && source !== null) {\n Object.keys(source).forEach(function (key) {\n output[key] = source[key];\n });\n }\n }\n return output;\n };\n}\nif (!Object.values) {\n Object.values = function (o) {\n return Object.keys(o).map(function (k) {\n return o[k];\n });\n };\n}\nif (!Array.prototype.find) {\n defineProp(Array.prototype, \"find\", function (predicate) {\n var len = this.length;\n var thisArg = arguments[1];\n for (var k = 0; k < len; k++) {\n var kValue = this[k];\n if (predicate.call(thisArg, kValue, k, this)) {\n return kValue;\n }\n }\n });\n}\nif (!Array.prototype.findIndex) {\n defineProp(Array.prototype, \"findIndex\", function (predicate) {\n var len = this.length;\n var thisArg = arguments[1];\n for (var k = 0; k < len; k++) {\n var kValue = this[k];\n if (predicate.call(thisArg, kValue, k, this)) {\n return k;\n }\n }\n });\n}\nif (!Array.prototype.includes) {\n defineProp(Array.prototype, \"includes\", function (item, position) {\n return this.indexOf(item, position) != -1;\n });\n}\nif (!Array.prototype.fill) {\n defineProp(Array.prototype, \"fill\", function (value) {\n var O = this;\n var len = O.length >>> 0;\n var start = arguments[1];\n var relativeStart = start >> 0;\n var k = relativeStart < 0\n ? Math.max(len + relativeStart, 0)\n : Math.min(relativeStart, len);\n var end = arguments[2];\n var relativeEnd = end === undefined ? len : end >> 0;\n var final = relativeEnd < 0\n ? Math.max(len + relativeEnd, 0)\n : Math.min(relativeEnd, len);\n while (k < final) {\n O[k] = value;\n k++;\n }\n return O;\n });\n}\nif (!Array.of) {\n defineProp(Array, \"of\", function () {\n return Array.prototype.slice.call(arguments);\n });\n}\n\n});\n\nace.define(\"ace/lib/fixoldbrowsers\",[\"require\",\"exports\",\"module\",\"ace/lib/es6-shim\"], function(require, exports, module){// vim:set ts=4 sts=4 sw=4 st:\n\"use strict\";\nrequire(\"./es6-shim\");\n\n});\n\nace.define(\"ace/lib/lang\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nexports.last = function (a) {\n return a[a.length - 1];\n};\nexports.stringReverse = function (string) {\n return string.split(\"\").reverse().join(\"\");\n};\nexports.stringRepeat = function (string, count) {\n var result = '';\n while (count > 0) {\n if (count & 1)\n result += string;\n if (count >>= 1)\n string += string;\n }\n return result;\n};\nvar trimBeginRegexp = /^\\s\\s*/;\nvar trimEndRegexp = /\\s\\s*$/;\nexports.stringTrimLeft = function (string) {\n return string.replace(trimBeginRegexp, '');\n};\nexports.stringTrimRight = function (string) {\n return string.replace(trimEndRegexp, '');\n};\nexports.copyObject = function (obj) {\n var copy = {};\n for (var key in obj) {\n copy[key] = obj[key];\n }\n return copy;\n};\nexports.copyArray = function (array) {\n var copy = [];\n for (var i = 0, l = array.length; i < l; i++) {\n if (array[i] && typeof array[i] == \"object\")\n copy[i] = this.copyObject(array[i]);\n else\n copy[i] = array[i];\n }\n return copy;\n};\nexports.deepCopy = function deepCopy(obj) {\n if (typeof obj !== \"object\" || !obj)\n return obj;\n var copy;\n if (Array.isArray(obj)) {\n copy = [];\n for (var key = 0; key < obj.length; key++) {\n copy[key] = deepCopy(obj[key]);\n }\n return copy;\n }\n if (Object.prototype.toString.call(obj) !== \"[object Object]\")\n return obj;\n copy = {};\n for (var key in obj)\n copy[key] = deepCopy(obj[key]);\n return copy;\n};\nexports.arrayToMap = function (arr) {\n var map = {};\n for (var i = 0; i < arr.length; i++) {\n map[arr[i]] = 1;\n }\n return map;\n};\nexports.createMap = function (props) {\n var map = Object.create(null);\n for (var i in props) {\n map[i] = props[i];\n }\n return map;\n};\nexports.arrayRemove = function (array, value) {\n for (var i = 0; i <= array.length; i++) {\n if (value === array[i]) {\n array.splice(i, 1);\n }\n }\n};\nexports.escapeRegExp = function (str) {\n return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g, '\\\\$1');\n};\nexports.escapeHTML = function (str) {\n return (\"\" + str).replace(/&/g, \"&\").replace(/\"/g, \""\").replace(/'/g, \"'\").replace(/= 0)\n ? parseFloat((ua.match(/(?:MSIE |Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/) || [])[1])\n : parseFloat((ua.match(/(?:Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/) || [])[1]); // for ie\nexports.isOldIE = exports.isIE && exports.isIE < 9;\nexports.isGecko = exports.isMozilla = ua.match(/ Gecko\\/\\d+/);\nexports.isOpera = typeof opera == \"object\" && Object.prototype.toString.call(window.opera) == \"[object Opera]\";\nexports.isWebKit = parseFloat(ua.split(\"WebKit/\")[1]) || undefined;\nexports.isChrome = parseFloat(ua.split(\" Chrome/\")[1]) || undefined;\nexports.isEdge = parseFloat(ua.split(\" Edge/\")[1]) || undefined;\nexports.isAIR = ua.indexOf(\"AdobeAIR\") >= 0;\nexports.isAndroid = ua.indexOf(\"Android\") >= 0;\nexports.isChromeOS = ua.indexOf(\" CrOS \") >= 0;\nexports.isIOS = /iPad|iPhone|iPod/.test(ua) && !window.MSStream;\nif (exports.isIOS)\n exports.isMac = true;\nexports.isMobile = exports.isIOS || exports.isAndroid;\n\n});\n\nace.define(\"ace/lib/dom\",[\"require\",\"exports\",\"module\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar useragent = require(\"./useragent\");\nvar XHTML_NS = \"http://www.w3.org/1999/xhtml\";\nexports.buildDom = function buildDom(arr, parent, refs) {\n if (typeof arr == \"string\" && arr) {\n var txt = document.createTextNode(arr);\n if (parent)\n parent.appendChild(txt);\n return txt;\n }\n if (!Array.isArray(arr)) {\n if (arr && arr.appendChild && parent)\n parent.appendChild(arr);\n return arr;\n }\n if (typeof arr[0] != \"string\" || !arr[0]) {\n var els = [];\n for (var i = 0; i < arr.length; i++) {\n var ch = buildDom(arr[i], parent, refs);\n ch && els.push(ch);\n }\n return els;\n }\n var el = document.createElement(arr[0]);\n var options = arr[1];\n var childIndex = 1;\n if (options && typeof options == \"object\" && !Array.isArray(options))\n childIndex = 2;\n for (var i = childIndex; i < arr.length; i++)\n buildDom(arr[i], el, refs);\n if (childIndex == 2) {\n Object.keys(options).forEach(function (n) {\n var val = options[n];\n if (n === \"class\") {\n el.className = Array.isArray(val) ? val.join(\" \") : val;\n }\n else if (typeof val == \"function\" || n == \"value\" || n[0] == \"$\") {\n el[n] = val;\n }\n else if (n === \"ref\") {\n if (refs)\n refs[val] = el;\n }\n else if (n === \"style\") {\n if (typeof val == \"string\")\n el.style.cssText = val;\n }\n else if (val != null) {\n el.setAttribute(n, val);\n }\n });\n }\n if (parent)\n parent.appendChild(el);\n return el;\n};\nexports.getDocumentHead = function (doc) {\n if (!doc)\n doc = document;\n return doc.head || doc.getElementsByTagName(\"head\")[0] || doc.documentElement;\n};\nexports.createElement = function (tag, ns) {\n return document.createElementNS ?\n document.createElementNS(ns || XHTML_NS, tag) :\n document.createElement(tag);\n};\nexports.removeChildren = function (element) {\n element.innerHTML = \"\";\n};\nexports.createTextNode = function (textContent, element) {\n var doc = element ? element.ownerDocument : document;\n return doc.createTextNode(textContent);\n};\nexports.createFragment = function (element) {\n var doc = element ? element.ownerDocument : document;\n return doc.createDocumentFragment();\n};\nexports.hasCssClass = function (el, name) {\n var classes = (el.className + \"\").split(/\\s+/g);\n return classes.indexOf(name) !== -1;\n};\nexports.addCssClass = function (el, name) {\n if (!exports.hasCssClass(el, name)) {\n el.className += \" \" + name;\n }\n};\nexports.removeCssClass = function (el, name) {\n var classes = el.className.split(/\\s+/g);\n while (true) {\n var index = classes.indexOf(name);\n if (index == -1) {\n break;\n }\n classes.splice(index, 1);\n }\n el.className = classes.join(\" \");\n};\nexports.toggleCssClass = function (el, name) {\n var classes = el.className.split(/\\s+/g), add = true;\n while (true) {\n var index = classes.indexOf(name);\n if (index == -1) {\n break;\n }\n add = false;\n classes.splice(index, 1);\n }\n if (add)\n classes.push(name);\n el.className = classes.join(\" \");\n return add;\n};\nexports.setCssClass = function (node, className, include) {\n if (include) {\n exports.addCssClass(node, className);\n }\n else {\n exports.removeCssClass(node, className);\n }\n};\nexports.hasCssString = function (id, doc) {\n var index = 0, sheets;\n doc = doc || document;\n if ((sheets = doc.querySelectorAll(\"style\"))) {\n while (index < sheets.length) {\n if (sheets[index++].id === id) {\n return true;\n }\n }\n }\n};\nexports.removeElementById = function (id, doc) {\n doc = doc || document;\n if (doc.getElementById(id)) {\n doc.getElementById(id).remove();\n }\n};\nvar strictCSP;\nvar cssCache = [];\nexports.useStrictCSP = function (value) {\n strictCSP = value;\n if (value == false)\n insertPendingStyles();\n else if (!cssCache)\n cssCache = [];\n};\nfunction insertPendingStyles() {\n var cache = cssCache;\n cssCache = null;\n cache && cache.forEach(function (item) {\n importCssString(item[0], item[1]);\n });\n}\nfunction importCssString(cssText, id, target) {\n if (typeof document == \"undefined\")\n return;\n if (cssCache) {\n if (target) {\n insertPendingStyles();\n }\n else if (target === false) {\n return cssCache.push([cssText, id]);\n }\n }\n if (strictCSP)\n return;\n var container = target;\n if (!target || !target.getRootNode) {\n container = document;\n }\n else {\n container = target.getRootNode();\n if (!container || container == target)\n container = document;\n }\n var doc = container.ownerDocument || container;\n if (id && exports.hasCssString(id, container))\n return null;\n if (id)\n cssText += \"\\n/*# sourceURL=ace/css/\" + id + \" */\";\n var style = exports.createElement(\"style\");\n style.appendChild(doc.createTextNode(cssText));\n if (id)\n style.id = id;\n if (container == doc)\n container = exports.getDocumentHead(doc);\n container.insertBefore(style, container.firstChild);\n}\nexports.importCssString = importCssString;\nexports.importCssStylsheet = function (uri, doc) {\n exports.buildDom([\"link\", { rel: \"stylesheet\", href: uri }], exports.getDocumentHead(doc));\n};\nexports.scrollbarWidth = function (doc) {\n var inner = exports.createElement(\"ace_inner\");\n inner.style.width = \"100%\";\n inner.style.minWidth = \"0px\";\n inner.style.height = \"200px\";\n inner.style.display = \"block\";\n var outer = exports.createElement(\"ace_outer\");\n var style = outer.style;\n style.position = \"absolute\";\n style.left = \"-10000px\";\n style.overflow = \"hidden\";\n style.width = \"200px\";\n style.minWidth = \"0px\";\n style.height = \"150px\";\n style.display = \"block\";\n outer.appendChild(inner);\n var body = (doc && doc.documentElement) || (document && document.documentElement);\n if (!body)\n return 0;\n body.appendChild(outer);\n var noScrollbar = inner.offsetWidth;\n style.overflow = \"scroll\";\n var withScrollbar = inner.offsetWidth;\n if (noScrollbar === withScrollbar) {\n withScrollbar = outer.clientWidth;\n }\n body.removeChild(outer);\n return noScrollbar - withScrollbar;\n};\nexports.computedStyle = function (element, style) {\n return window.getComputedStyle(element, \"\") || {};\n};\nexports.setStyle = function (styles, property, value) {\n if (styles[property] !== value) {\n styles[property] = value;\n }\n};\nexports.HAS_CSS_ANIMATION = false;\nexports.HAS_CSS_TRANSFORMS = false;\nexports.HI_DPI = useragent.isWin\n ? typeof window !== \"undefined\" && window.devicePixelRatio >= 1.5\n : true;\nif (useragent.isChromeOS)\n exports.HI_DPI = false;\nif (typeof document !== \"undefined\") {\n var div = document.createElement(\"div\");\n if (exports.HI_DPI && div.style.transform !== undefined)\n exports.HAS_CSS_TRANSFORMS = true;\n if (!useragent.isEdge && typeof div.style.animationName !== \"undefined\")\n exports.HAS_CSS_ANIMATION = true;\n div = null;\n}\nif (exports.HAS_CSS_TRANSFORMS) {\n exports.translate = function (element, tx, ty) {\n element.style.transform = \"translate(\" + Math.round(tx) + \"px, \" + Math.round(ty) + \"px)\";\n };\n}\nelse {\n exports.translate = function (element, tx, ty) {\n element.style.top = Math.round(ty) + \"px\";\n element.style.left = Math.round(tx) + \"px\";\n };\n}\n\n});\n\nace.define(\"ace/lib/net\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){/*\n * based on code from:\n *\n * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\"use strict\";\nvar dom = require(\"./dom\");\nexports.get = function (url, callback) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n callback(xhr.responseText);\n }\n };\n xhr.send(null);\n};\nexports.loadScript = function (path, callback) {\n var head = dom.getDocumentHead();\n var s = document.createElement('script');\n s.src = path;\n head.appendChild(s);\n s.onload = s.onreadystatechange = function (_, isAbort) {\n if (isAbort || !s.readyState || s.readyState == \"loaded\" || s.readyState == \"complete\") {\n s = s.onload = s.onreadystatechange = null;\n if (!isAbort)\n callback();\n }\n };\n};\nexports.qualifyURL = function (url) {\n var a = document.createElement('a');\n a.href = url;\n return a.href;\n};\n\n});\n\nace.define(\"ace/lib/oop\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nexports.inherits = function (ctor, superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n};\nexports.mixin = function (obj, mixin) {\n for (var key in mixin) {\n obj[key] = mixin[key];\n }\n return obj;\n};\nexports.implement = function (proto, mixin) {\n exports.mixin(proto, mixin);\n};\n\n});\n\nace.define(\"ace/lib/event_emitter\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar EventEmitter = {};\nvar stopPropagation = function () { this.propagationStopped = true; };\nvar preventDefault = function () { this.defaultPrevented = true; };\nEventEmitter._emit =\n EventEmitter._dispatchEvent = function (eventName, e) {\n this._eventRegistry || (this._eventRegistry = {});\n this._defaultHandlers || (this._defaultHandlers = {});\n var listeners = this._eventRegistry[eventName] || [];\n var defaultHandler = this._defaultHandlers[eventName];\n if (!listeners.length && !defaultHandler)\n return;\n if (typeof e != \"object\" || !e)\n e = {};\n if (!e.type)\n e.type = eventName;\n if (!e.stopPropagation)\n e.stopPropagation = stopPropagation;\n if (!e.preventDefault)\n e.preventDefault = preventDefault;\n listeners = listeners.slice();\n for (var i = 0; i < listeners.length; i++) {\n listeners[i](e, this);\n if (e.propagationStopped)\n break;\n }\n if (defaultHandler && !e.defaultPrevented)\n return defaultHandler(e, this);\n };\nEventEmitter._signal = function (eventName, e) {\n var listeners = (this._eventRegistry || {})[eventName];\n if (!listeners)\n return;\n listeners = listeners.slice();\n for (var i = 0; i < listeners.length; i++)\n listeners[i](e, this);\n};\nEventEmitter.once = function (eventName, callback) {\n var _self = this;\n this.on(eventName, function newCallback() {\n _self.off(eventName, newCallback);\n callback.apply(null, arguments);\n });\n if (!callback) {\n return new Promise(function (resolve) {\n callback = resolve;\n });\n }\n};\nEventEmitter.setDefaultHandler = function (eventName, callback) {\n var handlers = this._defaultHandlers;\n if (!handlers)\n handlers = this._defaultHandlers = { _disabled_: {} };\n if (handlers[eventName]) {\n var old = handlers[eventName];\n var disabled = handlers._disabled_[eventName];\n if (!disabled)\n handlers._disabled_[eventName] = disabled = [];\n disabled.push(old);\n var i = disabled.indexOf(callback);\n if (i != -1)\n disabled.splice(i, 1);\n }\n handlers[eventName] = callback;\n};\nEventEmitter.removeDefaultHandler = function (eventName, callback) {\n var handlers = this._defaultHandlers;\n if (!handlers)\n return;\n var disabled = handlers._disabled_[eventName];\n if (handlers[eventName] == callback) {\n if (disabled)\n this.setDefaultHandler(eventName, disabled.pop());\n }\n else if (disabled) {\n var i = disabled.indexOf(callback);\n if (i != -1)\n disabled.splice(i, 1);\n }\n};\nEventEmitter.on =\n EventEmitter.addEventListener = function (eventName, callback, capturing) {\n this._eventRegistry = this._eventRegistry || {};\n var listeners = this._eventRegistry[eventName];\n if (!listeners)\n listeners = this._eventRegistry[eventName] = [];\n if (listeners.indexOf(callback) == -1)\n listeners[capturing ? \"unshift\" : \"push\"](callback);\n return callback;\n };\nEventEmitter.off =\n EventEmitter.removeListener =\n EventEmitter.removeEventListener = function (eventName, callback) {\n this._eventRegistry = this._eventRegistry || {};\n var listeners = this._eventRegistry[eventName];\n if (!listeners)\n return;\n var index = listeners.indexOf(callback);\n if (index !== -1)\n listeners.splice(index, 1);\n };\nEventEmitter.removeAllListeners = function (eventName) {\n if (!eventName)\n this._eventRegistry = this._defaultHandlers = undefined;\n if (this._eventRegistry)\n this._eventRegistry[eventName] = undefined;\n if (this._defaultHandlers)\n this._defaultHandlers[eventName] = undefined;\n};\nexports.EventEmitter = EventEmitter;\n\n});\n\nace.define(\"ace/lib/app_config\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"no use strict\";\nvar oop = require(\"./oop\");\nvar EventEmitter = require(\"./event_emitter\").EventEmitter;\nvar optionsProvider = {\n setOptions: function (optList) {\n Object.keys(optList).forEach(function (key) {\n this.setOption(key, optList[key]);\n }, this);\n },\n getOptions: function (optionNames) {\n var result = {};\n if (!optionNames) {\n var options = this.$options;\n optionNames = Object.keys(options).filter(function (key) {\n return !options[key].hidden;\n });\n }\n else if (!Array.isArray(optionNames)) {\n result = optionNames;\n optionNames = Object.keys(result);\n }\n optionNames.forEach(function (key) {\n result[key] = this.getOption(key);\n }, this);\n return result;\n },\n setOption: function (name, value) {\n if (this[\"$\" + name] === value)\n return;\n var opt = this.$options[name];\n if (!opt) {\n return warn('misspelled option \"' + name + '\"');\n }\n if (opt.forwardTo)\n return this[opt.forwardTo] && this[opt.forwardTo].setOption(name, value);\n if (!opt.handlesSet)\n this[\"$\" + name] = value;\n if (opt && opt.set)\n opt.set.call(this, value);\n },\n getOption: function (name) {\n var opt = this.$options[name];\n if (!opt) {\n return warn('misspelled option \"' + name + '\"');\n }\n if (opt.forwardTo)\n return this[opt.forwardTo] && this[opt.forwardTo].getOption(name);\n return opt && opt.get ? opt.get.call(this) : this[\"$\" + name];\n }\n};\nfunction warn(message) {\n if (typeof console != \"undefined\" && console.warn)\n console.warn.apply(console, arguments);\n}\nfunction reportError(msg, data) {\n var e = new Error(msg);\n e.data = data;\n if (typeof console == \"object\" && console.error)\n console.error(e);\n setTimeout(function () { throw e; });\n}\nvar messages;\nvar AppConfig = /** @class */ (function () {\n function AppConfig() {\n this.$defaultOptions = {};\n }\n AppConfig.prototype.defineOptions = function (obj, path, options) {\n if (!obj.$options)\n this.$defaultOptions[path] = obj.$options = {};\n Object.keys(options).forEach(function (key) {\n var opt = options[key];\n if (typeof opt == \"string\")\n opt = { forwardTo: opt };\n opt.name || (opt.name = key);\n obj.$options[opt.name] = opt;\n if (\"initialValue\" in opt)\n obj[\"$\" + opt.name] = opt.initialValue;\n });\n oop.implement(obj, optionsProvider);\n return this;\n };\n AppConfig.prototype.resetOptions = function (obj) {\n Object.keys(obj.$options).forEach(function (key) {\n var opt = obj.$options[key];\n if (\"value\" in opt)\n obj.setOption(key, opt.value);\n });\n };\n AppConfig.prototype.setDefaultValue = function (path, name, value) {\n if (!path) {\n for (path in this.$defaultOptions)\n if (this.$defaultOptions[path][name])\n break;\n if (!this.$defaultOptions[path][name])\n return false;\n }\n var opts = this.$defaultOptions[path] || (this.$defaultOptions[path] = {});\n if (opts[name]) {\n if (opts.forwardTo)\n this.setDefaultValue(opts.forwardTo, name, value);\n else\n opts[name].value = value;\n }\n };\n AppConfig.prototype.setDefaultValues = function (path, optionHash) {\n Object.keys(optionHash).forEach(function (key) {\n this.setDefaultValue(path, key, optionHash[key]);\n }, this);\n };\n AppConfig.prototype.setMessages = function (value) {\n messages = value;\n };\n AppConfig.prototype.nls = function (string, params) {\n if (messages && !messages[string]) {\n warn(\"No message found for '\" + string + \"' in the provided messages, falling back to default English message.\");\n }\n var translated = messages && messages[string] || string;\n if (params) {\n translated = translated.replace(/\\$(\\$|[\\d]+)/g, function (_, name) {\n if (name == \"$\")\n return \"$\";\n return params[name];\n });\n }\n return translated;\n };\n return AppConfig;\n}());\nAppConfig.prototype.warn = warn;\nAppConfig.prototype.reportError = reportError;\noop.implement(AppConfig.prototype, EventEmitter);\nexports.AppConfig = AppConfig;\n\n});\n\nace.define(\"ace/theme/textmate-css\",[\"require\",\"exports\",\"module\"], function(require, exports, module){module.exports = \".ace-tm .ace_gutter {\\n background: #f0f0f0;\\n color: #333;\\n}\\n\\n.ace-tm .ace_print-margin {\\n width: 1px;\\n background: #e8e8e8;\\n}\\n\\n.ace-tm .ace_fold {\\n background-color: #6B72E6;\\n}\\n\\n.ace-tm {\\n background-color: #FFFFFF;\\n color: black;\\n}\\n\\n.ace-tm .ace_cursor {\\n color: black;\\n}\\n \\n.ace-tm .ace_invisible {\\n color: rgb(191, 191, 191);\\n}\\n\\n.ace-tm .ace_storage,\\n.ace-tm .ace_keyword {\\n color: blue;\\n}\\n\\n.ace-tm .ace_constant {\\n color: rgb(197, 6, 11);\\n}\\n\\n.ace-tm .ace_constant.ace_buildin {\\n color: rgb(88, 72, 246);\\n}\\n\\n.ace-tm .ace_constant.ace_language {\\n color: rgb(88, 92, 246);\\n}\\n\\n.ace-tm .ace_constant.ace_library {\\n color: rgb(6, 150, 14);\\n}\\n\\n.ace-tm .ace_invalid {\\n background-color: rgba(255, 0, 0, 0.1);\\n color: red;\\n}\\n\\n.ace-tm .ace_support.ace_function {\\n color: rgb(60, 76, 114);\\n}\\n\\n.ace-tm .ace_support.ace_constant {\\n color: rgb(6, 150, 14);\\n}\\n\\n.ace-tm .ace_support.ace_type,\\n.ace-tm .ace_support.ace_class {\\n color: rgb(109, 121, 222);\\n}\\n\\n.ace-tm .ace_keyword.ace_operator {\\n color: rgb(104, 118, 135);\\n}\\n\\n.ace-tm .ace_string {\\n color: rgb(3, 106, 7);\\n}\\n\\n.ace-tm .ace_comment {\\n color: rgb(76, 136, 107);\\n}\\n\\n.ace-tm .ace_comment.ace_doc {\\n color: rgb(0, 102, 255);\\n}\\n\\n.ace-tm .ace_comment.ace_doc.ace_tag {\\n color: rgb(128, 159, 191);\\n}\\n\\n.ace-tm .ace_constant.ace_numeric {\\n color: rgb(0, 0, 205);\\n}\\n\\n.ace-tm .ace_variable {\\n color: rgb(49, 132, 149);\\n}\\n\\n.ace-tm .ace_xml-pe {\\n color: rgb(104, 104, 91);\\n}\\n\\n.ace-tm .ace_entity.ace_name.ace_function {\\n color: #0000A2;\\n}\\n\\n\\n.ace-tm .ace_heading {\\n color: rgb(12, 7, 255);\\n}\\n\\n.ace-tm .ace_list {\\n color:rgb(185, 6, 144);\\n}\\n\\n.ace-tm .ace_meta.ace_tag {\\n color:rgb(0, 22, 142);\\n}\\n\\n.ace-tm .ace_string.ace_regex {\\n color: rgb(255, 0, 0)\\n}\\n\\n.ace-tm .ace_marker-layer .ace_selection {\\n background: rgb(181, 213, 255);\\n}\\n.ace-tm.ace_multiselect .ace_selection.ace_start {\\n box-shadow: 0 0 3px 0px white;\\n}\\n.ace-tm .ace_marker-layer .ace_step {\\n background: rgb(252, 255, 0);\\n}\\n\\n.ace-tm .ace_marker-layer .ace_stack {\\n background: rgb(164, 229, 101);\\n}\\n\\n.ace-tm .ace_marker-layer .ace_bracket {\\n margin: -1px 0 0 -1px;\\n border: 1px solid rgb(192, 192, 192);\\n}\\n\\n.ace-tm .ace_marker-layer .ace_active-line {\\n background: rgba(0, 0, 0, 0.07);\\n}\\n\\n.ace-tm .ace_gutter-active-line {\\n background-color : #dcdcdc;\\n}\\n\\n.ace-tm .ace_marker-layer .ace_selected-word {\\n background: rgb(250, 250, 255);\\n border: 1px solid rgb(200, 200, 250);\\n}\\n\\n.ace-tm .ace_indent-guide {\\n background: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\\\") right repeat-y;\\n}\\n\\n.ace-tm .ace_indent-guide-active {\\n background: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC\\\") right repeat-y;\\n}\\n\";\n\n});\n\nace.define(\"ace/theme/textmate\",[\"require\",\"exports\",\"module\",\"ace/theme/textmate-css\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nexports.isDark = false;\nexports.cssClass = \"ace-tm\";\nexports.cssText = require(\"./textmate-css\");\nexports.$id = \"ace/theme/textmate\";\nvar dom = require(\"../lib/dom\");\ndom.importCssString(exports.cssText, exports.cssClass, false);\n\n});\n\nace.define(\"ace/config\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/lib/net\",\"ace/lib/dom\",\"ace/lib/app_config\",\"ace/theme/textmate\"], function(require, exports, module){\"no use strict\";\nvar lang = require(\"./lib/lang\");\nvar net = require(\"./lib/net\");\nvar dom = require(\"./lib/dom\");\nvar AppConfig = require(\"./lib/app_config\").AppConfig;\nmodule.exports = exports = new AppConfig();\nvar options = {\n packaged: false,\n workerPath: null,\n modePath: null,\n themePath: null,\n basePath: \"\",\n suffix: \".js\",\n $moduleUrls: {},\n loadWorkerFromBlob: true,\n sharedPopups: false,\n useStrictCSP: null\n};\nexports.get = function (key) {\n if (!options.hasOwnProperty(key))\n throw new Error(\"Unknown config key: \" + key);\n return options[key];\n};\nexports.set = function (key, value) {\n if (options.hasOwnProperty(key))\n options[key] = value;\n else if (this.setDefaultValue(\"\", key, value) == false)\n throw new Error(\"Unknown config key: \" + key);\n if (key == \"useStrictCSP\")\n dom.useStrictCSP(value);\n};\nexports.all = function () {\n return lang.copyObject(options);\n};\nexports.$modes = {};\nexports.moduleUrl = function (name, component) {\n if (options.$moduleUrls[name])\n return options.$moduleUrls[name];\n var parts = name.split(\"/\");\n component = component || parts[parts.length - 2] || \"\";\n var sep = component == \"snippets\" ? \"/\" : \"-\";\n var base = parts[parts.length - 1];\n if (component == \"worker\" && sep == \"-\") {\n var re = new RegExp(\"^\" + component + \"[\\\\-_]|[\\\\-_]\" + component + \"$\", \"g\");\n base = base.replace(re, \"\");\n }\n if ((!base || base == component) && parts.length > 1)\n base = parts[parts.length - 2];\n var path = options[component + \"Path\"];\n if (path == null) {\n path = options.basePath;\n }\n else if (sep == \"/\") {\n component = sep = \"\";\n }\n if (path && path.slice(-1) != \"/\")\n path += \"/\";\n return path + component + sep + base + this.get(\"suffix\");\n};\nexports.setModuleUrl = function (name, subst) {\n return options.$moduleUrls[name] = subst;\n};\nvar loader = function (moduleName, cb) {\n if (moduleName === \"ace/theme/textmate\" || moduleName === \"./theme/textmate\")\n return cb(null, require(\"./theme/textmate\"));\n if (customLoader)\n return customLoader(moduleName, cb);\n console.error(\"loader is not configured\");\n};\nvar customLoader;\nexports.setLoader = function (cb) {\n customLoader = cb;\n};\nexports.dynamicModules = Object.create(null);\nexports.$loading = {};\nexports.$loaded = {};\nexports.loadModule = function (moduleName, onLoad) {\n var loadedModule, moduleType;\n if (Array.isArray(moduleName)) {\n moduleType = moduleName[0];\n moduleName = moduleName[1];\n }\n var load = function (module) {\n if (module && !exports.$loading[moduleName])\n return onLoad && onLoad(module);\n if (!exports.$loading[moduleName])\n exports.$loading[moduleName] = [];\n exports.$loading[moduleName].push(onLoad);\n if (exports.$loading[moduleName].length > 1)\n return;\n var afterLoad = function () {\n loader(moduleName, function (err, module) {\n if (module)\n exports.$loaded[moduleName] = module;\n exports._emit(\"load.module\", { name: moduleName, module: module });\n var listeners = exports.$loading[moduleName];\n exports.$loading[moduleName] = null;\n listeners.forEach(function (onLoad) {\n onLoad && onLoad(module);\n });\n });\n };\n if (!exports.get(\"packaged\"))\n return afterLoad();\n net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad);\n reportErrorIfPathIsNotConfigured();\n };\n if (exports.dynamicModules[moduleName]) {\n exports.dynamicModules[moduleName]().then(function (module) {\n if (module.default) {\n load(module.default);\n }\n else {\n load(module);\n }\n });\n }\n else {\n try {\n loadedModule = this.$require(moduleName);\n }\n catch (e) { }\n load(loadedModule || exports.$loaded[moduleName]);\n }\n};\nexports.$require = function (moduleName) {\n if (typeof module.require == \"function\") {\n var req = \"require\";\n return module[req](moduleName);\n }\n};\nexports.setModuleLoader = function (moduleName, onLoad) {\n exports.dynamicModules[moduleName] = onLoad;\n};\nvar reportErrorIfPathIsNotConfigured = function () {\n if (!options.basePath && !options.workerPath\n && !options.modePath && !options.themePath\n && !Object.keys(options.$moduleUrls).length) {\n console.error(\"Unable to infer path to ace from script src,\", \"use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes\", \"or with webpack use ace/webpack-resolver\");\n reportErrorIfPathIsNotConfigured = function () { };\n }\n};\nexports.version = \"1.24.1\";\n\n});\n\nace.define(\"ace/loader_build\",[\"require\",\"exports\",\"module\",\"ace/lib/fixoldbrowsers\",\"ace/config\"], function(require, exports, module) {\n\"use strict\";\n\nrequire(\"./lib/fixoldbrowsers\");\nvar config = require(\"./config\");\nconfig.setLoader(function(moduleName, cb) {\n require([moduleName], function(module) {\n cb(null, module);\n });\n});\n\nvar global = (function() {\n return this || typeof window != \"undefined\" && window;\n})();\n\nmodule.exports = function(ace) {\n config.init = init;\n config.$require = require;\n ace.require = require;\n\n if (typeof define === \"function\")\n ace.define = define;\n};\ninit(true);function init(packaged) {\n\n if (!global || !global.document)\n return;\n \n config.set(\"packaged\", packaged || require.packaged || module.packaged || (global.define && define.packaged));\n\n var scriptOptions = {};\n var scriptUrl = \"\";\n var currentScript = (document.currentScript || document._currentScript ); // native or polyfill\n var currentDocument = currentScript && currentScript.ownerDocument || document;\n \n if (currentScript && currentScript.src) {\n scriptUrl = currentScript.src.split(/[?#]/)[0].split(\"/\").slice(0, -1).join(\"/\") || \"\";\n }\n \n var scripts = currentDocument.getElementsByTagName(\"script\");\n for (var i=0; i
[\" + this.end.row + \"/\" + this.end.column + \"]\");\n };\n Range.prototype.contains = function (row, column) {\n return this.compare(row, column) == 0;\n };\n Range.prototype.compareRange = function (range) {\n var cmp, end = range.end, start = range.start;\n cmp = this.compare(end.row, end.column);\n if (cmp == 1) {\n cmp = this.compare(start.row, start.column);\n if (cmp == 1) {\n return 2;\n }\n else if (cmp == 0) {\n return 1;\n }\n else {\n return 0;\n }\n }\n else if (cmp == -1) {\n return -2;\n }\n else {\n cmp = this.compare(start.row, start.column);\n if (cmp == -1) {\n return -1;\n }\n else if (cmp == 1) {\n return 42;\n }\n else {\n return 0;\n }\n }\n };\n Range.prototype.comparePoint = function (p) {\n return this.compare(p.row, p.column);\n };\n Range.prototype.containsRange = function (range) {\n return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;\n };\n Range.prototype.intersects = function (range) {\n var cmp = this.compareRange(range);\n return (cmp == -1 || cmp == 0 || cmp == 1);\n };\n Range.prototype.isEnd = function (row, column) {\n return this.end.row == row && this.end.column == column;\n };\n Range.prototype.isStart = function (row, column) {\n return this.start.row == row && this.start.column == column;\n };\n Range.prototype.setStart = function (row, column) {\n if (typeof row == \"object\") {\n this.start.column = row.column;\n this.start.row = row.row;\n }\n else {\n this.start.row = row;\n this.start.column = column;\n }\n };\n Range.prototype.setEnd = function (row, column) {\n if (typeof row == \"object\") {\n this.end.column = row.column;\n this.end.row = row.row;\n }\n else {\n this.end.row = row;\n this.end.column = column;\n }\n };\n Range.prototype.inside = function (row, column) {\n if (this.compare(row, column) == 0) {\n if (this.isEnd(row, column) || this.isStart(row, column)) {\n return false;\n }\n else {\n return true;\n }\n }\n return false;\n };\n Range.prototype.insideStart = function (row, column) {\n if (this.compare(row, column) == 0) {\n if (this.isEnd(row, column)) {\n return false;\n }\n else {\n return true;\n }\n }\n return false;\n };\n Range.prototype.insideEnd = function (row, column) {\n if (this.compare(row, column) == 0) {\n if (this.isStart(row, column)) {\n return false;\n }\n else {\n return true;\n }\n }\n return false;\n };\n Range.prototype.compare = function (row, column) {\n if (!this.isMultiLine()) {\n if (row === this.start.row) {\n return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);\n }\n }\n if (row < this.start.row)\n return -1;\n if (row > this.end.row)\n return 1;\n if (this.start.row === row)\n return column >= this.start.column ? 0 : -1;\n if (this.end.row === row)\n return column <= this.end.column ? 0 : 1;\n return 0;\n };\n Range.prototype.compareStart = function (row, column) {\n if (this.start.row == row && this.start.column == column) {\n return -1;\n }\n else {\n return this.compare(row, column);\n }\n };\n Range.prototype.compareEnd = function (row, column) {\n if (this.end.row == row && this.end.column == column) {\n return 1;\n }\n else {\n return this.compare(row, column);\n }\n };\n Range.prototype.compareInside = function (row, column) {\n if (this.end.row == row && this.end.column == column) {\n return 1;\n }\n else if (this.start.row == row && this.start.column == column) {\n return -1;\n }\n else {\n return this.compare(row, column);\n }\n };\n Range.prototype.clipRows = function (firstRow, lastRow) {\n if (this.end.row > lastRow)\n var end = { row: lastRow + 1, column: 0 };\n else if (this.end.row < firstRow)\n var end = { row: firstRow, column: 0 };\n if (this.start.row > lastRow)\n var start = { row: lastRow + 1, column: 0 };\n else if (this.start.row < firstRow)\n var start = { row: firstRow, column: 0 };\n return Range.fromPoints(start || this.start, end || this.end);\n };\n Range.prototype.extend = function (row, column) {\n var cmp = this.compare(row, column);\n if (cmp == 0)\n return this;\n else if (cmp == -1)\n var start = { row: row, column: column };\n else\n var end = { row: row, column: column };\n return Range.fromPoints(start || this.start, end || this.end);\n };\n Range.prototype.isEmpty = function () {\n return (this.start.row === this.end.row && this.start.column === this.end.column);\n };\n Range.prototype.isMultiLine = function () {\n return (this.start.row !== this.end.row);\n };\n Range.prototype.clone = function () {\n return Range.fromPoints(this.start, this.end);\n };\n Range.prototype.collapseRows = function () {\n if (this.end.column == 0)\n return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0);\n else\n return new Range(this.start.row, 0, this.end.row, 0);\n };\n Range.prototype.toScreenRange = function (session) {\n var screenPosStart = session.documentToScreenPosition(this.start);\n var screenPosEnd = session.documentToScreenPosition(this.end);\n return new Range(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column);\n };\n Range.prototype.moveBy = function (row, column) {\n this.start.row += row;\n this.start.column += column;\n this.end.row += row;\n this.end.column += column;\n };\n return Range;\n}());\nRange.fromPoints = function (start, end) {\n return new Range(start.row, start.column, end.row, end.column);\n};\nRange.comparePoints = comparePoints;\nRange.comparePoints = function (p1, p2) {\n return p1.row - p2.row || p1.column - p2.column;\n};\nexports.Range = Range;\n\n});\n\nace.define(\"ace/lib/keys\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\"], function(require, exports, module){/*! @license\n==========================================================================\nSproutCore -- JavaScript Application Framework\ncopyright 2006-2009, Sprout Systems Inc., Apple Inc. and contributors.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the \"Software\"),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n\nSproutCore and the SproutCore logo are trademarks of Sprout Systems, Inc.\n\nFor more information about SproutCore, visit http://www.sproutcore.com\n\n\n==========================================================================\n@license */\n\"use strict\";\nvar oop = require(\"./oop\");\nvar Keys = (function () {\n var ret = {\n MODIFIER_KEYS: {\n 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta',\n 91: 'MetaLeft', 92: 'MetaRight', 93: 'ContextMenu'\n },\n KEY_MODS: {\n \"ctrl\": 1, \"alt\": 2, \"option\": 2, \"shift\": 4,\n \"super\": 8, \"meta\": 8, \"command\": 8, \"cmd\": 8,\n \"control\": 1\n },\n FUNCTION_KEYS: {\n 8: \"Backspace\",\n 9: \"Tab\",\n 13: \"Return\",\n 19: \"Pause\",\n 27: \"Esc\",\n 32: \"Space\",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"Left\",\n 38: \"Up\",\n 39: \"Right\",\n 40: \"Down\",\n 44: \"Print\",\n 45: \"Insert\",\n 46: \"Delete\",\n 96: \"Numpad0\",\n 97: \"Numpad1\",\n 98: \"Numpad2\",\n 99: \"Numpad3\",\n 100: \"Numpad4\",\n 101: \"Numpad5\",\n 102: \"Numpad6\",\n 103: \"Numpad7\",\n 104: \"Numpad8\",\n 105: \"Numpad9\",\n '-13': \"NumpadEnter\",\n 112: \"F1\",\n 113: \"F2\",\n 114: \"F3\",\n 115: \"F4\",\n 116: \"F5\",\n 117: \"F6\",\n 118: \"F7\",\n 119: \"F8\",\n 120: \"F9\",\n 121: \"F10\",\n 122: \"F11\",\n 123: \"F12\",\n 144: \"Numlock\",\n 145: \"Scrolllock\"\n },\n PRINTABLE_KEYS: {\n 32: ' ', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5',\n 54: '6', 55: '7', 56: '8', 57: '9', 59: ';', 61: '=', 65: 'a',\n 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h',\n 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o',\n 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v',\n 87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.',\n 186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`',\n 219: '[', 220: '\\\\', 221: ']', 222: \"'\", 111: '/', 106: '*'\n }\n };\n ret.PRINTABLE_KEYS[173] = '-';\n var name, i;\n for (i in ret.FUNCTION_KEYS) {\n name = ret.FUNCTION_KEYS[i].toLowerCase();\n ret[name] = parseInt(i, 10);\n }\n for (i in ret.PRINTABLE_KEYS) {\n name = ret.PRINTABLE_KEYS[i].toLowerCase();\n ret[name] = parseInt(i, 10);\n }\n oop.mixin(ret, ret.MODIFIER_KEYS);\n oop.mixin(ret, ret.PRINTABLE_KEYS);\n oop.mixin(ret, ret.FUNCTION_KEYS);\n ret.enter = ret[\"return\"];\n ret.escape = ret.esc;\n ret.del = ret[\"delete\"];\n (function () {\n var mods = [\"cmd\", \"ctrl\", \"alt\", \"shift\"];\n for (var i = Math.pow(2, mods.length); i--;) {\n ret.KEY_MODS[i] = mods.filter(function (x) {\n return i & ret.KEY_MODS[x];\n }).join(\"-\") + \"-\";\n }\n })();\n ret.KEY_MODS[0] = \"\";\n ret.KEY_MODS[-1] = \"input-\";\n return ret;\n})();\noop.mixin(exports, Keys);\nexports.default = exports;\nexports.keyCodeToString = function (keyCode) {\n var keyString = Keys[keyCode];\n if (typeof keyString != \"string\")\n keyString = String.fromCharCode(keyCode);\n return keyString.toLowerCase();\n};\n\n});\n\nace.define(\"ace/lib/event\",[\"require\",\"exports\",\"module\",\"ace/lib/keys\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar keys = require(\"./keys\");\nvar useragent = require(\"./useragent\");\nvar pressedKeys = null;\nvar ts = 0;\nvar activeListenerOptions;\nfunction detectListenerOptionsSupport() {\n activeListenerOptions = false;\n try {\n document.createComment(\"\").addEventListener(\"test\", function () { }, {\n get passive() {\n activeListenerOptions = { passive: false };\n }\n });\n }\n catch (e) { }\n}\nfunction getListenerOptions() {\n if (activeListenerOptions == undefined)\n detectListenerOptionsSupport();\n return activeListenerOptions;\n}\nfunction EventListener(elem, type, callback) {\n this.elem = elem;\n this.type = type;\n this.callback = callback;\n}\nEventListener.prototype.destroy = function () {\n removeListener(this.elem, this.type, this.callback);\n this.elem = this.type = this.callback = undefined;\n};\nvar addListener = exports.addListener = function (elem, type, callback, destroyer) {\n elem.addEventListener(type, callback, getListenerOptions());\n if (destroyer)\n destroyer.$toDestroy.push(new EventListener(elem, type, callback));\n};\nvar removeListener = exports.removeListener = function (elem, type, callback) {\n elem.removeEventListener(type, callback, getListenerOptions());\n};\nexports.stopEvent = function (e) {\n exports.stopPropagation(e);\n exports.preventDefault(e);\n return false;\n};\nexports.stopPropagation = function (e) {\n if (e.stopPropagation)\n e.stopPropagation();\n};\nexports.preventDefault = function (e) {\n if (e.preventDefault)\n e.preventDefault();\n};\nexports.getButton = function (e) {\n if (e.type == \"dblclick\")\n return 0;\n if (e.type == \"contextmenu\" || (useragent.isMac && (e.ctrlKey && !e.altKey && !e.shiftKey)))\n return 2;\n return e.button;\n};\nexports.capture = function (el, eventHandler, releaseCaptureHandler) {\n var ownerDocument = el && el.ownerDocument || document;\n function onMouseUp(e) {\n eventHandler && eventHandler(e);\n releaseCaptureHandler && releaseCaptureHandler(e);\n removeListener(ownerDocument, \"mousemove\", eventHandler);\n removeListener(ownerDocument, \"mouseup\", onMouseUp);\n removeListener(ownerDocument, \"dragstart\", onMouseUp);\n }\n addListener(ownerDocument, \"mousemove\", eventHandler);\n addListener(ownerDocument, \"mouseup\", onMouseUp);\n addListener(ownerDocument, \"dragstart\", onMouseUp);\n return onMouseUp;\n};\nexports.addMouseWheelListener = function (el, callback, destroyer) {\n addListener(el, \"wheel\", function (e) {\n var factor = 0.15;\n var deltaX = e.deltaX || 0;\n var deltaY = e.deltaY || 0;\n switch (e.deltaMode) {\n case e.DOM_DELTA_PIXEL:\n e.wheelX = deltaX * factor;\n e.wheelY = deltaY * factor;\n break;\n case e.DOM_DELTA_LINE:\n var linePixels = 15;\n e.wheelX = deltaX * linePixels;\n e.wheelY = deltaY * linePixels;\n break;\n case e.DOM_DELTA_PAGE:\n var pagePixels = 150;\n e.wheelX = deltaX * pagePixels;\n e.wheelY = deltaY * pagePixels;\n break;\n }\n callback(e);\n }, destroyer);\n};\nexports.addMultiMouseDownListener = function (elements, timeouts, eventHandler, callbackName, destroyer) {\n var clicks = 0;\n var startX, startY, timer;\n var eventNames = {\n 2: \"dblclick\",\n 3: \"tripleclick\",\n 4: \"quadclick\"\n };\n function onMousedown(e) {\n if (exports.getButton(e) !== 0) {\n clicks = 0;\n }\n else if (e.detail > 1) {\n clicks++;\n if (clicks > 4)\n clicks = 1;\n }\n else {\n clicks = 1;\n }\n if (useragent.isIE) {\n var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5;\n if (!timer || isNewClick)\n clicks = 1;\n if (timer)\n clearTimeout(timer);\n timer = setTimeout(function () { timer = null; }, timeouts[clicks - 1] || 600);\n if (clicks == 1) {\n startX = e.clientX;\n startY = e.clientY;\n }\n }\n e._clicks = clicks;\n eventHandler[callbackName](\"mousedown\", e);\n if (clicks > 4)\n clicks = 0;\n else if (clicks > 1)\n return eventHandler[callbackName](eventNames[clicks], e);\n }\n if (!Array.isArray(elements))\n elements = [elements];\n elements.forEach(function (el) {\n addListener(el, \"mousedown\", onMousedown, destroyer);\n });\n};\nvar getModifierHash = function (e) {\n return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);\n};\nexports.getModifierString = function (e) {\n return keys.KEY_MODS[getModifierHash(e)];\n};\nfunction normalizeCommandKeys(callback, e, keyCode) {\n var hashId = getModifierHash(e);\n if (!useragent.isMac && pressedKeys) {\n if (e.getModifierState && (e.getModifierState(\"OS\") || e.getModifierState(\"Win\")))\n hashId |= 8;\n if (pressedKeys.altGr) {\n if ((3 & hashId) != 3)\n pressedKeys.altGr = 0;\n else\n return;\n }\n if (keyCode === 18 || keyCode === 17) {\n var location = \"location\" in e ? e.location : e.keyLocation;\n if (keyCode === 17 && location === 1) {\n if (pressedKeys[keyCode] == 1)\n ts = e.timeStamp;\n }\n else if (keyCode === 18 && hashId === 3 && location === 2) {\n var dt = e.timeStamp - ts;\n if (dt < 50)\n pressedKeys.altGr = true;\n }\n }\n }\n if (keyCode in keys.MODIFIER_KEYS) {\n keyCode = -1;\n }\n if (!hashId && keyCode === 13) {\n var location = \"location\" in e ? e.location : e.keyLocation;\n if (location === 3) {\n callback(e, hashId, -keyCode);\n if (e.defaultPrevented)\n return;\n }\n }\n if (useragent.isChromeOS && hashId & 8) {\n callback(e, hashId, keyCode);\n if (e.defaultPrevented)\n return;\n else\n hashId &= ~8;\n }\n if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) {\n return false;\n }\n return callback(e, hashId, keyCode);\n}\nexports.addCommandKeyListener = function (el, callback, destroyer) {\n if (useragent.isOldGecko || (useragent.isOpera && !(\"KeyboardEvent\" in window))) {\n var lastKeyDownKeyCode = null;\n addListener(el, \"keydown\", function (e) {\n lastKeyDownKeyCode = e.keyCode;\n }, destroyer);\n addListener(el, \"keypress\", function (e) {\n return normalizeCommandKeys(callback, e, lastKeyDownKeyCode);\n }, destroyer);\n }\n else {\n var lastDefaultPrevented = null;\n addListener(el, \"keydown\", function (e) {\n pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1;\n var result = normalizeCommandKeys(callback, e, e.keyCode);\n lastDefaultPrevented = e.defaultPrevented;\n return result;\n }, destroyer);\n addListener(el, \"keypress\", function (e) {\n if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) {\n exports.stopEvent(e);\n lastDefaultPrevented = null;\n }\n }, destroyer);\n addListener(el, \"keyup\", function (e) {\n pressedKeys[e.keyCode] = null;\n }, destroyer);\n if (!pressedKeys) {\n resetPressedKeys();\n addListener(window, \"focus\", resetPressedKeys);\n }\n }\n};\nfunction resetPressedKeys() {\n pressedKeys = Object.create(null);\n}\nif (typeof window == \"object\" && window.postMessage && !useragent.isOldIE) {\n var postMessageId = 1;\n exports.nextTick = function (callback, win) {\n win = win || window;\n var messageName = \"zero-timeout-message-\" + (postMessageId++);\n var listener = function (e) {\n if (e.data == messageName) {\n exports.stopPropagation(e);\n removeListener(win, \"message\", listener);\n callback();\n }\n };\n addListener(win, \"message\", listener);\n win.postMessage(messageName, \"*\");\n };\n}\nexports.$idleBlocked = false;\nexports.onIdle = function (cb, timeout) {\n return setTimeout(function handler() {\n if (!exports.$idleBlocked) {\n cb();\n }\n else {\n setTimeout(handler, 100);\n }\n }, timeout);\n};\nexports.$idleBlockId = null;\nexports.blockIdle = function (delay) {\n if (exports.$idleBlockId)\n clearTimeout(exports.$idleBlockId);\n exports.$idleBlocked = true;\n exports.$idleBlockId = setTimeout(function () {\n exports.$idleBlocked = false;\n }, delay || 100);\n};\nexports.nextFrame = typeof window == \"object\" && (window.requestAnimationFrame\n || window.mozRequestAnimationFrame\n || window.webkitRequestAnimationFrame\n || window.msRequestAnimationFrame\n || window.oRequestAnimationFrame);\nif (exports.nextFrame)\n exports.nextFrame = exports.nextFrame.bind(window);\nelse\n exports.nextFrame = function (callback) {\n setTimeout(callback, 17);\n };\n\n});\n\nace.define(\"ace/clipboard\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar $cancelT;\nmodule.exports = {\n lineMode: false,\n pasteCancelled: function () {\n if ($cancelT && $cancelT > Date.now() - 50)\n return true;\n return $cancelT = false;\n },\n cancel: function () {\n $cancelT = Date.now();\n }\n};\n\n});\n\nace.define(\"ace/keyboard/textinput\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/config\",\"ace/lib/useragent\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/clipboard\",\"ace/lib/keys\"], function(require, exports, module){\"use strict\";\nvar event = require(\"../lib/event\");\nvar nls = require(\"../config\").nls;\nvar useragent = require(\"../lib/useragent\");\nvar dom = require(\"../lib/dom\");\nvar lang = require(\"../lib/lang\");\nvar clipboard = require(\"../clipboard\");\nvar BROKEN_SETDATA = useragent.isChrome < 18;\nvar USE_IE_MIME_TYPE = useragent.isIE;\nvar HAS_FOCUS_ARGS = useragent.isChrome > 63;\nvar MAX_LINE_LENGTH = 400;\nvar KEYS = require(\"../lib/keys\");\nvar MODS = KEYS.KEY_MODS;\nvar isIOS = useragent.isIOS;\nvar valueResetRegex = isIOS ? /\\s/ : /\\n/;\nvar isMobile = useragent.isMobile;\nvar TextInput = function (parentNode, host) {\n var text = dom.createElement(\"textarea\");\n text.className = \"ace_text-input\";\n text.setAttribute(\"wrap\", \"off\");\n text.setAttribute(\"autocorrect\", \"off\");\n text.setAttribute(\"autocapitalize\", \"off\");\n text.setAttribute(\"spellcheck\", false);\n text.style.opacity = \"0\";\n parentNode.insertBefore(text, parentNode.firstChild);\n var copied = false;\n var pasted = false;\n var inComposition = false;\n var sendingText = false;\n var tempStyle = '';\n if (!isMobile)\n text.style.fontSize = \"1px\";\n var commandMode = false;\n var ignoreFocusEvents = false;\n var lastValue = \"\";\n var lastSelectionStart = 0;\n var lastSelectionEnd = 0;\n var lastRestoreEnd = 0;\n var rowStart = Number.MAX_SAFE_INTEGER;\n var rowEnd = Number.MIN_SAFE_INTEGER;\n var numberOfExtraLines = 0;\n try {\n var isFocused = document.activeElement === text;\n }\n catch (e) { }\n this.setNumberOfExtraLines = function (number) {\n rowStart = Number.MAX_SAFE_INTEGER;\n rowEnd = Number.MIN_SAFE_INTEGER;\n if (number < 0) {\n numberOfExtraLines = 0;\n return;\n }\n numberOfExtraLines = number;\n };\n this.setAriaOptions = function (options) {\n if (options.activeDescendant) {\n text.setAttribute(\"aria-haspopup\", \"true\");\n text.setAttribute(\"aria-autocomplete\", options.inline ? \"both\" : \"list\");\n text.setAttribute(\"aria-activedescendant\", options.activeDescendant);\n }\n else {\n text.setAttribute(\"aria-haspopup\", \"false\");\n text.setAttribute(\"aria-autocomplete\", \"both\");\n text.removeAttribute(\"aria-activedescendant\");\n }\n if (options.role) {\n text.setAttribute(\"role\", options.role);\n }\n if (options.setLabel) {\n text.setAttribute(\"aria-roledescription\", nls(\"editor\"));\n if (host.session) {\n var row = host.session.selection.cursor.row;\n text.setAttribute(\"aria-label\", nls(\"Cursor at row $0\", [row + 1]));\n }\n }\n };\n this.setAriaOptions({ role: \"textbox\" });\n event.addListener(text, \"blur\", function (e) {\n if (ignoreFocusEvents)\n return;\n host.onBlur(e);\n isFocused = false;\n }, host);\n event.addListener(text, \"focus\", function (e) {\n if (ignoreFocusEvents)\n return;\n isFocused = true;\n if (useragent.isEdge) {\n try {\n if (!document.hasFocus())\n return;\n }\n catch (e) { }\n }\n host.onFocus(e);\n if (useragent.isEdge)\n setTimeout(resetSelection);\n else\n resetSelection();\n }, host);\n this.$focusScroll = false;\n this.focus = function () {\n this.setAriaOptions({\n setLabel: host.renderer.enableKeyboardAccessibility\n });\n if (tempStyle || HAS_FOCUS_ARGS || this.$focusScroll == \"browser\")\n return text.focus({ preventScroll: true });\n var top = text.style.top;\n text.style.position = \"fixed\";\n text.style.top = \"0px\";\n try {\n var isTransformed = text.getBoundingClientRect().top != 0;\n }\n catch (e) {\n return;\n }\n var ancestors = [];\n if (isTransformed) {\n var t = text.parentElement;\n while (t && t.nodeType == 1) {\n ancestors.push(t);\n t.setAttribute(\"ace_nocontext\", true);\n if (!t.parentElement && t.getRootNode)\n t = t.getRootNode().host;\n else\n t = t.parentElement;\n }\n }\n text.focus({ preventScroll: true });\n if (isTransformed) {\n ancestors.forEach(function (p) {\n p.removeAttribute(\"ace_nocontext\");\n });\n }\n setTimeout(function () {\n text.style.position = \"\";\n if (text.style.top == \"0px\")\n text.style.top = top;\n }, 0);\n };\n this.blur = function () {\n text.blur();\n };\n this.isFocused = function () {\n return isFocused;\n };\n host.on(\"beforeEndOperation\", function () {\n var curOp = host.curOp;\n var commandName = curOp && curOp.command && curOp.command.name;\n if (commandName == \"insertstring\")\n return;\n var isUserAction = commandName && (curOp.docChanged || curOp.selectionChanged);\n if (inComposition && isUserAction) {\n lastValue = text.value = \"\";\n onCompositionEnd();\n }\n resetSelection();\n });\n var positionToSelection = function (row, column) {\n var selection = column;\n for (var i = 1; i <= row - rowStart && i < 2 * numberOfExtraLines + 1; i++) {\n selection += host.session.getLine(row - i).length + 1;\n }\n return selection;\n };\n var resetSelection = isIOS\n ? function (value) {\n if (!isFocused || (copied && !value) || sendingText)\n return;\n if (!value)\n value = \"\";\n var newValue = \"\\n ab\" + value + \"cde fg\\n\";\n if (newValue != text.value)\n text.value = lastValue = newValue;\n var selectionStart = 4;\n var selectionEnd = 4 + (value.length || (host.selection.isEmpty() ? 0 : 1));\n if (lastSelectionStart != selectionStart || lastSelectionEnd != selectionEnd) {\n text.setSelectionRange(selectionStart, selectionEnd);\n }\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n }\n : function () {\n if (inComposition || sendingText)\n return;\n if (!isFocused && !afterContextMenu)\n return;\n inComposition = true;\n var selectionStart = 0;\n var selectionEnd = 0;\n var line = \"\";\n if (host.session) {\n var selection = host.selection;\n var range = selection.getRange();\n var row = selection.cursor.row;\n if (row === rowEnd + 1) {\n rowStart = rowEnd + 1;\n rowEnd = rowStart + 2 * numberOfExtraLines;\n }\n else if (row === rowStart - 1) {\n rowEnd = rowStart - 1;\n rowStart = rowEnd - 2 * numberOfExtraLines;\n }\n else if (row < rowStart - 1 || row > rowEnd + 1) {\n rowStart = row > numberOfExtraLines ? row - numberOfExtraLines : 0;\n rowEnd = row > numberOfExtraLines ? row + numberOfExtraLines : 2 * numberOfExtraLines;\n }\n var lines = [];\n for (var i = rowStart; i <= rowEnd; i++) {\n lines.push(host.session.getLine(i));\n }\n line = lines.join('\\n');\n selectionStart = positionToSelection(range.start.row, range.start.column);\n selectionEnd = positionToSelection(range.end.row, range.end.column);\n if (range.start.row < rowStart) {\n var prevLine = host.session.getLine(rowStart - 1);\n selectionStart = range.start.row < rowStart - 1 ? 0 : selectionStart;\n selectionEnd += prevLine.length + 1;\n line = prevLine + \"\\n\" + line;\n }\n else if (range.end.row > rowEnd) {\n var nextLine = host.session.getLine(rowEnd + 1);\n selectionEnd = range.end.row > rowEnd + 1 ? nextLine.length : range.end.column;\n selectionEnd += line.length + 1;\n line = line + \"\\n\" + nextLine;\n }\n else if (isMobile && row > 0) {\n line = \"\\n\" + line;\n selectionEnd += 1;\n selectionStart += 1;\n }\n if (line.length > MAX_LINE_LENGTH) {\n if (selectionStart < MAX_LINE_LENGTH && selectionEnd < MAX_LINE_LENGTH) {\n line = line.slice(0, MAX_LINE_LENGTH);\n }\n else {\n line = \"\\n\";\n if (selectionStart == selectionEnd) {\n selectionStart = selectionEnd = 0;\n }\n else {\n selectionStart = 0;\n selectionEnd = 1;\n }\n }\n }\n var newValue = line + \"\\n\\n\";\n if (newValue != lastValue) {\n text.value = lastValue = newValue;\n lastSelectionStart = lastSelectionEnd = newValue.length;\n }\n }\n if (afterContextMenu) {\n lastSelectionStart = text.selectionStart;\n lastSelectionEnd = text.selectionEnd;\n }\n if (lastSelectionEnd != selectionEnd\n || lastSelectionStart != selectionStart\n || text.selectionEnd != lastSelectionEnd // on ie edge selectionEnd changes silently after the initialization\n ) {\n try {\n text.setSelectionRange(selectionStart, selectionEnd);\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n }\n catch (e) { }\n }\n inComposition = false;\n };\n this.resetSelection = resetSelection;\n if (isFocused)\n host.onFocus();\n var isAllSelected = function (text) {\n return text.selectionStart === 0 && text.selectionEnd >= lastValue.length\n && text.value === lastValue && lastValue\n && text.selectionEnd !== lastSelectionEnd;\n };\n var onSelect = function (e) {\n if (inComposition)\n return;\n if (copied) {\n copied = false;\n }\n else if (isAllSelected(text)) {\n host.selectAll();\n resetSelection();\n }\n else if (isMobile && text.selectionStart != lastSelectionStart) {\n resetSelection();\n }\n };\n var inputHandler = null;\n this.setInputHandler = function (cb) { inputHandler = cb; };\n this.getInputHandler = function () { return inputHandler; };\n var afterContextMenu = false;\n var sendText = function (value, fromInput) {\n if (afterContextMenu)\n afterContextMenu = false;\n if (pasted) {\n resetSelection();\n if (value)\n host.onPaste(value);\n pasted = false;\n return \"\";\n }\n else {\n var selectionStart = text.selectionStart;\n var selectionEnd = text.selectionEnd;\n var extendLeft = lastSelectionStart;\n var extendRight = lastValue.length - lastSelectionEnd;\n var inserted = value;\n var restoreStart = value.length - selectionStart;\n var restoreEnd = value.length - selectionEnd;\n var i = 0;\n while (extendLeft > 0 && lastValue[i] == value[i]) {\n i++;\n extendLeft--;\n }\n inserted = inserted.slice(i);\n i = 1;\n while (extendRight > 0 && lastValue.length - i > lastSelectionStart - 1 && lastValue[lastValue.length - i] == value[value.length - i]) {\n i++;\n extendRight--;\n }\n restoreStart -= i - 1;\n restoreEnd -= i - 1;\n var endIndex = inserted.length - i + 1;\n if (endIndex < 0) {\n extendLeft = -endIndex;\n endIndex = 0;\n }\n inserted = inserted.slice(0, endIndex);\n if (!fromInput && !inserted && !restoreStart && !extendLeft && !extendRight && !restoreEnd)\n return \"\";\n sendingText = true;\n var shouldReset = false;\n if (useragent.isAndroid && inserted == \". \") {\n inserted = \" \";\n shouldReset = true;\n }\n if (inserted && !extendLeft && !extendRight && !restoreStart && !restoreEnd || commandMode) {\n host.onTextInput(inserted);\n }\n else {\n host.onTextInput(inserted, {\n extendLeft: extendLeft,\n extendRight: extendRight,\n restoreStart: restoreStart,\n restoreEnd: restoreEnd\n });\n }\n sendingText = false;\n lastValue = value;\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n lastRestoreEnd = restoreEnd;\n return shouldReset ? \"\\n\" : inserted;\n }\n };\n var onInput = function (e) {\n if (inComposition)\n return onCompositionUpdate();\n if (e && e.inputType) {\n if (e.inputType == \"historyUndo\")\n return host.execCommand(\"undo\");\n if (e.inputType == \"historyRedo\")\n return host.execCommand(\"redo\");\n }\n var data = text.value;\n var inserted = sendText(data, true);\n if (data.length > MAX_LINE_LENGTH + 100\n || valueResetRegex.test(inserted)\n || isMobile && lastSelectionStart < 1 && lastSelectionStart == lastSelectionEnd) {\n resetSelection();\n }\n };\n var handleClipboardData = function (e, data, forceIEMime) {\n var clipboardData = e.clipboardData || window.clipboardData;\n if (!clipboardData || BROKEN_SETDATA)\n return;\n var mime = USE_IE_MIME_TYPE || forceIEMime ? \"Text\" : \"text/plain\";\n try {\n if (data) {\n return clipboardData.setData(mime, data) !== false;\n }\n else {\n return clipboardData.getData(mime);\n }\n }\n catch (e) {\n if (!forceIEMime)\n return handleClipboardData(e, data, true);\n }\n };\n var doCopy = function (e, isCut) {\n var data = host.getCopyText();\n if (!data)\n return event.preventDefault(e);\n if (handleClipboardData(e, data)) {\n if (isIOS) {\n resetSelection(data);\n copied = data;\n setTimeout(function () {\n copied = false;\n }, 10);\n }\n isCut ? host.onCut() : host.onCopy();\n event.preventDefault(e);\n }\n else {\n copied = true;\n text.value = data;\n text.select();\n setTimeout(function () {\n copied = false;\n resetSelection();\n isCut ? host.onCut() : host.onCopy();\n });\n }\n };\n var onCut = function (e) {\n doCopy(e, true);\n };\n var onCopy = function (e) {\n doCopy(e, false);\n };\n var onPaste = function (e) {\n var data = handleClipboardData(e);\n if (clipboard.pasteCancelled())\n return;\n if (typeof data == \"string\") {\n if (data)\n host.onPaste(data, e);\n if (useragent.isIE)\n setTimeout(resetSelection);\n event.preventDefault(e);\n }\n else {\n text.value = \"\";\n pasted = true;\n }\n };\n event.addCommandKeyListener(text, host.onCommandKey.bind(host), host);\n event.addListener(text, \"select\", onSelect, host);\n event.addListener(text, \"input\", onInput, host);\n event.addListener(text, \"cut\", onCut, host);\n event.addListener(text, \"copy\", onCopy, host);\n event.addListener(text, \"paste\", onPaste, host);\n if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)) {\n event.addListener(parentNode, \"keydown\", function (e) {\n if ((useragent.isMac && !e.metaKey) || !e.ctrlKey)\n return;\n switch (e.keyCode) {\n case 67:\n onCopy(e);\n break;\n case 86:\n onPaste(e);\n break;\n case 88:\n onCut(e);\n break;\n }\n }, host);\n }\n var onCompositionStart = function (e) {\n if (inComposition || !host.onCompositionStart || host.$readOnly)\n return;\n inComposition = {};\n if (commandMode)\n return;\n if (e.data)\n inComposition.useTextareaForIME = false;\n setTimeout(onCompositionUpdate, 0);\n host._signal(\"compositionStart\");\n host.on(\"mousedown\", cancelComposition);\n var range = host.getSelectionRange();\n range.end.row = range.start.row;\n range.end.column = range.start.column;\n inComposition.markerRange = range;\n inComposition.selectionStart = lastSelectionStart;\n host.onCompositionStart(inComposition);\n if (inComposition.useTextareaForIME) {\n lastValue = text.value = \"\";\n lastSelectionStart = 0;\n lastSelectionEnd = 0;\n }\n else {\n if (text.msGetInputContext)\n inComposition.context = text.msGetInputContext();\n if (text.getInputContext)\n inComposition.context = text.getInputContext();\n }\n };\n var onCompositionUpdate = function () {\n if (!inComposition || !host.onCompositionUpdate || host.$readOnly)\n return;\n if (commandMode)\n return cancelComposition();\n if (inComposition.useTextareaForIME) {\n host.onCompositionUpdate(text.value);\n }\n else {\n var data = text.value;\n sendText(data);\n if (inComposition.markerRange) {\n if (inComposition.context) {\n inComposition.markerRange.start.column = inComposition.selectionStart\n = inComposition.context.compositionStartOffset;\n }\n inComposition.markerRange.end.column = inComposition.markerRange.start.column\n + lastSelectionEnd - inComposition.selectionStart + lastRestoreEnd;\n }\n }\n };\n var onCompositionEnd = function (e) {\n if (!host.onCompositionEnd || host.$readOnly)\n return;\n inComposition = false;\n host.onCompositionEnd();\n host.off(\"mousedown\", cancelComposition);\n if (e)\n onInput();\n };\n function cancelComposition() {\n ignoreFocusEvents = true;\n text.blur();\n text.focus();\n ignoreFocusEvents = false;\n }\n var syncComposition = lang.delayedCall(onCompositionUpdate, 50).schedule.bind(null, null);\n function onKeyup(e) {\n if (e.keyCode == 27 && text.value.length < text.selectionStart) {\n if (!inComposition)\n lastValue = text.value;\n lastSelectionStart = lastSelectionEnd = -1;\n resetSelection();\n }\n syncComposition();\n }\n event.addListener(text, \"compositionstart\", onCompositionStart, host);\n event.addListener(text, \"compositionupdate\", onCompositionUpdate, host);\n event.addListener(text, \"keyup\", onKeyup, host);\n event.addListener(text, \"keydown\", syncComposition, host);\n event.addListener(text, \"compositionend\", onCompositionEnd, host);\n this.getElement = function () {\n return text;\n };\n this.setCommandMode = function (value) {\n commandMode = value;\n text.readOnly = false;\n };\n this.setReadOnly = function (readOnly) {\n if (!commandMode)\n text.readOnly = readOnly;\n };\n this.setCopyWithEmptySelection = function (value) {\n };\n this.onContextMenu = function (e) {\n afterContextMenu = true;\n resetSelection();\n host._emit(\"nativecontextmenu\", { target: host, domEvent: e });\n this.moveToMouse(e, true);\n };\n this.moveToMouse = function (e, bringToFront) {\n if (!tempStyle)\n tempStyle = text.style.cssText;\n text.style.cssText = (bringToFront ? \"z-index:100000;\" : \"\")\n + (useragent.isIE ? \"opacity:0.1;\" : \"\")\n + \"text-indent: -\" + (lastSelectionStart + lastSelectionEnd) * host.renderer.characterWidth * 0.5 + \"px;\";\n var rect = host.container.getBoundingClientRect();\n var style = dom.computedStyle(host.container);\n var top = rect.top + (parseInt(style.borderTopWidth) || 0);\n var left = rect.left + (parseInt(rect.borderLeftWidth) || 0);\n var maxTop = rect.bottom - top - text.clientHeight - 2;\n var move = function (e) {\n dom.translate(text, e.clientX - left - 2, Math.min(e.clientY - top - 2, maxTop));\n };\n move(e);\n if (e.type != \"mousedown\")\n return;\n host.renderer.$isMousePressed = true;\n clearTimeout(closeTimeout);\n if (useragent.isWin)\n event.capture(host.container, move, onContextMenuClose);\n };\n this.onContextMenuClose = onContextMenuClose;\n var closeTimeout;\n function onContextMenuClose() {\n clearTimeout(closeTimeout);\n closeTimeout = setTimeout(function () {\n if (tempStyle) {\n text.style.cssText = tempStyle;\n tempStyle = '';\n }\n host.renderer.$isMousePressed = false;\n if (host.renderer.$keepTextAreaAtCursor)\n host.renderer.$moveTextAreaToCursor();\n }, 0);\n }\n var onContextMenu = function (e) {\n host.textInput.onContextMenu(e);\n onContextMenuClose();\n };\n event.addListener(text, \"mouseup\", onContextMenu, host);\n event.addListener(text, \"mousedown\", function (e) {\n e.preventDefault();\n onContextMenuClose();\n }, host);\n event.addListener(host.renderer.scroller, \"contextmenu\", onContextMenu, host);\n event.addListener(text, \"contextmenu\", onContextMenu, host);\n if (isIOS)\n addIosSelectionHandler(parentNode, host, text);\n function addIosSelectionHandler(parentNode, host, text) {\n var typingResetTimeout = null;\n var typing = false;\n text.addEventListener(\"keydown\", function (e) {\n if (typingResetTimeout)\n clearTimeout(typingResetTimeout);\n typing = true;\n }, true);\n text.addEventListener(\"keyup\", function (e) {\n typingResetTimeout = setTimeout(function () {\n typing = false;\n }, 100);\n }, true);\n var detectArrowKeys = function (e) {\n if (document.activeElement !== text)\n return;\n if (typing || inComposition || host.$mouseHandler.isMousePressed)\n return;\n if (copied) {\n return;\n }\n var selectionStart = text.selectionStart;\n var selectionEnd = text.selectionEnd;\n var key = null;\n var modifier = 0;\n if (selectionStart == 0) {\n key = KEYS.up;\n }\n else if (selectionStart == 1) {\n key = KEYS.home;\n }\n else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd] == \"\\n\") {\n key = KEYS.end;\n }\n else if (selectionStart < lastSelectionStart && lastValue[selectionStart - 1] == \" \") {\n key = KEYS.left;\n modifier = MODS.option;\n }\n else if (selectionStart < lastSelectionStart\n || (selectionStart == lastSelectionStart\n && lastSelectionEnd != lastSelectionStart\n && selectionStart == selectionEnd)) {\n key = KEYS.left;\n }\n else if (selectionEnd > lastSelectionEnd && lastValue.slice(0, selectionEnd).split(\"\\n\").length > 2) {\n key = KEYS.down;\n }\n else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd - 1] == \" \") {\n key = KEYS.right;\n modifier = MODS.option;\n }\n else if (selectionEnd > lastSelectionEnd\n || (selectionEnd == lastSelectionEnd\n && lastSelectionEnd != lastSelectionStart\n && selectionStart == selectionEnd)) {\n key = KEYS.right;\n }\n if (selectionStart !== selectionEnd)\n modifier |= MODS.shift;\n if (key) {\n var result = host.onCommandKey({}, modifier, key);\n if (!result && host.commands) {\n key = KEYS.keyCodeToString(key);\n var command = host.commands.findKeyCommand(modifier, key);\n if (command)\n host.execCommand(command);\n }\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n resetSelection(\"\");\n }\n };\n document.addEventListener(\"selectionchange\", detectArrowKeys);\n host.on(\"destroy\", function () {\n document.removeEventListener(\"selectionchange\", detectArrowKeys);\n });\n }\n this.destroy = function () {\n if (text.parentElement)\n text.parentElement.removeChild(text);\n };\n};\nexports.TextInput = TextInput;\nexports.$setUserAgentForTests = function (_isMobile, _isIOS) {\n isMobile = _isMobile;\n isIOS = _isIOS;\n};\n\n});\n\nace.define(\"ace/mouse/default_handlers\",[\"require\",\"exports\",\"module\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar useragent = require(\"../lib/useragent\");\nvar DRAG_OFFSET = 0; // pixels\nvar SCROLL_COOLDOWN_T = 550; // milliseconds\nvar DefaultHandlers = /** @class */ (function () {\n function DefaultHandlers(mouseHandler) {\n mouseHandler.$clickSelection = null;\n var editor = mouseHandler.editor;\n editor.setDefaultHandler(\"mousedown\", this.onMouseDown.bind(mouseHandler));\n editor.setDefaultHandler(\"dblclick\", this.onDoubleClick.bind(mouseHandler));\n editor.setDefaultHandler(\"tripleclick\", this.onTripleClick.bind(mouseHandler));\n editor.setDefaultHandler(\"quadclick\", this.onQuadClick.bind(mouseHandler));\n editor.setDefaultHandler(\"mousewheel\", this.onMouseWheel.bind(mouseHandler));\n var exports = [\"select\", \"startSelect\", \"selectEnd\", \"selectAllEnd\", \"selectByWordsEnd\",\n \"selectByLinesEnd\", \"dragWait\", \"dragWaitEnd\", \"focusWait\"];\n exports.forEach(function (x) {\n mouseHandler[x] = this[x];\n }, this);\n mouseHandler.selectByLines = this.extendSelectionBy.bind(mouseHandler, \"getLineRange\");\n mouseHandler.selectByWords = this.extendSelectionBy.bind(mouseHandler, \"getWordRange\");\n }\n DefaultHandlers.prototype.onMouseDown = function (ev) {\n var inSelection = ev.inSelection();\n var pos = ev.getDocumentPosition();\n this.mousedownEvent = ev;\n var editor = this.editor;\n var button = ev.getButton();\n if (button !== 0) {\n var selectionRange = editor.getSelectionRange();\n var selectionEmpty = selectionRange.isEmpty();\n if (selectionEmpty || button == 1)\n editor.selection.moveToPosition(pos);\n if (button == 2) {\n editor.textInput.onContextMenu(ev.domEvent);\n if (!useragent.isMozilla)\n ev.preventDefault();\n }\n return;\n }\n this.mousedownEvent.time = Date.now();\n if (inSelection && !editor.isFocused()) {\n editor.focus();\n if (this.$focusTimeout && !this.$clickSelection && !editor.inMultiSelectMode) {\n this.setState(\"focusWait\");\n this.captureMouse(ev);\n return;\n }\n }\n this.captureMouse(ev);\n this.startSelect(pos, ev.domEvent._clicks > 1);\n return ev.preventDefault();\n };\n DefaultHandlers.prototype.startSelect = function (pos, waitForClickSelection) {\n pos = pos || this.editor.renderer.screenToTextCoordinates(this.x, this.y);\n var editor = this.editor;\n if (!this.mousedownEvent)\n return;\n if (this.mousedownEvent.getShiftKey())\n editor.selection.selectToPosition(pos);\n else if (!waitForClickSelection)\n editor.selection.moveToPosition(pos);\n if (!waitForClickSelection)\n this.select();\n editor.setStyle(\"ace_selecting\");\n this.setState(\"select\");\n };\n DefaultHandlers.prototype.select = function () {\n var anchor, editor = this.editor;\n var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y);\n if (this.$clickSelection) {\n var cmp = this.$clickSelection.comparePoint(cursor);\n if (cmp == -1) {\n anchor = this.$clickSelection.end;\n }\n else if (cmp == 1) {\n anchor = this.$clickSelection.start;\n }\n else {\n var orientedRange = calcRangeOrientation(this.$clickSelection, cursor);\n cursor = orientedRange.cursor;\n anchor = orientedRange.anchor;\n }\n editor.selection.setSelectionAnchor(anchor.row, anchor.column);\n }\n editor.selection.selectToPosition(cursor);\n editor.renderer.scrollCursorIntoView();\n };\n DefaultHandlers.prototype.extendSelectionBy = function (unitName) {\n var anchor, editor = this.editor;\n var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y);\n var range = editor.selection[unitName](cursor.row, cursor.column);\n if (this.$clickSelection) {\n var cmpStart = this.$clickSelection.comparePoint(range.start);\n var cmpEnd = this.$clickSelection.comparePoint(range.end);\n if (cmpStart == -1 && cmpEnd <= 0) {\n anchor = this.$clickSelection.end;\n if (range.end.row != cursor.row || range.end.column != cursor.column)\n cursor = range.start;\n }\n else if (cmpEnd == 1 && cmpStart >= 0) {\n anchor = this.$clickSelection.start;\n if (range.start.row != cursor.row || range.start.column != cursor.column)\n cursor = range.end;\n }\n else if (cmpStart == -1 && cmpEnd == 1) {\n cursor = range.end;\n anchor = range.start;\n }\n else {\n var orientedRange = calcRangeOrientation(this.$clickSelection, cursor);\n cursor = orientedRange.cursor;\n anchor = orientedRange.anchor;\n }\n editor.selection.setSelectionAnchor(anchor.row, anchor.column);\n }\n editor.selection.selectToPosition(cursor);\n editor.renderer.scrollCursorIntoView();\n };\n DefaultHandlers.prototype.selectByLinesEnd = function () {\n this.$clickSelection = null;\n this.editor.unsetStyle(\"ace_selecting\");\n };\n DefaultHandlers.prototype.focusWait = function () {\n var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);\n var time = Date.now();\n if (distance > DRAG_OFFSET || time - this.mousedownEvent.time > this.$focusTimeout)\n this.startSelect(this.mousedownEvent.getDocumentPosition());\n };\n DefaultHandlers.prototype.onDoubleClick = function (ev) {\n var pos = ev.getDocumentPosition();\n var editor = this.editor;\n var session = editor.session;\n var range = session.getBracketRange(pos);\n if (range) {\n if (range.isEmpty()) {\n range.start.column--;\n range.end.column++;\n }\n this.setState(\"select\");\n }\n else {\n range = editor.selection.getWordRange(pos.row, pos.column);\n this.setState(\"selectByWords\");\n }\n this.$clickSelection = range;\n this.select();\n };\n DefaultHandlers.prototype.onTripleClick = function (ev) {\n var pos = ev.getDocumentPosition();\n var editor = this.editor;\n this.setState(\"selectByLines\");\n var range = editor.getSelectionRange();\n if (range.isMultiLine() && range.contains(pos.row, pos.column)) {\n this.$clickSelection = editor.selection.getLineRange(range.start.row);\n this.$clickSelection.end = editor.selection.getLineRange(range.end.row).end;\n }\n else {\n this.$clickSelection = editor.selection.getLineRange(pos.row);\n }\n this.select();\n };\n DefaultHandlers.prototype.onQuadClick = function (ev) {\n var editor = this.editor;\n editor.selectAll();\n this.$clickSelection = editor.getSelectionRange();\n this.setState(\"selectAll\");\n };\n DefaultHandlers.prototype.onMouseWheel = function (ev) {\n if (ev.getAccelKey())\n return;\n if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) {\n ev.wheelX = ev.wheelY;\n ev.wheelY = 0;\n }\n var editor = this.editor;\n if (!this.$lastScroll)\n this.$lastScroll = { t: 0, vx: 0, vy: 0, allowed: 0 };\n var prevScroll = this.$lastScroll;\n var t = ev.domEvent.timeStamp;\n var dt = t - prevScroll.t;\n var vx = dt ? ev.wheelX / dt : prevScroll.vx;\n var vy = dt ? ev.wheelY / dt : prevScroll.vy;\n if (dt < SCROLL_COOLDOWN_T) {\n vx = (vx + prevScroll.vx) / 2;\n vy = (vy + prevScroll.vy) / 2;\n }\n var direction = Math.abs(vx / vy);\n var canScroll = false;\n if (direction >= 1 && editor.renderer.isScrollableBy(ev.wheelX * ev.speed, 0))\n canScroll = true;\n if (direction <= 1 && editor.renderer.isScrollableBy(0, ev.wheelY * ev.speed))\n canScroll = true;\n if (canScroll) {\n prevScroll.allowed = t;\n }\n else if (t - prevScroll.allowed < SCROLL_COOLDOWN_T) {\n var isSlower = Math.abs(vx) <= 1.5 * Math.abs(prevScroll.vx)\n && Math.abs(vy) <= 1.5 * Math.abs(prevScroll.vy);\n if (isSlower) {\n canScroll = true;\n prevScroll.allowed = t;\n }\n else {\n prevScroll.allowed = 0;\n }\n }\n prevScroll.t = t;\n prevScroll.vx = vx;\n prevScroll.vy = vy;\n if (canScroll) {\n editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed);\n return ev.stop();\n }\n };\n return DefaultHandlers;\n}());\nDefaultHandlers.prototype.selectEnd = DefaultHandlers.prototype.selectByLinesEnd;\nDefaultHandlers.prototype.selectAllEnd = DefaultHandlers.prototype.selectByLinesEnd;\nDefaultHandlers.prototype.selectByWordsEnd = DefaultHandlers.prototype.selectByLinesEnd;\nexports.DefaultHandlers = DefaultHandlers;\nfunction calcDistance(ax, ay, bx, by) {\n return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2));\n}\nfunction calcRangeOrientation(range, cursor) {\n if (range.start.row == range.end.row)\n var cmp = 2 * cursor.column - range.start.column - range.end.column;\n else if (range.start.row == range.end.row - 1 && !range.start.column && !range.end.column)\n var cmp = cursor.column - 4;\n else\n var cmp = 2 * cursor.row - range.start.row - range.end.row;\n if (cmp < 0)\n return { cursor: range.start, anchor: range.end };\n else\n return { cursor: range.end, anchor: range.start };\n}\n\n});\n\nace.define(\"ace/tooltip\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar __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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar dom = require(\"./lib/dom\");\nvar Range = require(\"./range\").Range;\nvar CLASSNAME = \"ace_tooltip\";\nvar Tooltip = /** @class */ (function () {\n function Tooltip(parentNode) {\n this.isOpen = false;\n this.$element = null;\n this.$parentNode = parentNode;\n }\n Tooltip.prototype.$init = function () {\n this.$element = dom.createElement(\"div\");\n this.$element.className = CLASSNAME;\n this.$element.style.display = \"none\";\n this.$parentNode.appendChild(this.$element);\n return this.$element;\n };\n Tooltip.prototype.getElement = function () {\n return this.$element || this.$init();\n };\n Tooltip.prototype.setText = function (text) {\n this.getElement().textContent = text;\n };\n Tooltip.prototype.setHtml = function (html) {\n this.getElement().innerHTML = html;\n };\n Tooltip.prototype.setPosition = function (x, y) {\n this.getElement().style.left = x + \"px\";\n this.getElement().style.top = y + \"px\";\n };\n Tooltip.prototype.setClassName = function (className) {\n dom.addCssClass(this.getElement(), className);\n };\n Tooltip.prototype.setTheme = function (theme) {\n this.$element.className = CLASSNAME + \" \" +\n (theme.isDark ? \"ace_dark \" : \"\") + (theme.cssClass || \"\");\n };\n Tooltip.prototype.show = function (text, x, y) {\n if (text != null)\n this.setText(text);\n if (x != null && y != null)\n this.setPosition(x, y);\n if (!this.isOpen) {\n this.getElement().style.display = \"block\";\n this.isOpen = true;\n }\n };\n Tooltip.prototype.hide = function () {\n if (this.isOpen) {\n this.getElement().style.display = \"none\";\n this.getElement().className = CLASSNAME;\n this.isOpen = false;\n }\n };\n Tooltip.prototype.getHeight = function () {\n return this.getElement().offsetHeight;\n };\n Tooltip.prototype.getWidth = function () {\n return this.getElement().offsetWidth;\n };\n Tooltip.prototype.destroy = function () {\n this.isOpen = false;\n if (this.$element && this.$element.parentNode) {\n this.$element.parentNode.removeChild(this.$element);\n }\n };\n return Tooltip;\n}());\nvar PopupManager = /** @class */ (function () {\n function PopupManager() {\n this.popups = [];\n }\n PopupManager.prototype.addPopup = function (popup) {\n this.popups.push(popup);\n this.updatePopups();\n };\n PopupManager.prototype.removePopup = function (popup) {\n var index = this.popups.indexOf(popup);\n if (index !== -1) {\n this.popups.splice(index, 1);\n this.updatePopups();\n }\n };\n PopupManager.prototype.updatePopups = function () {\n var e_1, _a, e_2, _b;\n this.popups.sort(function (a, b) { return b.priority - a.priority; });\n var visiblepopups = [];\n try {\n for (var _c = __values(this.popups), _d = _c.next(); !_d.done; _d = _c.next()) {\n var popup = _d.value;\n var shouldDisplay = true;\n try {\n for (var visiblepopups_1 = (e_2 = void 0, __values(visiblepopups)), visiblepopups_1_1 = visiblepopups_1.next(); !visiblepopups_1_1.done; visiblepopups_1_1 = visiblepopups_1.next()) {\n var visiblePopup = visiblepopups_1_1.value;\n if (this.doPopupsOverlap(visiblePopup, popup)) {\n shouldDisplay = false;\n break;\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (visiblepopups_1_1 && !visiblepopups_1_1.done && (_b = visiblepopups_1.return)) _b.call(visiblepopups_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (shouldDisplay) {\n visiblepopups.push(popup);\n }\n else {\n popup.hide();\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n PopupManager.prototype.doPopupsOverlap = function (popupA, popupB) {\n var rectA = popupA.getElement().getBoundingClientRect();\n var rectB = popupB.getElement().getBoundingClientRect();\n return (rectA.left < rectB.right && rectA.right > rectB.left && rectA.top < rectB.bottom && rectA.bottom\n > rectB.top);\n };\n return PopupManager;\n}());\nvar popupManager = new PopupManager();\nexports.popupManager = popupManager;\nexports.Tooltip = Tooltip;\nvar HoverTooltip = /** @class */ (function (_super) {\n __extends(HoverTooltip, _super);\n function HoverTooltip(parentNode) {\n if (parentNode === void 0) { parentNode = document.body; }\n var _this = _super.call(this, parentNode) || this;\n _this.timeout = undefined;\n _this.lastT = 0;\n _this.idleTime = 350;\n _this.lastEvent = undefined;\n _this.onMouseOut = _this.onMouseOut.bind(_this);\n _this.onMouseMove = _this.onMouseMove.bind(_this);\n _this.waitForHover = _this.waitForHover.bind(_this);\n _this.hide = _this.hide.bind(_this);\n var el = _this.getElement();\n el.style.whiteSpace = \"pre-wrap\";\n el.style.pointerEvents = \"auto\";\n el.addEventListener(\"mouseout\", _this.onMouseOut);\n el.tabIndex = -1;\n el.addEventListener(\"blur\", function () {\n if (!el.contains(document.activeElement))\n this.hide();\n }.bind(_this));\n return _this;\n }\n HoverTooltip.prototype.addToEditor = function (editor) {\n editor.on(\"mousemove\", this.onMouseMove);\n editor.on(\"mousedown\", this.hide);\n editor.renderer.getMouseEventTarget().addEventListener(\"mouseout\", this.onMouseOut, true);\n };\n HoverTooltip.prototype.removeFromEditor = function (editor) {\n editor.off(\"mousemove\", this.onMouseMove);\n editor.off(\"mousedown\", this.hide);\n editor.renderer.getMouseEventTarget().removeEventListener(\"mouseout\", this.onMouseOut, true);\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n };\n HoverTooltip.prototype.onMouseMove = function (e, editor) {\n this.lastEvent = e;\n this.lastT = Date.now();\n var isMousePressed = editor.$mouseHandler.isMousePressed;\n if (this.isOpen) {\n var pos = this.lastEvent && this.lastEvent.getDocumentPosition();\n if (!this.range\n || !this.range.contains(pos.row, pos.column)\n || isMousePressed\n || this.isOutsideOfText(this.lastEvent)) {\n this.hide();\n }\n }\n if (this.timeout || isMousePressed)\n return;\n this.lastEvent = e;\n this.timeout = setTimeout(this.waitForHover, this.idleTime);\n };\n HoverTooltip.prototype.waitForHover = function () {\n if (this.timeout)\n clearTimeout(this.timeout);\n var dt = Date.now() - this.lastT;\n if (this.idleTime - dt > 10) {\n this.timeout = setTimeout(this.waitForHover, this.idleTime - dt);\n return;\n }\n this.timeout = null;\n if (this.lastEvent && !this.isOutsideOfText(this.lastEvent)) {\n this.$gatherData(this.lastEvent, this.lastEvent.editor);\n }\n };\n HoverTooltip.prototype.isOutsideOfText = function (e) {\n var editor = e.editor;\n var docPos = e.getDocumentPosition();\n var line = editor.session.getLine(docPos.row);\n if (docPos.column == line.length) {\n var screenPos = editor.renderer.pixelToScreenCoordinates(e.clientX, e.clientY);\n var clippedPos = editor.session.documentToScreenPosition(docPos.row, docPos.column);\n if (clippedPos.column != screenPos.column\n || clippedPos.row != screenPos.row) {\n return true;\n }\n }\n return false;\n };\n HoverTooltip.prototype.setDataProvider = function (value) {\n this.$gatherData = value;\n };\n HoverTooltip.prototype.showForRange = function (editor, range, domNode, startingEvent) {\n if (startingEvent && startingEvent != this.lastEvent)\n return;\n if (this.isOpen && document.activeElement == this.getElement())\n return;\n var renderer = editor.renderer;\n if (!this.isOpen) {\n popupManager.addPopup(this);\n this.$registerCloseEvents();\n this.setTheme(renderer.theme);\n }\n this.isOpen = true;\n this.addMarker(range, editor.session);\n this.range = Range.fromPoints(range.start, range.end);\n var element = this.getElement();\n element.innerHTML = \"\";\n element.appendChild(domNode);\n element.style.display = \"block\";\n var position = renderer.textToScreenCoordinates(range.start.row, range.start.column);\n var cursorPos = editor.getCursorPosition();\n var labelHeight = element.clientHeight;\n var rect = renderer.scroller.getBoundingClientRect();\n var isTopdown = true;\n if (this.row > cursorPos.row) {\n isTopdown = true;\n }\n else if (this.row < cursorPos.row) {\n isTopdown = false;\n }\n if (position.pageY - labelHeight + renderer.lineHeight < rect.top) {\n isTopdown = true;\n }\n else if (position.pageY + labelHeight > rect.bottom) {\n isTopdown = false;\n }\n if (!isTopdown) {\n position.pageY -= labelHeight;\n }\n else {\n position.pageY += renderer.lineHeight;\n }\n element.style.maxWidth = rect.width - (position.pageX - rect.left) + \"px\";\n this.setPosition(position.pageX, position.pageY);\n };\n HoverTooltip.prototype.addMarker = function (range, session) {\n if (this.marker) {\n this.$markerSession.removeMarker(this.marker);\n }\n this.$markerSession = session;\n this.marker = session && session.addMarker(range, \"ace_highlight-marker\", \"text\");\n };\n HoverTooltip.prototype.hide = function (e) {\n if (!e && document.activeElement == this.getElement())\n return;\n if (e && e.target && (e.type != \"keydown\" || e.ctrlKey || e.metaKey) && this.$element.contains(e.target))\n return;\n this.lastEvent = null;\n if (this.timeout)\n clearTimeout(this.timeout);\n this.timeout = null;\n this.addMarker(null);\n if (this.isOpen) {\n this.$removeCloseEvents();\n this.getElement().style.display = \"none\";\n this.isOpen = false;\n popupManager.removePopup(this);\n }\n };\n HoverTooltip.prototype.$registerCloseEvents = function () {\n window.addEventListener(\"keydown\", this.hide, true);\n window.addEventListener(\"mousewheel\", this.hide, true);\n window.addEventListener(\"mousedown\", this.hide, true);\n };\n HoverTooltip.prototype.$removeCloseEvents = function () {\n window.removeEventListener(\"keydown\", this.hide, true);\n window.removeEventListener(\"mousewheel\", this.hide, true);\n window.removeEventListener(\"mousedown\", this.hide, true);\n };\n HoverTooltip.prototype.onMouseOut = function (e) {\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.lastEvent = null;\n if (!this.isOpen)\n return;\n if (!e.relatedTarget || e.relatedTarget == this.getElement())\n return;\n if (e && e.currentTarget.contains(e.relatedTarget))\n return;\n if (!e.relatedTarget.classList.contains(\"ace_content\"))\n this.hide();\n };\n return HoverTooltip;\n}(Tooltip));\nexports.HoverTooltip = HoverTooltip;\n\n});\n\nace.define(\"ace/mouse/default_gutter_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/tooltip\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar __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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar dom = require(\"../lib/dom\");\nvar event = require(\"../lib/event\");\nvar Tooltip = require(\"../tooltip\").Tooltip;\nvar nls = require(\"../config\").nls;\nfunction GutterHandler(mouseHandler) {\n var editor = mouseHandler.editor;\n var gutter = editor.renderer.$gutterLayer;\n var tooltip = new GutterTooltip(editor);\n mouseHandler.editor.setDefaultHandler(\"guttermousedown\", function (e) {\n if (!editor.isFocused() || e.getButton() != 0)\n return;\n var gutterRegion = gutter.getRegion(e);\n if (gutterRegion == \"foldWidgets\")\n return;\n var row = e.getDocumentPosition().row;\n var selection = editor.session.selection;\n if (e.getShiftKey())\n selection.selectTo(row, 0);\n else {\n if (e.domEvent.detail == 2) {\n editor.selectAll();\n return e.preventDefault();\n }\n mouseHandler.$clickSelection = editor.selection.getLineRange(row);\n }\n mouseHandler.setState(\"selectByLines\");\n mouseHandler.captureMouse(e);\n return e.preventDefault();\n });\n var tooltipTimeout, mouseEvent;\n function showTooltip() {\n var row = mouseEvent.getDocumentPosition().row;\n var maxRow = editor.session.getLength();\n if (row == maxRow) {\n var screenRow = editor.renderer.pixelToScreenCoordinates(0, mouseEvent.y).row;\n var pos = mouseEvent.$pos;\n if (screenRow > editor.session.documentToScreenRow(pos.row, pos.column))\n return hideTooltip();\n }\n tooltip.showTooltip(row);\n if (!tooltip.isOpen)\n return;\n editor.on(\"mousewheel\", hideTooltip);\n if (mouseHandler.$tooltipFollowsMouse) {\n moveTooltip(mouseEvent);\n }\n else {\n var gutterRow = mouseEvent.getGutterRow();\n var gutterCell = gutter.$lines.get(gutterRow);\n if (gutterCell) {\n var gutterElement = gutterCell.element.querySelector(\".ace_gutter_annotation\");\n var rect = gutterElement.getBoundingClientRect();\n var style = tooltip.getElement().style;\n style.left = rect.right + \"px\";\n style.top = rect.bottom + \"px\";\n }\n else {\n moveTooltip(mouseEvent);\n }\n }\n }\n function hideTooltip() {\n if (tooltipTimeout)\n tooltipTimeout = clearTimeout(tooltipTimeout);\n if (tooltip.isOpen) {\n tooltip.hideTooltip();\n editor.off(\"mousewheel\", hideTooltip);\n }\n }\n function moveTooltip(e) {\n tooltip.setPosition(e.x, e.y);\n }\n mouseHandler.editor.setDefaultHandler(\"guttermousemove\", function (e) {\n var target = e.domEvent.target || e.domEvent.srcElement;\n if (dom.hasCssClass(target, \"ace_fold-widget\"))\n return hideTooltip();\n if (tooltip.isOpen && mouseHandler.$tooltipFollowsMouse)\n moveTooltip(e);\n mouseEvent = e;\n if (tooltipTimeout)\n return;\n tooltipTimeout = setTimeout(function () {\n tooltipTimeout = null;\n if (mouseEvent && !mouseHandler.isMousePressed)\n showTooltip();\n else\n hideTooltip();\n }, 50);\n });\n event.addListener(editor.renderer.$gutter, \"mouseout\", function (e) {\n mouseEvent = null;\n if (!tooltip.isOpen || tooltipTimeout)\n return;\n tooltipTimeout = setTimeout(function () {\n tooltipTimeout = null;\n hideTooltip();\n }, 50);\n }, editor);\n editor.on(\"changeSession\", hideTooltip);\n editor.on(\"input\", hideTooltip);\n}\nexports.GutterHandler = GutterHandler;\nvar GutterTooltip = /** @class */ (function (_super) {\n __extends(GutterTooltip, _super);\n function GutterTooltip(editor) {\n var _this = _super.call(this, editor.container) || this;\n _this.editor = editor;\n return _this;\n }\n GutterTooltip.prototype.setPosition = function (x, y) {\n var windowWidth = window.innerWidth || document.documentElement.clientWidth;\n var windowHeight = window.innerHeight || document.documentElement.clientHeight;\n var width = this.getWidth();\n var height = this.getHeight();\n x += 15;\n y += 15;\n if (x + width > windowWidth) {\n x -= (x + width) - windowWidth;\n }\n if (y + height > windowHeight) {\n y -= 20 + height;\n }\n Tooltip.prototype.setPosition.call(this, x, y);\n };\n Object.defineProperty(GutterTooltip, \"annotationLabels\", {\n get: function () {\n return {\n error: { singular: nls(\"error\"), plural: nls(\"errors\") },\n warning: { singular: nls(\"warning\"), plural: nls(\"warnings\") },\n info: { singular: nls(\"information message\"), plural: nls(\"information messages\") }\n };\n },\n enumerable: false,\n configurable: true\n });\n GutterTooltip.prototype.showTooltip = function (row) {\n var gutter = this.editor.renderer.$gutterLayer;\n var annotationsInRow = gutter.$annotations[row];\n var annotation;\n if (annotationsInRow)\n annotation = { text: Array.from(annotationsInRow.text), type: Array.from(annotationsInRow.type) };\n else\n annotation = { text: [], type: [] };\n var fold = gutter.session.getFoldLine(row);\n if (fold && gutter.$showFoldedAnnotations) {\n var annotationsInFold = { error: [], warning: [], info: [] };\n var mostSevereAnnotationInFoldType;\n for (var i = row + 1; i <= fold.end.row; i++) {\n if (!gutter.$annotations[i])\n continue;\n for (var j = 0; j < gutter.$annotations[i].text.length; j++) {\n var annotationType = gutter.$annotations[i].type[j];\n annotationsInFold[annotationType].push(gutter.$annotations[i].text[j]);\n if (annotationType === \"error\") {\n mostSevereAnnotationInFoldType = \"error_fold\";\n continue;\n }\n if (annotationType === \"warning\") {\n mostSevereAnnotationInFoldType = \"warning_fold\";\n continue;\n }\n }\n }\n if (mostSevereAnnotationInFoldType === \"error_fold\" || mostSevereAnnotationInFoldType === \"warning_fold\") {\n var summaryFoldedAnnotations = \"\".concat(GutterTooltip.annotationsToSummaryString(annotationsInFold), \" in folded code.\");\n annotation.text.push(summaryFoldedAnnotations);\n annotation.type.push(mostSevereAnnotationInFoldType);\n }\n }\n if (annotation.text.length === 0)\n return this.hide();\n var annotationMessages = { error: [], warning: [], info: [] };\n var iconClassName = gutter.$useSvgGutterIcons ? \"ace_icon_svg\" : \"ace_icon\";\n for (var i = 0; i < annotation.text.length; i++) {\n var line = \" \").concat(annotation.text[i]);\n annotationMessages[annotation.type[i].replace(\"_fold\", \"\")].push(line);\n }\n var tooltipContent = [].concat(annotationMessages.error, annotationMessages.warning, annotationMessages.info).join(\"
\");\n this.setHtml(tooltipContent);\n this.$element.setAttribute(\"aria-live\", \"polite\");\n if (!this.isOpen) {\n this.setTheme(this.editor.renderer.theme);\n this.setClassName(\"ace_gutter-tooltip\");\n }\n this.show();\n this.editor._signal(\"showGutterTooltip\", this);\n };\n GutterTooltip.prototype.hideTooltip = function () {\n this.$element.removeAttribute(\"aria-live\");\n this.hide();\n this.editor._signal(\"hideGutterTooltip\", this);\n };\n GutterTooltip.annotationsToSummaryString = function (annotations) {\n var e_1, _a;\n var summary = [];\n var annotationTypes = ['error', 'warning', 'info'];\n try {\n for (var annotationTypes_1 = __values(annotationTypes), annotationTypes_1_1 = annotationTypes_1.next(); !annotationTypes_1_1.done; annotationTypes_1_1 = annotationTypes_1.next()) {\n var annotationType = annotationTypes_1_1.value;\n if (!annotations[annotationType].length)\n continue;\n var label = annotations[annotationType].length === 1 ? GutterTooltip.annotationLabels[annotationType].singular : GutterTooltip.annotationLabels[annotationType].plural;\n summary.push(\"\".concat(annotations[annotationType].length, \" \").concat(label));\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (annotationTypes_1_1 && !annotationTypes_1_1.done && (_a = annotationTypes_1.return)) _a.call(annotationTypes_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return summary.join(\", \");\n };\n return GutterTooltip;\n}(Tooltip));\nexports.GutterTooltip = GutterTooltip;\n\n});\n\nace.define(\"ace/mouse/mouse_event\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar MouseEvent = /** @class */ (function () {\n function MouseEvent(domEvent, editor) {\n this.domEvent = domEvent;\n this.editor = editor;\n this.x = this.clientX = domEvent.clientX;\n this.y = this.clientY = domEvent.clientY;\n this.$pos = null;\n this.$inSelection = null;\n this.propagationStopped = false;\n this.defaultPrevented = false;\n }\n MouseEvent.prototype.stopPropagation = function () {\n event.stopPropagation(this.domEvent);\n this.propagationStopped = true;\n };\n MouseEvent.prototype.preventDefault = function () {\n event.preventDefault(this.domEvent);\n this.defaultPrevented = true;\n };\n MouseEvent.prototype.stop = function () {\n this.stopPropagation();\n this.preventDefault();\n };\n MouseEvent.prototype.getDocumentPosition = function () {\n if (this.$pos)\n return this.$pos;\n this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY);\n return this.$pos;\n };\n MouseEvent.prototype.getGutterRow = function () {\n var documentRow = this.getDocumentPosition().row;\n var screenRow = this.editor.session.documentToScreenRow(documentRow, 0);\n var screenTopRow = this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row, 0);\n return screenRow - screenTopRow;\n };\n MouseEvent.prototype.inSelection = function () {\n if (this.$inSelection !== null)\n return this.$inSelection;\n var editor = this.editor;\n var selectionRange = editor.getSelectionRange();\n if (selectionRange.isEmpty())\n this.$inSelection = false;\n else {\n var pos = this.getDocumentPosition();\n this.$inSelection = selectionRange.contains(pos.row, pos.column);\n }\n return this.$inSelection;\n };\n MouseEvent.prototype.getButton = function () {\n return event.getButton(this.domEvent);\n };\n MouseEvent.prototype.getShiftKey = function () {\n return this.domEvent.shiftKey;\n };\n MouseEvent.prototype.getAccelKey = function () {\n return useragent.isMac ? this.domEvent.metaKey : this.domEvent.ctrlKey;\n };\n return MouseEvent;\n}());\nexports.MouseEvent = MouseEvent;\n\n});\n\nace.define(\"ace/mouse/dragdrop_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar AUTOSCROLL_DELAY = 200;\nvar SCROLL_CURSOR_DELAY = 200;\nvar SCROLL_CURSOR_HYSTERESIS = 5;\nfunction DragdropHandler(mouseHandler) {\n var editor = mouseHandler.editor;\n var dragImage = dom.createElement(\"div\");\n dragImage.style.cssText = \"top:-100px;position:absolute;z-index:2147483647;opacity:0.5\";\n dragImage.textContent = \"\\xa0\";\n var exports = [\"dragWait\", \"dragWaitEnd\", \"startDrag\", \"dragReadyEnd\", \"onMouseDrag\"];\n exports.forEach(function (x) {\n mouseHandler[x] = this[x];\n }, this);\n editor.on(\"mousedown\", this.onMouseDown.bind(mouseHandler));\n var mouseTarget = editor.container;\n var dragSelectionMarker, x, y;\n var timerId, range;\n var dragCursor, counter = 0;\n var dragOperation;\n var isInternal;\n var autoScrollStartTime;\n var cursorMovedTime;\n var cursorPointOnCaretMoved;\n this.onDragStart = function (e) {\n if (this.cancelDrag || !mouseTarget.draggable) {\n var self = this;\n setTimeout(function () {\n self.startSelect();\n self.captureMouse(e);\n }, 0);\n return e.preventDefault();\n }\n range = editor.getSelectionRange();\n var dataTransfer = e.dataTransfer;\n dataTransfer.effectAllowed = editor.getReadOnly() ? \"copy\" : \"copyMove\";\n editor.container.appendChild(dragImage);\n dataTransfer.setDragImage && dataTransfer.setDragImage(dragImage, 0, 0);\n setTimeout(function () {\n editor.container.removeChild(dragImage);\n });\n dataTransfer.clearData();\n dataTransfer.setData(\"Text\", editor.session.getTextRange());\n isInternal = true;\n this.setState(\"drag\");\n };\n this.onDragEnd = function (e) {\n mouseTarget.draggable = false;\n isInternal = false;\n this.setState(null);\n if (!editor.getReadOnly()) {\n var dropEffect = e.dataTransfer.dropEffect;\n if (!dragOperation && dropEffect == \"move\")\n editor.session.remove(editor.getSelectionRange());\n editor.$resetCursorStyle();\n }\n this.editor.unsetStyle(\"ace_dragging\");\n this.editor.renderer.setCursorStyle(\"\");\n };\n this.onDragEnter = function (e) {\n if (editor.getReadOnly() || !canAccept(e.dataTransfer))\n return;\n x = e.clientX;\n y = e.clientY;\n if (!dragSelectionMarker)\n addDragMarker();\n counter++;\n e.dataTransfer.dropEffect = dragOperation = getDropEffect(e);\n return event.preventDefault(e);\n };\n this.onDragOver = function (e) {\n if (editor.getReadOnly() || !canAccept(e.dataTransfer))\n return;\n x = e.clientX;\n y = e.clientY;\n if (!dragSelectionMarker) {\n addDragMarker();\n counter++;\n }\n if (onMouseMoveTimer !== null)\n onMouseMoveTimer = null;\n e.dataTransfer.dropEffect = dragOperation = getDropEffect(e);\n return event.preventDefault(e);\n };\n this.onDragLeave = function (e) {\n counter--;\n if (counter <= 0 && dragSelectionMarker) {\n clearDragMarker();\n dragOperation = null;\n return event.preventDefault(e);\n }\n };\n this.onDrop = function (e) {\n if (!dragCursor)\n return;\n var dataTransfer = e.dataTransfer;\n if (isInternal) {\n switch (dragOperation) {\n case \"move\":\n if (range.contains(dragCursor.row, dragCursor.column)) {\n range = {\n start: dragCursor,\n end: dragCursor\n };\n }\n else {\n range = editor.moveText(range, dragCursor);\n }\n break;\n case \"copy\":\n range = editor.moveText(range, dragCursor, true);\n break;\n }\n }\n else {\n var dropData = dataTransfer.getData('Text');\n range = {\n start: dragCursor,\n end: editor.session.insert(dragCursor, dropData)\n };\n editor.focus();\n dragOperation = null;\n }\n clearDragMarker();\n return event.preventDefault(e);\n };\n event.addListener(mouseTarget, \"dragstart\", this.onDragStart.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragend\", this.onDragEnd.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragenter\", this.onDragEnter.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragover\", this.onDragOver.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragleave\", this.onDragLeave.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"drop\", this.onDrop.bind(mouseHandler), editor);\n function scrollCursorIntoView(cursor, prevCursor) {\n var now = Date.now();\n var vMovement = !prevCursor || cursor.row != prevCursor.row;\n var hMovement = !prevCursor || cursor.column != prevCursor.column;\n if (!cursorMovedTime || vMovement || hMovement) {\n editor.moveCursorToPosition(cursor);\n cursorMovedTime = now;\n cursorPointOnCaretMoved = { x: x, y: y };\n }\n else {\n var distance = calcDistance(cursorPointOnCaretMoved.x, cursorPointOnCaretMoved.y, x, y);\n if (distance > SCROLL_CURSOR_HYSTERESIS) {\n cursorMovedTime = null;\n }\n else if (now - cursorMovedTime >= SCROLL_CURSOR_DELAY) {\n editor.renderer.scrollCursorIntoView();\n cursorMovedTime = null;\n }\n }\n }\n function autoScroll(cursor, prevCursor) {\n var now = Date.now();\n var lineHeight = editor.renderer.layerConfig.lineHeight;\n var characterWidth = editor.renderer.layerConfig.characterWidth;\n var editorRect = editor.renderer.scroller.getBoundingClientRect();\n var offsets = {\n x: {\n left: x - editorRect.left,\n right: editorRect.right - x\n },\n y: {\n top: y - editorRect.top,\n bottom: editorRect.bottom - y\n }\n };\n var nearestXOffset = Math.min(offsets.x.left, offsets.x.right);\n var nearestYOffset = Math.min(offsets.y.top, offsets.y.bottom);\n var scrollCursor = { row: cursor.row, column: cursor.column };\n if (nearestXOffset / characterWidth <= 2) {\n scrollCursor.column += (offsets.x.left < offsets.x.right ? -3 : +2);\n }\n if (nearestYOffset / lineHeight <= 1) {\n scrollCursor.row += (offsets.y.top < offsets.y.bottom ? -1 : +1);\n }\n var vScroll = cursor.row != scrollCursor.row;\n var hScroll = cursor.column != scrollCursor.column;\n var vMovement = !prevCursor || cursor.row != prevCursor.row;\n if (vScroll || (hScroll && !vMovement)) {\n if (!autoScrollStartTime)\n autoScrollStartTime = now;\n else if (now - autoScrollStartTime >= AUTOSCROLL_DELAY)\n editor.renderer.scrollCursorIntoView(scrollCursor);\n }\n else {\n autoScrollStartTime = null;\n }\n }\n function onDragInterval() {\n var prevCursor = dragCursor;\n dragCursor = editor.renderer.screenToTextCoordinates(x, y);\n scrollCursorIntoView(dragCursor, prevCursor);\n autoScroll(dragCursor, prevCursor);\n }\n function addDragMarker() {\n range = editor.selection.toOrientedRange();\n dragSelectionMarker = editor.session.addMarker(range, \"ace_selection\", editor.getSelectionStyle());\n editor.clearSelection();\n if (editor.isFocused())\n editor.renderer.$cursorLayer.setBlinking(false);\n clearInterval(timerId);\n onDragInterval();\n timerId = setInterval(onDragInterval, 20);\n counter = 0;\n event.addListener(document, \"mousemove\", onMouseMove);\n }\n function clearDragMarker() {\n clearInterval(timerId);\n editor.session.removeMarker(dragSelectionMarker);\n dragSelectionMarker = null;\n editor.selection.fromOrientedRange(range);\n if (editor.isFocused() && !isInternal)\n editor.$resetCursorStyle();\n range = null;\n dragCursor = null;\n counter = 0;\n autoScrollStartTime = null;\n cursorMovedTime = null;\n event.removeListener(document, \"mousemove\", onMouseMove);\n }\n var onMouseMoveTimer = null;\n function onMouseMove() {\n if (onMouseMoveTimer == null) {\n onMouseMoveTimer = setTimeout(function () {\n if (onMouseMoveTimer != null && dragSelectionMarker)\n clearDragMarker();\n }, 20);\n }\n }\n function canAccept(dataTransfer) {\n var types = dataTransfer.types;\n return !types || Array.prototype.some.call(types, function (type) {\n return type == 'text/plain' || type == 'Text';\n });\n }\n function getDropEffect(e) {\n var copyAllowed = ['copy', 'copymove', 'all', 'uninitialized'];\n var moveAllowed = ['move', 'copymove', 'linkmove', 'all', 'uninitialized'];\n var copyModifierState = useragent.isMac ? e.altKey : e.ctrlKey;\n var effectAllowed = \"uninitialized\";\n try {\n effectAllowed = e.dataTransfer.effectAllowed.toLowerCase();\n }\n catch (e) { }\n var dropEffect = \"none\";\n if (copyModifierState && copyAllowed.indexOf(effectAllowed) >= 0)\n dropEffect = \"copy\";\n else if (moveAllowed.indexOf(effectAllowed) >= 0)\n dropEffect = \"move\";\n else if (copyAllowed.indexOf(effectAllowed) >= 0)\n dropEffect = \"copy\";\n return dropEffect;\n }\n}\n(function () {\n this.dragWait = function () {\n var interval = Date.now() - this.mousedownEvent.time;\n if (interval > this.editor.getDragDelay())\n this.startDrag();\n };\n this.dragWaitEnd = function () {\n var target = this.editor.container;\n target.draggable = false;\n this.startSelect(this.mousedownEvent.getDocumentPosition());\n this.selectEnd();\n };\n this.dragReadyEnd = function (e) {\n this.editor.$resetCursorStyle();\n this.editor.unsetStyle(\"ace_dragging\");\n this.editor.renderer.setCursorStyle(\"\");\n this.dragWaitEnd();\n };\n this.startDrag = function () {\n this.cancelDrag = false;\n var editor = this.editor;\n var target = editor.container;\n target.draggable = true;\n editor.renderer.$cursorLayer.setBlinking(false);\n editor.setStyle(\"ace_dragging\");\n var cursorStyle = useragent.isWin ? \"default\" : \"move\";\n editor.renderer.setCursorStyle(cursorStyle);\n this.setState(\"dragReady\");\n };\n this.onMouseDrag = function (e) {\n var target = this.editor.container;\n if (useragent.isIE && this.state == \"dragReady\") {\n var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);\n if (distance > 3)\n target.dragDrop();\n }\n if (this.state === \"dragWait\") {\n var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);\n if (distance > 0) {\n target.draggable = false;\n this.startSelect(this.mousedownEvent.getDocumentPosition());\n }\n }\n };\n this.onMouseDown = function (e) {\n if (!this.$dragEnabled)\n return;\n this.mousedownEvent = e;\n var editor = this.editor;\n var inSelection = e.inSelection();\n var button = e.getButton();\n var clickCount = e.domEvent.detail || 1;\n if (clickCount === 1 && button === 0 && inSelection) {\n if (e.editor.inMultiSelectMode && (e.getAccelKey() || e.getShiftKey()))\n return;\n this.mousedownEvent.time = Date.now();\n var eventTarget = e.domEvent.target || e.domEvent.srcElement;\n if (\"unselectable\" in eventTarget)\n eventTarget.unselectable = \"on\";\n if (editor.getDragDelay()) {\n if (useragent.isWebKit) {\n this.cancelDrag = true;\n var mouseTarget = editor.container;\n mouseTarget.draggable = true;\n }\n this.setState(\"dragWait\");\n }\n else {\n this.startDrag();\n }\n this.captureMouse(e, this.onMouseDrag.bind(this));\n e.defaultPrevented = true;\n }\n };\n}).call(DragdropHandler.prototype);\nfunction calcDistance(ax, ay, bx, by) {\n return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2));\n}\nexports.DragdropHandler = DragdropHandler;\n\n});\n\nace.define(\"ace/mouse/touch_handler\",[\"require\",\"exports\",\"module\",\"ace/mouse/mouse_event\",\"ace/lib/event\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar MouseEvent = require(\"./mouse_event\").MouseEvent;\nvar event = require(\"../lib/event\");\nvar dom = require(\"../lib/dom\");\nexports.addTouchListeners = function (el, editor) {\n var mode = \"scroll\";\n var startX;\n var startY;\n var touchStartT;\n var lastT;\n var longTouchTimer;\n var animationTimer;\n var animationSteps = 0;\n var pos;\n var clickCount = 0;\n var vX = 0;\n var vY = 0;\n var pressed;\n var contextMenu;\n function createContextMenu() {\n var clipboard = window.navigator && window.navigator.clipboard;\n var isOpen = false;\n var updateMenu = function () {\n var selected = editor.getCopyText();\n var hasUndo = editor.session.getUndoManager().hasUndo();\n contextMenu.replaceChild(dom.buildDom(isOpen ? [\"span\",\n !selected && [\"span\", { class: \"ace_mobile-button\", action: \"selectall\" }, \"Select All\"],\n selected && [\"span\", { class: \"ace_mobile-button\", action: \"copy\" }, \"Copy\"],\n selected && [\"span\", { class: \"ace_mobile-button\", action: \"cut\" }, \"Cut\"],\n clipboard && [\"span\", { class: \"ace_mobile-button\", action: \"paste\" }, \"Paste\"],\n hasUndo && [\"span\", { class: \"ace_mobile-button\", action: \"undo\" }, \"Undo\"],\n [\"span\", { class: \"ace_mobile-button\", action: \"find\" }, \"Find\"],\n [\"span\", { class: \"ace_mobile-button\", action: \"openCommandPallete\" }, \"Palette\"]\n ] : [\"span\"]), contextMenu.firstChild);\n };\n var handleClick = function (e) {\n var action = e.target.getAttribute(\"action\");\n if (action == \"more\" || !isOpen) {\n isOpen = !isOpen;\n return updateMenu();\n }\n if (action == \"paste\") {\n clipboard.readText().then(function (text) {\n editor.execCommand(action, text);\n });\n }\n else if (action) {\n if (action == \"cut\" || action == \"copy\") {\n if (clipboard)\n clipboard.writeText(editor.getCopyText());\n else\n document.execCommand(\"copy\");\n }\n editor.execCommand(action);\n }\n contextMenu.firstChild.style.display = \"none\";\n isOpen = false;\n if (action != \"openCommandPallete\")\n editor.focus();\n };\n contextMenu = dom.buildDom([\"div\",\n {\n class: \"ace_mobile-menu\",\n ontouchstart: function (e) {\n mode = \"menu\";\n e.stopPropagation();\n e.preventDefault();\n editor.textInput.focus();\n },\n ontouchend: function (e) {\n e.stopPropagation();\n e.preventDefault();\n handleClick(e);\n },\n onclick: handleClick\n },\n [\"span\"],\n [\"span\", { class: \"ace_mobile-button\", action: \"more\" }, \"...\"]\n ], editor.container);\n }\n function showContextMenu() {\n if (!contextMenu)\n createContextMenu();\n var cursor = editor.selection.cursor;\n var pagePos = editor.renderer.textToScreenCoordinates(cursor.row, cursor.column);\n var leftOffset = editor.renderer.textToScreenCoordinates(0, 0).pageX;\n var scrollLeft = editor.renderer.scrollLeft;\n var rect = editor.container.getBoundingClientRect();\n contextMenu.style.top = pagePos.pageY - rect.top - 3 + \"px\";\n if (pagePos.pageX - rect.left < rect.width - 70) {\n contextMenu.style.left = \"\";\n contextMenu.style.right = \"10px\";\n }\n else {\n contextMenu.style.right = \"\";\n contextMenu.style.left = leftOffset + scrollLeft - rect.left + \"px\";\n }\n contextMenu.style.display = \"\";\n contextMenu.firstChild.style.display = \"none\";\n editor.on(\"input\", hideContextMenu);\n }\n function hideContextMenu(e) {\n if (contextMenu)\n contextMenu.style.display = \"none\";\n editor.off(\"input\", hideContextMenu);\n }\n function handleLongTap() {\n longTouchTimer = null;\n clearTimeout(longTouchTimer);\n var range = editor.selection.getRange();\n var inSelection = range.contains(pos.row, pos.column);\n if (range.isEmpty() || !inSelection) {\n editor.selection.moveToPosition(pos);\n editor.selection.selectWord();\n }\n mode = \"wait\";\n showContextMenu();\n }\n function switchToSelectionMode() {\n longTouchTimer = null;\n clearTimeout(longTouchTimer);\n editor.selection.moveToPosition(pos);\n var range = clickCount >= 2\n ? editor.selection.getLineRange(pos.row)\n : editor.session.getBracketRange(pos);\n if (range && !range.isEmpty()) {\n editor.selection.setRange(range);\n }\n else {\n editor.selection.selectWord();\n }\n mode = \"wait\";\n }\n event.addListener(el, \"contextmenu\", function (e) {\n if (!pressed)\n return;\n var textarea = editor.textInput.getElement();\n textarea.focus();\n }, editor);\n event.addListener(el, \"touchstart\", function (e) {\n var touches = e.touches;\n if (longTouchTimer || touches.length > 1) {\n clearTimeout(longTouchTimer);\n longTouchTimer = null;\n touchStartT = -1;\n mode = \"zoom\";\n return;\n }\n pressed = editor.$mouseHandler.isMousePressed = true;\n var h = editor.renderer.layerConfig.lineHeight;\n var w = editor.renderer.layerConfig.lineHeight;\n var t = e.timeStamp;\n lastT = t;\n var touchObj = touches[0];\n var x = touchObj.clientX;\n var y = touchObj.clientY;\n if (Math.abs(startX - x) + Math.abs(startY - y) > h)\n touchStartT = -1;\n startX = e.clientX = x;\n startY = e.clientY = y;\n vX = vY = 0;\n var ev = new MouseEvent(e, editor);\n pos = ev.getDocumentPosition();\n if (t - touchStartT < 500 && touches.length == 1 && !animationSteps) {\n clickCount++;\n e.preventDefault();\n e.button = 0;\n switchToSelectionMode();\n }\n else {\n clickCount = 0;\n var cursor = editor.selection.cursor;\n var anchor = editor.selection.isEmpty() ? cursor : editor.selection.anchor;\n var cursorPos = editor.renderer.$cursorLayer.getPixelPosition(cursor, true);\n var anchorPos = editor.renderer.$cursorLayer.getPixelPosition(anchor, true);\n var rect = editor.renderer.scroller.getBoundingClientRect();\n var offsetTop = editor.renderer.layerConfig.offset;\n var offsetLeft = editor.renderer.scrollLeft;\n var weightedDistance = function (x, y) {\n x = x / w;\n y = y / h - 0.75;\n return x * x + y * y;\n };\n if (e.clientX < rect.left) {\n mode = \"zoom\";\n return;\n }\n var diff1 = weightedDistance(e.clientX - rect.left - cursorPos.left + offsetLeft, e.clientY - rect.top - cursorPos.top + offsetTop);\n var diff2 = weightedDistance(e.clientX - rect.left - anchorPos.left + offsetLeft, e.clientY - rect.top - anchorPos.top + offsetTop);\n if (diff1 < 3.5 && diff2 < 3.5)\n mode = diff1 > diff2 ? \"cursor\" : \"anchor\";\n if (diff2 < 3.5)\n mode = \"anchor\";\n else if (diff1 < 3.5)\n mode = \"cursor\";\n else\n mode = \"scroll\";\n longTouchTimer = setTimeout(handleLongTap, 450);\n }\n touchStartT = t;\n }, editor);\n event.addListener(el, \"touchend\", function (e) {\n pressed = editor.$mouseHandler.isMousePressed = false;\n if (animationTimer)\n clearInterval(animationTimer);\n if (mode == \"zoom\") {\n mode = \"\";\n animationSteps = 0;\n }\n else if (longTouchTimer) {\n editor.selection.moveToPosition(pos);\n animationSteps = 0;\n showContextMenu();\n }\n else if (mode == \"scroll\") {\n animate();\n hideContextMenu();\n }\n else {\n showContextMenu();\n }\n clearTimeout(longTouchTimer);\n longTouchTimer = null;\n }, editor);\n event.addListener(el, \"touchmove\", function (e) {\n if (longTouchTimer) {\n clearTimeout(longTouchTimer);\n longTouchTimer = null;\n }\n var touches = e.touches;\n if (touches.length > 1 || mode == \"zoom\")\n return;\n var touchObj = touches[0];\n var wheelX = startX - touchObj.clientX;\n var wheelY = startY - touchObj.clientY;\n if (mode == \"wait\") {\n if (wheelX * wheelX + wheelY * wheelY > 4)\n mode = \"cursor\";\n else\n return e.preventDefault();\n }\n startX = touchObj.clientX;\n startY = touchObj.clientY;\n e.clientX = touchObj.clientX;\n e.clientY = touchObj.clientY;\n var t = e.timeStamp;\n var dt = t - lastT;\n lastT = t;\n if (mode == \"scroll\") {\n var mouseEvent = new MouseEvent(e, editor);\n mouseEvent.speed = 1;\n mouseEvent.wheelX = wheelX;\n mouseEvent.wheelY = wheelY;\n if (10 * Math.abs(wheelX) < Math.abs(wheelY))\n wheelX = 0;\n if (10 * Math.abs(wheelY) < Math.abs(wheelX))\n wheelY = 0;\n if (dt != 0) {\n vX = wheelX / dt;\n vY = wheelY / dt;\n }\n editor._emit(\"mousewheel\", mouseEvent);\n if (!mouseEvent.propagationStopped) {\n vX = vY = 0;\n }\n }\n else {\n var ev = new MouseEvent(e, editor);\n var pos = ev.getDocumentPosition();\n if (mode == \"cursor\")\n editor.selection.moveCursorToPosition(pos);\n else if (mode == \"anchor\")\n editor.selection.setSelectionAnchor(pos.row, pos.column);\n editor.renderer.scrollCursorIntoView(pos);\n e.preventDefault();\n }\n }, editor);\n function animate() {\n animationSteps += 60;\n animationTimer = setInterval(function () {\n if (animationSteps-- <= 0) {\n clearInterval(animationTimer);\n animationTimer = null;\n }\n if (Math.abs(vX) < 0.01)\n vX = 0;\n if (Math.abs(vY) < 0.01)\n vY = 0;\n if (animationSteps < 20)\n vX = 0.9 * vX;\n if (animationSteps < 20)\n vY = 0.9 * vY;\n var oldScrollTop = editor.session.getScrollTop();\n editor.renderer.scrollBy(10 * vX, 10 * vY);\n if (oldScrollTop == editor.session.getScrollTop())\n animationSteps = 0;\n }, 10);\n }\n};\n\n});\n\nace.define(\"ace/mouse/mouse_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\",\"ace/mouse/default_handlers\",\"ace/mouse/default_gutter_handler\",\"ace/mouse/mouse_event\",\"ace/mouse/dragdrop_handler\",\"ace/mouse/touch_handler\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar DefaultHandlers = require(\"./default_handlers\").DefaultHandlers;\nvar DefaultGutterHandler = require(\"./default_gutter_handler\").GutterHandler;\nvar MouseEvent = require(\"./mouse_event\").MouseEvent;\nvar DragdropHandler = require(\"./dragdrop_handler\").DragdropHandler;\nvar addTouchListeners = require(\"./touch_handler\").addTouchListeners;\nvar config = require(\"../config\");\nvar MouseHandler = /** @class */ (function () {\n function MouseHandler(editor) {\n var _self = this;\n this.editor = editor;\n new DefaultHandlers(this);\n new DefaultGutterHandler(this);\n new DragdropHandler(this);\n var focusEditor = function (e) {\n var windowBlurred = !document.hasFocus || !document.hasFocus()\n || !editor.isFocused() && document.activeElement == (editor.textInput && editor.textInput.getElement());\n if (windowBlurred)\n window.focus();\n editor.focus();\n setTimeout(function () {\n if (!editor.isFocused())\n editor.focus();\n });\n };\n var mouseTarget = editor.renderer.getMouseEventTarget();\n event.addListener(mouseTarget, \"click\", this.onMouseEvent.bind(this, \"click\"), editor);\n event.addListener(mouseTarget, \"mousemove\", this.onMouseMove.bind(this, \"mousemove\"), editor);\n event.addMultiMouseDownListener([\n mouseTarget,\n editor.renderer.scrollBarV && editor.renderer.scrollBarV.inner,\n editor.renderer.scrollBarH && editor.renderer.scrollBarH.inner,\n editor.textInput && editor.textInput.getElement()\n ].filter(Boolean), [400, 300, 250], this, \"onMouseEvent\", editor);\n event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, \"mousewheel\"), editor);\n addTouchListeners(editor.container, editor);\n var gutterEl = editor.renderer.$gutter;\n event.addListener(gutterEl, \"mousedown\", this.onMouseEvent.bind(this, \"guttermousedown\"), editor);\n event.addListener(gutterEl, \"click\", this.onMouseEvent.bind(this, \"gutterclick\"), editor);\n event.addListener(gutterEl, \"dblclick\", this.onMouseEvent.bind(this, \"gutterdblclick\"), editor);\n event.addListener(gutterEl, \"mousemove\", this.onMouseEvent.bind(this, \"guttermousemove\"), editor);\n event.addListener(mouseTarget, \"mousedown\", focusEditor, editor);\n event.addListener(gutterEl, \"mousedown\", focusEditor, editor);\n if (useragent.isIE && editor.renderer.scrollBarV) {\n event.addListener(editor.renderer.scrollBarV.element, \"mousedown\", focusEditor, editor);\n event.addListener(editor.renderer.scrollBarH.element, \"mousedown\", focusEditor, editor);\n }\n editor.on(\"mousemove\", function (e) {\n if (_self.state || _self.$dragDelay || !_self.$dragEnabled)\n return;\n var character = editor.renderer.screenToTextCoordinates(e.x, e.y);\n var range = editor.session.selection.getRange();\n var renderer = editor.renderer;\n if (!range.isEmpty() && range.insideStart(character.row, character.column)) {\n renderer.setCursorStyle(\"default\");\n }\n else {\n renderer.setCursorStyle(\"\");\n }\n }, editor);\n }\n MouseHandler.prototype.onMouseEvent = function (name, e) {\n if (!this.editor.session)\n return;\n this.editor._emit(name, new MouseEvent(e, this.editor));\n };\n MouseHandler.prototype.onMouseMove = function (name, e) {\n var listeners = this.editor._eventRegistry && this.editor._eventRegistry.mousemove;\n if (!listeners || !listeners.length)\n return;\n this.editor._emit(name, new MouseEvent(e, this.editor));\n };\n MouseHandler.prototype.onMouseWheel = function (name, e) {\n var mouseEvent = new MouseEvent(e, this.editor);\n mouseEvent.speed = this.$scrollSpeed * 2;\n mouseEvent.wheelX = e.wheelX;\n mouseEvent.wheelY = e.wheelY;\n this.editor._emit(name, mouseEvent);\n };\n MouseHandler.prototype.setState = function (state) {\n this.state = state;\n };\n MouseHandler.prototype.captureMouse = function (ev, mouseMoveHandler) {\n this.x = ev.x;\n this.y = ev.y;\n this.isMousePressed = true;\n var editor = this.editor;\n var renderer = this.editor.renderer;\n renderer.$isMousePressed = true;\n var self = this;\n var onMouseMove = function (e) {\n if (!e)\n return;\n if (useragent.isWebKit && !e.which && self.releaseMouse)\n return self.releaseMouse();\n self.x = e.clientX;\n self.y = e.clientY;\n mouseMoveHandler && mouseMoveHandler(e);\n self.mouseEvent = new MouseEvent(e, self.editor);\n self.$mouseMoved = true;\n };\n var onCaptureEnd = function (e) {\n editor.off(\"beforeEndOperation\", onOperationEnd);\n clearInterval(timerId);\n if (editor.session)\n onCaptureInterval();\n self[self.state + \"End\"] && self[self.state + \"End\"](e);\n self.state = \"\";\n self.isMousePressed = renderer.$isMousePressed = false;\n if (renderer.$keepTextAreaAtCursor)\n renderer.$moveTextAreaToCursor();\n self.$onCaptureMouseMove = self.releaseMouse = null;\n e && self.onMouseEvent(\"mouseup\", e);\n editor.endOperation();\n };\n var onCaptureInterval = function () {\n self[self.state] && self[self.state]();\n self.$mouseMoved = false;\n };\n if (useragent.isOldIE && ev.domEvent.type == \"dblclick\") {\n return setTimeout(function () { onCaptureEnd(ev); });\n }\n var onOperationEnd = function (e) {\n if (!self.releaseMouse)\n return;\n if (editor.curOp.command.name && editor.curOp.selectionChanged) {\n self[self.state + \"End\"] && self[self.state + \"End\"]();\n self.state = \"\";\n self.releaseMouse();\n }\n };\n editor.on(\"beforeEndOperation\", onOperationEnd);\n editor.startOperation({ command: { name: \"mouse\" } });\n self.$onCaptureMouseMove = onMouseMove;\n self.releaseMouse = event.capture(this.editor.container, onMouseMove, onCaptureEnd);\n var timerId = setInterval(onCaptureInterval, 20);\n };\n MouseHandler.prototype.cancelContextMenu = function () {\n var stop = function (e) {\n if (e && e.domEvent && e.domEvent.type != \"contextmenu\")\n return;\n this.editor.off(\"nativecontextmenu\", stop);\n if (e && e.domEvent)\n event.stopEvent(e.domEvent);\n }.bind(this);\n setTimeout(stop, 10);\n this.editor.on(\"nativecontextmenu\", stop);\n };\n MouseHandler.prototype.destroy = function () {\n if (this.releaseMouse)\n this.releaseMouse();\n };\n return MouseHandler;\n}());\nMouseHandler.prototype.releaseMouse = null;\nconfig.defineOptions(MouseHandler.prototype, \"mouseHandler\", {\n scrollSpeed: { initialValue: 2 },\n dragDelay: { initialValue: (useragent.isMac ? 150 : 0) },\n dragEnabled: { initialValue: true },\n focusTimeout: { initialValue: 0 },\n tooltipFollowsMouse: { initialValue: true }\n});\nexports.MouseHandler = MouseHandler;\n\n});\n\nace.define(\"ace/mouse/fold_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar FoldHandler = /** @class */ (function () {\n function FoldHandler(editor) {\n editor.on(\"click\", function (e) {\n var position = e.getDocumentPosition();\n var session = editor.session;\n var fold = session.getFoldAt(position.row, position.column, 1);\n if (fold) {\n if (e.getAccelKey())\n session.removeFold(fold);\n else\n session.expandFold(fold);\n e.stop();\n }\n var target = e.domEvent && e.domEvent.target;\n if (target && dom.hasCssClass(target, \"ace_inline_button\")) {\n if (dom.hasCssClass(target, \"ace_toggle_wrap\")) {\n session.setOption(\"wrap\", !session.getUseWrapMode());\n editor.renderer.scrollCursorIntoView();\n }\n }\n });\n editor.on(\"gutterclick\", function (e) {\n var gutterRegion = editor.renderer.$gutterLayer.getRegion(e);\n if (gutterRegion == \"foldWidgets\") {\n var row = e.getDocumentPosition().row;\n var session = editor.session;\n if (session.foldWidgets && session.foldWidgets[row])\n editor.session.onFoldWidgetClick(row, e);\n if (!editor.isFocused())\n editor.focus();\n e.stop();\n }\n });\n editor.on(\"gutterdblclick\", function (e) {\n var gutterRegion = editor.renderer.$gutterLayer.getRegion(e);\n if (gutterRegion == \"foldWidgets\") {\n var row = e.getDocumentPosition().row;\n var session = editor.session;\n var data = session.getParentFoldRangeData(row, true);\n var range = data.range || data.firstRange;\n if (range) {\n row = range.start.row;\n var fold = session.getFoldAt(row, session.getLine(row).length, 1);\n if (fold) {\n session.removeFold(fold);\n }\n else {\n session.addFold(\"...\", range);\n editor.renderer.scrollCursorIntoView({ row: range.start.row, column: 0 });\n }\n }\n e.stop();\n }\n });\n }\n return FoldHandler;\n}());\nexports.FoldHandler = FoldHandler;\n\n});\n\nace.define(\"ace/keyboard/keybinding\",[\"require\",\"exports\",\"module\",\"ace/lib/keys\",\"ace/lib/event\"], function(require, exports, module){\"use strict\";\nvar keyUtil = require(\"../lib/keys\");\nvar event = require(\"../lib/event\");\nvar KeyBinding = /** @class */ (function () {\n function KeyBinding(editor) {\n this.$editor = editor;\n this.$data = { editor: editor };\n this.$handlers = [];\n this.setDefaultHandler(editor.commands);\n }\n KeyBinding.prototype.setDefaultHandler = function (kb) {\n this.removeKeyboardHandler(this.$defaultHandler);\n this.$defaultHandler = kb;\n this.addKeyboardHandler(kb, 0);\n };\n KeyBinding.prototype.setKeyboardHandler = function (kb) {\n var h = this.$handlers;\n if (h[h.length - 1] == kb)\n return;\n while (h[h.length - 1] && h[h.length - 1] != this.$defaultHandler)\n this.removeKeyboardHandler(h[h.length - 1]);\n this.addKeyboardHandler(kb, 1);\n };\n KeyBinding.prototype.addKeyboardHandler = function (kb, pos) {\n if (!kb)\n return;\n if (typeof kb == \"function\" && !kb.handleKeyboard)\n kb.handleKeyboard = kb;\n var i = this.$handlers.indexOf(kb);\n if (i != -1)\n this.$handlers.splice(i, 1);\n if (pos == undefined)\n this.$handlers.push(kb);\n else\n this.$handlers.splice(pos, 0, kb);\n if (i == -1 && kb.attach)\n kb.attach(this.$editor);\n };\n KeyBinding.prototype.removeKeyboardHandler = function (kb) {\n var i = this.$handlers.indexOf(kb);\n if (i == -1)\n return false;\n this.$handlers.splice(i, 1);\n kb.detach && kb.detach(this.$editor);\n return true;\n };\n KeyBinding.prototype.getKeyboardHandler = function () {\n return this.$handlers[this.$handlers.length - 1];\n };\n KeyBinding.prototype.getStatusText = function () {\n var data = this.$data;\n var editor = data.editor;\n return this.$handlers.map(function (h) {\n return h.getStatusText && h.getStatusText(editor, data) || \"\";\n }).filter(Boolean).join(\" \");\n };\n KeyBinding.prototype.$callKeyboardHandlers = function (hashId, keyString, keyCode, e) {\n var toExecute;\n var success = false;\n var commands = this.$editor.commands;\n for (var i = this.$handlers.length; i--;) {\n toExecute = this.$handlers[i].handleKeyboard(this.$data, hashId, keyString, keyCode, e);\n if (!toExecute || !toExecute.command)\n continue;\n if (toExecute.command == \"null\") {\n success = true;\n }\n else {\n success = commands.exec(toExecute.command, this.$editor, toExecute.args, e);\n }\n if (success && e && hashId != -1 &&\n toExecute.passEvent != true && toExecute.command.passEvent != true) {\n event.stopEvent(e);\n }\n if (success)\n break;\n }\n if (!success && hashId == -1) {\n toExecute = { command: \"insertstring\" };\n success = commands.exec(\"insertstring\", this.$editor, keyString);\n }\n if (success && this.$editor._signal)\n this.$editor._signal(\"keyboardActivity\", toExecute);\n return success;\n };\n KeyBinding.prototype.onCommandKey = function (e, hashId, keyCode) {\n var keyString = keyUtil.keyCodeToString(keyCode);\n return this.$callKeyboardHandlers(hashId, keyString, keyCode, e);\n };\n KeyBinding.prototype.onTextInput = function (text) {\n return this.$callKeyboardHandlers(-1, text);\n };\n return KeyBinding;\n}());\nexports.KeyBinding = KeyBinding;\n\n});\n\nace.define(\"ace/lib/bidiutil\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar ArabicAlefBetIntervalsBegine = ['\\u0621', '\\u0641'];\nvar ArabicAlefBetIntervalsEnd = ['\\u063A', '\\u064a'];\nvar dir = 0, hiLevel = 0;\nvar lastArabic = false, hasUBAT_AL = false, hasUBAT_B = false, hasUBAT_S = false, hasBlockSep = false, hasSegSep = false;\nvar impTab_LTR = [ [0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 0x11, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 0x15, 0x15, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]\n];\nvar impTab_RTL = [ [2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 0x21, 3, 1, 1]\n];\nvar LTR = 0, RTL = 1;\nvar L = 0;\nvar R = 1;\nvar EN = 2;\nvar AN = 3;\nvar ON = 4;\nvar B = 5;\nvar S = 6;\nvar AL = 7;\nvar WS = 8;\nvar CS = 9;\nvar ES = 10;\nvar ET = 11;\nvar NSM = 12;\nvar LRE = 13;\nvar RLE = 14;\nvar PDF = 15;\nvar LRO = 16;\nvar RLO = 17;\nvar BN = 18;\nvar UnicodeTBL00 = [\n BN, BN, BN, BN, BN, BN, BN, BN, BN, S, B, S, WS, B, BN, BN,\n BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, B, B, B, S,\n WS, ON, ON, ET, ET, ET, ON, ON, ON, ON, ON, ES, CS, ES, CS, CS,\n EN, EN, EN, EN, EN, EN, EN, EN, EN, EN, CS, ON, ON, ON, ON, ON,\n ON, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L,\n L, L, L, L, L, L, L, L, L, L, L, ON, ON, ON, ON, ON,\n ON, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L,\n L, L, L, L, L, L, L, L, L, L, L, ON, ON, ON, ON, BN,\n BN, BN, BN, BN, BN, B, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN,\n BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN,\n CS, ON, ET, ET, ET, ET, ON, ON, ON, ON, L, ON, ON, BN, ON, ON,\n ET, ET, EN, EN, ON, L, ON, ON, ON, EN, L, ON, ON, ON, ON, ON\n];\nvar UnicodeTBL20 = [\n WS, WS, WS, WS, WS, WS, WS, WS, WS, WS, WS, BN, BN, BN, L, R,\n ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON,\n ON, ON, ON, ON, ON, ON, ON, ON, WS, B, LRE, RLE, PDF, LRO, RLO, CS,\n ET, ET, ET, ET, ET, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON,\n ON, ON, ON, ON, CS, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON,\n ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, WS\n];\nfunction _computeLevels(chars, levels, len, charTypes) {\n var impTab = dir ? impTab_RTL : impTab_LTR, prevState = null, newClass = null, newLevel = null, newState = 0, action = null, cond = null, condPos = -1, i = null, ix = null, classes = [];\n if (!charTypes) {\n for (i = 0, charTypes = []; i < len; i++) {\n charTypes[i] = _getCharacterType(chars[i]);\n }\n }\n hiLevel = dir;\n lastArabic = false;\n hasUBAT_AL = false;\n hasUBAT_B = false;\n hasUBAT_S = false;\n for (ix = 0; ix < len; ix++) {\n prevState = newState;\n classes[ix] = newClass = _getCharClass(chars, charTypes, classes, ix);\n newState = impTab[prevState][newClass];\n action = newState & 0xF0;\n newState &= 0x0F;\n levels[ix] = newLevel = impTab[newState][5];\n if (action > 0) {\n if (action == 0x10) {\n for (i = condPos; i < ix; i++) {\n levels[i] = 1;\n }\n condPos = -1;\n }\n else {\n condPos = -1;\n }\n }\n cond = impTab[newState][6];\n if (cond) {\n if (condPos == -1) {\n condPos = ix;\n }\n }\n else {\n if (condPos > -1) {\n for (i = condPos; i < ix; i++) {\n levels[i] = newLevel;\n }\n condPos = -1;\n }\n }\n if (charTypes[ix] == B) {\n levels[ix] = 0;\n }\n hiLevel |= newLevel;\n }\n if (hasUBAT_S) {\n for (i = 0; i < len; i++) {\n if (charTypes[i] == S) {\n levels[i] = dir;\n for (var j = i - 1; j >= 0; j--) {\n if (charTypes[j] == WS) {\n levels[j] = dir;\n }\n else {\n break;\n }\n }\n }\n }\n }\n}\nfunction _invertLevel(lev, levels, _array) {\n if (hiLevel < lev) {\n return;\n }\n if (lev == 1 && dir == RTL && !hasUBAT_B) {\n _array.reverse();\n return;\n }\n var len = _array.length, start = 0, end, lo, hi, tmp;\n while (start < len) {\n if (levels[start] >= lev) {\n end = start + 1;\n while (end < len && levels[end] >= lev) {\n end++;\n }\n for (lo = start, hi = end - 1; lo < hi; lo++, hi--) {\n tmp = _array[lo];\n _array[lo] = _array[hi];\n _array[hi] = tmp;\n }\n start = end;\n }\n start++;\n }\n}\nfunction _getCharClass(chars, types, classes, ix) {\n var cType = types[ix], wType, nType, len, i;\n switch (cType) {\n case L:\n case R:\n lastArabic = false;\n case ON:\n case AN:\n return cType;\n case EN:\n return lastArabic ? AN : EN;\n case AL:\n lastArabic = true;\n hasUBAT_AL = true;\n return R;\n case WS:\n return ON;\n case CS:\n if (ix < 1 || (ix + 1) >= types.length ||\n ((wType = classes[ix - 1]) != EN && wType != AN) ||\n ((nType = types[ix + 1]) != EN && nType != AN)) {\n return ON;\n }\n if (lastArabic) {\n nType = AN;\n }\n return nType == wType ? nType : ON;\n case ES:\n wType = ix > 0 ? classes[ix - 1] : B;\n if (wType == EN && (ix + 1) < types.length && types[ix + 1] == EN) {\n return EN;\n }\n return ON;\n case ET:\n if (ix > 0 && classes[ix - 1] == EN) {\n return EN;\n }\n if (lastArabic) {\n return ON;\n }\n i = ix + 1;\n len = types.length;\n while (i < len && types[i] == ET) {\n i++;\n }\n if (i < len && types[i] == EN) {\n return EN;\n }\n return ON;\n case NSM:\n len = types.length;\n i = ix + 1;\n while (i < len && types[i] == NSM) {\n i++;\n }\n if (i < len) {\n var c = chars[ix], rtlCandidate = (c >= 0x0591 && c <= 0x08FF) || c == 0xFB1E;\n wType = types[i];\n if (rtlCandidate && (wType == R || wType == AL)) {\n return R;\n }\n }\n if (ix < 1 || (wType = types[ix - 1]) == B) {\n return ON;\n }\n return classes[ix - 1];\n case B:\n lastArabic = false;\n hasUBAT_B = true;\n return dir;\n case S:\n hasUBAT_S = true;\n return ON;\n case LRE:\n case RLE:\n case LRO:\n case RLO:\n case PDF:\n lastArabic = false;\n case BN:\n return ON;\n }\n}\nfunction _getCharacterType(ch) {\n var uc = ch.charCodeAt(0), hi = uc >> 8;\n if (hi == 0) {\n return ((uc > 0x00BF) ? L : UnicodeTBL00[uc]);\n }\n else if (hi == 5) {\n return (/[\\u0591-\\u05f4]/.test(ch) ? R : L);\n }\n else if (hi == 6) {\n if (/[\\u0610-\\u061a\\u064b-\\u065f\\u06d6-\\u06e4\\u06e7-\\u06ed]/.test(ch))\n return NSM;\n else if (/[\\u0660-\\u0669\\u066b-\\u066c]/.test(ch))\n return AN;\n else if (uc == 0x066A)\n return ET;\n else if (/[\\u06f0-\\u06f9]/.test(ch))\n return EN;\n else\n return AL;\n }\n else if (hi == 0x20 && uc <= 0x205F) {\n return UnicodeTBL20[uc & 0xFF];\n }\n else if (hi == 0xFE) {\n return (uc >= 0xFE70 ? AL : ON);\n }\n return ON;\n}\nfunction _isArabicDiacritics(ch) {\n return (ch >= '\\u064b' && ch <= '\\u0655');\n}\nexports.L = L;\nexports.R = R;\nexports.EN = EN;\nexports.ON_R = 3;\nexports.AN = 4;\nexports.R_H = 5;\nexports.B = 6;\nexports.RLE = 7;\nexports.DOT = \"\\xB7\";\nexports.doBidiReorder = function (text, textCharTypes, isRtl) {\n if (text.length < 2)\n return {};\n var chars = text.split(\"\"), logicalFromVisual = new Array(chars.length), bidiLevels = new Array(chars.length), levels = [];\n dir = isRtl ? RTL : LTR;\n _computeLevels(chars, levels, chars.length, textCharTypes);\n for (var i = 0; i < logicalFromVisual.length; logicalFromVisual[i] = i, i++)\n ;\n _invertLevel(2, levels, logicalFromVisual);\n _invertLevel(1, levels, logicalFromVisual);\n for (var i = 0; i < logicalFromVisual.length - 1; i++) { //fix levels to reflect character width\n if (textCharTypes[i] === AN) {\n levels[i] = exports.AN;\n }\n else if (levels[i] === R && ((textCharTypes[i] > AL && textCharTypes[i] < LRE)\n || textCharTypes[i] === ON || textCharTypes[i] === BN)) {\n levels[i] = exports.ON_R;\n }\n else if ((i > 0 && chars[i - 1] === '\\u0644') && /\\u0622|\\u0623|\\u0625|\\u0627/.test(chars[i])) {\n levels[i - 1] = levels[i] = exports.R_H;\n i++;\n }\n }\n if (chars[chars.length - 1] === exports.DOT)\n levels[chars.length - 1] = exports.B;\n if (chars[0] === '\\u202B')\n levels[0] = exports.RLE;\n for (var i = 0; i < logicalFromVisual.length; i++) {\n bidiLevels[i] = levels[logicalFromVisual[i]];\n }\n return { 'logicalFromVisual': logicalFromVisual, 'bidiLevels': bidiLevels };\n};\nexports.hasBidiCharacters = function (text, textCharTypes) {\n var ret = false;\n for (var i = 0; i < text.length; i++) {\n textCharTypes[i] = _getCharacterType(text.charAt(i));\n if (!ret && (textCharTypes[i] == R || textCharTypes[i] == AL || textCharTypes[i] == AN))\n ret = true;\n }\n return ret;\n};\nexports.getVisualFromLogicalIdx = function (logIdx, rowMap) {\n for (var i = 0; i < rowMap.logicalFromVisual.length; i++) {\n if (rowMap.logicalFromVisual[i] == logIdx)\n return i;\n }\n return 0;\n};\n\n});\n\nace.define(\"ace/bidihandler\",[\"require\",\"exports\",\"module\",\"ace/lib/bidiutil\",\"ace/lib/lang\"], function(require, exports, module){\"use strict\";\nvar bidiUtil = require(\"./lib/bidiutil\");\nvar lang = require(\"./lib/lang\");\nvar bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac\\u202B]/;\nvar BidiHandler = /** @class */ (function () {\n function BidiHandler(session) {\n this.session = session;\n this.bidiMap = {};\n this.currentRow = null;\n this.bidiUtil = bidiUtil;\n this.charWidths = [];\n this.EOL = \"\\xAC\";\n this.showInvisibles = true;\n this.isRtlDir = false;\n this.$isRtl = false;\n this.line = \"\";\n this.wrapIndent = 0;\n this.EOF = \"\\xB6\";\n this.RLE = \"\\u202B\";\n this.contentWidth = 0;\n this.fontMetrics = null;\n this.rtlLineOffset = 0;\n this.wrapOffset = 0;\n this.isMoveLeftOperation = false;\n this.seenBidi = bidiRE.test(session.getValue());\n }\n BidiHandler.prototype.isBidiRow = function (screenRow, docRow, splitIndex) {\n if (!this.seenBidi)\n return false;\n if (screenRow !== this.currentRow) {\n this.currentRow = screenRow;\n this.updateRowLine(docRow, splitIndex);\n this.updateBidiMap();\n }\n return this.bidiMap.bidiLevels;\n };\n BidiHandler.prototype.onChange = function (delta) {\n if (!this.seenBidi) {\n if (delta.action == \"insert\" && bidiRE.test(delta.lines.join(\"\\n\"))) {\n this.seenBidi = true;\n this.currentRow = null;\n }\n }\n else {\n this.currentRow = null;\n }\n };\n BidiHandler.prototype.getDocumentRow = function () {\n var docRow = 0;\n var rowCache = this.session.$screenRowCache;\n if (rowCache.length) {\n var index = this.session.$getRowCacheIndex(rowCache, this.currentRow);\n if (index >= 0)\n docRow = this.session.$docRowCache[index];\n }\n return docRow;\n };\n BidiHandler.prototype.getSplitIndex = function () {\n var splitIndex = 0;\n var rowCache = this.session.$screenRowCache;\n if (rowCache.length) {\n var currentIndex, prevIndex = this.session.$getRowCacheIndex(rowCache, this.currentRow);\n while (this.currentRow - splitIndex > 0) {\n currentIndex = this.session.$getRowCacheIndex(rowCache, this.currentRow - splitIndex - 1);\n if (currentIndex !== prevIndex)\n break;\n prevIndex = currentIndex;\n splitIndex++;\n }\n }\n else {\n splitIndex = this.currentRow;\n }\n return splitIndex;\n };\n BidiHandler.prototype.updateRowLine = function (docRow, splitIndex) {\n if (docRow === undefined)\n docRow = this.getDocumentRow();\n var isLastRow = (docRow === this.session.getLength() - 1), endOfLine = isLastRow ? this.EOF : this.EOL;\n this.wrapIndent = 0;\n this.line = this.session.getLine(docRow);\n this.isRtlDir = this.$isRtl || this.line.charAt(0) === this.RLE;\n if (this.session.$useWrapMode) {\n var splits = this.session.$wrapData[docRow];\n if (splits) {\n if (splitIndex === undefined)\n splitIndex = this.getSplitIndex();\n if (splitIndex > 0 && splits.length) {\n this.wrapIndent = splits.indent;\n this.wrapOffset = this.wrapIndent * this.charWidths[bidiUtil.L];\n this.line = (splitIndex < splits.length) ?\n this.line.substring(splits[splitIndex - 1], splits[splitIndex]) :\n this.line.substring(splits[splits.length - 1]);\n }\n else {\n this.line = this.line.substring(0, splits[splitIndex]);\n }\n if (splitIndex == splits.length) {\n this.line += (this.showInvisibles) ? endOfLine : bidiUtil.DOT;\n }\n }\n }\n else {\n this.line += this.showInvisibles ? endOfLine : bidiUtil.DOT;\n }\n var session = this.session, shift = 0, size;\n this.line = this.line.replace(/\\t|[\\u1100-\\u2029, \\u202F-\\uFFE6]/g, function (ch, i) {\n if (ch === '\\t' || session.isFullWidth(ch.charCodeAt(0))) {\n size = (ch === '\\t') ? session.getScreenTabSize(i + shift) : 2;\n shift += size - 1;\n return lang.stringRepeat(bidiUtil.DOT, size);\n }\n return ch;\n });\n if (this.isRtlDir) {\n this.fontMetrics.$main.textContent = (this.line.charAt(this.line.length - 1) == bidiUtil.DOT) ? this.line.substr(0, this.line.length - 1) : this.line;\n this.rtlLineOffset = this.contentWidth - this.fontMetrics.$main.getBoundingClientRect().width;\n }\n };\n BidiHandler.prototype.updateBidiMap = function () {\n var textCharTypes = [];\n if (bidiUtil.hasBidiCharacters(this.line, textCharTypes) || this.isRtlDir) {\n this.bidiMap = bidiUtil.doBidiReorder(this.line, textCharTypes, this.isRtlDir);\n }\n else {\n this.bidiMap = {};\n }\n };\n BidiHandler.prototype.markAsDirty = function () {\n this.currentRow = null;\n };\n BidiHandler.prototype.updateCharacterWidths = function (fontMetrics) {\n if (this.characterWidth === fontMetrics.$characterSize.width)\n return;\n this.fontMetrics = fontMetrics;\n var characterWidth = this.characterWidth = fontMetrics.$characterSize.width;\n var bidiCharWidth = fontMetrics.$measureCharWidth(\"\\u05d4\");\n this.charWidths[bidiUtil.L] = this.charWidths[bidiUtil.EN] = this.charWidths[bidiUtil.ON_R] = characterWidth;\n this.charWidths[bidiUtil.R] = this.charWidths[bidiUtil.AN] = bidiCharWidth;\n this.charWidths[bidiUtil.R_H] = bidiCharWidth * 0.45;\n this.charWidths[bidiUtil.B] = this.charWidths[bidiUtil.RLE] = 0;\n this.currentRow = null;\n };\n BidiHandler.prototype.setShowInvisibles = function (showInvisibles) {\n this.showInvisibles = showInvisibles;\n this.currentRow = null;\n };\n BidiHandler.prototype.setEolChar = function (eolChar) {\n this.EOL = eolChar;\n };\n BidiHandler.prototype.setContentWidth = function (width) {\n this.contentWidth = width;\n };\n BidiHandler.prototype.isRtlLine = function (row) {\n if (this.$isRtl)\n return true;\n if (row != undefined)\n return (this.session.getLine(row).charAt(0) == this.RLE);\n else\n return this.isRtlDir;\n };\n BidiHandler.prototype.setRtlDirection = function (editor, isRtlDir) {\n var cursor = editor.getCursorPosition();\n for (var row = editor.selection.getSelectionAnchor().row; row <= cursor.row; row++) {\n if (!isRtlDir && editor.session.getLine(row).charAt(0) === editor.session.$bidiHandler.RLE)\n editor.session.doc.removeInLine(row, 0, 1);\n else if (isRtlDir && editor.session.getLine(row).charAt(0) !== editor.session.$bidiHandler.RLE)\n editor.session.doc.insert({ column: 0, row: row }, editor.session.$bidiHandler.RLE);\n }\n };\n BidiHandler.prototype.getPosLeft = function (col) {\n col -= this.wrapIndent;\n var leftBoundary = (this.line.charAt(0) === this.RLE) ? 1 : 0;\n var logicalIdx = (col > leftBoundary) ? (this.session.getOverwrite() ? col : col - 1) : leftBoundary;\n var visualIdx = bidiUtil.getVisualFromLogicalIdx(logicalIdx, this.bidiMap), levels = this.bidiMap.bidiLevels, left = 0;\n if (!this.session.getOverwrite() && col <= leftBoundary && levels[visualIdx] % 2 !== 0)\n visualIdx++;\n for (var i = 0; i < visualIdx; i++) {\n left += this.charWidths[levels[i]];\n }\n if (!this.session.getOverwrite() && (col > leftBoundary) && (levels[visualIdx] % 2 === 0))\n left += this.charWidths[levels[visualIdx]];\n if (this.wrapIndent)\n left += this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;\n if (this.isRtlDir)\n left += this.rtlLineOffset;\n return left;\n };\n BidiHandler.prototype.getSelections = function (startCol, endCol) {\n var map = this.bidiMap, levels = map.bidiLevels, level, selections = [], offset = 0, selColMin = Math.min(startCol, endCol) - this.wrapIndent, selColMax = Math.max(startCol, endCol) - this.wrapIndent, isSelected = false, isSelectedPrev = false, selectionStart = 0;\n if (this.wrapIndent)\n offset += this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;\n for (var logIdx, visIdx = 0; visIdx < levels.length; visIdx++) {\n logIdx = map.logicalFromVisual[visIdx];\n level = levels[visIdx];\n isSelected = (logIdx >= selColMin) && (logIdx < selColMax);\n if (isSelected && !isSelectedPrev) {\n selectionStart = offset;\n }\n else if (!isSelected && isSelectedPrev) {\n selections.push({ left: selectionStart, width: offset - selectionStart });\n }\n offset += this.charWidths[level];\n isSelectedPrev = isSelected;\n }\n if (isSelected && (visIdx === levels.length)) {\n selections.push({ left: selectionStart, width: offset - selectionStart });\n }\n if (this.isRtlDir) {\n for (var i = 0; i < selections.length; i++) {\n selections[i].left += this.rtlLineOffset;\n }\n }\n return selections;\n };\n BidiHandler.prototype.offsetToCol = function (posX) {\n if (this.isRtlDir)\n posX -= this.rtlLineOffset;\n var logicalIdx = 0, posX = Math.max(posX, 0), offset = 0, visualIdx = 0, levels = this.bidiMap.bidiLevels, charWidth = this.charWidths[levels[visualIdx]];\n if (this.wrapIndent)\n posX -= this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;\n while (posX > offset + charWidth / 2) {\n offset += charWidth;\n if (visualIdx === levels.length - 1) {\n charWidth = 0;\n break;\n }\n charWidth = this.charWidths[levels[++visualIdx]];\n }\n if (visualIdx > 0 && (levels[visualIdx - 1] % 2 !== 0) && (levels[visualIdx] % 2 === 0)) {\n if (posX < offset)\n visualIdx--;\n logicalIdx = this.bidiMap.logicalFromVisual[visualIdx];\n }\n else if (visualIdx > 0 && (levels[visualIdx - 1] % 2 === 0) && (levels[visualIdx] % 2 !== 0)) {\n logicalIdx = 1 + ((posX > offset) ? this.bidiMap.logicalFromVisual[visualIdx]\n : this.bidiMap.logicalFromVisual[visualIdx - 1]);\n }\n else if ((this.isRtlDir && visualIdx === levels.length - 1 && charWidth === 0 && (levels[visualIdx - 1] % 2 === 0))\n || (!this.isRtlDir && visualIdx === 0 && (levels[visualIdx] % 2 !== 0))) {\n logicalIdx = 1 + this.bidiMap.logicalFromVisual[visualIdx];\n }\n else {\n if (visualIdx > 0 && (levels[visualIdx - 1] % 2 !== 0) && charWidth !== 0)\n visualIdx--;\n logicalIdx = this.bidiMap.logicalFromVisual[visualIdx];\n }\n if (logicalIdx === 0 && this.isRtlDir)\n logicalIdx++;\n return (logicalIdx + this.wrapIndent);\n };\n return BidiHandler;\n}());\nexports.BidiHandler = BidiHandler;\n\n});\n\nace.define(\"ace/selection\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/lib/event_emitter\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar lang = require(\"./lib/lang\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Range = require(\"./range\").Range;\nvar Selection = function (session) {\n this.session = session;\n this.doc = session.getDocument();\n this.clearSelection();\n this.cursor = this.lead = this.doc.createAnchor(0, 0);\n this.anchor = this.doc.createAnchor(0, 0);\n this.$silent = false;\n var self = this;\n this.cursor.on(\"change\", function (e) {\n self.$cursorChanged = true;\n if (!self.$silent)\n self._emit(\"changeCursor\");\n if (!self.$isEmpty && !self.$silent)\n self._emit(\"changeSelection\");\n if (!self.$keepDesiredColumnOnChange && e.old.column != e.value.column)\n self.$desiredColumn = null;\n });\n this.anchor.on(\"change\", function () {\n self.$anchorChanged = true;\n if (!self.$isEmpty && !self.$silent)\n self._emit(\"changeSelection\");\n });\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.isEmpty = function () {\n return this.$isEmpty || (this.anchor.row == this.lead.row &&\n this.anchor.column == this.lead.column);\n };\n this.isMultiLine = function () {\n return !this.$isEmpty && this.anchor.row != this.cursor.row;\n };\n this.getCursor = function () {\n return this.lead.getPosition();\n };\n this.setAnchor = function (row, column) {\n this.$isEmpty = false;\n this.anchor.setPosition(row, column);\n };\n this.setSelectionAnchor = this.setAnchor;\n this.getAnchor = function () {\n if (this.$isEmpty)\n return this.getSelectionLead();\n return this.anchor.getPosition();\n };\n this.getSelectionAnchor = this.getAnchor;\n this.getSelectionLead = function () {\n return this.lead.getPosition();\n };\n this.isBackwards = function () {\n var anchor = this.anchor;\n var lead = this.lead;\n return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column));\n };\n this.getRange = function () {\n var anchor = this.anchor;\n var lead = this.lead;\n if (this.$isEmpty)\n return Range.fromPoints(lead, lead);\n return this.isBackwards()\n ? Range.fromPoints(lead, anchor)\n : Range.fromPoints(anchor, lead);\n };\n this.clearSelection = function () {\n if (!this.$isEmpty) {\n this.$isEmpty = true;\n this._emit(\"changeSelection\");\n }\n };\n this.selectAll = function () {\n this.$setSelection(0, 0, Number.MAX_VALUE, Number.MAX_VALUE);\n };\n this.setRange =\n this.setSelectionRange = function (range, reverse) {\n var start = reverse ? range.end : range.start;\n var end = reverse ? range.start : range.end;\n this.$setSelection(start.row, start.column, end.row, end.column);\n };\n this.$setSelection = function (anchorRow, anchorColumn, cursorRow, cursorColumn) {\n if (this.$silent)\n return;\n var wasEmpty = this.$isEmpty;\n var wasMultiselect = this.inMultiSelectMode;\n this.$silent = true;\n this.$cursorChanged = this.$anchorChanged = false;\n this.anchor.setPosition(anchorRow, anchorColumn);\n this.cursor.setPosition(cursorRow, cursorColumn);\n this.$isEmpty = !Range.comparePoints(this.anchor, this.cursor);\n this.$silent = false;\n if (this.$cursorChanged)\n this._emit(\"changeCursor\");\n if (this.$cursorChanged || this.$anchorChanged || wasEmpty != this.$isEmpty || wasMultiselect)\n this._emit(\"changeSelection\");\n };\n this.$moveSelection = function (mover) {\n var lead = this.lead;\n if (this.$isEmpty)\n this.setSelectionAnchor(lead.row, lead.column);\n mover.call(this);\n };\n this.selectTo = function (row, column) {\n this.$moveSelection(function () {\n this.moveCursorTo(row, column);\n });\n };\n this.selectToPosition = function (pos) {\n this.$moveSelection(function () {\n this.moveCursorToPosition(pos);\n });\n };\n this.moveTo = function (row, column) {\n this.clearSelection();\n this.moveCursorTo(row, column);\n };\n this.moveToPosition = function (pos) {\n this.clearSelection();\n this.moveCursorToPosition(pos);\n };\n this.selectUp = function () {\n this.$moveSelection(this.moveCursorUp);\n };\n this.selectDown = function () {\n this.$moveSelection(this.moveCursorDown);\n };\n this.selectRight = function () {\n this.$moveSelection(this.moveCursorRight);\n };\n this.selectLeft = function () {\n this.$moveSelection(this.moveCursorLeft);\n };\n this.selectLineStart = function () {\n this.$moveSelection(this.moveCursorLineStart);\n };\n this.selectLineEnd = function () {\n this.$moveSelection(this.moveCursorLineEnd);\n };\n this.selectFileEnd = function () {\n this.$moveSelection(this.moveCursorFileEnd);\n };\n this.selectFileStart = function () {\n this.$moveSelection(this.moveCursorFileStart);\n };\n this.selectWordRight = function () {\n this.$moveSelection(this.moveCursorWordRight);\n };\n this.selectWordLeft = function () {\n this.$moveSelection(this.moveCursorWordLeft);\n };\n this.getWordRange = function (row, column) {\n if (typeof column == \"undefined\") {\n var cursor = row || this.lead;\n row = cursor.row;\n column = cursor.column;\n }\n return this.session.getWordRange(row, column);\n };\n this.selectWord = function () {\n this.setSelectionRange(this.getWordRange());\n };\n this.selectAWord = function () {\n var cursor = this.getCursor();\n var range = this.session.getAWordRange(cursor.row, cursor.column);\n this.setSelectionRange(range);\n };\n this.getLineRange = function (row, excludeLastChar) {\n var rowStart = typeof row == \"number\" ? row : this.lead.row;\n var rowEnd;\n var foldLine = this.session.getFoldLine(rowStart);\n if (foldLine) {\n rowStart = foldLine.start.row;\n rowEnd = foldLine.end.row;\n }\n else {\n rowEnd = rowStart;\n }\n if (excludeLastChar === true)\n return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length);\n else\n return new Range(rowStart, 0, rowEnd + 1, 0);\n };\n this.selectLine = function () {\n this.setSelectionRange(this.getLineRange());\n };\n this.moveCursorUp = function () {\n this.moveCursorBy(-1, 0);\n };\n this.moveCursorDown = function () {\n this.moveCursorBy(1, 0);\n };\n this.wouldMoveIntoSoftTab = function (cursor, tabSize, direction) {\n var start = cursor.column;\n var end = cursor.column + tabSize;\n if (direction < 0) {\n start = cursor.column - tabSize;\n end = cursor.column;\n }\n return this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(start, end).split(\" \").length - 1 == tabSize;\n };\n this.moveCursorLeft = function () {\n var cursor = this.lead.getPosition(), fold;\n if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) {\n this.moveCursorTo(fold.start.row, fold.start.column);\n }\n else if (cursor.column === 0) {\n if (cursor.row > 0) {\n this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length);\n }\n }\n else {\n var tabSize = this.session.getTabSize();\n if (this.wouldMoveIntoSoftTab(cursor, tabSize, -1) && !this.session.getNavigateWithinSoftTabs()) {\n this.moveCursorBy(0, -tabSize);\n }\n else {\n this.moveCursorBy(0, -1);\n }\n }\n };\n this.moveCursorRight = function () {\n var cursor = this.lead.getPosition(), fold;\n if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) {\n this.moveCursorTo(fold.end.row, fold.end.column);\n }\n else if (this.lead.column == this.doc.getLine(this.lead.row).length) {\n if (this.lead.row < this.doc.getLength() - 1) {\n this.moveCursorTo(this.lead.row + 1, 0);\n }\n }\n else {\n var tabSize = this.session.getTabSize();\n var cursor = this.lead;\n if (this.wouldMoveIntoSoftTab(cursor, tabSize, 1) && !this.session.getNavigateWithinSoftTabs()) {\n this.moveCursorBy(0, tabSize);\n }\n else {\n this.moveCursorBy(0, 1);\n }\n }\n };\n this.moveCursorLineStart = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var screenRow = this.session.documentToScreenRow(row, column);\n var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0);\n var beforeCursor = this.session.getDisplayLine(row, null, firstColumnPosition.row, firstColumnPosition.column);\n var leadingSpace = beforeCursor.match(/^\\s*/);\n if (leadingSpace[0].length != column && !this.session.$useEmacsStyleLineStart)\n firstColumnPosition.column += leadingSpace[0].length;\n this.moveCursorToPosition(firstColumnPosition);\n };\n this.moveCursorLineEnd = function () {\n var lead = this.lead;\n var lineEnd = this.session.getDocumentLastRowColumnPosition(lead.row, lead.column);\n if (this.lead.column == lineEnd.column) {\n var line = this.session.getLine(lineEnd.row);\n if (lineEnd.column == line.length) {\n var textEnd = line.search(/\\s+$/);\n if (textEnd > 0)\n lineEnd.column = textEnd;\n }\n }\n this.moveCursorTo(lineEnd.row, lineEnd.column);\n };\n this.moveCursorFileEnd = function () {\n var row = this.doc.getLength() - 1;\n var column = this.doc.getLine(row).length;\n this.moveCursorTo(row, column);\n };\n this.moveCursorFileStart = function () {\n this.moveCursorTo(0, 0);\n };\n this.moveCursorLongWordRight = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var line = this.doc.getLine(row);\n var rightOfCursor = line.substring(column);\n this.session.nonTokenRe.lastIndex = 0;\n this.session.tokenRe.lastIndex = 0;\n var fold = this.session.getFoldAt(row, column, 1);\n if (fold) {\n this.moveCursorTo(fold.end.row, fold.end.column);\n return;\n }\n if (this.session.nonTokenRe.exec(rightOfCursor)) {\n column += this.session.nonTokenRe.lastIndex;\n this.session.nonTokenRe.lastIndex = 0;\n rightOfCursor = line.substring(column);\n }\n if (column >= line.length) {\n this.moveCursorTo(row, line.length);\n this.moveCursorRight();\n if (row < this.doc.getLength() - 1)\n this.moveCursorWordRight();\n return;\n }\n if (this.session.tokenRe.exec(rightOfCursor)) {\n column += this.session.tokenRe.lastIndex;\n this.session.tokenRe.lastIndex = 0;\n }\n this.moveCursorTo(row, column);\n };\n this.moveCursorLongWordLeft = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var fold;\n if (fold = this.session.getFoldAt(row, column, -1)) {\n this.moveCursorTo(fold.start.row, fold.start.column);\n return;\n }\n var str = this.session.getFoldStringAt(row, column, -1);\n if (str == null) {\n str = this.doc.getLine(row).substring(0, column);\n }\n var leftOfCursor = lang.stringReverse(str);\n this.session.nonTokenRe.lastIndex = 0;\n this.session.tokenRe.lastIndex = 0;\n if (this.session.nonTokenRe.exec(leftOfCursor)) {\n column -= this.session.nonTokenRe.lastIndex;\n leftOfCursor = leftOfCursor.slice(this.session.nonTokenRe.lastIndex);\n this.session.nonTokenRe.lastIndex = 0;\n }\n if (column <= 0) {\n this.moveCursorTo(row, 0);\n this.moveCursorLeft();\n if (row > 0)\n this.moveCursorWordLeft();\n return;\n }\n if (this.session.tokenRe.exec(leftOfCursor)) {\n column -= this.session.tokenRe.lastIndex;\n this.session.tokenRe.lastIndex = 0;\n }\n this.moveCursorTo(row, column);\n };\n this.$shortWordEndIndex = function (rightOfCursor) {\n var index = 0, ch;\n var whitespaceRe = /\\s/;\n var tokenRe = this.session.tokenRe;\n tokenRe.lastIndex = 0;\n if (this.session.tokenRe.exec(rightOfCursor)) {\n index = this.session.tokenRe.lastIndex;\n }\n else {\n while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch))\n index++;\n if (index < 1) {\n tokenRe.lastIndex = 0;\n while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) {\n tokenRe.lastIndex = 0;\n index++;\n if (whitespaceRe.test(ch)) {\n if (index > 2) {\n index--;\n break;\n }\n else {\n while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch))\n index++;\n if (index > 2)\n break;\n }\n }\n }\n }\n }\n tokenRe.lastIndex = 0;\n return index;\n };\n this.moveCursorShortWordRight = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var line = this.doc.getLine(row);\n var rightOfCursor = line.substring(column);\n var fold = this.session.getFoldAt(row, column, 1);\n if (fold)\n return this.moveCursorTo(fold.end.row, fold.end.column);\n if (column == line.length) {\n var l = this.doc.getLength();\n do {\n row++;\n rightOfCursor = this.doc.getLine(row);\n } while (row < l && /^\\s*$/.test(rightOfCursor));\n if (!/^\\s+/.test(rightOfCursor))\n rightOfCursor = \"\";\n column = 0;\n }\n var index = this.$shortWordEndIndex(rightOfCursor);\n this.moveCursorTo(row, column + index);\n };\n this.moveCursorShortWordLeft = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var fold;\n if (fold = this.session.getFoldAt(row, column, -1))\n return this.moveCursorTo(fold.start.row, fold.start.column);\n var line = this.session.getLine(row).substring(0, column);\n if (column === 0) {\n do {\n row--;\n line = this.doc.getLine(row);\n } while (row > 0 && /^\\s*$/.test(line));\n column = line.length;\n if (!/\\s+$/.test(line))\n line = \"\";\n }\n var leftOfCursor = lang.stringReverse(line);\n var index = this.$shortWordEndIndex(leftOfCursor);\n return this.moveCursorTo(row, column - index);\n };\n this.moveCursorWordRight = function () {\n if (this.session.$selectLongWords)\n this.moveCursorLongWordRight();\n else\n this.moveCursorShortWordRight();\n };\n this.moveCursorWordLeft = function () {\n if (this.session.$selectLongWords)\n this.moveCursorLongWordLeft();\n else\n this.moveCursorShortWordLeft();\n };\n this.moveCursorBy = function (rows, chars) {\n var screenPos = this.session.documentToScreenPosition(this.lead.row, this.lead.column);\n var offsetX;\n if (chars === 0) {\n if (rows !== 0) {\n if (this.session.$bidiHandler.isBidiRow(screenPos.row, this.lead.row)) {\n offsetX = this.session.$bidiHandler.getPosLeft(screenPos.column);\n screenPos.column = Math.round(offsetX / this.session.$bidiHandler.charWidths[0]);\n }\n else {\n offsetX = screenPos.column * this.session.$bidiHandler.charWidths[0];\n }\n }\n if (this.$desiredColumn)\n screenPos.column = this.$desiredColumn;\n else\n this.$desiredColumn = screenPos.column;\n }\n if (rows != 0 && this.session.lineWidgets && this.session.lineWidgets[this.lead.row]) {\n var widget = this.session.lineWidgets[this.lead.row];\n if (rows < 0)\n rows -= widget.rowsAbove || 0;\n else if (rows > 0)\n rows += widget.rowCount - (widget.rowsAbove || 0);\n }\n var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column, offsetX);\n if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column) {\n }\n this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0);\n };\n this.moveCursorToPosition = function (position) {\n this.moveCursorTo(position.row, position.column);\n };\n this.moveCursorTo = function (row, column, keepDesiredColumn) {\n var fold = this.session.getFoldAt(row, column, 1);\n if (fold) {\n row = fold.start.row;\n column = fold.start.column;\n }\n this.$keepDesiredColumnOnChange = true;\n var line = this.session.getLine(row);\n if (/[\\uDC00-\\uDFFF]/.test(line.charAt(column)) && line.charAt(column - 1)) {\n if (this.lead.row == row && this.lead.column == column + 1)\n column = column - 1;\n else\n column = column + 1;\n }\n this.lead.setPosition(row, column);\n this.$keepDesiredColumnOnChange = false;\n if (!keepDesiredColumn)\n this.$desiredColumn = null;\n };\n this.moveCursorToScreen = function (row, column, keepDesiredColumn) {\n var pos = this.session.screenToDocumentPosition(row, column);\n this.moveCursorTo(pos.row, pos.column, keepDesiredColumn);\n };\n this.detach = function () {\n this.lead.detach();\n this.anchor.detach();\n };\n this.fromOrientedRange = function (range) {\n this.setSelectionRange(range, range.cursor == range.start);\n this.$desiredColumn = range.desiredColumn || this.$desiredColumn;\n };\n this.toOrientedRange = function (range) {\n var r = this.getRange();\n if (range) {\n range.start.column = r.start.column;\n range.start.row = r.start.row;\n range.end.column = r.end.column;\n range.end.row = r.end.row;\n }\n else {\n range = r;\n }\n range.cursor = this.isBackwards() ? range.start : range.end;\n range.desiredColumn = this.$desiredColumn;\n return range;\n };\n this.getRangeOfMovements = function (func) {\n var start = this.getCursor();\n try {\n func(this);\n var end = this.getCursor();\n return Range.fromPoints(start, end);\n }\n catch (e) {\n return Range.fromPoints(start, start);\n }\n finally {\n this.moveCursorToPosition(start);\n }\n };\n this.toJSON = function () {\n if (this.rangeCount) {\n var data = this.ranges.map(function (r) {\n var r1 = r.clone();\n r1.isBackwards = r.cursor == r.start;\n return r1;\n });\n }\n else {\n var data = this.getRange();\n data.isBackwards = this.isBackwards();\n }\n return data;\n };\n this.fromJSON = function (data) {\n if (data.start == undefined) {\n if (this.rangeList && data.length > 1) {\n this.toSingleRange(data[0]);\n for (var i = data.length; i--;) {\n var r = Range.fromPoints(data[i].start, data[i].end);\n if (data[i].isBackwards)\n r.cursor = r.start;\n this.addRange(r, true);\n }\n return;\n }\n else {\n data = data[0];\n }\n }\n if (this.rangeList)\n this.toSingleRange(data);\n this.setSelectionRange(data, data.isBackwards);\n };\n this.isEqual = function (data) {\n if ((data.length || this.rangeCount) && data.length != this.rangeCount)\n return false;\n if (!data.length || !this.ranges)\n return this.getRange().isEqual(data);\n for (var i = this.ranges.length; i--;) {\n if (!this.ranges[i].isEqual(data[i]))\n return false;\n }\n return true;\n };\n}).call(Selection.prototype);\nexports.Selection = Selection;\n\n});\n\nace.define(\"ace/tokenizer\",[\"require\",\"exports\",\"module\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar config = require(\"./config\");\nvar MAX_TOKEN_COUNT = 2000;\nvar Tokenizer = /** @class */ (function () {\n function Tokenizer(rules) {\n this.states = rules;\n this.regExps = {};\n this.matchMappings = {};\n for (var key in this.states) {\n var state = this.states[key];\n var ruleRegExps = [];\n var matchTotal = 0;\n var mapping = this.matchMappings[key] = { defaultToken: \"text\" };\n var flag = \"g\";\n var splitterRurles = [];\n for (var i = 0; i < state.length; i++) {\n var rule = state[i];\n if (rule.defaultToken)\n mapping.defaultToken = rule.defaultToken;\n if (rule.caseInsensitive && flag.indexOf(\"i\") === -1)\n flag += \"i\";\n if (rule.unicode && flag.indexOf(\"u\") === -1)\n flag += \"u\";\n if (rule.regex == null)\n continue;\n if (rule.regex instanceof RegExp)\n rule.regex = rule.regex.toString().slice(1, -1);\n var adjustedregex = rule.regex;\n var matchcount = new RegExp(\"(?:(\" + adjustedregex + \")|(.))\").exec(\"a\").length - 2;\n if (Array.isArray(rule.token)) {\n if (rule.token.length == 1 || matchcount == 1) {\n rule.token = rule.token[0];\n }\n else if (matchcount - 1 != rule.token.length) {\n this.reportError(\"number of classes and regexp groups doesn't match\", {\n rule: rule,\n groupCount: matchcount - 1\n });\n rule.token = rule.token[0];\n }\n else {\n rule.tokenArray = rule.token;\n rule.token = null;\n rule.onMatch = this.$arrayTokens;\n }\n }\n else if (typeof rule.token == \"function\" && !rule.onMatch) {\n if (matchcount > 1)\n rule.onMatch = this.$applyToken;\n else\n rule.onMatch = rule.token;\n }\n if (matchcount > 1) {\n if (/\\\\\\d/.test(rule.regex)) {\n adjustedregex = rule.regex.replace(/\\\\([0-9]+)/g, function (match, digit) {\n return \"\\\\\" + (parseInt(digit, 10) + matchTotal + 1);\n });\n }\n else {\n matchcount = 1;\n adjustedregex = this.removeCapturingGroups(rule.regex);\n }\n if (!rule.splitRegex && typeof rule.token != \"string\")\n splitterRurles.push(rule); // flag will be known only at the very end\n }\n mapping[matchTotal] = i;\n matchTotal += matchcount;\n ruleRegExps.push(adjustedregex);\n if (!rule.onMatch)\n rule.onMatch = null;\n }\n if (!ruleRegExps.length) {\n mapping[0] = 0;\n ruleRegExps.push(\"$\");\n }\n splitterRurles.forEach(function (rule) {\n rule.splitRegex = this.createSplitterRegexp(rule.regex, flag);\n }, this);\n this.regExps[key] = new RegExp(\"(\" + ruleRegExps.join(\")|(\") + \")|($)\", flag);\n }\n }\n Tokenizer.prototype.$setMaxTokenCount = function (m) {\n MAX_TOKEN_COUNT = m | 0;\n };\n Tokenizer.prototype.$applyToken = function (str) {\n var values = this.splitRegex.exec(str).slice(1);\n var types = this.token.apply(this, values);\n if (typeof types === \"string\")\n return [{ type: types, value: str }];\n var tokens = [];\n for (var i = 0, l = types.length; i < l; i++) {\n if (values[i])\n tokens[tokens.length] = {\n type: types[i],\n value: values[i]\n };\n }\n return tokens;\n };\n Tokenizer.prototype.$arrayTokens = function (str) {\n if (!str)\n return [];\n var values = this.splitRegex.exec(str);\n if (!values)\n return \"text\";\n var tokens = [];\n var types = this.tokenArray;\n for (var i = 0, l = types.length; i < l; i++) {\n if (values[i + 1])\n tokens[tokens.length] = {\n type: types[i],\n value: values[i + 1]\n };\n }\n return tokens;\n };\n Tokenizer.prototype.removeCapturingGroups = function (src) {\n var r = src.replace(/\\\\.|\\[(?:\\\\.|[^\\\\\\]])*|\\(\\?[:=!<]|(\\()/g, function (x, y) { return y ? \"(?:\" : x; });\n return r;\n };\n Tokenizer.prototype.createSplitterRegexp = function (src, flag) {\n if (src.indexOf(\"(?=\") != -1) {\n var stack = 0;\n var inChClass = false;\n var lastCapture = {};\n src.replace(/(\\\\.)|(\\((?:\\?[=!])?)|(\\))|([\\[\\]])/g, function (m, esc, parenOpen, parenClose, square, index) {\n if (inChClass) {\n inChClass = square != \"]\";\n }\n else if (square) {\n inChClass = true;\n }\n else if (parenClose) {\n if (stack == lastCapture.stack) {\n lastCapture.end = index + 1;\n lastCapture.stack = -1;\n }\n stack--;\n }\n else if (parenOpen) {\n stack++;\n if (parenOpen.length != 1) {\n lastCapture.stack = stack;\n lastCapture.start = index;\n }\n }\n return m;\n });\n if (lastCapture.end != null && /^\\)*$/.test(src.substr(lastCapture.end)))\n src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end);\n }\n if (src.charAt(0) != \"^\")\n src = \"^\" + src;\n if (src.charAt(src.length - 1) != \"$\")\n src += \"$\";\n return new RegExp(src, (flag || \"\").replace(\"g\", \"\"));\n };\n Tokenizer.prototype.getLineTokens = function (line, startState) {\n if (startState && typeof startState != \"string\") {\n var stack = startState.slice(0);\n startState = stack[0];\n if (startState === \"#tmp\") {\n stack.shift();\n startState = stack.shift();\n }\n }\n else\n var stack = [];\n var currentState = startState || \"start\";\n var state = this.states[currentState];\n if (!state) {\n currentState = \"start\";\n state = this.states[currentState];\n }\n var mapping = this.matchMappings[currentState];\n var re = this.regExps[currentState];\n re.lastIndex = 0;\n var match, tokens = [];\n var lastIndex = 0;\n var matchAttempts = 0;\n var token = { type: null, value: \"\" };\n while (match = re.exec(line)) {\n var type = mapping.defaultToken;\n var rule = null;\n var value = match[0];\n var index = re.lastIndex;\n if (index - value.length > lastIndex) {\n var skipped = line.substring(lastIndex, index - value.length);\n if (token.type == type) {\n token.value += skipped;\n }\n else {\n if (token.type)\n tokens.push(token);\n token = { type: type, value: skipped };\n }\n }\n for (var i = 0; i < match.length - 2; i++) {\n if (match[i + 1] === undefined)\n continue;\n rule = state[mapping[i]];\n if (rule.onMatch)\n type = rule.onMatch(value, currentState, stack, line);\n else\n type = rule.token;\n if (rule.next) {\n if (typeof rule.next == \"string\") {\n currentState = rule.next;\n }\n else {\n currentState = rule.next(currentState, stack);\n }\n state = this.states[currentState];\n if (!state) {\n this.reportError(\"state doesn't exist\", currentState);\n currentState = \"start\";\n state = this.states[currentState];\n }\n mapping = this.matchMappings[currentState];\n lastIndex = index;\n re = this.regExps[currentState];\n re.lastIndex = index;\n }\n if (rule.consumeLineEnd)\n lastIndex = index;\n break;\n }\n if (value) {\n if (typeof type === \"string\") {\n if ((!rule || rule.merge !== false) && token.type === type) {\n token.value += value;\n }\n else {\n if (token.type)\n tokens.push(token);\n token = { type: type, value: value };\n }\n }\n else if (type) {\n if (token.type)\n tokens.push(token);\n token = { type: null, value: \"\" };\n for (var i = 0; i < type.length; i++)\n tokens.push(type[i]);\n }\n }\n if (lastIndex == line.length)\n break;\n lastIndex = index;\n if (matchAttempts++ > MAX_TOKEN_COUNT) {\n if (matchAttempts > 2 * line.length) {\n this.reportError(\"infinite loop with in ace tokenizer\", {\n startState: startState,\n line: line\n });\n }\n while (lastIndex < line.length) {\n if (token.type)\n tokens.push(token);\n token = {\n value: line.substring(lastIndex, lastIndex += 500),\n type: \"overflow\"\n };\n }\n currentState = \"start\";\n stack = [];\n break;\n }\n }\n if (token.type)\n tokens.push(token);\n if (stack.length > 1) {\n if (stack[0] !== currentState)\n stack.unshift(\"#tmp\", currentState);\n }\n return {\n tokens: tokens,\n state: stack.length ? stack : currentState\n };\n };\n return Tokenizer;\n}());\nTokenizer.prototype.reportError = config.reportError;\nexports.Tokenizer = Tokenizer;\n\n});\n\nace.define(\"ace/mode/text_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"../lib/lang\");\nvar TextHighlightRules = function () {\n this.$rules = {\n \"start\": [{\n token: \"empty_line\",\n regex: '^$'\n }, {\n defaultToken: \"text\"\n }]\n };\n};\n(function () {\n this.addRules = function (rules, prefix) {\n if (!prefix) {\n for (var key in rules)\n this.$rules[key] = rules[key];\n return;\n }\n for (var key in rules) {\n var state = rules[key];\n for (var i = 0; i < state.length; i++) {\n var rule = state[i];\n if (rule.next || rule.onMatch) {\n if (typeof rule.next == \"string\") {\n if (rule.next.indexOf(prefix) !== 0)\n rule.next = prefix + rule.next;\n }\n if (rule.nextState && rule.nextState.indexOf(prefix) !== 0)\n rule.nextState = prefix + rule.nextState;\n }\n }\n this.$rules[prefix + key] = state;\n }\n };\n this.getRules = function () {\n return this.$rules;\n };\n this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) {\n var embedRules = typeof HighlightRules == \"function\"\n ? new HighlightRules().getRules()\n : HighlightRules;\n if (states) {\n for (var i = 0; i < states.length; i++)\n states[i] = prefix + states[i];\n }\n else {\n states = [];\n for (var key in embedRules)\n states.push(prefix + key);\n }\n this.addRules(embedRules, prefix);\n if (escapeRules) {\n var addRules = Array.prototype[append ? \"push\" : \"unshift\"];\n for (var i = 0; i < states.length; i++)\n addRules.apply(this.$rules[states[i]], lang.deepCopy(escapeRules));\n }\n if (!this.$embeds)\n this.$embeds = [];\n this.$embeds.push(prefix);\n };\n this.getEmbeds = function () {\n return this.$embeds;\n };\n var pushState = function (currentState, stack) {\n if (currentState != \"start\" || stack.length)\n stack.unshift(this.nextState, currentState);\n return this.nextState;\n };\n var popState = function (currentState, stack) {\n stack.shift();\n return stack.shift() || \"start\";\n };\n this.normalizeRules = function () {\n var id = 0;\n var rules = this.$rules;\n function processState(key) {\n var state = rules[key];\n state.processed = true;\n for (var i = 0; i < state.length; i++) {\n var rule = state[i];\n var toInsert = null;\n if (Array.isArray(rule)) {\n toInsert = rule;\n rule = {};\n }\n if (!rule.regex && rule.start) {\n rule.regex = rule.start;\n if (!rule.next)\n rule.next = [];\n rule.next.push({\n defaultToken: rule.token\n }, {\n token: rule.token + \".end\",\n regex: rule.end || rule.start,\n next: \"pop\"\n });\n rule.token = rule.token + \".start\";\n rule.push = true;\n }\n var next = rule.next || rule.push;\n if (next && Array.isArray(next)) {\n var stateName = rule.stateName;\n if (!stateName) {\n stateName = rule.token;\n if (typeof stateName != \"string\")\n stateName = stateName[0] || \"\";\n if (rules[stateName])\n stateName += id++;\n }\n rules[stateName] = next;\n rule.next = stateName;\n processState(stateName);\n }\n else if (next == \"pop\") {\n rule.next = popState;\n }\n if (rule.push) {\n rule.nextState = rule.next || rule.push;\n rule.next = pushState;\n delete rule.push;\n }\n if (rule.rules) {\n for (var r in rule.rules) {\n if (rules[r]) {\n if (rules[r].push)\n rules[r].push.apply(rules[r], rule.rules[r]);\n }\n else {\n rules[r] = rule.rules[r];\n }\n }\n }\n var includeName = typeof rule == \"string\" ? rule : rule.include;\n if (includeName) {\n if (includeName === \"$self\")\n includeName = \"start\";\n if (Array.isArray(includeName))\n toInsert = includeName.map(function (x) { return rules[x]; });\n else\n toInsert = rules[includeName];\n }\n if (toInsert) {\n var args = [i, 1].concat(toInsert);\n if (rule.noEscape)\n args = args.filter(function (x) { return !x.next; });\n state.splice.apply(state, args);\n i--;\n }\n if (rule.keywordMap) {\n rule.token = this.createKeywordMapper(rule.keywordMap, rule.defaultToken || \"text\", rule.caseInsensitive);\n delete rule.defaultToken;\n }\n }\n }\n Object.keys(rules).forEach(processState, this);\n };\n this.createKeywordMapper = function (map, defaultToken, ignoreCase, splitChar) {\n var keywords = Object.create(null);\n this.$keywordList = [];\n Object.keys(map).forEach(function (className) {\n var a = map[className];\n var list = a.split(splitChar || \"|\");\n for (var i = list.length; i--;) {\n var word = list[i];\n this.$keywordList.push(word);\n if (ignoreCase)\n word = word.toLowerCase();\n keywords[word] = className;\n }\n }, this);\n map = null;\n return ignoreCase\n ? function (value) { return keywords[value.toLowerCase()] || defaultToken; }\n : function (value) { return keywords[value] || defaultToken; };\n };\n this.getKeywords = function () {\n return this.$keywords;\n };\n}).call(TextHighlightRules.prototype);\nexports.TextHighlightRules = TextHighlightRules;\n\n});\n\nace.define(\"ace/mode/behaviour\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar Behaviour = function () {\n this.$behaviours = {};\n};\n(function () {\n this.add = function (name, action, callback) {\n switch (undefined) {\n case this.$behaviours:\n this.$behaviours = {};\n case this.$behaviours[name]:\n this.$behaviours[name] = {};\n }\n this.$behaviours[name][action] = callback;\n };\n this.addBehaviours = function (behaviours) {\n for (var key in behaviours) {\n for (var action in behaviours[key]) {\n this.add(key, action, behaviours[key][action]);\n }\n }\n };\n this.remove = function (name) {\n if (this.$behaviours && this.$behaviours[name]) {\n delete this.$behaviours[name];\n }\n };\n this.inherit = function (mode, filter) {\n if (typeof mode === \"function\") {\n var behaviours = new mode().getBehaviours(filter);\n }\n else {\n var behaviours = mode.getBehaviours(filter);\n }\n this.addBehaviours(behaviours);\n };\n this.getBehaviours = function (filter) {\n if (!filter) {\n return this.$behaviours;\n }\n else {\n var ret = {};\n for (var i = 0; i < filter.length; i++) {\n if (this.$behaviours[filter[i]]) {\n ret[filter[i]] = this.$behaviours[filter[i]];\n }\n }\n return ret;\n }\n };\n}).call(Behaviour.prototype);\nexports.Behaviour = Behaviour;\n\n});\n\nace.define(\"ace/token_iterator\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"./range\").Range;\nvar TokenIterator = /** @class */ (function () {\n function TokenIterator(session, initialRow, initialColumn) {\n this.$session = session;\n this.$row = initialRow;\n this.$rowTokens = session.getTokens(initialRow);\n var token = session.getTokenAt(initialRow, initialColumn);\n this.$tokenIndex = token ? token.index : -1;\n }\n TokenIterator.prototype.stepBackward = function () {\n this.$tokenIndex -= 1;\n while (this.$tokenIndex < 0) {\n this.$row -= 1;\n if (this.$row < 0) {\n this.$row = 0;\n return null;\n }\n this.$rowTokens = this.$session.getTokens(this.$row);\n this.$tokenIndex = this.$rowTokens.length - 1;\n }\n return this.$rowTokens[this.$tokenIndex];\n };\n TokenIterator.prototype.stepForward = function () {\n this.$tokenIndex += 1;\n var rowCount;\n while (this.$tokenIndex >= this.$rowTokens.length) {\n this.$row += 1;\n if (!rowCount)\n rowCount = this.$session.getLength();\n if (this.$row >= rowCount) {\n this.$row = rowCount - 1;\n return null;\n }\n this.$rowTokens = this.$session.getTokens(this.$row);\n this.$tokenIndex = 0;\n }\n return this.$rowTokens[this.$tokenIndex];\n };\n TokenIterator.prototype.getCurrentToken = function () {\n return this.$rowTokens[this.$tokenIndex];\n };\n TokenIterator.prototype.getCurrentTokenRow = function () {\n return this.$row;\n };\n TokenIterator.prototype.getCurrentTokenColumn = function () {\n var rowTokens = this.$rowTokens;\n var tokenIndex = this.$tokenIndex;\n var column = rowTokens[tokenIndex].start;\n if (column !== undefined)\n return column;\n column = 0;\n while (tokenIndex > 0) {\n tokenIndex -= 1;\n column += rowTokens[tokenIndex].value.length;\n }\n return column;\n };\n TokenIterator.prototype.getCurrentTokenPosition = function () {\n return { row: this.$row, column: this.getCurrentTokenColumn() };\n };\n TokenIterator.prototype.getCurrentTokenRange = function () {\n var token = this.$rowTokens[this.$tokenIndex];\n var column = this.getCurrentTokenColumn();\n return new Range(this.$row, column, this.$row, column + token.value.length);\n };\n return TokenIterator;\n}());\nexports.TokenIterator = TokenIterator;\n\n});\n\nace.define(\"ace/mode/behaviour/cstyle\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/behaviour\",\"ace/token_iterator\",\"ace/lib/lang\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../../lib/oop\");\nvar Behaviour = require(\"../behaviour\").Behaviour;\nvar TokenIterator = require(\"../../token_iterator\").TokenIterator;\nvar lang = require(\"../../lib/lang\");\nvar SAFE_INSERT_IN_TOKENS = [\"text\", \"paren.rparen\", \"rparen\", \"paren\", \"punctuation.operator\"];\nvar SAFE_INSERT_BEFORE_TOKENS = [\"text\", \"paren.rparen\", \"rparen\", \"paren\", \"punctuation.operator\", \"comment\"];\nvar context;\nvar contextCache = {};\nvar defaultQuotes = { '\"': '\"', \"'\": \"'\" };\nvar initContext = function (editor) {\n var id = -1;\n if (editor.multiSelect) {\n id = editor.selection.index;\n if (contextCache.rangeCount != editor.multiSelect.rangeCount)\n contextCache = { rangeCount: editor.multiSelect.rangeCount };\n }\n if (contextCache[id])\n return context = contextCache[id];\n context = contextCache[id] = {\n autoInsertedBrackets: 0,\n autoInsertedRow: -1,\n autoInsertedLineEnd: \"\",\n maybeInsertedBrackets: 0,\n maybeInsertedRow: -1,\n maybeInsertedLineStart: \"\",\n maybeInsertedLineEnd: \"\"\n };\n};\nvar getWrapped = function (selection, selected, opening, closing) {\n var rowDiff = selection.end.row - selection.start.row;\n return {\n text: opening + selected + closing,\n selection: [\n 0,\n selection.start.column + 1,\n rowDiff,\n selection.end.column + (rowDiff ? 0 : 1)\n ]\n };\n};\nvar CstyleBehaviour = function (options) {\n options = options || {};\n this.add(\"braces\", \"insertion\", function (state, action, editor, session, text) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (text == '{') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && selected !== \"{\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '{', '}');\n }\n else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n if (/[\\]\\}\\)]/.test(line[cursor.column]) || editor.inMultiSelectMode || options.braces) {\n CstyleBehaviour.recordAutoInsert(editor, session, \"}\");\n return {\n text: '{}',\n selection: [1, 1]\n };\n }\n else {\n CstyleBehaviour.recordMaybeInsert(editor, session, \"{\");\n return {\n text: '{',\n selection: [1, 1]\n };\n }\n }\n }\n else if (text == '}') {\n initContext(editor);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == '}') {\n var matching = session.$findOpeningBracket('}', { column: cursor.column + 1, row: cursor.row });\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n else if (text == \"\\n\" || text == \"\\r\\n\") {\n initContext(editor);\n var closing = \"\";\n if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {\n closing = lang.stringRepeat(\"}\", context.maybeInsertedBrackets);\n CstyleBehaviour.clearMaybeInsertedClosing();\n }\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar === '}') {\n var openBracePos = session.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 }, '}');\n if (!openBracePos)\n return null;\n var next_indent = this.$getIndent(session.getLine(openBracePos.row));\n }\n else if (closing) {\n var next_indent = this.$getIndent(line);\n }\n else {\n CstyleBehaviour.clearMaybeInsertedClosing();\n return;\n }\n var indent = next_indent + session.getTabString();\n return {\n text: '\\n' + indent + '\\n' + next_indent + closing,\n selection: [1, indent.length, 1, indent.length]\n };\n }\n else {\n CstyleBehaviour.clearMaybeInsertedClosing();\n }\n });\n this.add(\"braces\", \"deletion\", function (state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '{') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.end.column, range.end.column + 1);\n if (rightChar == '}') {\n range.end.column++;\n return range;\n }\n else {\n context.maybeInsertedBrackets--;\n }\n }\n });\n this.add(\"parens\", \"insertion\", function (state, action, editor, session, text) {\n if (text == '(') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '(', ')');\n }\n else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n CstyleBehaviour.recordAutoInsert(editor, session, \")\");\n return {\n text: '()',\n selection: [1, 1]\n };\n }\n }\n else if (text == ')') {\n initContext(editor);\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == ')') {\n var matching = session.$findOpeningBracket(')', { column: cursor.column + 1, row: cursor.row });\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n });\n this.add(\"parens\", \"deletion\", function (state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '(') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == ')') {\n range.end.column++;\n return range;\n }\n }\n });\n this.add(\"brackets\", \"insertion\", function (state, action, editor, session, text) {\n if (text == '[') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '[', ']');\n }\n else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n CstyleBehaviour.recordAutoInsert(editor, session, \"]\");\n return {\n text: '[]',\n selection: [1, 1]\n };\n }\n }\n else if (text == ']') {\n initContext(editor);\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == ']') {\n var matching = session.$findOpeningBracket(']', { column: cursor.column + 1, row: cursor.row });\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n });\n this.add(\"brackets\", \"deletion\", function (state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '[') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == ']') {\n range.end.column++;\n return range;\n }\n }\n });\n this.add(\"string_dquotes\", \"insertion\", function (state, action, editor, session, text) {\n var quotes = session.$mode.$quotes || defaultQuotes;\n if (text.length == 1 && quotes[text]) {\n if (this.lineCommentStart && this.lineCommentStart.indexOf(text) != -1)\n return;\n initContext(editor);\n var quote = text;\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && (selected.length != 1 || !quotes[selected]) && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, quote, quote);\n }\n else if (!selected) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var leftChar = line.substring(cursor.column - 1, cursor.column);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n var token = session.getTokenAt(cursor.row, cursor.column);\n var rightToken = session.getTokenAt(cursor.row, cursor.column + 1);\n if (leftChar == \"\\\\\" && token && /escape/.test(token.type))\n return null;\n var stringBefore = token && /string|escape/.test(token.type);\n var stringAfter = !rightToken || /string|escape/.test(rightToken.type);\n var pair;\n if (rightChar == quote) {\n pair = stringBefore !== stringAfter;\n if (pair && /string\\.end/.test(rightToken.type))\n pair = false;\n }\n else {\n if (stringBefore && !stringAfter)\n return null; // wrap string with different quote\n if (stringBefore && stringAfter)\n return null; // do not pair quotes inside strings\n var wordRe = session.$mode.tokenRe;\n wordRe.lastIndex = 0;\n var isWordBefore = wordRe.test(leftChar);\n wordRe.lastIndex = 0;\n var isWordAfter = wordRe.test(rightChar);\n var pairQuotesAfter = session.$mode.$pairQuotesAfter;\n var shouldPairQuotes = pairQuotesAfter && pairQuotesAfter[quote] && pairQuotesAfter[quote].test(leftChar);\n if ((!shouldPairQuotes && isWordBefore) || isWordAfter)\n return null; // before or after alphanumeric\n if (rightChar && !/[\\s;,.})\\]\\\\]/.test(rightChar))\n return null; // there is rightChar and it isn't closing\n var charBefore = line[cursor.column - 2];\n if (leftChar == quote && (charBefore == quote || wordRe.test(charBefore)))\n return null;\n pair = true;\n }\n return {\n text: pair ? quote + quote : \"\",\n selection: [1, 1]\n };\n }\n }\n });\n this.add(\"string_dquotes\", \"deletion\", function (state, action, editor, session, range) {\n var quotes = session.$mode.$quotes || defaultQuotes;\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && quotes.hasOwnProperty(selected)) {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == selected) {\n range.end.column++;\n return range;\n }\n }\n });\n if (options.closeDocComment !== false) {\n this.add(\"doc comment end\", \"insertion\", function (state, action, editor, session, text) {\n if (state === \"doc-start\" && (text === \"\\n\" || text === \"\\r\\n\") && editor.selection.isEmpty()) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var nextLine = session.doc.getLine(cursor.row + 1);\n var indent = this.$getIndent(line);\n if (/\\s*\\*/.test(nextLine)) {\n if (/^\\s*\\*/.test(line)) {\n return {\n text: text + indent + \"* \",\n selection: [1, 3 + indent.length, 1, 3 + indent.length]\n };\n }\n else {\n return {\n text: text + indent + \" * \",\n selection: [1, 3 + indent.length, 1, 3 + indent.length]\n };\n }\n }\n if (/\\/\\*\\*/.test(line.substring(0, cursor.column))) {\n return {\n text: text + indent + \" * \" + text + \" \" + indent + \"*/\",\n selection: [1, 4 + indent.length, 1, 4 + indent.length]\n };\n }\n }\n });\n }\n};\nCstyleBehaviour.isSaneInsertion = function (editor, session) {\n var cursor = editor.getCursorPosition();\n var iterator = new TokenIterator(session, cursor.row, cursor.column);\n if (!this.$matchTokenType(iterator.getCurrentToken() || \"text\", SAFE_INSERT_IN_TOKENS)) {\n if (/[)}\\]]/.test(editor.session.getLine(cursor.row)[cursor.column]))\n return true;\n var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);\n if (!this.$matchTokenType(iterator2.getCurrentToken() || \"text\", SAFE_INSERT_IN_TOKENS))\n return false;\n }\n iterator.stepForward();\n return iterator.getCurrentTokenRow() !== cursor.row ||\n this.$matchTokenType(iterator.getCurrentToken() || \"text\", SAFE_INSERT_BEFORE_TOKENS);\n};\nCstyleBehaviour.$matchTokenType = function (token, types) {\n return types.indexOf(token.type || token) > -1;\n};\nCstyleBehaviour.recordAutoInsert = function (editor, session, bracket) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))\n context.autoInsertedBrackets = 0;\n context.autoInsertedRow = cursor.row;\n context.autoInsertedLineEnd = bracket + line.substr(cursor.column);\n context.autoInsertedBrackets++;\n};\nCstyleBehaviour.recordMaybeInsert = function (editor, session, bracket) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (!this.isMaybeInsertedClosing(cursor, line))\n context.maybeInsertedBrackets = 0;\n context.maybeInsertedRow = cursor.row;\n context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;\n context.maybeInsertedLineEnd = line.substr(cursor.column);\n context.maybeInsertedBrackets++;\n};\nCstyleBehaviour.isAutoInsertedClosing = function (cursor, line, bracket) {\n return context.autoInsertedBrackets > 0 &&\n cursor.row === context.autoInsertedRow &&\n bracket === context.autoInsertedLineEnd[0] &&\n line.substr(cursor.column) === context.autoInsertedLineEnd;\n};\nCstyleBehaviour.isMaybeInsertedClosing = function (cursor, line) {\n return context.maybeInsertedBrackets > 0 &&\n cursor.row === context.maybeInsertedRow &&\n line.substr(cursor.column) === context.maybeInsertedLineEnd &&\n line.substr(0, cursor.column) == context.maybeInsertedLineStart;\n};\nCstyleBehaviour.popAutoInsertedClosing = function () {\n context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);\n context.autoInsertedBrackets--;\n};\nCstyleBehaviour.clearMaybeInsertedClosing = function () {\n if (context) {\n context.maybeInsertedBrackets = 0;\n context.maybeInsertedRow = -1;\n }\n};\noop.inherits(CstyleBehaviour, Behaviour);\nexports.CstyleBehaviour = CstyleBehaviour;\n\n});\n\nace.define(\"ace/unicode\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar wordChars = [48, 9, 8, 25, 5, 0, 2, 25, 48, 0, 11, 0, 5, 0, 6, 22, 2, 30, 2, 457, 5, 11, 15, 4, 8, 0, 2, 0, 18, 116, 2, 1, 3, 3, 9, 0, 2, 2, 2, 0, 2, 19, 2, 82, 2, 138, 2, 4, 3, 155, 12, 37, 3, 0, 8, 38, 10, 44, 2, 0, 2, 1, 2, 1, 2, 0, 9, 26, 6, 2, 30, 10, 7, 61, 2, 9, 5, 101, 2, 7, 3, 9, 2, 18, 3, 0, 17, 58, 3, 100, 15, 53, 5, 0, 6, 45, 211, 57, 3, 18, 2, 5, 3, 11, 3, 9, 2, 1, 7, 6, 2, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 0, 4, 3, 3, 8, 3, 1, 3, 3, 9, 0, 5, 1, 2, 4, 3, 11, 16, 2, 2, 5, 5, 1, 3, 21, 2, 6, 2, 1, 2, 1, 2, 1, 3, 0, 2, 4, 5, 1, 3, 2, 4, 0, 8, 3, 2, 0, 8, 15, 12, 2, 2, 8, 2, 2, 2, 21, 2, 6, 2, 1, 2, 4, 3, 9, 2, 2, 2, 2, 3, 0, 16, 3, 3, 9, 18, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 3, 8, 3, 1, 3, 2, 9, 1, 5, 1, 2, 4, 3, 9, 2, 0, 17, 1, 2, 5, 4, 2, 2, 3, 4, 1, 2, 0, 2, 1, 4, 1, 4, 2, 4, 11, 5, 4, 4, 2, 2, 3, 3, 0, 7, 0, 15, 9, 18, 2, 2, 7, 2, 2, 2, 22, 2, 9, 2, 4, 4, 7, 2, 2, 2, 3, 8, 1, 2, 1, 7, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22, 2, 9, 2, 4, 3, 8, 2, 2, 2, 3, 8, 1, 8, 0, 2, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22, 2, 15, 4, 7, 2, 2, 2, 3, 10, 0, 9, 3, 3, 9, 11, 5, 3, 1, 2, 17, 4, 23, 2, 8, 2, 0, 3, 6, 4, 0, 5, 5, 2, 0, 2, 7, 19, 1, 14, 57, 6, 14, 2, 9, 40, 1, 2, 0, 3, 1, 2, 0, 3, 0, 7, 3, 2, 6, 2, 2, 2, 0, 2, 0, 3, 1, 2, 12, 2, 2, 3, 4, 2, 0, 2, 5, 3, 9, 3, 1, 35, 0, 24, 1, 7, 9, 12, 0, 2, 0, 2, 0, 5, 9, 2, 35, 5, 19, 2, 5, 5, 7, 2, 35, 10, 0, 58, 73, 7, 77, 3, 37, 11, 42, 2, 0, 4, 328, 2, 3, 3, 6, 2, 0, 2, 3, 3, 40, 2, 3, 3, 32, 2, 3, 3, 6, 2, 0, 2, 3, 3, 14, 2, 56, 2, 3, 3, 66, 5, 0, 33, 15, 17, 84, 13, 619, 3, 16, 2, 25, 6, 74, 22, 12, 2, 6, 12, 20, 12, 19, 13, 12, 2, 2, 2, 1, 13, 51, 3, 29, 4, 0, 5, 1, 3, 9, 34, 2, 3, 9, 7, 87, 9, 42, 6, 69, 11, 28, 4, 11, 5, 11, 11, 39, 3, 4, 12, 43, 5, 25, 7, 10, 38, 27, 5, 62, 2, 28, 3, 10, 7, 9, 14, 0, 89, 75, 5, 9, 18, 8, 13, 42, 4, 11, 71, 55, 9, 9, 4, 48, 83, 2, 2, 30, 14, 230, 23, 280, 3, 5, 3, 37, 3, 5, 3, 7, 2, 0, 2, 0, 2, 0, 2, 30, 3, 52, 2, 6, 2, 0, 4, 2, 2, 6, 4, 3, 3, 5, 5, 12, 6, 2, 2, 6, 67, 1, 20, 0, 29, 0, 14, 0, 17, 4, 60, 12, 5, 0, 4, 11, 18, 0, 5, 0, 3, 9, 2, 0, 4, 4, 7, 0, 2, 0, 2, 0, 2, 3, 2, 10, 3, 3, 6, 4, 5, 0, 53, 1, 2684, 46, 2, 46, 2, 132, 7, 6, 15, 37, 11, 53, 10, 0, 17, 22, 10, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 31, 48, 0, 470, 1, 36, 5, 2, 4, 6, 1, 5, 85, 3, 1, 3, 2, 2, 89, 2, 3, 6, 40, 4, 93, 18, 23, 57, 15, 513, 6581, 75, 20939, 53, 1164, 68, 45, 3, 268, 4, 27, 21, 31, 3, 13, 13, 1, 2, 24, 9, 69, 11, 1, 38, 8, 3, 102, 3, 1, 111, 44, 25, 51, 13, 68, 12, 9, 7, 23, 4, 0, 5, 45, 3, 35, 13, 28, 4, 64, 15, 10, 39, 54, 10, 13, 3, 9, 7, 22, 4, 1, 5, 66, 25, 2, 227, 42, 2, 1, 3, 9, 7, 11171, 13, 22, 5, 48, 8453, 301, 3, 61, 3, 105, 39, 6, 13, 4, 6, 11, 2, 12, 2, 4, 2, 0, 2, 1, 2, 1, 2, 107, 34, 362, 19, 63, 3, 53, 41, 11, 5, 15, 17, 6, 13, 1, 25, 2, 33, 4, 2, 134, 20, 9, 8, 25, 5, 0, 2, 25, 12, 88, 4, 5, 3, 5, 3, 5, 3, 2];\nvar code = 0;\nvar str = [];\nfor (var i = 0; i < wordChars.length; i += 2) {\n str.push(code += wordChars[i]);\n if (wordChars[i + 1])\n str.push(45, code += wordChars[i + 1]);\n}\nexports.wordChars = String.fromCharCode.apply(null, str);\n\n});\n\nace.define(\"ace/mode/text\",[\"require\",\"exports\",\"module\",\"ace/config\",\"ace/tokenizer\",\"ace/mode/text_highlight_rules\",\"ace/mode/behaviour/cstyle\",\"ace/unicode\",\"ace/lib/lang\",\"ace/token_iterator\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar config = require(\"../config\");\nvar Tokenizer = require(\"../tokenizer\").Tokenizer;\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\nvar CstyleBehaviour = require(\"./behaviour/cstyle\").CstyleBehaviour;\nvar unicode = require(\"../unicode\");\nvar lang = require(\"../lib/lang\");\nvar TokenIterator = require(\"../token_iterator\").TokenIterator;\nvar Range = require(\"../range\").Range;\nvar Mode = function () {\n this.HighlightRules = TextHighlightRules;\n};\n(function () {\n this.$defaultBehaviour = new CstyleBehaviour();\n this.tokenRe = new RegExp(\"^[\" + unicode.wordChars + \"\\\\$_]+\", \"g\");\n this.nonTokenRe = new RegExp(\"^(?:[^\" + unicode.wordChars + \"\\\\$_]|\\\\s])+\", \"g\");\n this.getTokenizer = function () {\n if (!this.$tokenizer) {\n this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig);\n this.$tokenizer = new Tokenizer(this.$highlightRules.getRules());\n }\n return this.$tokenizer;\n };\n this.lineCommentStart = \"\";\n this.blockComment = \"\";\n this.toggleCommentLines = function (state, session, startRow, endRow) {\n var doc = session.doc;\n var ignoreBlankLines = true;\n var shouldRemove = true;\n var minIndent = Infinity;\n var tabSize = session.getTabSize();\n var insertAtTabStop = false;\n if (!this.lineCommentStart) {\n if (!this.blockComment)\n return false;\n var lineCommentStart = this.blockComment.start;\n var lineCommentEnd = this.blockComment.end;\n var regexpStart = new RegExp(\"^(\\\\s*)(?:\" + lang.escapeRegExp(lineCommentStart) + \")\");\n var regexpEnd = new RegExp(\"(?:\" + lang.escapeRegExp(lineCommentEnd) + \")\\\\s*$\");\n var comment = function (line, i) {\n if (testRemove(line, i))\n return;\n if (!ignoreBlankLines || /\\S/.test(line)) {\n doc.insertInLine({ row: i, column: line.length }, lineCommentEnd);\n doc.insertInLine({ row: i, column: minIndent }, lineCommentStart);\n }\n };\n var uncomment = function (line, i) {\n var m;\n if (m = line.match(regexpEnd))\n doc.removeInLine(i, line.length - m[0].length, line.length);\n if (m = line.match(regexpStart))\n doc.removeInLine(i, m[1].length, m[0].length);\n };\n var testRemove = function (line, row) {\n if (regexpStart.test(line))\n return true;\n var tokens = session.getTokens(row);\n for (var i = 0; i < tokens.length; i++) {\n if (tokens[i].type === \"comment\")\n return true;\n }\n };\n }\n else {\n if (Array.isArray(this.lineCommentStart)) {\n var regexpStart = this.lineCommentStart.map(lang.escapeRegExp).join(\"|\");\n var lineCommentStart = this.lineCommentStart[0];\n }\n else {\n var regexpStart = lang.escapeRegExp(this.lineCommentStart);\n var lineCommentStart = this.lineCommentStart;\n }\n regexpStart = new RegExp(\"^(\\\\s*)(?:\" + regexpStart + \") ?\");\n insertAtTabStop = session.getUseSoftTabs();\n var uncomment = function (line, i) {\n var m = line.match(regexpStart);\n if (!m)\n return;\n var start = m[1].length, end = m[0].length;\n if (!shouldInsertSpace(line, start, end) && m[0][end - 1] == \" \")\n end--;\n doc.removeInLine(i, start, end);\n };\n var commentWithSpace = lineCommentStart + \" \";\n var comment = function (line, i) {\n if (!ignoreBlankLines || /\\S/.test(line)) {\n if (shouldInsertSpace(line, minIndent, minIndent))\n doc.insertInLine({ row: i, column: minIndent }, commentWithSpace);\n else\n doc.insertInLine({ row: i, column: minIndent }, lineCommentStart);\n }\n };\n var testRemove = function (line, i) {\n return regexpStart.test(line);\n };\n var shouldInsertSpace = function (line, before, after) {\n var spaces = 0;\n while (before-- && line.charAt(before) == \" \")\n spaces++;\n if (spaces % tabSize != 0)\n return false;\n var spaces = 0;\n while (line.charAt(after++) == \" \")\n spaces++;\n if (tabSize > 2)\n return spaces % tabSize != tabSize - 1;\n else\n return spaces % tabSize == 0;\n };\n }\n function iter(fun) {\n for (var i = startRow; i <= endRow; i++)\n fun(doc.getLine(i), i);\n }\n var minEmptyLength = Infinity;\n iter(function (line, i) {\n var indent = line.search(/\\S/);\n if (indent !== -1) {\n if (indent < minIndent)\n minIndent = indent;\n if (shouldRemove && !testRemove(line, i))\n shouldRemove = false;\n }\n else if (minEmptyLength > line.length) {\n minEmptyLength = line.length;\n }\n });\n if (minIndent == Infinity) {\n minIndent = minEmptyLength;\n ignoreBlankLines = false;\n shouldRemove = false;\n }\n if (insertAtTabStop && minIndent % tabSize != 0)\n minIndent = Math.floor(minIndent / tabSize) * tabSize;\n iter(shouldRemove ? uncomment : comment);\n };\n this.toggleBlockComment = function (state, session, range, cursor) {\n var comment = this.blockComment;\n if (!comment)\n return;\n if (!comment.start && comment[0])\n comment = comment[0];\n var iterator = new TokenIterator(session, cursor.row, cursor.column);\n var token = iterator.getCurrentToken();\n var sel = session.selection;\n var initialRange = session.selection.toOrientedRange();\n var startRow, colDiff;\n if (token && /comment/.test(token.type)) {\n var startRange, endRange;\n while (token && /comment/.test(token.type)) {\n var i = token.value.indexOf(comment.start);\n if (i != -1) {\n var row = iterator.getCurrentTokenRow();\n var column = iterator.getCurrentTokenColumn() + i;\n startRange = new Range(row, column, row, column + comment.start.length);\n break;\n }\n token = iterator.stepBackward();\n }\n var iterator = new TokenIterator(session, cursor.row, cursor.column);\n var token = iterator.getCurrentToken();\n while (token && /comment/.test(token.type)) {\n var i = token.value.indexOf(comment.end);\n if (i != -1) {\n var row = iterator.getCurrentTokenRow();\n var column = iterator.getCurrentTokenColumn() + i;\n endRange = new Range(row, column, row, column + comment.end.length);\n break;\n }\n token = iterator.stepForward();\n }\n if (endRange)\n session.remove(endRange);\n if (startRange) {\n session.remove(startRange);\n startRow = startRange.start.row;\n colDiff = -comment.start.length;\n }\n }\n else {\n colDiff = comment.start.length;\n startRow = range.start.row;\n session.insert(range.end, comment.end);\n session.insert(range.start, comment.start);\n }\n if (initialRange.start.row == startRow)\n initialRange.start.column += colDiff;\n if (initialRange.end.row == startRow)\n initialRange.end.column += colDiff;\n session.selection.fromOrientedRange(initialRange);\n };\n this.getNextLineIndent = function (state, line, tab) {\n return this.$getIndent(line);\n };\n this.checkOutdent = function (state, line, input) {\n return false;\n };\n this.autoOutdent = function (state, doc, row) {\n };\n this.$getIndent = function (line) {\n return line.match(/^\\s*/)[0];\n };\n this.createWorker = function (session) {\n return null;\n };\n this.createModeDelegates = function (mapping) {\n this.$embeds = [];\n this.$modes = {};\n for (var i in mapping) {\n if (mapping[i]) {\n var Mode = mapping[i];\n var id = Mode.prototype.$id;\n var mode = config.$modes[id];\n if (!mode)\n config.$modes[id] = mode = new Mode();\n if (!config.$modes[i])\n config.$modes[i] = mode;\n this.$embeds.push(i);\n this.$modes[i] = mode;\n }\n }\n var delegations = [\"toggleBlockComment\", \"toggleCommentLines\", \"getNextLineIndent\",\n \"checkOutdent\", \"autoOutdent\", \"transformAction\", \"getCompletions\"];\n for (var i = 0; i < delegations.length; i++) {\n (function (scope) {\n var functionName = delegations[i];\n var defaultHandler = scope[functionName];\n scope[delegations[i]] = function () {\n return this.$delegator(functionName, arguments, defaultHandler);\n };\n }(this));\n }\n };\n this.$delegator = function (method, args, defaultHandler) {\n var state = args[0] || \"start\";\n if (typeof state != \"string\") {\n if (Array.isArray(state[2])) {\n var language = state[2][state[2].length - 1];\n var mode = this.$modes[language];\n if (mode)\n return mode[method].apply(mode, [state[1]].concat([].slice.call(args, 1)));\n }\n state = state[0] || \"start\";\n }\n for (var i = 0; i < this.$embeds.length; i++) {\n if (!this.$modes[this.$embeds[i]])\n continue;\n var split = state.split(this.$embeds[i]);\n if (!split[0] && split[1]) {\n args[0] = split[1];\n var mode = this.$modes[this.$embeds[i]];\n return mode[method].apply(mode, args);\n }\n }\n var ret = defaultHandler.apply(this, args);\n return defaultHandler ? ret : undefined;\n };\n this.transformAction = function (state, action, editor, session, param) {\n if (this.$behaviour) {\n var behaviours = this.$behaviour.getBehaviours();\n for (var key in behaviours) {\n if (behaviours[key][action]) {\n var ret = behaviours[key][action].apply(this, arguments);\n if (ret) {\n return ret;\n }\n }\n }\n }\n };\n this.getKeywords = function (append) {\n if (!this.completionKeywords) {\n var rules = this.$tokenizer.rules;\n var completionKeywords = [];\n for (var rule in rules) {\n var ruleItr = rules[rule];\n for (var r = 0, l = ruleItr.length; r < l; r++) {\n if (typeof ruleItr[r].token === \"string\") {\n if (/keyword|support|storage/.test(ruleItr[r].token))\n completionKeywords.push(ruleItr[r].regex);\n }\n else if (typeof ruleItr[r].token === \"object\") {\n for (var a = 0, aLength = ruleItr[r].token.length; a < aLength; a++) {\n if (/keyword|support|storage/.test(ruleItr[r].token[a])) {\n var rule = ruleItr[r].regex.match(/\\(.+?\\)/g)[a];\n completionKeywords.push(rule.substr(1, rule.length - 2));\n }\n }\n }\n }\n }\n this.completionKeywords = completionKeywords;\n }\n if (!append)\n return this.$keywordList;\n return completionKeywords.concat(this.$keywordList || []);\n };\n this.$createKeywordList = function () {\n if (!this.$highlightRules)\n this.getTokenizer();\n return this.$keywordList = this.$highlightRules.$keywordList || [];\n };\n this.getCompletions = function (state, session, pos, prefix) {\n var keywords = this.$keywordList || this.$createKeywordList();\n return keywords.map(function (word) {\n return {\n name: word,\n value: word,\n score: 0,\n meta: \"keyword\"\n };\n });\n };\n this.$id = \"ace/mode/text\";\n}).call(Mode.prototype);\nexports.Mode = Mode;\n\n});\n\nace.define(\"ace/apply_delta\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nfunction throwDeltaError(delta, errorText) {\n console.log(\"Invalid Delta:\", delta);\n throw \"Invalid Delta: \" + errorText;\n}\nfunction positionInDocument(docLines, position) {\n return position.row >= 0 && position.row < docLines.length &&\n position.column >= 0 && position.column <= docLines[position.row].length;\n}\nfunction validateDelta(docLines, delta) {\n if (delta.action != \"insert\" && delta.action != \"remove\")\n throwDeltaError(delta, \"delta.action must be 'insert' or 'remove'\");\n if (!(delta.lines instanceof Array))\n throwDeltaError(delta, \"delta.lines must be an Array\");\n if (!delta.start || !delta.end)\n throwDeltaError(delta, \"delta.start/end must be an present\");\n var start = delta.start;\n if (!positionInDocument(docLines, delta.start))\n throwDeltaError(delta, \"delta.start must be contained in document\");\n var end = delta.end;\n if (delta.action == \"remove\" && !positionInDocument(docLines, end))\n throwDeltaError(delta, \"delta.end must contained in document for 'remove' actions\");\n var numRangeRows = end.row - start.row;\n var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));\n if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)\n throwDeltaError(delta, \"delta.range must match delta lines\");\n}\nexports.applyDelta = function (docLines, delta, doNotValidate) {\n var row = delta.start.row;\n var startColumn = delta.start.column;\n var line = docLines[row] || \"\";\n switch (delta.action) {\n case \"insert\":\n var lines = delta.lines;\n if (lines.length === 1) {\n docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);\n }\n else {\n var args = [row, 1].concat(delta.lines);\n docLines.splice.apply(docLines, args);\n docLines[row] = line.substring(0, startColumn) + docLines[row];\n docLines[row + delta.lines.length - 1] += line.substring(startColumn);\n }\n break;\n case \"remove\":\n var endColumn = delta.end.column;\n var endRow = delta.end.row;\n if (row === endRow) {\n docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);\n }\n else {\n docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn));\n }\n break;\n }\n};\n\n});\n\nace.define(\"ace/anchor\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Anchor = /** @class */ (function () {\n function Anchor(doc, row, column) {\n this.$onChange = this.onChange.bind(this);\n this.attach(doc);\n if (typeof column == \"undefined\")\n this.setPosition(row.row, row.column);\n else\n this.setPosition(row, column);\n }\n Anchor.prototype.getPosition = function () {\n return this.$clipPositionToDocument(this.row, this.column);\n };\n Anchor.prototype.getDocument = function () {\n return this.document;\n };\n Anchor.prototype.onChange = function (delta) {\n if (delta.start.row == delta.end.row && delta.start.row != this.row)\n return;\n if (delta.start.row > this.row)\n return;\n var point = $getTransformedPoint(delta, { row: this.row, column: this.column }, this.$insertRight);\n this.setPosition(point.row, point.column, true);\n };\n Anchor.prototype.setPosition = function (row, column, noClip) {\n var pos;\n if (noClip) {\n pos = {\n row: row,\n column: column\n };\n }\n else {\n pos = this.$clipPositionToDocument(row, column);\n }\n if (this.row == pos.row && this.column == pos.column)\n return;\n var old = {\n row: this.row,\n column: this.column\n };\n this.row = pos.row;\n this.column = pos.column;\n this._signal(\"change\", {\n old: old,\n value: pos\n });\n };\n Anchor.prototype.detach = function () {\n this.document.off(\"change\", this.$onChange);\n };\n Anchor.prototype.attach = function (doc) {\n this.document = doc || this.document;\n this.document.on(\"change\", this.$onChange);\n };\n Anchor.prototype.$clipPositionToDocument = function (row, column) {\n var pos = {};\n if (row >= this.document.getLength()) {\n pos.row = Math.max(0, this.document.getLength() - 1);\n pos.column = this.document.getLine(pos.row).length;\n }\n else if (row < 0) {\n pos.row = 0;\n pos.column = 0;\n }\n else {\n pos.row = row;\n pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));\n }\n if (column < 0)\n pos.column = 0;\n return pos;\n };\n return Anchor;\n}());\nAnchor.prototype.$insertRight = false;\noop.implement(Anchor.prototype, EventEmitter);\nfunction $pointsInOrder(point1, point2, equalPointsInOrder) {\n var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;\n return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);\n}\nfunction $getTransformedPoint(delta, point, moveIfEqual) {\n var deltaIsInsert = delta.action == \"insert\";\n var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);\n var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);\n var deltaStart = delta.start;\n var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.\n if ($pointsInOrder(point, deltaStart, moveIfEqual)) {\n return {\n row: point.row,\n column: point.column\n };\n }\n if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {\n return {\n row: point.row + deltaRowShift,\n column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)\n };\n }\n return {\n row: deltaStart.row,\n column: deltaStart.column\n };\n}\nexports.Anchor = Anchor;\n\n});\n\nace.define(\"ace/document\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/apply_delta\",\"ace/lib/event_emitter\",\"ace/range\",\"ace/anchor\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar applyDelta = require(\"./apply_delta\").applyDelta;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Range = require(\"./range\").Range;\nvar Anchor = require(\"./anchor\").Anchor;\nvar Document = /** @class */ (function () {\n function Document(textOrLines) {\n this.$lines = [\"\"];\n if (textOrLines.length === 0) {\n this.$lines = [\"\"];\n }\n else if (Array.isArray(textOrLines)) {\n this.insertMergedLines({ row: 0, column: 0 }, textOrLines);\n }\n else {\n this.insert({ row: 0, column: 0 }, textOrLines);\n }\n }\n Document.prototype.setValue = function (text) {\n var len = this.getLength() - 1;\n this.remove(new Range(0, 0, len, this.getLine(len).length));\n this.insert({ row: 0, column: 0 }, text || \"\");\n };\n Document.prototype.getValue = function () {\n return this.getAllLines().join(this.getNewLineCharacter());\n };\n Document.prototype.createAnchor = function (row, column) {\n return new Anchor(this, row, column);\n };\n Document.prototype.$detectNewLine = function (text) {\n var match = text.match(/^.*?(\\r\\n|\\r|\\n)/m);\n this.$autoNewLine = match ? match[1] : \"\\n\";\n this._signal(\"changeNewLineMode\");\n };\n Document.prototype.getNewLineCharacter = function () {\n switch (this.$newLineMode) {\n case \"windows\":\n return \"\\r\\n\";\n case \"unix\":\n return \"\\n\";\n default:\n return this.$autoNewLine || \"\\n\";\n }\n };\n Document.prototype.setNewLineMode = function (newLineMode) {\n if (this.$newLineMode === newLineMode)\n return;\n this.$newLineMode = newLineMode;\n this._signal(\"changeNewLineMode\");\n };\n Document.prototype.getNewLineMode = function () {\n return this.$newLineMode;\n };\n Document.prototype.isNewLine = function (text) {\n return (text == \"\\r\\n\" || text == \"\\r\" || text == \"\\n\");\n };\n Document.prototype.getLine = function (row) {\n return this.$lines[row] || \"\";\n };\n Document.prototype.getLines = function (firstRow, lastRow) {\n return this.$lines.slice(firstRow, lastRow + 1);\n };\n Document.prototype.getAllLines = function () {\n return this.getLines(0, this.getLength());\n };\n Document.prototype.getLength = function () {\n return this.$lines.length;\n };\n Document.prototype.getTextRange = function (range) {\n return this.getLinesForRange(range).join(this.getNewLineCharacter());\n };\n Document.prototype.getLinesForRange = function (range) {\n var lines;\n if (range.start.row === range.end.row) {\n lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];\n }\n else {\n lines = this.getLines(range.start.row, range.end.row);\n lines[0] = (lines[0] || \"\").substring(range.start.column);\n var l = lines.length - 1;\n if (range.end.row - range.start.row == l)\n lines[l] = lines[l].substring(0, range.end.column);\n }\n return lines;\n };\n Document.prototype.insertLines = function (row, lines) {\n console.warn(\"Use of document.insertLines is deprecated. Use the insertFullLines method instead.\");\n return this.insertFullLines(row, lines);\n };\n Document.prototype.removeLines = function (firstRow, lastRow) {\n console.warn(\"Use of document.removeLines is deprecated. Use the removeFullLines method instead.\");\n return this.removeFullLines(firstRow, lastRow);\n };\n Document.prototype.insertNewLine = function (position) {\n console.warn(\"Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.\");\n return this.insertMergedLines(position, [\"\", \"\"]);\n };\n Document.prototype.insert = function (position, text) {\n if (this.getLength() <= 1)\n this.$detectNewLine(text);\n return this.insertMergedLines(position, this.$split(text));\n };\n Document.prototype.insertInLine = function (position, text) {\n var start = this.clippedPos(position.row, position.column);\n var end = this.pos(position.row, position.column + text.length);\n this.applyDelta({\n start: start,\n end: end,\n action: \"insert\",\n lines: [text]\n }, true);\n return this.clonePos(end);\n };\n Document.prototype.clippedPos = function (row, column) {\n var length = this.getLength();\n if (row === undefined) {\n row = length;\n }\n else if (row < 0) {\n row = 0;\n }\n else if (row >= length) {\n row = length - 1;\n column = undefined;\n }\n var line = this.getLine(row);\n if (column == undefined)\n column = line.length;\n column = Math.min(Math.max(column, 0), line.length);\n return { row: row, column: column };\n };\n Document.prototype.clonePos = function (pos) {\n return { row: pos.row, column: pos.column };\n };\n Document.prototype.pos = function (row, column) {\n return { row: row, column: column };\n };\n Document.prototype.$clipPosition = function (position) {\n var length = this.getLength();\n if (position.row >= length) {\n position.row = Math.max(0, length - 1);\n position.column = this.getLine(length - 1).length;\n }\n else {\n position.row = Math.max(0, position.row);\n position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);\n }\n return position;\n };\n Document.prototype.insertFullLines = function (row, lines) {\n row = Math.min(Math.max(row, 0), this.getLength());\n var column = 0;\n if (row < this.getLength()) {\n lines = lines.concat([\"\"]);\n column = 0;\n }\n else {\n lines = [\"\"].concat(lines);\n row--;\n column = this.$lines[row].length;\n }\n this.insertMergedLines({ row: row, column: column }, lines);\n };\n Document.prototype.insertMergedLines = function (position, lines) {\n var start = this.clippedPos(position.row, position.column);\n var end = {\n row: start.row + lines.length - 1,\n column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length\n };\n this.applyDelta({\n start: start,\n end: end,\n action: \"insert\",\n lines: lines\n });\n return this.clonePos(end);\n };\n Document.prototype.remove = function (range) {\n var start = this.clippedPos(range.start.row, range.start.column);\n var end = this.clippedPos(range.end.row, range.end.column);\n this.applyDelta({\n start: start,\n end: end,\n action: \"remove\",\n lines: this.getLinesForRange({ start: start, end: end })\n });\n return this.clonePos(start);\n };\n Document.prototype.removeInLine = function (row, startColumn, endColumn) {\n var start = this.clippedPos(row, startColumn);\n var end = this.clippedPos(row, endColumn);\n this.applyDelta({\n start: start,\n end: end,\n action: \"remove\",\n lines: this.getLinesForRange({ start: start, end: end })\n }, true);\n return this.clonePos(start);\n };\n Document.prototype.removeFullLines = function (firstRow, lastRow) {\n firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);\n lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);\n var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;\n var deleteLastNewLine = lastRow < this.getLength() - 1;\n var startRow = (deleteFirstNewLine ? firstRow - 1 : firstRow);\n var startCol = (deleteFirstNewLine ? this.getLine(startRow).length : 0);\n var endRow = (deleteLastNewLine ? lastRow + 1 : lastRow);\n var endCol = (deleteLastNewLine ? 0 : this.getLine(endRow).length);\n var range = new Range(startRow, startCol, endRow, endCol);\n var deletedLines = this.$lines.slice(firstRow, lastRow + 1);\n this.applyDelta({\n start: range.start,\n end: range.end,\n action: \"remove\",\n lines: this.getLinesForRange(range)\n });\n return deletedLines;\n };\n Document.prototype.removeNewLine = function (row) {\n if (row < this.getLength() - 1 && row >= 0) {\n this.applyDelta({\n start: this.pos(row, this.getLine(row).length),\n end: this.pos(row + 1, 0),\n action: \"remove\",\n lines: [\"\", \"\"]\n });\n }\n };\n Document.prototype.replace = function (range, text) {\n if (!(range instanceof Range))\n range = Range.fromPoints(range.start, range.end);\n if (text.length === 0 && range.isEmpty())\n return range.start;\n if (text == this.getTextRange(range))\n return range.end;\n this.remove(range);\n var end;\n if (text) {\n end = this.insert(range.start, text);\n }\n else {\n end = range.start;\n }\n return end;\n };\n Document.prototype.applyDeltas = function (deltas) {\n for (var i = 0; i < deltas.length; i++) {\n this.applyDelta(deltas[i]);\n }\n };\n Document.prototype.revertDeltas = function (deltas) {\n for (var i = deltas.length - 1; i >= 0; i--) {\n this.revertDelta(deltas[i]);\n }\n };\n Document.prototype.applyDelta = function (delta, doNotValidate) {\n var isInsert = delta.action == \"insert\";\n if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]\n : !Range.comparePoints(delta.start, delta.end)) {\n return;\n }\n if (isInsert && delta.lines.length > 20000) {\n this.$splitAndapplyLargeDelta(delta, 20000);\n }\n else {\n applyDelta(this.$lines, delta, doNotValidate);\n this._signal(\"change\", delta);\n }\n };\n Document.prototype.$safeApplyDelta = function (delta) {\n var docLength = this.$lines.length;\n if (delta.action == \"remove\" && delta.start.row < docLength && delta.end.row < docLength\n || delta.action == \"insert\" && delta.start.row <= docLength) {\n this.applyDelta(delta);\n }\n };\n Document.prototype.$splitAndapplyLargeDelta = function (delta, MAX) {\n var lines = delta.lines;\n var l = lines.length - MAX + 1;\n var row = delta.start.row;\n var column = delta.start.column;\n for (var from = 0, to = 0; from < l; from = to) {\n to += MAX - 1;\n var chunk = lines.slice(from, to);\n chunk.push(\"\");\n this.applyDelta({\n start: this.pos(row + from, column),\n end: this.pos(row + to, column = 0),\n action: delta.action,\n lines: chunk\n }, true);\n }\n delta.lines = lines.slice(from);\n delta.start.row = row + from;\n delta.start.column = column;\n this.applyDelta(delta, true);\n };\n Document.prototype.revertDelta = function (delta) {\n this.$safeApplyDelta({\n start: this.clonePos(delta.start),\n end: this.clonePos(delta.end),\n action: (delta.action == \"insert\" ? \"remove\" : \"insert\"),\n lines: delta.lines.slice()\n });\n };\n Document.prototype.indexToPosition = function (index, startRow) {\n var lines = this.$lines || this.getAllLines();\n var newlineLength = this.getNewLineCharacter().length;\n for (var i = startRow || 0, l = lines.length; i < l; i++) {\n index -= lines[i].length + newlineLength;\n if (index < 0)\n return { row: i, column: index + lines[i].length + newlineLength };\n }\n return { row: l - 1, column: index + lines[l - 1].length + newlineLength };\n };\n Document.prototype.positionToIndex = function (pos, startRow) {\n var lines = this.$lines || this.getAllLines();\n var newlineLength = this.getNewLineCharacter().length;\n var index = 0;\n var row = Math.min(pos.row, lines.length);\n for (var i = startRow || 0; i < row; ++i)\n index += lines[i].length + newlineLength;\n return index + pos.column;\n };\n Document.prototype.$split = function (text) {\n return text.split(/\\r\\n|\\r|\\n/);\n };\n return Document;\n}());\nDocument.prototype.$autoNewLine = \"\";\nDocument.prototype.$newLineMode = \"auto\";\noop.implement(Document.prototype, EventEmitter);\nexports.Document = Document;\n\n});\n\nace.define(\"ace/background_tokenizer\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar BackgroundTokenizer = /** @class */ (function () {\n function BackgroundTokenizer(tokenizer, editor) {\n this.running = false;\n this.lines = [];\n this.states = [];\n this.currentLine = 0;\n this.tokenizer = tokenizer;\n var self = this;\n this.$worker = function () {\n if (!self.running) {\n return;\n }\n var workerStart = new Date();\n var currentLine = self.currentLine;\n var endLine = -1;\n var doc = self.doc;\n var startLine = currentLine;\n while (self.lines[currentLine])\n currentLine++;\n var len = doc.getLength();\n var processedLines = 0;\n self.running = false;\n while (currentLine < len) {\n self.$tokenizeRow(currentLine);\n endLine = currentLine;\n do {\n currentLine++;\n } while (self.lines[currentLine]);\n processedLines++;\n if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) {\n self.running = setTimeout(self.$worker, 20);\n break;\n }\n }\n self.currentLine = currentLine;\n if (endLine == -1)\n endLine = currentLine;\n if (startLine <= endLine)\n self.fireUpdateEvent(startLine, endLine);\n };\n }\n BackgroundTokenizer.prototype.setTokenizer = function (tokenizer) {\n this.tokenizer = tokenizer;\n this.lines = [];\n this.states = [];\n this.start(0);\n };\n BackgroundTokenizer.prototype.setDocument = function (doc) {\n this.doc = doc;\n this.lines = [];\n this.states = [];\n this.stop();\n };\n BackgroundTokenizer.prototype.fireUpdateEvent = function (firstRow, lastRow) {\n var data = {\n first: firstRow,\n last: lastRow\n };\n this._signal(\"update\", { data: data });\n };\n BackgroundTokenizer.prototype.start = function (startRow) {\n this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength());\n this.lines.splice(this.currentLine, this.lines.length);\n this.states.splice(this.currentLine, this.states.length);\n this.stop();\n this.running = setTimeout(this.$worker, 700);\n };\n BackgroundTokenizer.prototype.scheduleStart = function () {\n if (!this.running)\n this.running = setTimeout(this.$worker, 700);\n };\n BackgroundTokenizer.prototype.$updateOnChange = function (delta) {\n var startRow = delta.start.row;\n var len = delta.end.row - startRow;\n if (len === 0) {\n this.lines[startRow] = null;\n }\n else if (delta.action == \"remove\") {\n this.lines.splice(startRow, len + 1, null);\n this.states.splice(startRow, len + 1, null);\n }\n else {\n var args = Array(len + 1);\n args.unshift(startRow, 1);\n this.lines.splice.apply(this.lines, args);\n this.states.splice.apply(this.states, args);\n }\n this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength());\n this.stop();\n };\n BackgroundTokenizer.prototype.stop = function () {\n if (this.running)\n clearTimeout(this.running);\n this.running = false;\n };\n BackgroundTokenizer.prototype.getTokens = function (row) {\n return this.lines[row] || this.$tokenizeRow(row);\n };\n BackgroundTokenizer.prototype.getState = function (row) {\n if (this.currentLine == row)\n this.$tokenizeRow(row);\n return this.states[row] || \"start\";\n };\n BackgroundTokenizer.prototype.$tokenizeRow = function (row) {\n var line = this.doc.getLine(row);\n var state = this.states[row - 1];\n var data = this.tokenizer.getLineTokens(line, state, row);\n if (this.states[row] + \"\" !== data.state + \"\") {\n this.states[row] = data.state;\n this.lines[row + 1] = null;\n if (this.currentLine > row + 1)\n this.currentLine = row + 1;\n }\n else if (this.currentLine == row) {\n this.currentLine = row + 1;\n }\n return this.lines[row] = data.tokens;\n };\n BackgroundTokenizer.prototype.cleanup = function () {\n this.running = false;\n this.lines = [];\n this.states = [];\n this.currentLine = 0;\n this.removeAllListeners();\n };\n return BackgroundTokenizer;\n}());\noop.implement(BackgroundTokenizer.prototype, EventEmitter);\nexports.BackgroundTokenizer = BackgroundTokenizer;\n\n});\n\nace.define(\"ace/search_highlight\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"./lib/lang\");\nvar Range = require(\"./range\").Range;\nvar SearchHighlight = /** @class */ (function () {\n function SearchHighlight(regExp, clazz, type) {\n if (type === void 0) { type = \"text\"; }\n this.setRegexp(regExp);\n this.clazz = clazz;\n this.type = type;\n }\n SearchHighlight.prototype.setRegexp = function (regExp) {\n if (this.regExp + \"\" == regExp + \"\")\n return;\n this.regExp = regExp;\n this.cache = [];\n };\n SearchHighlight.prototype.update = function (html, markerLayer, session, config) {\n if (!this.regExp)\n return;\n var start = config.firstRow, end = config.lastRow;\n var renderedMarkerRanges = {};\n for (var i = start; i <= end; i++) {\n var ranges = this.cache[i];\n if (ranges == null) {\n ranges = lang.getMatchOffsets(session.getLine(i), this.regExp);\n if (ranges.length > this.MAX_RANGES)\n ranges = ranges.slice(0, this.MAX_RANGES);\n ranges = ranges.map(function (match) {\n return new Range(i, match.offset, i, match.offset + match.length);\n });\n this.cache[i] = ranges.length ? ranges : \"\";\n }\n for (var j = ranges.length; j--;) {\n var rangeToAddMarkerTo = ranges[j].toScreenRange(session);\n var rangeAsString = rangeToAddMarkerTo.toString();\n if (renderedMarkerRanges[rangeAsString])\n continue;\n renderedMarkerRanges[rangeAsString] = true;\n markerLayer.drawSingleLineMarker(html, rangeToAddMarkerTo, this.clazz, config);\n }\n }\n };\n return SearchHighlight;\n}());\nSearchHighlight.prototype.MAX_RANGES = 500;\nexports.SearchHighlight = SearchHighlight;\n\n});\n\nace.define(\"ace/edit_session/fold_line\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nvar FoldLine = /** @class */ (function () {\n function FoldLine(foldData, folds) {\n this.foldData = foldData;\n if (Array.isArray(folds)) {\n this.folds = folds;\n }\n else {\n folds = this.folds = [folds];\n }\n var last = folds[folds.length - 1];\n this.range = new Range(folds[0].start.row, folds[0].start.column, last.end.row, last.end.column);\n this.start = this.range.start;\n this.end = this.range.end;\n this.folds.forEach(function (fold) {\n fold.setFoldLine(this);\n }, this);\n }\n FoldLine.prototype.shiftRow = function (shift) {\n this.start.row += shift;\n this.end.row += shift;\n this.folds.forEach(function (fold) {\n fold.start.row += shift;\n fold.end.row += shift;\n });\n };\n FoldLine.prototype.addFold = function (fold) {\n if (fold.sameRow) {\n if (fold.start.row < this.startRow || fold.endRow > this.endRow) {\n throw new Error(\"Can't add a fold to this FoldLine as it has no connection\");\n }\n this.folds.push(fold);\n this.folds.sort(function (a, b) {\n return -a.range.compareEnd(b.start.row, b.start.column);\n });\n if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) {\n this.end.row = fold.end.row;\n this.end.column = fold.end.column;\n }\n else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) {\n this.start.row = fold.start.row;\n this.start.column = fold.start.column;\n }\n }\n else if (fold.start.row == this.end.row) {\n this.folds.push(fold);\n this.end.row = fold.end.row;\n this.end.column = fold.end.column;\n }\n else if (fold.end.row == this.start.row) {\n this.folds.unshift(fold);\n this.start.row = fold.start.row;\n this.start.column = fold.start.column;\n }\n else {\n throw new Error(\"Trying to add fold to FoldRow that doesn't have a matching row\");\n }\n fold.foldLine = this;\n };\n FoldLine.prototype.containsRow = function (row) {\n return row >= this.start.row && row <= this.end.row;\n };\n FoldLine.prototype.walk = function (callback, endRow, endColumn) {\n var lastEnd = 0, folds = this.folds, fold, cmp, stop, isNewRow = true;\n if (endRow == null) {\n endRow = this.end.row;\n endColumn = this.end.column;\n }\n for (var i = 0; i < folds.length; i++) {\n fold = folds[i];\n cmp = fold.range.compareStart(endRow, endColumn);\n if (cmp == -1) {\n callback(null, endRow, endColumn, lastEnd, isNewRow);\n return;\n }\n stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow);\n stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd);\n if (stop || cmp === 0) {\n return;\n }\n isNewRow = !fold.sameRow;\n lastEnd = fold.end.column;\n }\n callback(null, endRow, endColumn, lastEnd, isNewRow);\n };\n FoldLine.prototype.getNextFoldTo = function (row, column) {\n var fold, cmp;\n for (var i = 0; i < this.folds.length; i++) {\n fold = this.folds[i];\n cmp = fold.range.compareEnd(row, column);\n if (cmp == -1) {\n return {\n fold: fold,\n kind: \"after\"\n };\n }\n else if (cmp === 0) {\n return {\n fold: fold,\n kind: \"inside\"\n };\n }\n }\n return null;\n };\n FoldLine.prototype.addRemoveChars = function (row, column, len) {\n var ret = this.getNextFoldTo(row, column), fold, folds;\n if (ret) {\n fold = ret.fold;\n if (ret.kind == \"inside\"\n && fold.start.column != column\n && fold.start.row != row) {\n window.console && window.console.log(row, column, fold);\n }\n else if (fold.start.row == row) {\n folds = this.folds;\n var i = folds.indexOf(fold);\n if (i === 0) {\n this.start.column += len;\n }\n for (i; i < folds.length; i++) {\n fold = folds[i];\n fold.start.column += len;\n if (!fold.sameRow) {\n return;\n }\n fold.end.column += len;\n }\n this.end.column += len;\n }\n }\n };\n FoldLine.prototype.split = function (row, column) {\n var pos = this.getNextFoldTo(row, column);\n if (!pos || pos.kind == \"inside\")\n return null;\n var fold = pos.fold;\n var folds = this.folds;\n var foldData = this.foldData;\n var i = folds.indexOf(fold);\n var foldBefore = folds[i - 1];\n this.end.row = foldBefore.end.row;\n this.end.column = foldBefore.end.column;\n folds = folds.splice(i, folds.length - i);\n var newFoldLine = new FoldLine(foldData, folds);\n foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine);\n return newFoldLine;\n };\n FoldLine.prototype.merge = function (foldLineNext) {\n var folds = foldLineNext.folds;\n for (var i = 0; i < folds.length; i++) {\n this.addFold(folds[i]);\n }\n var foldData = this.foldData;\n foldData.splice(foldData.indexOf(foldLineNext), 1);\n };\n FoldLine.prototype.toString = function () {\n var ret = [this.range.toString() + \": [\"];\n this.folds.forEach(function (fold) {\n ret.push(\" \" + fold.toString());\n });\n ret.push(\"]\");\n return ret.join(\"\\n\");\n };\n FoldLine.prototype.idxToPosition = function (idx) {\n var lastFoldEndColumn = 0;\n for (var i = 0; i < this.folds.length; i++) {\n var fold = this.folds[i];\n idx -= fold.start.column - lastFoldEndColumn;\n if (idx < 0) {\n return {\n row: fold.start.row,\n column: fold.start.column + idx\n };\n }\n idx -= fold.placeholder.length;\n if (idx < 0) {\n return fold.start;\n }\n lastFoldEndColumn = fold.end.column;\n }\n return {\n row: this.end.row,\n column: this.end.column + idx\n };\n };\n return FoldLine;\n}());\nexports.FoldLine = FoldLine;\n\n});\n\nace.define(\"ace/range_list\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"./range\").Range;\nvar comparePoints = Range.comparePoints;\nvar RangeList = /** @class */ (function () {\n function RangeList() {\n this.ranges = [];\n this.$bias = 1;\n }\n RangeList.prototype.pointIndex = function (pos, excludeEdges, startIndex) {\n var list = this.ranges;\n for (var i = startIndex || 0; i < list.length; i++) {\n var range = list[i];\n var cmpEnd = comparePoints(pos, range.end);\n if (cmpEnd > 0)\n continue;\n var cmpStart = comparePoints(pos, range.start);\n if (cmpEnd === 0)\n return excludeEdges && cmpStart !== 0 ? -i - 2 : i;\n if (cmpStart > 0 || (cmpStart === 0 && !excludeEdges))\n return i;\n return -i - 1;\n }\n return -i - 1;\n };\n RangeList.prototype.add = function (range) {\n var excludeEdges = !range.isEmpty();\n var startIndex = this.pointIndex(range.start, excludeEdges);\n if (startIndex < 0)\n startIndex = -startIndex - 1;\n var endIndex = this.pointIndex(range.end, excludeEdges, startIndex);\n if (endIndex < 0)\n endIndex = -endIndex - 1;\n else\n endIndex++;\n return this.ranges.splice(startIndex, endIndex - startIndex, range);\n };\n RangeList.prototype.addList = function (list) {\n var removed = [];\n for (var i = list.length; i--;) {\n removed.push.apply(removed, this.add(list[i]));\n }\n return removed;\n };\n RangeList.prototype.substractPoint = function (pos) {\n var i = this.pointIndex(pos);\n if (i >= 0)\n return this.ranges.splice(i, 1);\n };\n RangeList.prototype.merge = function () {\n var removed = [];\n var list = this.ranges;\n list = list.sort(function (a, b) {\n return comparePoints(a.start, b.start);\n });\n var next = list[0], range;\n for (var i = 1; i < list.length; i++) {\n range = next;\n next = list[i];\n var cmp = comparePoints(range.end, next.start);\n if (cmp < 0)\n continue;\n if (cmp == 0 && !range.isEmpty() && !next.isEmpty())\n continue;\n if (comparePoints(range.end, next.end) < 0) {\n range.end.row = next.end.row;\n range.end.column = next.end.column;\n }\n list.splice(i, 1);\n removed.push(next);\n next = range;\n i--;\n }\n this.ranges = list;\n return removed;\n };\n RangeList.prototype.contains = function (row, column) {\n return this.pointIndex({ row: row, column: column }) >= 0;\n };\n RangeList.prototype.containsPoint = function (pos) {\n return this.pointIndex(pos) >= 0;\n };\n RangeList.prototype.rangeAtPoint = function (pos) {\n var i = this.pointIndex(pos);\n if (i >= 0)\n return this.ranges[i];\n };\n RangeList.prototype.clipRows = function (startRow, endRow) {\n var list = this.ranges;\n if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow)\n return [];\n var startIndex = this.pointIndex({ row: startRow, column: 0 });\n if (startIndex < 0)\n startIndex = -startIndex - 1;\n var endIndex = this.pointIndex({ row: endRow, column: 0 }, startIndex);\n if (endIndex < 0)\n endIndex = -endIndex - 1;\n var clipped = [];\n for (var i = startIndex; i < endIndex; i++) {\n clipped.push(list[i]);\n }\n return clipped;\n };\n RangeList.prototype.removeAll = function () {\n return this.ranges.splice(0, this.ranges.length);\n };\n RangeList.prototype.attach = function (session) {\n if (this.session)\n this.detach();\n this.session = session;\n this.onChange = this.$onChange.bind(this);\n this.session.on('change', this.onChange);\n };\n RangeList.prototype.detach = function () {\n if (!this.session)\n return;\n this.session.removeListener('change', this.onChange);\n this.session = null;\n };\n RangeList.prototype.$onChange = function (delta) {\n var start = delta.start;\n var end = delta.end;\n var startRow = start.row;\n var endRow = end.row;\n var ranges = this.ranges;\n for (var i = 0, n = ranges.length; i < n; i++) {\n var r = ranges[i];\n if (r.end.row >= startRow)\n break;\n }\n if (delta.action == \"insert\") {\n var lineDif = endRow - startRow;\n var colDiff = -start.column + end.column;\n for (; i < n; i++) {\n var r = ranges[i];\n if (r.start.row > startRow)\n break;\n if (r.start.row == startRow && r.start.column >= start.column) {\n if (r.start.column == start.column && this.$bias <= 0) {\n }\n else {\n r.start.column += colDiff;\n r.start.row += lineDif;\n }\n }\n if (r.end.row == startRow && r.end.column >= start.column) {\n if (r.end.column == start.column && this.$bias < 0) {\n continue;\n }\n if (r.end.column == start.column && colDiff > 0 && i < n - 1) {\n if (r.end.column > r.start.column && r.end.column == ranges[i + 1].start.column)\n r.end.column -= colDiff;\n }\n r.end.column += colDiff;\n r.end.row += lineDif;\n }\n }\n }\n else {\n var lineDif = startRow - endRow;\n var colDiff = start.column - end.column;\n for (; i < n; i++) {\n var r = ranges[i];\n if (r.start.row > endRow)\n break;\n if (r.end.row < endRow\n && (startRow < r.end.row\n || startRow == r.end.row && start.column < r.end.column)) {\n r.end.row = startRow;\n r.end.column = start.column;\n }\n else if (r.end.row == endRow) {\n if (r.end.column <= end.column) {\n if (lineDif || r.end.column > start.column) {\n r.end.column = start.column;\n r.end.row = start.row;\n }\n }\n else {\n r.end.column += colDiff;\n r.end.row += lineDif;\n }\n }\n else if (r.end.row > endRow) {\n r.end.row += lineDif;\n }\n if (r.start.row < endRow\n && (startRow < r.start.row\n || startRow == r.start.row && start.column < r.start.column)) {\n r.start.row = startRow;\n r.start.column = start.column;\n }\n else if (r.start.row == endRow) {\n if (r.start.column <= end.column) {\n if (lineDif || r.start.column > start.column) {\n r.start.column = start.column;\n r.start.row = start.row;\n }\n }\n else {\n r.start.column += colDiff;\n r.start.row += lineDif;\n }\n }\n else if (r.start.row > endRow) {\n r.start.row += lineDif;\n }\n }\n }\n if (lineDif != 0 && i < n) {\n for (; i < n; i++) {\n var r = ranges[i];\n r.start.row += lineDif;\n r.end.row += lineDif;\n }\n }\n };\n return RangeList;\n}());\nRangeList.prototype.comparePoints = comparePoints;\nexports.RangeList = RangeList;\n\n});\n\nace.define(\"ace/edit_session/fold\",[\"require\",\"exports\",\"module\",\"ace/range_list\"], function(require, exports, module){\"use strict\";\nvar __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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar RangeList = require(\"../range_list\").RangeList;\nvar Fold = /** @class */ (function (_super) {\n __extends(Fold, _super);\n function Fold(range, placeholder) {\n var _this = _super.call(this) || this;\n _this.foldLine = null;\n _this.placeholder = placeholder;\n _this.range = range;\n _this.start = range.start;\n _this.end = range.end;\n _this.sameRow = range.start.row == range.end.row;\n _this.subFolds = _this.ranges = [];\n return _this;\n }\n Fold.prototype.toString = function () {\n return '\"' + this.placeholder + '\" ' + this.range.toString();\n };\n Fold.prototype.setFoldLine = function (foldLine) {\n this.foldLine = foldLine;\n this.subFolds.forEach(function (fold) {\n fold.setFoldLine(foldLine);\n });\n };\n Fold.prototype.clone = function () {\n var range = this.range.clone();\n var fold = new Fold(range, this.placeholder);\n this.subFolds.forEach(function (subFold) {\n fold.subFolds.push(subFold.clone());\n });\n fold.collapseChildren = this.collapseChildren;\n return fold;\n };\n Fold.prototype.addSubFold = function (fold) {\n if (this.range.isEqual(fold))\n return;\n consumeRange(fold, this.start);\n var row = fold.start.row, column = fold.start.column;\n for (var i = 0, cmp = -1; i < this.subFolds.length; i++) {\n cmp = this.subFolds[i].range.compare(row, column);\n if (cmp != 1)\n break;\n }\n var afterStart = this.subFolds[i];\n var firstConsumed = 0;\n if (cmp == 0) {\n if (afterStart.range.containsRange(fold))\n return afterStart.addSubFold(fold);\n else\n firstConsumed = 1;\n }\n var row = fold.range.end.row, column = fold.range.end.column;\n for (var j = i, cmp = -1; j < this.subFolds.length; j++) {\n cmp = this.subFolds[j].range.compare(row, column);\n if (cmp != 1)\n break;\n }\n if (cmp == 0)\n j++;\n var consumedFolds = this.subFolds.splice(i, j - i, fold);\n var last = cmp == 0 ? consumedFolds.length - 1 : consumedFolds.length;\n for (var k = firstConsumed; k < last; k++) {\n fold.addSubFold(consumedFolds[k]);\n }\n fold.setFoldLine(this.foldLine);\n return fold;\n };\n Fold.prototype.restoreRange = function (range) {\n return restoreRange(range, this.start);\n };\n return Fold;\n}(RangeList));\nfunction consumePoint(point, anchor) {\n point.row -= anchor.row;\n if (point.row == 0)\n point.column -= anchor.column;\n}\nfunction consumeRange(range, anchor) {\n consumePoint(range.start, anchor);\n consumePoint(range.end, anchor);\n}\nfunction restorePoint(point, anchor) {\n if (point.row == 0)\n point.column += anchor.column;\n point.row += anchor.row;\n}\nfunction restoreRange(range, anchor) {\n restorePoint(range.start, anchor);\n restorePoint(range.end, anchor);\n}\nexports.Fold = Fold;\n\n});\n\nace.define(\"ace/edit_session/folding\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/edit_session/fold_line\",\"ace/edit_session/fold\",\"ace/token_iterator\",\"ace/mouse/mouse_event\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nvar FoldLine = require(\"./fold_line\").FoldLine;\nvar Fold = require(\"./fold\").Fold;\nvar TokenIterator = require(\"../token_iterator\").TokenIterator;\nvar MouseEvent = require(\"../mouse/mouse_event\").MouseEvent;\nfunction Folding() {\n this.getFoldAt = function (row, column, side) {\n var foldLine = this.getFoldLine(row);\n if (!foldLine)\n return null;\n var folds = foldLine.folds;\n for (var i = 0; i < folds.length; i++) {\n var range = folds[i].range;\n if (range.contains(row, column)) {\n if (side == 1 && range.isEnd(row, column) && !range.isEmpty()) {\n continue;\n }\n else if (side == -1 && range.isStart(row, column) && !range.isEmpty()) {\n continue;\n }\n return folds[i];\n }\n }\n };\n this.getFoldsInRange = function (range) {\n var start = range.start;\n var end = range.end;\n var foldLines = this.$foldData;\n var foundFolds = [];\n start.column += 1;\n end.column -= 1;\n for (var i = 0; i < foldLines.length; i++) {\n var cmp = foldLines[i].range.compareRange(range);\n if (cmp == 2) {\n continue;\n }\n else if (cmp == -2) {\n break;\n }\n var folds = foldLines[i].folds;\n for (var j = 0; j < folds.length; j++) {\n var fold = folds[j];\n cmp = fold.range.compareRange(range);\n if (cmp == -2) {\n break;\n }\n else if (cmp == 2) {\n continue;\n }\n else \n if (cmp == 42) {\n break;\n }\n foundFolds.push(fold);\n }\n }\n start.column -= 1;\n end.column += 1;\n return foundFolds;\n };\n this.getFoldsInRangeList = function (ranges) {\n if (Array.isArray(ranges)) {\n var folds = [];\n ranges.forEach(function (range) {\n folds = folds.concat(this.getFoldsInRange(range));\n }, this);\n }\n else {\n var folds = this.getFoldsInRange(ranges);\n }\n return folds;\n };\n this.getAllFolds = function () {\n var folds = [];\n var foldLines = this.$foldData;\n for (var i = 0; i < foldLines.length; i++)\n for (var j = 0; j < foldLines[i].folds.length; j++)\n folds.push(foldLines[i].folds[j]);\n return folds;\n };\n this.getFoldStringAt = function (row, column, trim, foldLine) {\n foldLine = foldLine || this.getFoldLine(row);\n if (!foldLine)\n return null;\n var lastFold = {\n end: { column: 0 }\n };\n var str, fold;\n for (var i = 0; i < foldLine.folds.length; i++) {\n fold = foldLine.folds[i];\n var cmp = fold.range.compareEnd(row, column);\n if (cmp == -1) {\n str = this\n .getLine(fold.start.row)\n .substring(lastFold.end.column, fold.start.column);\n break;\n }\n else if (cmp === 0) {\n return null;\n }\n lastFold = fold;\n }\n if (!str)\n str = this.getLine(fold.start.row).substring(lastFold.end.column);\n if (trim == -1)\n return str.substring(0, column - lastFold.end.column);\n else if (trim == 1)\n return str.substring(column - lastFold.end.column);\n else\n return str;\n };\n this.getFoldLine = function (docRow, startFoldLine) {\n var foldData = this.$foldData;\n var i = 0;\n if (startFoldLine)\n i = foldData.indexOf(startFoldLine);\n if (i == -1)\n i = 0;\n for (i; i < foldData.length; i++) {\n var foldLine = foldData[i];\n if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) {\n return foldLine;\n }\n else if (foldLine.end.row > docRow) {\n return null;\n }\n }\n return null;\n };\n this.getNextFoldLine = function (docRow, startFoldLine) {\n var foldData = this.$foldData;\n var i = 0;\n if (startFoldLine)\n i = foldData.indexOf(startFoldLine);\n if (i == -1)\n i = 0;\n for (i; i < foldData.length; i++) {\n var foldLine = foldData[i];\n if (foldLine.end.row >= docRow) {\n return foldLine;\n }\n }\n return null;\n };\n this.getFoldedRowCount = function (first, last) {\n var foldData = this.$foldData, rowCount = last - first + 1;\n for (var i = 0; i < foldData.length; i++) {\n var foldLine = foldData[i], end = foldLine.end.row, start = foldLine.start.row;\n if (end >= last) {\n if (start < last) {\n if (start >= first)\n rowCount -= last - start;\n else\n rowCount = 0; // in one fold\n }\n break;\n }\n else if (end >= first) {\n if (start >= first) // fold inside range\n rowCount -= end - start;\n else\n rowCount -= end - first + 1;\n }\n }\n return rowCount;\n };\n this.$addFoldLine = function (foldLine) {\n this.$foldData.push(foldLine);\n this.$foldData.sort(function (a, b) {\n return a.start.row - b.start.row;\n });\n return foldLine;\n };\n this.addFold = function (placeholder, range) {\n var foldData = this.$foldData;\n var added = false;\n var fold;\n if (placeholder instanceof Fold)\n fold = placeholder;\n else {\n fold = new Fold(range, placeholder);\n fold.collapseChildren = range.collapseChildren;\n }\n this.$clipRangeToDocument(fold.range);\n var startRow = fold.start.row;\n var startColumn = fold.start.column;\n var endRow = fold.end.row;\n var endColumn = fold.end.column;\n var startFold = this.getFoldAt(startRow, startColumn, 1);\n var endFold = this.getFoldAt(endRow, endColumn, -1);\n if (startFold && endFold == startFold)\n return startFold.addSubFold(fold);\n if (startFold && !startFold.range.isStart(startRow, startColumn))\n this.removeFold(startFold);\n if (endFold && !endFold.range.isEnd(endRow, endColumn))\n this.removeFold(endFold);\n var folds = this.getFoldsInRange(fold.range);\n if (folds.length > 0) {\n this.removeFolds(folds);\n if (!fold.collapseChildren) {\n folds.forEach(function (subFold) {\n fold.addSubFold(subFold);\n });\n }\n }\n for (var i = 0; i < foldData.length; i++) {\n var foldLine = foldData[i];\n if (endRow == foldLine.start.row) {\n foldLine.addFold(fold);\n added = true;\n break;\n }\n else if (startRow == foldLine.end.row) {\n foldLine.addFold(fold);\n added = true;\n if (!fold.sameRow) {\n var foldLineNext = foldData[i + 1];\n if (foldLineNext && foldLineNext.start.row == endRow) {\n foldLine.merge(foldLineNext);\n break;\n }\n }\n break;\n }\n else if (endRow <= foldLine.start.row) {\n break;\n }\n }\n if (!added)\n foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold));\n if (this.$useWrapMode)\n this.$updateWrapData(foldLine.start.row, foldLine.start.row);\n else\n this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row);\n this.$modified = true;\n this._signal(\"changeFold\", { data: fold, action: \"add\" });\n return fold;\n };\n this.addFolds = function (folds) {\n folds.forEach(function (fold) {\n this.addFold(fold);\n }, this);\n };\n this.removeFold = function (fold) {\n var foldLine = fold.foldLine;\n var startRow = foldLine.start.row;\n var endRow = foldLine.end.row;\n var foldLines = this.$foldData;\n var folds = foldLine.folds;\n if (folds.length == 1) {\n foldLines.splice(foldLines.indexOf(foldLine), 1);\n }\n else \n if (foldLine.range.isEnd(fold.end.row, fold.end.column)) {\n folds.pop();\n foldLine.end.row = folds[folds.length - 1].end.row;\n foldLine.end.column = folds[folds.length - 1].end.column;\n }\n else \n if (foldLine.range.isStart(fold.start.row, fold.start.column)) {\n folds.shift();\n foldLine.start.row = folds[0].start.row;\n foldLine.start.column = folds[0].start.column;\n }\n else \n if (fold.sameRow) {\n folds.splice(folds.indexOf(fold), 1);\n }\n else \n {\n var newFoldLine = foldLine.split(fold.start.row, fold.start.column);\n folds = newFoldLine.folds;\n folds.shift();\n newFoldLine.start.row = folds[0].start.row;\n newFoldLine.start.column = folds[0].start.column;\n }\n if (!this.$updating) {\n if (this.$useWrapMode)\n this.$updateWrapData(startRow, endRow);\n else\n this.$updateRowLengthCache(startRow, endRow);\n }\n this.$modified = true;\n this._signal(\"changeFold\", { data: fold, action: \"remove\" });\n };\n this.removeFolds = function (folds) {\n var cloneFolds = [];\n for (var i = 0; i < folds.length; i++) {\n cloneFolds.push(folds[i]);\n }\n cloneFolds.forEach(function (fold) {\n this.removeFold(fold);\n }, this);\n this.$modified = true;\n };\n this.expandFold = function (fold) {\n this.removeFold(fold);\n fold.subFolds.forEach(function (subFold) {\n fold.restoreRange(subFold);\n this.addFold(subFold);\n }, this);\n if (fold.collapseChildren > 0) {\n this.foldAll(fold.start.row + 1, fold.end.row, fold.collapseChildren - 1);\n }\n fold.subFolds = [];\n };\n this.expandFolds = function (folds) {\n folds.forEach(function (fold) {\n this.expandFold(fold);\n }, this);\n };\n this.unfold = function (location, expandInner) {\n var range, folds;\n if (location == null) {\n range = new Range(0, 0, this.getLength(), 0);\n if (expandInner == null)\n expandInner = true;\n }\n else if (typeof location == \"number\") {\n range = new Range(location, 0, location, this.getLine(location).length);\n }\n else if (\"row\" in location) {\n range = Range.fromPoints(location, location);\n }\n else if (Array.isArray(location)) {\n folds = [];\n location.forEach(function (range) {\n folds = folds.concat(this.unfold(range));\n }, this);\n return folds;\n }\n else {\n range = location;\n }\n folds = this.getFoldsInRangeList(range);\n var outermostFolds = folds;\n while (folds.length == 1\n && Range.comparePoints(folds[0].start, range.start) < 0\n && Range.comparePoints(folds[0].end, range.end) > 0) {\n this.expandFolds(folds);\n folds = this.getFoldsInRangeList(range);\n }\n if (expandInner != false) {\n this.removeFolds(folds);\n }\n else {\n this.expandFolds(folds);\n }\n if (outermostFolds.length)\n return outermostFolds;\n };\n this.isRowFolded = function (docRow, startFoldRow) {\n return !!this.getFoldLine(docRow, startFoldRow);\n };\n this.getRowFoldEnd = function (docRow, startFoldRow) {\n var foldLine = this.getFoldLine(docRow, startFoldRow);\n return foldLine ? foldLine.end.row : docRow;\n };\n this.getRowFoldStart = function (docRow, startFoldRow) {\n var foldLine = this.getFoldLine(docRow, startFoldRow);\n return foldLine ? foldLine.start.row : docRow;\n };\n this.getFoldDisplayLine = function (foldLine, endRow, endColumn, startRow, startColumn) {\n if (startRow == null)\n startRow = foldLine.start.row;\n if (startColumn == null)\n startColumn = 0;\n if (endRow == null)\n endRow = foldLine.end.row;\n if (endColumn == null)\n endColumn = this.getLine(endRow).length;\n var doc = this.doc;\n var textLine = \"\";\n foldLine.walk(function (placeholder, row, column, lastColumn) {\n if (row < startRow)\n return;\n if (row == startRow) {\n if (column < startColumn)\n return;\n lastColumn = Math.max(startColumn, lastColumn);\n }\n if (placeholder != null) {\n textLine += placeholder;\n }\n else {\n textLine += doc.getLine(row).substring(lastColumn, column);\n }\n }, endRow, endColumn);\n return textLine;\n };\n this.getDisplayLine = function (row, endColumn, startRow, startColumn) {\n var foldLine = this.getFoldLine(row);\n if (!foldLine) {\n var line;\n line = this.doc.getLine(row);\n return line.substring(startColumn || 0, endColumn || line.length);\n }\n else {\n return this.getFoldDisplayLine(foldLine, row, endColumn, startRow, startColumn);\n }\n };\n this.$cloneFoldData = function () {\n var fd = [];\n fd = this.$foldData.map(function (foldLine) {\n var folds = foldLine.folds.map(function (fold) {\n return fold.clone();\n });\n return new FoldLine(fd, folds);\n });\n return fd;\n };\n this.toggleFold = function (tryToUnfold) {\n var selection = this.selection;\n var range = selection.getRange();\n var fold;\n var bracketPos;\n if (range.isEmpty()) {\n var cursor = range.start;\n fold = this.getFoldAt(cursor.row, cursor.column);\n if (fold) {\n this.expandFold(fold);\n return;\n }\n else if (bracketPos = this.findMatchingBracket(cursor)) {\n if (range.comparePoint(bracketPos) == 1) {\n range.end = bracketPos;\n }\n else {\n range.start = bracketPos;\n range.start.column++;\n range.end.column--;\n }\n }\n else if (bracketPos = this.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 })) {\n if (range.comparePoint(bracketPos) == 1)\n range.end = bracketPos;\n else\n range.start = bracketPos;\n range.start.column++;\n }\n else {\n range = this.getCommentFoldRange(cursor.row, cursor.column) || range;\n }\n }\n else {\n var folds = this.getFoldsInRange(range);\n if (tryToUnfold && folds.length) {\n this.expandFolds(folds);\n return;\n }\n else if (folds.length == 1) {\n fold = folds[0];\n }\n }\n if (!fold)\n fold = this.getFoldAt(range.start.row, range.start.column);\n if (fold && fold.range.toString() == range.toString()) {\n this.expandFold(fold);\n return;\n }\n var placeholder = \"...\";\n if (!range.isMultiLine()) {\n placeholder = this.getTextRange(range);\n if (placeholder.length < 4)\n return;\n placeholder = placeholder.trim().substring(0, 2) + \"..\";\n }\n this.addFold(placeholder, range);\n };\n this.getCommentFoldRange = function (row, column, dir) {\n var iterator = new TokenIterator(this, row, column);\n var token = iterator.getCurrentToken();\n var type = token && token.type;\n if (token && /^comment|string/.test(type)) {\n type = type.match(/comment|string/)[0];\n if (type == \"comment\")\n type += \"|doc-start|\\\\.doc\";\n var re = new RegExp(type);\n var range = new Range();\n if (dir != 1) {\n do {\n token = iterator.stepBackward();\n } while (token && re.test(token.type) && !/^comment.end/.test(token.type));\n token = iterator.stepForward();\n }\n range.start.row = iterator.getCurrentTokenRow();\n range.start.column = iterator.getCurrentTokenColumn() + (/^comment.start/.test(token.type) ? token.value.length : 2);\n iterator = new TokenIterator(this, row, column);\n if (dir != -1) {\n var lastRow = -1;\n do {\n token = iterator.stepForward();\n if (lastRow == -1) {\n var state = this.getState(iterator.$row);\n if (!re.test(state))\n lastRow = iterator.$row;\n }\n else if (iterator.$row > lastRow) {\n break;\n }\n } while (token && re.test(token.type) && !/^comment.start/.test(token.type));\n token = iterator.stepBackward();\n }\n else\n token = iterator.getCurrentToken();\n range.end.row = iterator.getCurrentTokenRow();\n range.end.column = iterator.getCurrentTokenColumn();\n if (!/^comment.end/.test(token.type)) {\n range.end.column += token.value.length - 2;\n }\n return range;\n }\n };\n this.foldAll = function (startRow, endRow, depth, test) {\n if (depth == undefined)\n depth = 100000; // JSON.stringify doesn't hanle Infinity\n var foldWidgets = this.foldWidgets;\n if (!foldWidgets)\n return; // mode doesn't support folding\n endRow = endRow || this.getLength();\n startRow = startRow || 0;\n for (var row = startRow; row < endRow; row++) {\n if (foldWidgets[row] == null)\n foldWidgets[row] = this.getFoldWidget(row);\n if (foldWidgets[row] != \"start\")\n continue;\n if (test && !test(row))\n continue;\n var range = this.getFoldWidgetRange(row);\n if (range && range.isMultiLine()\n && range.end.row <= endRow\n && range.start.row >= startRow) {\n row = range.end.row;\n range.collapseChildren = depth;\n this.addFold(\"...\", range);\n }\n }\n };\n this.foldToLevel = function (level) {\n this.foldAll();\n while (level-- > 0)\n this.unfold(null, false);\n };\n this.foldAllComments = function () {\n var session = this;\n this.foldAll(null, null, null, function (row) {\n var tokens = session.getTokens(row);\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (token.type == \"text\" && /^\\s+$/.test(token.value))\n continue;\n if (/comment/.test(token.type))\n return true;\n return false;\n }\n });\n };\n this.$foldStyles = {\n \"manual\": 1,\n \"markbegin\": 1,\n \"markbeginend\": 1\n };\n this.$foldStyle = \"markbegin\";\n this.setFoldStyle = function (style) {\n if (!this.$foldStyles[style])\n throw new Error(\"invalid fold style: \" + style + \"[\" + Object.keys(this.$foldStyles).join(\", \") + \"]\");\n if (this.$foldStyle == style)\n return;\n this.$foldStyle = style;\n if (style == \"manual\")\n this.unfold();\n var mode = this.$foldMode;\n this.$setFolding(null);\n this.$setFolding(mode);\n };\n this.$setFolding = function (foldMode) {\n if (this.$foldMode == foldMode)\n return;\n this.$foldMode = foldMode;\n this.off('change', this.$updateFoldWidgets);\n this.off('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets);\n this._signal(\"changeAnnotation\");\n if (!foldMode || this.$foldStyle == \"manual\") {\n this.foldWidgets = null;\n return;\n }\n this.foldWidgets = [];\n this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle);\n this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle);\n this.$updateFoldWidgets = this.updateFoldWidgets.bind(this);\n this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this);\n this.on('change', this.$updateFoldWidgets);\n this.on('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets);\n };\n this.getParentFoldRangeData = function (row, ignoreCurrent) {\n var fw = this.foldWidgets;\n if (!fw || (ignoreCurrent && fw[row]))\n return {};\n var i = row - 1, firstRange;\n while (i >= 0) {\n var c = fw[i];\n if (c == null)\n c = fw[i] = this.getFoldWidget(i);\n if (c == \"start\") {\n var range = this.getFoldWidgetRange(i);\n if (!firstRange)\n firstRange = range;\n if (range && range.end.row >= row)\n break;\n }\n i--;\n }\n return {\n range: i !== -1 && range,\n firstRange: firstRange\n };\n };\n this.onFoldWidgetClick = function (row, e) {\n if (e instanceof MouseEvent)\n e = e.domEvent;\n var options = {\n children: e.shiftKey,\n all: e.ctrlKey || e.metaKey,\n siblings: e.altKey\n };\n var range = this.$toggleFoldWidget(row, options);\n if (!range) {\n var el = (e.target || e.srcElement);\n if (el && /ace_fold-widget/.test(el.className))\n el.className += \" ace_invalid\";\n }\n };\n this.$toggleFoldWidget = function (row, options) {\n if (!this.getFoldWidget)\n return;\n var type = this.getFoldWidget(row);\n var line = this.getLine(row);\n var dir = type === \"end\" ? -1 : 1;\n var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir);\n if (fold) {\n if (options.children || options.all)\n this.removeFold(fold);\n else\n this.expandFold(fold);\n return fold;\n }\n var range = this.getFoldWidgetRange(row, true);\n if (range && !range.isMultiLine()) {\n fold = this.getFoldAt(range.start.row, range.start.column, 1);\n if (fold && range.isEqual(fold.range)) {\n this.removeFold(fold);\n return fold;\n }\n }\n if (options.siblings) {\n var data = this.getParentFoldRangeData(row);\n if (data.range) {\n var startRow = data.range.start.row + 1;\n var endRow = data.range.end.row;\n }\n this.foldAll(startRow, endRow, options.all ? 10000 : 0);\n }\n else if (options.children) {\n endRow = range ? range.end.row : this.getLength();\n this.foldAll(row + 1, endRow, options.all ? 10000 : 0);\n }\n else if (range) {\n if (options.all)\n range.collapseChildren = 10000;\n this.addFold(\"...\", range);\n }\n return range;\n };\n this.toggleFoldWidget = function (toggleParent) {\n var row = this.selection.getCursor().row;\n row = this.getRowFoldStart(row);\n var range = this.$toggleFoldWidget(row, {});\n if (range)\n return;\n var data = this.getParentFoldRangeData(row, true);\n range = data.range || data.firstRange;\n if (range) {\n row = range.start.row;\n var fold = this.getFoldAt(row, this.getLine(row).length, 1);\n if (fold) {\n this.removeFold(fold);\n }\n else {\n this.addFold(\"...\", range);\n }\n }\n };\n this.updateFoldWidgets = function (delta) {\n var firstRow = delta.start.row;\n var len = delta.end.row - firstRow;\n if (len === 0) {\n this.foldWidgets[firstRow] = null;\n }\n else if (delta.action == 'remove') {\n this.foldWidgets.splice(firstRow, len + 1, null);\n }\n else {\n var args = Array(len + 1);\n args.unshift(firstRow, 1);\n this.foldWidgets.splice.apply(this.foldWidgets, args);\n }\n };\n this.tokenizerUpdateFoldWidgets = function (e) {\n var rows = e.data;\n if (rows.first != rows.last) {\n if (this.foldWidgets.length > rows.first)\n this.foldWidgets.splice(rows.first, this.foldWidgets.length);\n }\n };\n}\nexports.Folding = Folding;\n\n});\n\nace.define(\"ace/edit_session/bracket_match\",[\"require\",\"exports\",\"module\",\"ace/token_iterator\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar TokenIterator = require(\"../token_iterator\").TokenIterator;\nvar Range = require(\"../range\").Range;\nfunction BracketMatch() {\n this.findMatchingBracket = function (position, chr) {\n if (position.column == 0)\n return null;\n var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column - 1);\n if (charBeforeCursor == \"\")\n return null;\n var match = charBeforeCursor.match(/([\\(\\[\\{])|([\\)\\]\\}])/);\n if (!match)\n return null;\n if (match[1])\n return this.$findClosingBracket(match[1], position);\n else\n return this.$findOpeningBracket(match[2], position);\n };\n this.getBracketRange = function (pos) {\n var line = this.getLine(pos.row);\n var before = true, range;\n var chr = line.charAt(pos.column - 1);\n var match = chr && chr.match(/([\\(\\[\\{])|([\\)\\]\\}])/);\n if (!match) {\n chr = line.charAt(pos.column);\n pos = { row: pos.row, column: pos.column + 1 };\n match = chr && chr.match(/([\\(\\[\\{])|([\\)\\]\\}])/);\n before = false;\n }\n if (!match)\n return null;\n if (match[1]) {\n var bracketPos = this.$findClosingBracket(match[1], pos);\n if (!bracketPos)\n return null;\n range = Range.fromPoints(pos, bracketPos);\n if (!before) {\n range.end.column++;\n range.start.column--;\n }\n range.cursor = range.end;\n }\n else {\n var bracketPos = this.$findOpeningBracket(match[2], pos);\n if (!bracketPos)\n return null;\n range = Range.fromPoints(bracketPos, pos);\n if (!before) {\n range.start.column++;\n range.end.column--;\n }\n range.cursor = range.start;\n }\n return range;\n };\n this.getMatchingBracketRanges = function (pos, isBackwards) {\n var line = this.getLine(pos.row);\n var bracketsRegExp = /([\\(\\[\\{])|([\\)\\]\\}])/;\n var chr = !isBackwards && line.charAt(pos.column - 1);\n var match = chr && chr.match(bracketsRegExp);\n if (!match) {\n chr = (isBackwards === undefined || isBackwards) && line.charAt(pos.column);\n pos = {\n row: pos.row,\n column: pos.column + 1\n };\n match = chr && chr.match(bracketsRegExp);\n }\n if (!match)\n return null;\n var startRange = new Range(pos.row, pos.column - 1, pos.row, pos.column);\n var bracketPos = match[1] ? this.$findClosingBracket(match[1], pos)\n : this.$findOpeningBracket(match[2], pos);\n if (!bracketPos)\n return [startRange];\n var endRange = new Range(bracketPos.row, bracketPos.column, bracketPos.row, bracketPos.column + 1);\n return [startRange, endRange];\n };\n this.$brackets = {\n \")\": \"(\",\n \"(\": \")\",\n \"]\": \"[\",\n \"[\": \"]\",\n \"{\": \"}\",\n \"}\": \"{\",\n \"<\": \">\",\n \">\": \"<\"\n };\n this.$findOpeningBracket = function (bracket, position, typeRe) {\n var openBracket = this.$brackets[bracket];\n var depth = 1;\n var iterator = new TokenIterator(this, position.row, position.column);\n var token = iterator.getCurrentToken();\n if (!token)\n token = iterator.stepForward();\n if (!token)\n return;\n if (!typeRe) {\n typeRe = new RegExp(\"(\\\\.?\" +\n token.type.replace(\".\", \"\\\\.\").replace(\"rparen\", \".paren\")\n .replace(/\\b(?:end)\\b/, \"(?:start|begin|end)\")\n .replace(/-close\\b/, \"-(close|open)\")\n + \")+\");\n }\n var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2;\n var value = token.value;\n while (true) {\n while (valueIndex >= 0) {\n var chr = value.charAt(valueIndex);\n if (chr == openBracket) {\n depth -= 1;\n if (depth == 0) {\n return { row: iterator.getCurrentTokenRow(),\n column: valueIndex + iterator.getCurrentTokenColumn() };\n }\n }\n else if (chr == bracket) {\n depth += 1;\n }\n valueIndex -= 1;\n }\n do {\n token = iterator.stepBackward();\n } while (token && !typeRe.test(token.type));\n if (token == null)\n break;\n value = token.value;\n valueIndex = value.length - 1;\n }\n return null;\n };\n this.$findClosingBracket = function (bracket, position, typeRe) {\n var closingBracket = this.$brackets[bracket];\n var depth = 1;\n var iterator = new TokenIterator(this, position.row, position.column);\n var token = iterator.getCurrentToken();\n if (!token)\n token = iterator.stepForward();\n if (!token)\n return;\n if (!typeRe) {\n typeRe = new RegExp(\"(\\\\.?\" +\n token.type.replace(\".\", \"\\\\.\").replace(\"lparen\", \".paren\")\n .replace(/\\b(?:start|begin)\\b/, \"(?:start|begin|end)\")\n .replace(/-open\\b/, \"-(close|open)\")\n + \")+\");\n }\n var valueIndex = position.column - iterator.getCurrentTokenColumn();\n while (true) {\n var value = token.value;\n var valueLength = value.length;\n while (valueIndex < valueLength) {\n var chr = value.charAt(valueIndex);\n if (chr == closingBracket) {\n depth -= 1;\n if (depth == 0) {\n return { row: iterator.getCurrentTokenRow(),\n column: valueIndex + iterator.getCurrentTokenColumn() };\n }\n }\n else if (chr == bracket) {\n depth += 1;\n }\n valueIndex += 1;\n }\n do {\n token = iterator.stepForward();\n } while (token && !typeRe.test(token.type));\n if (token == null)\n break;\n valueIndex = 0;\n }\n return null;\n };\n this.getMatchingTags = function (pos) {\n var iterator = new TokenIterator(this, pos.row, pos.column);\n var token = this.$findTagName(iterator);\n if (!token)\n return;\n var prevToken = iterator.stepBackward();\n if (prevToken.value === '<') {\n return this.$findClosingTag(iterator, token);\n }\n else {\n return this.$findOpeningTag(iterator, token);\n }\n };\n this.$findTagName = function (iterator) {\n var token = iterator.getCurrentToken();\n var found = false;\n var backward = false;\n if (token && token.type.indexOf('tag-name') === -1) {\n do {\n if (backward)\n token = iterator.stepBackward();\n else\n token = iterator.stepForward();\n if (token) {\n if (token.value === \"/>\") {\n backward = true;\n }\n else if (token.type.indexOf('tag-name') !== -1) {\n found = true;\n }\n }\n } while (token && !found);\n }\n return token;\n };\n this.$findClosingTag = function (iterator, token) {\n var prevToken;\n var currentTag = token.value;\n var tag = token.value;\n var depth = 0;\n var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);\n token = iterator.stepForward();\n var openTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);\n var foundOpenTagEnd = false;\n do {\n prevToken = token;\n token = iterator.stepForward();\n if (token) {\n if (token.value === '>' && !foundOpenTagEnd) {\n var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for `>`\n foundOpenTagEnd = true;\n }\n if (token.type.indexOf('tag-name') !== -1) {\n currentTag = token.value;\n if (tag === currentTag) {\n if (prevToken.value === '<') {\n depth++;\n }\n else if (prevToken.value === '') {\n depth--;\n if (depth < 0) { //found closing tag\n iterator.stepBackward();\n var closeTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2); //Range for \n token = iterator.stepForward();\n var closeTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);\n token = iterator.stepForward();\n if (token && token.value === '>') {\n var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >\n }\n else {\n return;\n }\n }\n }\n }\n }\n else if (tag === currentTag && token.value === '/>') { // self-closing tag\n depth--;\n if (depth < 0) { //found self-closing tag end\n var closeTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2);\n var closeTagName = closeTagStart;\n var closeTagEnd = closeTagName;\n var openTagEnd = new Range(openTagName.end.row, openTagName.end.column, openTagName.end.row, openTagName.end.column + 1);\n }\n }\n }\n } while (token && depth >= 0);\n if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {\n return {\n openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),\n closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),\n openTagName: openTagName,\n closeTagName: closeTagName\n };\n }\n };\n this.$findOpeningTag = function (iterator, token) {\n var prevToken = iterator.getCurrentToken();\n var tag = token.value;\n var depth = 0;\n var startRow = iterator.getCurrentTokenRow();\n var startColumn = iterator.getCurrentTokenColumn();\n var endColumn = startColumn + 2;\n var closeTagStart = new Range(startRow, startColumn, startRow, endColumn); //Range for \n iterator.stepForward();\n var closeTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);\n token = iterator.stepForward();\n if (!token || token.value !== \">\")\n return;\n var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >\n iterator.stepBackward();\n iterator.stepBackward();\n do {\n token = prevToken;\n startRow = iterator.getCurrentTokenRow();\n startColumn = iterator.getCurrentTokenColumn();\n endColumn = startColumn + token.value.length;\n prevToken = iterator.stepBackward();\n if (token) {\n if (token.type.indexOf('tag-name') !== -1) {\n if (tag === token.value) {\n if (prevToken.value === '<') {\n depth++;\n if (depth > 0) { //found opening tag\n var openTagName = new Range(startRow, startColumn, startRow, endColumn);\n var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for <\n do {\n token = iterator.stepForward();\n } while (token && token.value !== '>');\n var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >\n }\n }\n else if (prevToken.value === '') {\n depth--;\n }\n }\n }\n else if (token.value === '/>') { // self-closing tag\n var stepCount = 0;\n var tmpToken = prevToken;\n while (tmpToken) {\n if (tmpToken.type.indexOf('tag-name') !== -1 && tmpToken.value === tag) {\n depth--;\n break;\n }\n else if (tmpToken.value === '<') {\n break;\n }\n tmpToken = iterator.stepBackward();\n stepCount++;\n }\n for (var i = 0; i < stepCount; i++) {\n iterator.stepForward();\n }\n }\n }\n } while (prevToken && depth <= 0);\n if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {\n return {\n openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),\n closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),\n openTagName: openTagName,\n closeTagName: closeTagName\n };\n }\n };\n}\nexports.BracketMatch = BracketMatch;\n\n});\n\nace.define(\"ace/edit_session\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/bidihandler\",\"ace/config\",\"ace/lib/event_emitter\",\"ace/selection\",\"ace/mode/text\",\"ace/range\",\"ace/document\",\"ace/background_tokenizer\",\"ace/search_highlight\",\"ace/edit_session/folding\",\"ace/edit_session/bracket_match\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar lang = require(\"./lib/lang\");\nvar BidiHandler = require(\"./bidihandler\").BidiHandler;\nvar config = require(\"./config\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Selection = require(\"./selection\").Selection;\nvar TextMode = require(\"./mode/text\").Mode;\nvar Range = require(\"./range\").Range;\nvar Document = require(\"./document\").Document;\nvar BackgroundTokenizer = require(\"./background_tokenizer\").BackgroundTokenizer;\nvar SearchHighlight = require(\"./search_highlight\").SearchHighlight;\nvar EditSession = /** @class */ (function () {\n function EditSession(text, mode) {\n this.$breakpoints = [];\n this.$decorations = [];\n this.$frontMarkers = {};\n this.$backMarkers = {};\n this.$markerId = 1;\n this.$undoSelect = true;\n this.$foldData = [];\n this.id = \"session\" + (++EditSession.$uid);\n this.$foldData.toString = function () {\n return this.join(\"\\n\");\n };\n this.bgTokenizer = new BackgroundTokenizer((new TextMode()).getTokenizer(), this);\n var _self = this;\n this.bgTokenizer.on(\"update\", function (e) {\n _self._signal(\"tokenizerUpdate\", e);\n });\n this.on(\"changeFold\", this.onChangeFold.bind(this));\n this.$onChange = this.onChange.bind(this);\n if (typeof text != \"object\" || !text.getLine)\n text = new Document(text);\n this.setDocument(text);\n this.selection = new Selection(this);\n this.$bidiHandler = new BidiHandler(this);\n config.resetOptions(this);\n this.setMode(mode);\n config._signal(\"session\", this);\n this.destroyed = false;\n }\n EditSession.prototype.setDocument = function (doc) {\n if (this.doc)\n this.doc.off(\"change\", this.$onChange);\n this.doc = doc;\n doc.on(\"change\", this.$onChange, true);\n this.bgTokenizer.setDocument(this.getDocument());\n this.resetCaches();\n };\n EditSession.prototype.getDocument = function () {\n return this.doc;\n };\n EditSession.prototype.$resetRowCache = function (docRow) {\n if (!docRow) {\n this.$docRowCache = [];\n this.$screenRowCache = [];\n return;\n }\n var l = this.$docRowCache.length;\n var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;\n if (l > i) {\n this.$docRowCache.splice(i, l);\n this.$screenRowCache.splice(i, l);\n }\n };\n EditSession.prototype.$getRowCacheIndex = function (cacheArray, val) {\n var low = 0;\n var hi = cacheArray.length - 1;\n while (low <= hi) {\n var mid = (low + hi) >> 1;\n var c = cacheArray[mid];\n if (val > c)\n low = mid + 1;\n else if (val < c)\n hi = mid - 1;\n else\n return mid;\n }\n return low - 1;\n };\n EditSession.prototype.resetCaches = function () {\n this.$modified = true;\n this.$wrapData = [];\n this.$rowLengthCache = [];\n this.$resetRowCache(0);\n if (!this.destroyed)\n this.bgTokenizer.start(0);\n };\n EditSession.prototype.onChangeFold = function (e) {\n var fold = e.data;\n this.$resetRowCache(fold.start.row);\n };\n EditSession.prototype.onChange = function (delta) {\n this.$modified = true;\n this.$bidiHandler.onChange(delta);\n this.$resetRowCache(delta.start.row);\n var removedFolds = this.$updateInternalDataOnChange(delta);\n if (!this.$fromUndo && this.$undoManager) {\n if (removedFolds && removedFolds.length) {\n this.$undoManager.add({\n action: \"removeFolds\",\n folds: removedFolds\n }, this.mergeUndoDeltas);\n this.mergeUndoDeltas = true;\n }\n this.$undoManager.add(delta, this.mergeUndoDeltas);\n this.mergeUndoDeltas = true;\n this.$informUndoManager.schedule();\n }\n this.bgTokenizer.$updateOnChange(delta);\n this._signal(\"change\", delta);\n };\n EditSession.prototype.setValue = function (text) {\n this.doc.setValue(text);\n this.selection.moveTo(0, 0);\n this.$resetRowCache(0);\n this.setUndoManager(this.$undoManager);\n this.getUndoManager().reset();\n };\n EditSession.prototype.toString = function () {\n return this.doc.getValue();\n };\n EditSession.prototype.getSelection = function () {\n return this.selection;\n };\n EditSession.prototype.getState = function (row) {\n return this.bgTokenizer.getState(row);\n };\n EditSession.prototype.getTokens = function (row) {\n return this.bgTokenizer.getTokens(row);\n };\n EditSession.prototype.getTokenAt = function (row, column) {\n var tokens = this.bgTokenizer.getTokens(row);\n var token, c = 0;\n if (column == null) {\n var i = tokens.length - 1;\n c = this.getLine(row).length;\n }\n else {\n for (var i = 0; i < tokens.length; i++) {\n c += tokens[i].value.length;\n if (c >= column)\n break;\n }\n }\n token = tokens[i];\n if (!token)\n return null;\n token.index = i;\n token.start = c - token.value.length;\n return token;\n };\n EditSession.prototype.setUndoManager = function (undoManager) {\n this.$undoManager = undoManager;\n if (this.$informUndoManager)\n this.$informUndoManager.cancel();\n if (undoManager) {\n var self = this;\n undoManager.addSession(this);\n this.$syncInformUndoManager = function () {\n self.$informUndoManager.cancel();\n self.mergeUndoDeltas = false;\n };\n this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);\n }\n else {\n this.$syncInformUndoManager = function () { };\n }\n };\n EditSession.prototype.markUndoGroup = function () {\n if (this.$syncInformUndoManager)\n this.$syncInformUndoManager();\n };\n EditSession.prototype.getUndoManager = function () {\n return this.$undoManager || this.$defaultUndoManager;\n };\n EditSession.prototype.getTabString = function () {\n if (this.getUseSoftTabs()) {\n return lang.stringRepeat(\" \", this.getTabSize());\n }\n else {\n return \"\\t\";\n }\n };\n EditSession.prototype.setUseSoftTabs = function (val) {\n this.setOption(\"useSoftTabs\", val);\n };\n EditSession.prototype.getUseSoftTabs = function () {\n return this.$useSoftTabs && !this.$mode.$indentWithTabs;\n };\n EditSession.prototype.setTabSize = function (tabSize) {\n this.setOption(\"tabSize\", tabSize);\n };\n EditSession.prototype.getTabSize = function () {\n return this.$tabSize;\n };\n EditSession.prototype.isTabStop = function (position) {\n return this.$useSoftTabs && (position.column % this.$tabSize === 0);\n };\n EditSession.prototype.setNavigateWithinSoftTabs = function (navigateWithinSoftTabs) {\n this.setOption(\"navigateWithinSoftTabs\", navigateWithinSoftTabs);\n };\n EditSession.prototype.getNavigateWithinSoftTabs = function () {\n return this.$navigateWithinSoftTabs;\n };\n EditSession.prototype.setOverwrite = function (overwrite) {\n this.setOption(\"overwrite\", overwrite);\n };\n EditSession.prototype.getOverwrite = function () {\n return this.$overwrite;\n };\n EditSession.prototype.toggleOverwrite = function () {\n this.setOverwrite(!this.$overwrite);\n };\n EditSession.prototype.addGutterDecoration = function (row, className) {\n if (!this.$decorations[row])\n this.$decorations[row] = \"\";\n this.$decorations[row] += \" \" + className;\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.removeGutterDecoration = function (row, className) {\n this.$decorations[row] = (this.$decorations[row] || \"\").replace(\" \" + className, \"\");\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.getBreakpoints = function () {\n return this.$breakpoints;\n };\n EditSession.prototype.setBreakpoints = function (rows) {\n this.$breakpoints = [];\n for (var i = 0; i < rows.length; i++) {\n this.$breakpoints[rows[i]] = \"ace_breakpoint\";\n }\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.clearBreakpoints = function () {\n this.$breakpoints = [];\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.setBreakpoint = function (row, className) {\n if (className === undefined)\n className = \"ace_breakpoint\";\n if (className)\n this.$breakpoints[row] = className;\n else\n delete this.$breakpoints[row];\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.clearBreakpoint = function (row) {\n delete this.$breakpoints[row];\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.addMarker = function (range, clazz, type, inFront) {\n var id = this.$markerId++;\n var marker = {\n range: range,\n type: type || \"line\",\n renderer: typeof type == \"function\" ? type : null,\n clazz: clazz,\n inFront: !!inFront,\n id: id\n };\n if (inFront) {\n this.$frontMarkers[id] = marker;\n this._signal(\"changeFrontMarker\");\n }\n else {\n this.$backMarkers[id] = marker;\n this._signal(\"changeBackMarker\");\n }\n return id;\n };\n EditSession.prototype.addDynamicMarker = function (marker, inFront) {\n if (!marker.update)\n return;\n var id = this.$markerId++;\n marker.id = id;\n marker.inFront = !!inFront;\n if (inFront) {\n this.$frontMarkers[id] = marker;\n this._signal(\"changeFrontMarker\");\n }\n else {\n this.$backMarkers[id] = marker;\n this._signal(\"changeBackMarker\");\n }\n return marker;\n };\n EditSession.prototype.removeMarker = function (markerId) {\n var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId];\n if (!marker)\n return;\n var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;\n delete (markers[markerId]);\n this._signal(marker.inFront ? \"changeFrontMarker\" : \"changeBackMarker\");\n };\n EditSession.prototype.getMarkers = function (inFront) {\n return inFront ? this.$frontMarkers : this.$backMarkers;\n };\n EditSession.prototype.highlight = function (re) {\n if (!this.$searchHighlight) {\n var highlight = new SearchHighlight(null, \"ace_selected-word\", \"text\");\n this.$searchHighlight = this.addDynamicMarker(highlight);\n }\n this.$searchHighlight.setRegexp(re);\n };\n EditSession.prototype.highlightLines = function (startRow, endRow, clazz, inFront) {\n if (typeof endRow != \"number\") {\n clazz = endRow;\n endRow = startRow;\n }\n if (!clazz)\n clazz = \"ace_step\";\n var range = new Range(startRow, 0, endRow, Infinity);\n range.id = this.addMarker(range, clazz, \"fullLine\", inFront);\n return range;\n };\n EditSession.prototype.setAnnotations = function (annotations) {\n this.$annotations = annotations;\n this._signal(\"changeAnnotation\", {});\n };\n EditSession.prototype.getAnnotations = function () {\n return this.$annotations || [];\n };\n EditSession.prototype.clearAnnotations = function () {\n this.setAnnotations([]);\n };\n EditSession.prototype.$detectNewLine = function (text) {\n var match = text.match(/^.*?(\\r?\\n)/m);\n if (match) {\n this.$autoNewLine = match[1];\n }\n else {\n this.$autoNewLine = \"\\n\";\n }\n };\n EditSession.prototype.getWordRange = function (row, column) {\n var line = this.getLine(row);\n var inToken = false;\n if (column > 0)\n inToken = !!line.charAt(column - 1).match(this.tokenRe);\n if (!inToken)\n inToken = !!line.charAt(column).match(this.tokenRe);\n if (inToken)\n var re = this.tokenRe;\n else if (/^\\s+$/.test(line.slice(column - 1, column + 1)))\n var re = /\\s/;\n else\n var re = this.nonTokenRe;\n var start = column;\n if (start > 0) {\n do {\n start--;\n } while (start >= 0 && line.charAt(start).match(re));\n start++;\n }\n var end = column;\n while (end < line.length && line.charAt(end).match(re)) {\n end++;\n }\n return new Range(row, start, row, end);\n };\n EditSession.prototype.getAWordRange = function (row, column) {\n var wordRange = this.getWordRange(row, column);\n var line = this.getLine(wordRange.end.row);\n while (line.charAt(wordRange.end.column).match(/[ \\t]/)) {\n wordRange.end.column += 1;\n }\n return wordRange;\n };\n EditSession.prototype.setNewLineMode = function (newLineMode) {\n this.doc.setNewLineMode(newLineMode);\n };\n EditSession.prototype.getNewLineMode = function () {\n return this.doc.getNewLineMode();\n };\n EditSession.prototype.setUseWorker = function (useWorker) { this.setOption(\"useWorker\", useWorker); };\n EditSession.prototype.getUseWorker = function () { return this.$useWorker; };\n EditSession.prototype.onReloadTokenizer = function (e) {\n var rows = e.data;\n this.bgTokenizer.start(rows.first);\n this._signal(\"tokenizerUpdate\", e);\n };\n EditSession.prototype.setMode = function (mode, cb) {\n if (mode && typeof mode === \"object\") {\n if (mode.getTokenizer)\n return this.$onChangeMode(mode);\n var options = mode;\n var path = options.path;\n }\n else {\n path = mode || \"ace/mode/text\";\n }\n if (!this.$modes[\"ace/mode/text\"])\n this.$modes[\"ace/mode/text\"] = new TextMode();\n if (this.$modes[path] && !options) {\n this.$onChangeMode(this.$modes[path]);\n cb && cb();\n return;\n }\n this.$modeId = path;\n config.loadModule([\"mode\", path], function (m) {\n if (this.$modeId !== path)\n return cb && cb();\n if (this.$modes[path] && !options) {\n this.$onChangeMode(this.$modes[path]);\n }\n else if (m && m.Mode) {\n m = new m.Mode(options);\n if (!options) {\n this.$modes[path] = m;\n m.$id = path;\n }\n this.$onChangeMode(m);\n }\n cb && cb();\n }.bind(this));\n if (!this.$mode)\n this.$onChangeMode(this.$modes[\"ace/mode/text\"], true);\n };\n EditSession.prototype.$onChangeMode = function (mode, $isPlaceholder) {\n if (!$isPlaceholder)\n this.$modeId = mode.$id;\n if (this.$mode === mode)\n return;\n var oldMode = this.$mode;\n this.$mode = mode;\n this.$stopWorker();\n if (this.$useWorker)\n this.$startWorker();\n var tokenizer = mode.getTokenizer();\n if (tokenizer.on !== undefined) {\n var onReloadTokenizer = this.onReloadTokenizer.bind(this);\n tokenizer.on(\"update\", onReloadTokenizer);\n }\n this.bgTokenizer.setTokenizer(tokenizer);\n this.bgTokenizer.setDocument(this.getDocument());\n this.tokenRe = mode.tokenRe;\n this.nonTokenRe = mode.nonTokenRe;\n if (!$isPlaceholder) {\n if (mode.attachToSession)\n mode.attachToSession(this);\n this.$options.wrapMethod.set.call(this, this.$wrapMethod);\n this.$setFolding(mode.foldingRules);\n this.bgTokenizer.start(0);\n this._emit(\"changeMode\", { oldMode: oldMode, mode: mode });\n }\n };\n EditSession.prototype.$stopWorker = function () {\n if (this.$worker) {\n this.$worker.terminate();\n this.$worker = null;\n }\n };\n EditSession.prototype.$startWorker = function () {\n try {\n this.$worker = this.$mode.createWorker(this);\n }\n catch (e) {\n config.warn(\"Could not load worker\", e);\n this.$worker = null;\n }\n };\n EditSession.prototype.getMode = function () {\n return this.$mode;\n };\n EditSession.prototype.setScrollTop = function (scrollTop) {\n if (this.$scrollTop === scrollTop || isNaN(scrollTop))\n return;\n this.$scrollTop = scrollTop;\n this._signal(\"changeScrollTop\", scrollTop);\n };\n EditSession.prototype.getScrollTop = function () {\n return this.$scrollTop;\n };\n EditSession.prototype.setScrollLeft = function (scrollLeft) {\n if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft))\n return;\n this.$scrollLeft = scrollLeft;\n this._signal(\"changeScrollLeft\", scrollLeft);\n };\n EditSession.prototype.getScrollLeft = function () {\n return this.$scrollLeft;\n };\n EditSession.prototype.getScreenWidth = function () {\n this.$computeWidth();\n if (this.lineWidgets)\n return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth);\n return this.screenWidth;\n };\n EditSession.prototype.getLineWidgetMaxWidth = function () {\n if (this.lineWidgetsWidth != null)\n return this.lineWidgetsWidth;\n var width = 0;\n this.lineWidgets.forEach(function (w) {\n if (w && w.screenWidth > width)\n width = w.screenWidth;\n });\n return this.lineWidgetWidth = width;\n };\n EditSession.prototype.$computeWidth = function (force) {\n if (this.$modified || force) {\n this.$modified = false;\n if (this.$useWrapMode)\n return this.screenWidth = this.$wrapLimit;\n var lines = this.doc.getAllLines();\n var cache = this.$rowLengthCache;\n var longestScreenLine = 0;\n var foldIndex = 0;\n var foldLine = this.$foldData[foldIndex];\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n var len = lines.length;\n for (var i = 0; i < len; i++) {\n if (i > foldStart) {\n i = foldLine.end.row + 1;\n if (i >= len)\n break;\n foldLine = this.$foldData[foldIndex++];\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (cache[i] == null)\n cache[i] = this.$getStringScreenWidth(lines[i])[0];\n if (cache[i] > longestScreenLine)\n longestScreenLine = cache[i];\n }\n this.screenWidth = longestScreenLine;\n }\n };\n EditSession.prototype.getLine = function (row) {\n return this.doc.getLine(row);\n };\n EditSession.prototype.getLines = function (firstRow, lastRow) {\n return this.doc.getLines(firstRow, lastRow);\n };\n EditSession.prototype.getLength = function () {\n return this.doc.getLength();\n };\n EditSession.prototype.getTextRange = function (range) {\n return this.doc.getTextRange(range || this.selection.getRange());\n };\n EditSession.prototype.insert = function (position, text) {\n return this.doc.insert(position, text);\n };\n EditSession.prototype.remove = function (range) {\n return this.doc.remove(range);\n };\n EditSession.prototype.removeFullLines = function (firstRow, lastRow) {\n return this.doc.removeFullLines(firstRow, lastRow);\n };\n EditSession.prototype.undoChanges = function (deltas, dontSelect) {\n if (!deltas.length)\n return;\n this.$fromUndo = true;\n for (var i = deltas.length - 1; i != -1; i--) {\n var delta = deltas[i];\n if (delta.action == \"insert\" || delta.action == \"remove\") {\n this.doc.revertDelta(delta);\n }\n else if (delta.folds) {\n this.addFolds(delta.folds);\n }\n }\n if (!dontSelect && this.$undoSelect) {\n if (deltas.selectionBefore)\n this.selection.fromJSON(deltas.selectionBefore);\n else\n this.selection.setRange(this.$getUndoSelection(deltas, true));\n }\n this.$fromUndo = false;\n };\n EditSession.prototype.redoChanges = function (deltas, dontSelect) {\n if (!deltas.length)\n return;\n this.$fromUndo = true;\n for (var i = 0; i < deltas.length; i++) {\n var delta = deltas[i];\n if (delta.action == \"insert\" || delta.action == \"remove\") {\n this.doc.$safeApplyDelta(delta);\n }\n }\n if (!dontSelect && this.$undoSelect) {\n if (deltas.selectionAfter)\n this.selection.fromJSON(deltas.selectionAfter);\n else\n this.selection.setRange(this.$getUndoSelection(deltas, false));\n }\n this.$fromUndo = false;\n };\n EditSession.prototype.setUndoSelect = function (enable) {\n this.$undoSelect = enable;\n };\n EditSession.prototype.$getUndoSelection = function (deltas, isUndo) {\n function isInsert(delta) {\n return isUndo ? delta.action !== \"insert\" : delta.action === \"insert\";\n }\n var range, point;\n for (var i = 0; i < deltas.length; i++) {\n var delta = deltas[i];\n if (!delta.start)\n continue; // skip folds\n if (!range) {\n if (isInsert(delta)) {\n range = Range.fromPoints(delta.start, delta.end);\n }\n else {\n range = Range.fromPoints(delta.start, delta.start);\n }\n continue;\n }\n if (isInsert(delta)) {\n point = delta.start;\n if (range.compare(point.row, point.column) == -1) {\n range.setStart(point);\n }\n point = delta.end;\n if (range.compare(point.row, point.column) == 1) {\n range.setEnd(point);\n }\n }\n else {\n point = delta.start;\n if (range.compare(point.row, point.column) == -1) {\n range = Range.fromPoints(delta.start, delta.start);\n }\n }\n }\n return range;\n };\n EditSession.prototype.replace = function (range, text) {\n return this.doc.replace(range, text);\n };\n EditSession.prototype.moveText = function (fromRange, toPosition, copy) {\n var text = this.getTextRange(fromRange);\n var folds = this.getFoldsInRange(fromRange);\n var toRange = Range.fromPoints(toPosition, toPosition);\n if (!copy) {\n this.remove(fromRange);\n var rowDiff = fromRange.start.row - fromRange.end.row;\n var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column;\n if (collDiff) {\n if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column)\n toRange.start.column += collDiff;\n if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column)\n toRange.end.column += collDiff;\n }\n if (rowDiff && toRange.start.row >= fromRange.end.row) {\n toRange.start.row += rowDiff;\n toRange.end.row += rowDiff;\n }\n }\n toRange.end = this.insert(toRange.start, text);\n if (folds.length) {\n var oldStart = fromRange.start;\n var newStart = toRange.start;\n var rowDiff = newStart.row - oldStart.row;\n var collDiff = newStart.column - oldStart.column;\n this.addFolds(folds.map(function (x) {\n x = x.clone();\n if (x.start.row == oldStart.row)\n x.start.column += collDiff;\n if (x.end.row == oldStart.row)\n x.end.column += collDiff;\n x.start.row += rowDiff;\n x.end.row += rowDiff;\n return x;\n }));\n }\n return toRange;\n };\n EditSession.prototype.indentRows = function (startRow, endRow, indentString) {\n indentString = indentString.replace(/\\t/g, this.getTabString());\n for (var row = startRow; row <= endRow; row++)\n this.doc.insertInLine({ row: row, column: 0 }, indentString);\n };\n EditSession.prototype.outdentRows = function (range) {\n var rowRange = range.collapseRows();\n var deleteRange = new Range(0, 0, 0, 0);\n var size = this.getTabSize();\n for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) {\n var line = this.getLine(i);\n deleteRange.start.row = i;\n deleteRange.end.row = i;\n for (var j = 0; j < size; ++j)\n if (line.charAt(j) != ' ')\n break;\n if (j < size && line.charAt(j) == '\\t') {\n deleteRange.start.column = j;\n deleteRange.end.column = j + 1;\n }\n else {\n deleteRange.start.column = 0;\n deleteRange.end.column = j;\n }\n this.remove(deleteRange);\n }\n };\n EditSession.prototype.$moveLines = function (firstRow, lastRow, dir) {\n firstRow = this.getRowFoldStart(firstRow);\n lastRow = this.getRowFoldEnd(lastRow);\n if (dir < 0) {\n var row = this.getRowFoldStart(firstRow + dir);\n if (row < 0)\n return 0;\n var diff = row - firstRow;\n }\n else if (dir > 0) {\n var row = this.getRowFoldEnd(lastRow + dir);\n if (row > this.doc.getLength() - 1)\n return 0;\n var diff = row - lastRow;\n }\n else {\n firstRow = this.$clipRowToDocument(firstRow);\n lastRow = this.$clipRowToDocument(lastRow);\n var diff = lastRow - firstRow + 1;\n }\n var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE);\n var folds = this.getFoldsInRange(range).map(function (x) {\n x = x.clone();\n x.start.row += diff;\n x.end.row += diff;\n return x;\n });\n var lines = dir == 0\n ? this.doc.getLines(firstRow, lastRow)\n : this.doc.removeFullLines(firstRow, lastRow);\n this.doc.insertFullLines(firstRow + diff, lines);\n folds.length && this.addFolds(folds);\n return diff;\n };\n EditSession.prototype.moveLinesUp = function (firstRow, lastRow) {\n return this.$moveLines(firstRow, lastRow, -1);\n };\n EditSession.prototype.moveLinesDown = function (firstRow, lastRow) {\n return this.$moveLines(firstRow, lastRow, 1);\n };\n EditSession.prototype.duplicateLines = function (firstRow, lastRow) {\n return this.$moveLines(firstRow, lastRow, 0);\n };\n EditSession.prototype.$clipRowToDocument = function (row) {\n return Math.max(0, Math.min(row, this.doc.getLength() - 1));\n };\n EditSession.prototype.$clipColumnToRow = function (row, column) {\n if (column < 0)\n return 0;\n return Math.min(this.doc.getLine(row).length, column);\n };\n EditSession.prototype.$clipPositionToDocument = function (row, column) {\n column = Math.max(0, column);\n if (row < 0) {\n row = 0;\n column = 0;\n }\n else {\n var len = this.doc.getLength();\n if (row >= len) {\n row = len - 1;\n column = this.doc.getLine(len - 1).length;\n }\n else {\n column = Math.min(this.doc.getLine(row).length, column);\n }\n }\n return {\n row: row,\n column: column\n };\n };\n EditSession.prototype.$clipRangeToDocument = function (range) {\n if (range.start.row < 0) {\n range.start.row = 0;\n range.start.column = 0;\n }\n else {\n range.start.column = this.$clipColumnToRow(range.start.row, range.start.column);\n }\n var len = this.doc.getLength() - 1;\n if (range.end.row > len) {\n range.end.row = len;\n range.end.column = this.doc.getLine(len).length;\n }\n else {\n range.end.column = this.$clipColumnToRow(range.end.row, range.end.column);\n }\n return range;\n };\n EditSession.prototype.setUseWrapMode = function (useWrapMode) {\n if (useWrapMode != this.$useWrapMode) {\n this.$useWrapMode = useWrapMode;\n this.$modified = true;\n this.$resetRowCache(0);\n if (useWrapMode) {\n var len = this.getLength();\n this.$wrapData = Array(len);\n this.$updateWrapData(0, len - 1);\n }\n this._signal(\"changeWrapMode\");\n }\n };\n EditSession.prototype.getUseWrapMode = function () {\n return this.$useWrapMode;\n };\n EditSession.prototype.setWrapLimitRange = function (min, max) {\n if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) {\n this.$wrapLimitRange = { min: min, max: max };\n this.$modified = true;\n this.$bidiHandler.markAsDirty();\n if (this.$useWrapMode)\n this._signal(\"changeWrapMode\");\n }\n };\n EditSession.prototype.adjustWrapLimit = function (desiredLimit, $printMargin) {\n var limits = this.$wrapLimitRange;\n if (limits.max < 0)\n limits = { min: $printMargin, max: $printMargin };\n var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max);\n if (wrapLimit != this.$wrapLimit && wrapLimit > 1) {\n this.$wrapLimit = wrapLimit;\n this.$modified = true;\n if (this.$useWrapMode) {\n this.$updateWrapData(0, this.getLength() - 1);\n this.$resetRowCache(0);\n this._signal(\"changeWrapLimit\");\n }\n return true;\n }\n return false;\n };\n EditSession.prototype.$constrainWrapLimit = function (wrapLimit, min, max) {\n if (min)\n wrapLimit = Math.max(min, wrapLimit);\n if (max)\n wrapLimit = Math.min(max, wrapLimit);\n return wrapLimit;\n };\n EditSession.prototype.getWrapLimit = function () {\n return this.$wrapLimit;\n };\n EditSession.prototype.setWrapLimit = function (limit) {\n this.setWrapLimitRange(limit, limit);\n };\n EditSession.prototype.getWrapLimitRange = function () {\n return {\n min: this.$wrapLimitRange.min,\n max: this.$wrapLimitRange.max\n };\n };\n EditSession.prototype.$updateInternalDataOnChange = function (delta) {\n var useWrapMode = this.$useWrapMode;\n var action = delta.action;\n var start = delta.start;\n var end = delta.end;\n var firstRow = start.row;\n var lastRow = end.row;\n var len = lastRow - firstRow;\n var removedFolds = null;\n this.$updating = true;\n if (len != 0) {\n if (action === \"remove\") {\n this[useWrapMode ? \"$wrapData\" : \"$rowLengthCache\"].splice(firstRow, len);\n var foldLines = this.$foldData;\n removedFolds = this.getFoldsInRange(delta);\n this.removeFolds(removedFolds);\n var foldLine = this.getFoldLine(end.row);\n var idx = 0;\n if (foldLine) {\n foldLine.addRemoveChars(end.row, end.column, start.column - end.column);\n foldLine.shiftRow(-len);\n var foldLineBefore = this.getFoldLine(firstRow);\n if (foldLineBefore && foldLineBefore !== foldLine) {\n foldLineBefore.merge(foldLine);\n foldLine = foldLineBefore;\n }\n idx = foldLines.indexOf(foldLine) + 1;\n }\n for (idx; idx < foldLines.length; idx++) {\n var foldLine = foldLines[idx];\n if (foldLine.start.row >= end.row) {\n foldLine.shiftRow(-len);\n }\n }\n lastRow = firstRow;\n }\n else {\n var args = Array(len);\n args.unshift(firstRow, 0);\n var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache;\n arr.splice.apply(arr, args);\n var foldLines = this.$foldData;\n var foldLine = this.getFoldLine(firstRow);\n var idx = 0;\n if (foldLine) {\n var cmp = foldLine.range.compareInside(start.row, start.column);\n if (cmp == 0) {\n foldLine = foldLine.split(start.row, start.column);\n if (foldLine) {\n foldLine.shiftRow(len);\n foldLine.addRemoveChars(lastRow, 0, end.column - start.column);\n }\n }\n else \n if (cmp == -1) {\n foldLine.addRemoveChars(firstRow, 0, end.column - start.column);\n foldLine.shiftRow(len);\n }\n idx = foldLines.indexOf(foldLine) + 1;\n }\n for (idx; idx < foldLines.length; idx++) {\n var foldLine = foldLines[idx];\n if (foldLine.start.row >= firstRow) {\n foldLine.shiftRow(len);\n }\n }\n }\n }\n else {\n len = Math.abs(delta.start.column - delta.end.column);\n if (action === \"remove\") {\n removedFolds = this.getFoldsInRange(delta);\n this.removeFolds(removedFolds);\n len = -len;\n }\n var foldLine = this.getFoldLine(firstRow);\n if (foldLine) {\n foldLine.addRemoveChars(firstRow, start.column, len);\n }\n }\n if (useWrapMode && this.$wrapData.length != this.doc.getLength()) {\n console.error(\"doc.getLength() and $wrapData.length have to be the same!\");\n }\n this.$updating = false;\n if (useWrapMode)\n this.$updateWrapData(firstRow, lastRow);\n else\n this.$updateRowLengthCache(firstRow, lastRow);\n return removedFolds;\n };\n EditSession.prototype.$updateRowLengthCache = function (firstRow, lastRow, b) {\n this.$rowLengthCache[firstRow] = null;\n this.$rowLengthCache[lastRow] = null;\n };\n EditSession.prototype.$updateWrapData = function (firstRow, lastRow) {\n var lines = this.doc.getAllLines();\n var tabSize = this.getTabSize();\n var wrapData = this.$wrapData;\n var wrapLimit = this.$wrapLimit;\n var tokens;\n var foldLine;\n var row = firstRow;\n lastRow = Math.min(lastRow, lines.length - 1);\n while (row <= lastRow) {\n foldLine = this.getFoldLine(row, foldLine);\n if (!foldLine) {\n tokens = this.$getDisplayTokens(lines[row]);\n wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);\n row++;\n }\n else {\n tokens = [];\n foldLine.walk(function (placeholder, row, column, lastColumn) {\n var walkTokens;\n if (placeholder != null) {\n walkTokens = this.$getDisplayTokens(placeholder, tokens.length);\n walkTokens[0] = PLACEHOLDER_START;\n for (var i = 1; i < walkTokens.length; i++) {\n walkTokens[i] = PLACEHOLDER_BODY;\n }\n }\n else {\n walkTokens = this.$getDisplayTokens(lines[row].substring(lastColumn, column), tokens.length);\n }\n tokens = tokens.concat(walkTokens);\n }.bind(this), foldLine.end.row, lines[foldLine.end.row].length + 1);\n wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);\n row = foldLine.end.row + 1;\n }\n }\n };\n EditSession.prototype.$computeWrapSplits = function (tokens, wrapLimit, tabSize) {\n if (tokens.length == 0) {\n return [];\n }\n var splits = [];\n var displayLength = tokens.length;\n var lastSplit = 0, lastDocSplit = 0;\n var isCode = this.$wrapAsCode;\n var indentedSoftWrap = this.$indentedSoftWrap;\n var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8)\n || indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2);\n function getWrapIndent() {\n var indentation = 0;\n if (maxIndent === 0)\n return indentation;\n if (indentedSoftWrap) {\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (token == SPACE)\n indentation += 1;\n else if (token == TAB)\n indentation += tabSize;\n else if (token == TAB_SPACE)\n continue;\n else\n break;\n }\n }\n if (isCode && indentedSoftWrap !== false)\n indentation += tabSize;\n return Math.min(indentation, maxIndent);\n }\n function addSplit(screenPos) {\n var len = screenPos - lastSplit;\n for (var i = lastSplit; i < screenPos; i++) {\n var ch = tokens[i];\n if (ch === 12 || ch === 2)\n len -= 1;\n }\n if (!splits.length) {\n indent = getWrapIndent();\n splits.indent = indent;\n }\n lastDocSplit += len;\n splits.push(lastDocSplit);\n lastSplit = screenPos;\n }\n var indent = 0;\n while (displayLength - lastSplit > wrapLimit - indent) {\n var split = lastSplit + wrapLimit - indent;\n if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) {\n addSplit(split);\n continue;\n }\n if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) {\n for (split; split != lastSplit - 1; split--) {\n if (tokens[split] == PLACEHOLDER_START) {\n break;\n }\n }\n if (split > lastSplit) {\n addSplit(split);\n continue;\n }\n split = lastSplit + wrapLimit;\n for (split; split < tokens.length; split++) {\n if (tokens[split] != PLACEHOLDER_BODY) {\n break;\n }\n }\n if (split == tokens.length) {\n break; // Breaks the while-loop.\n }\n addSplit(split);\n continue;\n }\n var minSplit = Math.max(split - (wrapLimit - (wrapLimit >> 2)), lastSplit - 1);\n while (split > minSplit && tokens[split] < PLACEHOLDER_START) {\n split--;\n }\n if (isCode) {\n while (split > minSplit && tokens[split] < PLACEHOLDER_START) {\n split--;\n }\n while (split > minSplit && tokens[split] == PUNCTUATION) {\n split--;\n }\n }\n else {\n while (split > minSplit && tokens[split] < SPACE) {\n split--;\n }\n }\n if (split > minSplit) {\n addSplit(++split);\n continue;\n }\n split = lastSplit + wrapLimit;\n if (tokens[split] == CHAR_EXT)\n split--;\n addSplit(split - indent);\n }\n return splits;\n };\n EditSession.prototype.$getDisplayTokens = function (str, offset) {\n var arr = [];\n var tabSize;\n offset = offset || 0;\n for (var i = 0; i < str.length; i++) {\n var c = str.charCodeAt(i);\n if (c == 9) {\n tabSize = this.getScreenTabSize(arr.length + offset);\n arr.push(TAB);\n for (var n = 1; n < tabSize; n++) {\n arr.push(TAB_SPACE);\n }\n }\n else if (c == 32) {\n arr.push(SPACE);\n }\n else if ((c > 39 && c < 48) || (c > 57 && c < 64)) {\n arr.push(PUNCTUATION);\n }\n else if (c >= 0x1100 && isFullWidth(c)) {\n arr.push(CHAR, CHAR_EXT);\n }\n else {\n arr.push(CHAR);\n }\n }\n return arr;\n };\n EditSession.prototype.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) {\n if (maxScreenColumn == 0)\n return [0, 0];\n if (maxScreenColumn == null)\n maxScreenColumn = Infinity;\n screenColumn = screenColumn || 0;\n var c, column;\n for (column = 0; column < str.length; column++) {\n c = str.charCodeAt(column);\n if (c == 9) {\n screenColumn += this.getScreenTabSize(screenColumn);\n }\n else if (c >= 0x1100 && isFullWidth(c)) {\n screenColumn += 2;\n }\n else {\n screenColumn += 1;\n }\n if (screenColumn > maxScreenColumn) {\n break;\n }\n }\n return [screenColumn, column];\n };\n EditSession.prototype.getRowLength = function (row) {\n var h = 1;\n if (this.lineWidgets)\n h += this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;\n if (!this.$useWrapMode || !this.$wrapData[row])\n return h;\n else\n return this.$wrapData[row].length + h;\n };\n EditSession.prototype.getRowLineCount = function (row) {\n if (!this.$useWrapMode || !this.$wrapData[row]) {\n return 1;\n }\n else {\n return this.$wrapData[row].length + 1;\n }\n };\n EditSession.prototype.getRowWrapIndent = function (screenRow) {\n if (this.$useWrapMode) {\n var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);\n var splits = this.$wrapData[pos.row];\n return splits.length && splits[0] < pos.column ? splits.indent : 0;\n }\n else {\n return 0;\n }\n };\n EditSession.prototype.getScreenLastRowColumn = function (screenRow) {\n var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);\n return this.documentToScreenColumn(pos.row, pos.column);\n };\n EditSession.prototype.getDocumentLastRowColumn = function (docRow, docColumn) {\n var screenRow = this.documentToScreenRow(docRow, docColumn);\n return this.getScreenLastRowColumn(screenRow);\n };\n EditSession.prototype.getDocumentLastRowColumnPosition = function (docRow, docColumn) {\n var screenRow = this.documentToScreenRow(docRow, docColumn);\n return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10);\n };\n EditSession.prototype.getRowSplitData = function (row) {\n if (!this.$useWrapMode) {\n return undefined;\n }\n else {\n return this.$wrapData[row];\n }\n };\n EditSession.prototype.getScreenTabSize = function (screenColumn) {\n return this.$tabSize - (screenColumn % this.$tabSize | 0);\n };\n EditSession.prototype.screenToDocumentRow = function (screenRow, screenColumn) {\n return this.screenToDocumentPosition(screenRow, screenColumn).row;\n };\n EditSession.prototype.screenToDocumentColumn = function (screenRow, screenColumn) {\n return this.screenToDocumentPosition(screenRow, screenColumn).column;\n };\n EditSession.prototype.screenToDocumentPosition = function (screenRow, screenColumn, offsetX) {\n if (screenRow < 0)\n return { row: 0, column: 0 };\n var line;\n var docRow = 0;\n var docColumn = 0;\n var column;\n var row = 0;\n var rowLength = 0;\n var rowCache = this.$screenRowCache;\n var i = this.$getRowCacheIndex(rowCache, screenRow);\n var l = rowCache.length;\n if (l && i >= 0) {\n var row = rowCache[i];\n var docRow = this.$docRowCache[i];\n var doCache = screenRow > rowCache[l - 1];\n }\n else {\n var doCache = !l;\n }\n var maxRow = this.getLength() - 1;\n var foldLine = this.getNextFoldLine(docRow);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (row <= screenRow) {\n rowLength = this.getRowLength(docRow);\n if (row + rowLength > screenRow || docRow >= maxRow) {\n break;\n }\n else {\n row += rowLength;\n docRow++;\n if (docRow > foldStart) {\n docRow = foldLine.end.row + 1;\n foldLine = this.getNextFoldLine(docRow, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n }\n if (doCache) {\n this.$docRowCache.push(docRow);\n this.$screenRowCache.push(row);\n }\n }\n if (foldLine && foldLine.start.row <= docRow) {\n line = this.getFoldDisplayLine(foldLine);\n docRow = foldLine.start.row;\n }\n else if (row + rowLength <= screenRow || docRow > maxRow) {\n return {\n row: maxRow,\n column: this.getLine(maxRow).length\n };\n }\n else {\n line = this.getLine(docRow);\n foldLine = null;\n }\n var wrapIndent = 0, splitIndex = Math.floor(screenRow - row);\n if (this.$useWrapMode) {\n var splits = this.$wrapData[docRow];\n if (splits) {\n column = splits[splitIndex];\n if (splitIndex > 0 && splits.length) {\n wrapIndent = splits.indent;\n docColumn = splits[splitIndex - 1] || splits[splits.length - 1];\n line = line.substring(docColumn);\n }\n }\n }\n if (offsetX !== undefined && this.$bidiHandler.isBidiRow(row + splitIndex, docRow, splitIndex))\n screenColumn = this.$bidiHandler.offsetToCol(offsetX);\n docColumn += this.$getStringScreenWidth(line, screenColumn - wrapIndent)[1];\n if (this.$useWrapMode && docColumn >= column)\n docColumn = column - 1;\n if (foldLine)\n return foldLine.idxToPosition(docColumn);\n return { row: docRow, column: docColumn };\n };\n EditSession.prototype.documentToScreenPosition = function (docRow, docColumn) {\n if (typeof docColumn === \"undefined\")\n var pos = this.$clipPositionToDocument(docRow.row, docRow.column);\n else\n pos = this.$clipPositionToDocument(docRow, docColumn);\n docRow = pos.row;\n docColumn = pos.column;\n var screenRow = 0;\n var foldStartRow = null;\n var fold = null;\n fold = this.getFoldAt(docRow, docColumn, 1);\n if (fold) {\n docRow = fold.start.row;\n docColumn = fold.start.column;\n }\n var rowEnd, row = 0;\n var rowCache = this.$docRowCache;\n var i = this.$getRowCacheIndex(rowCache, docRow);\n var l = rowCache.length;\n if (l && i >= 0) {\n var row = rowCache[i];\n var screenRow = this.$screenRowCache[i];\n var doCache = docRow > rowCache[l - 1];\n }\n else {\n var doCache = !l;\n }\n var foldLine = this.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (row < docRow) {\n if (row >= foldStart) {\n rowEnd = foldLine.end.row + 1;\n if (rowEnd > docRow)\n break;\n foldLine = this.getNextFoldLine(rowEnd, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n else {\n rowEnd = row + 1;\n }\n screenRow += this.getRowLength(row);\n row = rowEnd;\n if (doCache) {\n this.$docRowCache.push(row);\n this.$screenRowCache.push(screenRow);\n }\n }\n var textLine = \"\";\n if (foldLine && row >= foldStart) {\n textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn);\n foldStartRow = foldLine.start.row;\n }\n else {\n textLine = this.getLine(docRow).substring(0, docColumn);\n foldStartRow = docRow;\n }\n var wrapIndent = 0;\n if (this.$useWrapMode) {\n var wrapRow = this.$wrapData[foldStartRow];\n if (wrapRow) {\n var screenRowOffset = 0;\n while (textLine.length >= wrapRow[screenRowOffset]) {\n screenRow++;\n screenRowOffset++;\n }\n textLine = textLine.substring(wrapRow[screenRowOffset - 1] || 0, textLine.length);\n wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0;\n }\n }\n if (this.lineWidgets && this.lineWidgets[row] && this.lineWidgets[row].rowsAbove)\n screenRow += this.lineWidgets[row].rowsAbove;\n return {\n row: screenRow,\n column: wrapIndent + this.$getStringScreenWidth(textLine)[0]\n };\n };\n EditSession.prototype.documentToScreenColumn = function (row, docColumn) {\n return this.documentToScreenPosition(row, docColumn).column;\n };\n EditSession.prototype.documentToScreenRow = function (docRow, docColumn) {\n return this.documentToScreenPosition(docRow, docColumn).row;\n };\n EditSession.prototype.getScreenLength = function () {\n var screenRows = 0;\n var fold = null;\n if (!this.$useWrapMode) {\n screenRows = this.getLength();\n var foldData = this.$foldData;\n for (var i = 0; i < foldData.length; i++) {\n fold = foldData[i];\n screenRows -= fold.end.row - fold.start.row;\n }\n }\n else {\n var lastRow = this.$wrapData.length;\n var row = 0, i = 0;\n var fold = this.$foldData[i++];\n var foldStart = fold ? fold.start.row : Infinity;\n while (row < lastRow) {\n var splits = this.$wrapData[row];\n screenRows += splits ? splits.length + 1 : 1;\n row++;\n if (row > foldStart) {\n row = fold.end.row + 1;\n fold = this.$foldData[i++];\n foldStart = fold ? fold.start.row : Infinity;\n }\n }\n }\n if (this.lineWidgets)\n screenRows += this.$getWidgetScreenLength();\n return screenRows;\n };\n EditSession.prototype.$setFontMetrics = function (fm) {\n if (!this.$enableVarChar)\n return;\n this.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) {\n if (maxScreenColumn === 0)\n return [0, 0];\n if (!maxScreenColumn)\n maxScreenColumn = Infinity;\n screenColumn = screenColumn || 0;\n var c, column;\n for (column = 0; column < str.length; column++) {\n c = str.charAt(column);\n if (c === \"\\t\") {\n screenColumn += this.getScreenTabSize(screenColumn);\n }\n else {\n screenColumn += fm.getCharacterWidth(c);\n }\n if (screenColumn > maxScreenColumn) {\n break;\n }\n }\n return [screenColumn, column];\n };\n };\n EditSession.prototype.destroy = function () {\n if (!this.destroyed) {\n this.bgTokenizer.setDocument(null);\n this.bgTokenizer.cleanup();\n this.destroyed = true;\n }\n this.$stopWorker();\n this.removeAllListeners();\n if (this.doc) {\n this.doc.off(\"change\", this.$onChange);\n }\n this.selection.detach();\n };\n return EditSession;\n}());\nEditSession.$uid = 0;\nEditSession.prototype.$modes = config.$modes;\nEditSession.prototype.getValue = EditSession.prototype.toString;\nEditSession.prototype.$defaultUndoManager = {\n undo: function () { },\n redo: function () { },\n hasUndo: function () { },\n hasRedo: function () { },\n reset: function () { },\n add: function () { },\n addSelection: function () { },\n startNewGroup: function () { },\n addSession: function () { }\n};\nEditSession.prototype.$overwrite = false;\nEditSession.prototype.$mode = null;\nEditSession.prototype.$modeId = null;\nEditSession.prototype.$scrollTop = 0;\nEditSession.prototype.$scrollLeft = 0;\nEditSession.prototype.$wrapLimit = 80;\nEditSession.prototype.$useWrapMode = false;\nEditSession.prototype.$wrapLimitRange = {\n min: null,\n max: null\n};\nEditSession.prototype.lineWidgets = null;\nEditSession.prototype.isFullWidth = isFullWidth;\noop.implement(EditSession.prototype, EventEmitter);\nvar CHAR = 1, CHAR_EXT = 2, PLACEHOLDER_START = 3, PLACEHOLDER_BODY = 4, PUNCTUATION = 9, SPACE = 10, TAB = 11, TAB_SPACE = 12;\nfunction isFullWidth(c) {\n if (c < 0x1100)\n return false;\n return c >= 0x1100 && c <= 0x115F ||\n c >= 0x11A3 && c <= 0x11A7 ||\n c >= 0x11FA && c <= 0x11FF ||\n c >= 0x2329 && c <= 0x232A ||\n c >= 0x2E80 && c <= 0x2E99 ||\n c >= 0x2E9B && c <= 0x2EF3 ||\n c >= 0x2F00 && c <= 0x2FD5 ||\n c >= 0x2FF0 && c <= 0x2FFB ||\n c >= 0x3000 && c <= 0x303E ||\n c >= 0x3041 && c <= 0x3096 ||\n c >= 0x3099 && c <= 0x30FF ||\n c >= 0x3105 && c <= 0x312D ||\n c >= 0x3131 && c <= 0x318E ||\n c >= 0x3190 && c <= 0x31BA ||\n c >= 0x31C0 && c <= 0x31E3 ||\n c >= 0x31F0 && c <= 0x321E ||\n c >= 0x3220 && c <= 0x3247 ||\n c >= 0x3250 && c <= 0x32FE ||\n c >= 0x3300 && c <= 0x4DBF ||\n c >= 0x4E00 && c <= 0xA48C ||\n c >= 0xA490 && c <= 0xA4C6 ||\n c >= 0xA960 && c <= 0xA97C ||\n c >= 0xAC00 && c <= 0xD7A3 ||\n c >= 0xD7B0 && c <= 0xD7C6 ||\n c >= 0xD7CB && c <= 0xD7FB ||\n c >= 0xF900 && c <= 0xFAFF ||\n c >= 0xFE10 && c <= 0xFE19 ||\n c >= 0xFE30 && c <= 0xFE52 ||\n c >= 0xFE54 && c <= 0xFE66 ||\n c >= 0xFE68 && c <= 0xFE6B ||\n c >= 0xFF01 && c <= 0xFF60 ||\n c >= 0xFFE0 && c <= 0xFFE6;\n}\nrequire(\"./edit_session/folding\").Folding.call(EditSession.prototype);\nrequire(\"./edit_session/bracket_match\").BracketMatch.call(EditSession.prototype);\nconfig.defineOptions(EditSession.prototype, \"session\", {\n wrap: {\n set: function (value) {\n if (!value || value == \"off\")\n value = false;\n else if (value == \"free\")\n value = true;\n else if (value == \"printMargin\")\n value = -1;\n else if (typeof value == \"string\")\n value = parseInt(value, 10) || false;\n if (this.$wrap == value)\n return;\n this.$wrap = value;\n if (!value) {\n this.setUseWrapMode(false);\n }\n else {\n var col = typeof value == \"number\" ? value : null;\n this.setWrapLimitRange(col, col);\n this.setUseWrapMode(true);\n }\n },\n get: function () {\n if (this.getUseWrapMode()) {\n if (this.$wrap == -1)\n return \"printMargin\";\n if (!this.getWrapLimitRange().min)\n return \"free\";\n return this.$wrap;\n }\n return \"off\";\n },\n handlesSet: true\n },\n wrapMethod: {\n set: function (val) {\n val = val == \"auto\"\n ? this.$mode.type != \"text\"\n : val != \"text\";\n if (val != this.$wrapAsCode) {\n this.$wrapAsCode = val;\n if (this.$useWrapMode) {\n this.$useWrapMode = false;\n this.setUseWrapMode(true);\n }\n }\n },\n initialValue: \"auto\"\n },\n indentedSoftWrap: {\n set: function () {\n if (this.$useWrapMode) {\n this.$useWrapMode = false;\n this.setUseWrapMode(true);\n }\n },\n initialValue: true\n },\n firstLineNumber: {\n set: function () { this._signal(\"changeBreakpoint\"); },\n initialValue: 1\n },\n useWorker: {\n set: function (useWorker) {\n this.$useWorker = useWorker;\n this.$stopWorker();\n if (useWorker)\n this.$startWorker();\n },\n initialValue: true\n },\n useSoftTabs: { initialValue: true },\n tabSize: {\n set: function (tabSize) {\n tabSize = parseInt(tabSize);\n if (tabSize > 0 && this.$tabSize !== tabSize) {\n this.$modified = true;\n this.$rowLengthCache = [];\n this.$tabSize = tabSize;\n this._signal(\"changeTabSize\");\n }\n },\n initialValue: 4,\n handlesSet: true\n },\n navigateWithinSoftTabs: { initialValue: false },\n foldStyle: {\n set: function (val) { this.setFoldStyle(val); },\n handlesSet: true\n },\n overwrite: {\n set: function (val) { this._signal(\"changeOverwrite\"); },\n initialValue: false\n },\n newLineMode: {\n set: function (val) { this.doc.setNewLineMode(val); },\n get: function () { return this.doc.getNewLineMode(); },\n handlesSet: true\n },\n mode: {\n set: function (val) { this.setMode(val); },\n get: function () { return this.$modeId; },\n handlesSet: true\n }\n});\nexports.EditSession = EditSession;\n\n});\n\nace.define(\"ace/search\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/lib/oop\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"./lib/lang\");\nvar oop = require(\"./lib/oop\");\nvar Range = require(\"./range\").Range;\nvar Search = /** @class */ (function () {\n function Search() {\n this.$options = {};\n }\n Search.prototype.set = function (options) {\n oop.mixin(this.$options, options);\n return this;\n };\n Search.prototype.getOptions = function () {\n return lang.copyObject(this.$options);\n };\n Search.prototype.setOptions = function (options) {\n this.$options = options;\n };\n Search.prototype.find = function (session) {\n var options = this.$options;\n var iterator = this.$matchIterator(session, options);\n if (!iterator)\n return false;\n var firstRange = null;\n iterator.forEach(function (sr, sc, er, ec) {\n firstRange = new Range(sr, sc, er, ec);\n if (sc == ec && options.start && options.start.start\n && options.skipCurrent != false && firstRange.isEqual(options.start)) {\n firstRange = null;\n return false;\n }\n return true;\n });\n return firstRange;\n };\n Search.prototype.findAll = function (session) {\n var options = this.$options;\n if (!options.needle)\n return [];\n this.$assembleRegExp(options);\n var range = options.range;\n var lines = range\n ? session.getLines(range.start.row, range.end.row)\n : session.doc.getAllLines();\n var ranges = [];\n var re = options.re;\n if (options.$isMultiLine) {\n var len = re.length;\n var maxRow = lines.length - len;\n var prevRange;\n outer: for (var row = re.offset || 0; row <= maxRow; row++) {\n for (var j = 0; j < len; j++)\n if (lines[row + j].search(re[j]) == -1)\n continue outer;\n var startLine = lines[row];\n var line = lines[row + len - 1];\n var startIndex = startLine.length - startLine.match(re[0])[0].length;\n var endIndex = line.match(re[len - 1])[0].length;\n if (prevRange && prevRange.end.row === row &&\n prevRange.end.column > startIndex) {\n continue;\n }\n ranges.push(prevRange = new Range(row, startIndex, row + len - 1, endIndex));\n if (len > 2)\n row = row + len - 2;\n }\n }\n else {\n for (var i = 0; i < lines.length; i++) {\n var matches = lang.getMatchOffsets(lines[i], re);\n for (var j = 0; j < matches.length; j++) {\n var match = matches[j];\n ranges.push(new Range(i, match.offset, i, match.offset + match.length));\n }\n }\n }\n if (range) {\n var startColumn = range.start.column;\n var endColumn = range.end.column;\n var i = 0, j = ranges.length - 1;\n while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == 0)\n i++;\n var endRow = range.end.row - range.start.row;\n while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == endRow)\n j--;\n ranges = ranges.slice(i, j + 1);\n for (i = 0, j = ranges.length; i < j; i++) {\n ranges[i].start.row += range.start.row;\n ranges[i].end.row += range.start.row;\n }\n }\n return ranges;\n };\n Search.prototype.replace = function (input, replacement) {\n var options = this.$options;\n var re = this.$assembleRegExp(options);\n if (options.$isMultiLine)\n return replacement;\n if (!re)\n return;\n var match = re.exec(input);\n if (!match || match[0].length != input.length)\n return null;\n replacement = input.replace(re, replacement);\n if (options.preserveCase) {\n replacement = replacement.split(\"\");\n for (var i = Math.min(input.length, input.length); i--;) {\n var ch = input[i];\n if (ch && ch.toLowerCase() != ch)\n replacement[i] = replacement[i].toUpperCase();\n else\n replacement[i] = replacement[i].toLowerCase();\n }\n replacement = replacement.join(\"\");\n }\n return replacement;\n };\n Search.prototype.$assembleRegExp = function (options, $disableFakeMultiline) {\n if (options.needle instanceof RegExp)\n return options.re = options.needle;\n var needle = options.needle;\n if (!options.needle)\n return options.re = false;\n if (options.$supportsUnicodeFlag === undefined) {\n options.$supportsUnicodeFlag = lang.supportsUnicodeFlag();\n }\n try {\n new RegExp(needle, \"u\");\n }\n catch (e) {\n options.$supportsUnicodeFlag = false; //left for backward compatibility with previous versions for cases like /ab\\{2}/gu\n }\n if (!options.regExp)\n needle = lang.escapeRegExp(needle);\n if (options.wholeWord)\n needle = addWordBoundary(needle, options);\n var modifier = options.caseSensitive ? \"gm\" : \"gmi\";\n if (options.$supportsUnicodeFlag) {\n modifier += \"u\";\n }\n options.$isMultiLine = !$disableFakeMultiline && /[\\n\\r]/.test(needle);\n if (options.$isMultiLine)\n return options.re = this.$assembleMultilineRegExp(needle, modifier);\n try {\n var re = new RegExp(needle, modifier);\n }\n catch (e) {\n re = false;\n }\n return options.re = re;\n };\n Search.prototype.$assembleMultilineRegExp = function (needle, modifier) {\n var parts = needle.replace(/\\r\\n|\\r|\\n/g, \"$\\n^\").split(\"\\n\");\n var re = [];\n for (var i = 0; i < parts.length; i++)\n try {\n re.push(new RegExp(parts[i], modifier));\n }\n catch (e) {\n return false;\n }\n return re;\n };\n Search.prototype.$matchIterator = function (session, options) {\n var re = this.$assembleRegExp(options);\n if (!re)\n return false;\n var backwards = options.backwards == true;\n var skipCurrent = options.skipCurrent != false;\n var range = options.range;\n var start = options.start;\n if (!start)\n start = range ? range[backwards ? \"end\" : \"start\"] : session.selection.getRange();\n if (start.start)\n start = start[skipCurrent != backwards ? \"end\" : \"start\"];\n var firstRow = range ? range.start.row : 0;\n var lastRow = range ? range.end.row : session.getLength() - 1;\n if (backwards) {\n var forEach = function (callback) {\n var row = start.row;\n if (forEachInLine(row, start.column, callback))\n return;\n for (row--; row >= firstRow; row--)\n if (forEachInLine(row, Number.MAX_VALUE, callback))\n return;\n if (options.wrap == false)\n return;\n for (row = lastRow, firstRow = start.row; row >= firstRow; row--)\n if (forEachInLine(row, Number.MAX_VALUE, callback))\n return;\n };\n }\n else {\n var forEach = function (callback) {\n var row = start.row;\n if (forEachInLine(row, start.column, callback))\n return;\n for (row = row + 1; row <= lastRow; row++)\n if (forEachInLine(row, 0, callback))\n return;\n if (options.wrap == false)\n return;\n for (row = firstRow, lastRow = start.row; row <= lastRow; row++)\n if (forEachInLine(row, 0, callback))\n return;\n };\n }\n if (options.$isMultiLine) {\n var len = re.length;\n var forEachInLine = function (row, offset, callback) {\n var startRow = backwards ? row - len + 1 : row;\n if (startRow < 0 || startRow + len > session.getLength())\n return;\n var line = session.getLine(startRow);\n var startIndex = line.search(re[0]);\n if (!backwards && startIndex < offset || startIndex === -1)\n return;\n for (var i = 1; i < len; i++) {\n line = session.getLine(startRow + i);\n if (line.search(re[i]) == -1)\n return;\n }\n var endIndex = line.match(re[len - 1])[0].length;\n if (backwards && endIndex > offset)\n return;\n if (callback(startRow, startIndex, startRow + len - 1, endIndex))\n return true;\n };\n }\n else if (backwards) {\n var forEachInLine = function (row, endIndex, callback) {\n var line = session.getLine(row);\n var matches = [];\n var m, last = 0;\n re.lastIndex = 0;\n while ((m = re.exec(line))) {\n var length = m[0].length;\n last = m.index;\n if (!length) {\n if (last >= line.length)\n break;\n re.lastIndex = last += 1;\n }\n if (m.index + length > endIndex)\n break;\n matches.push(m.index, length);\n }\n for (var i = matches.length - 1; i >= 0; i -= 2) {\n var column = matches[i - 1];\n var length = matches[i];\n if (callback(row, column, row, column + length))\n return true;\n }\n };\n }\n else {\n var forEachInLine = function (row, startIndex, callback) {\n var line = session.getLine(row);\n var last;\n var m;\n re.lastIndex = startIndex;\n while ((m = re.exec(line))) {\n var length = m[0].length;\n last = m.index;\n if (callback(row, last, row, last + length))\n return true;\n if (!length) {\n re.lastIndex = last += 1;\n if (last >= line.length)\n return false;\n }\n }\n };\n }\n return { forEach: forEach };\n };\n return Search;\n}());\nfunction addWordBoundary(needle, options) {\n var supportsLookbehind = lang.supportsLookbehind();\n function wordBoundary(c, firstChar) {\n if (firstChar === void 0) { firstChar = true; }\n var wordRegExp = supportsLookbehind && options.$supportsUnicodeFlag ? new RegExp(\"[\\\\p{L}\\\\p{N}_]\", \"u\") : new RegExp(\"\\\\w\");\n if (wordRegExp.test(c) || options.regExp) {\n if (supportsLookbehind && options.$supportsUnicodeFlag) {\n if (firstChar)\n return \"(?<=^|[^\\\\p{L}\\\\p{N}_])\";\n return \"(?=[^\\\\p{L}\\\\p{N}_]|$)\";\n }\n return \"\\\\b\";\n }\n return \"\";\n }\n var needleArray = Array.from(needle);\n var firstChar = needleArray[0];\n var lastChar = needleArray[needleArray.length - 1];\n return wordBoundary(firstChar) + needle + wordBoundary(lastChar, false);\n}\nexports.Search = Search;\n\n});\n\nace.define(\"ace/keyboard/hash_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/keys\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar __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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar keyUtil = require(\"../lib/keys\");\nvar useragent = require(\"../lib/useragent\");\nvar KEY_MODS = keyUtil.KEY_MODS;\nvar MultiHashHandler = /** @class */ (function () {\n function MultiHashHandler(config, platform) {\n this.$init(config, platform, false);\n }\n MultiHashHandler.prototype.$init = function (config, platform, $singleCommand) {\n this.platform = platform || (useragent.isMac ? \"mac\" : \"win\");\n this.commands = {};\n this.commandKeyBinding = {};\n this.addCommands(config);\n this.$singleCommand = $singleCommand;\n };\n MultiHashHandler.prototype.addCommand = function (command) {\n if (this.commands[command.name])\n this.removeCommand(command);\n this.commands[command.name] = command;\n if (command.bindKey)\n this._buildKeyHash(command);\n };\n MultiHashHandler.prototype.removeCommand = function (command, keepCommand) {\n var name = command && (typeof command === 'string' ? command : command.name);\n command = this.commands[name];\n if (!keepCommand)\n delete this.commands[name];\n var ckb = this.commandKeyBinding;\n for (var keyId in ckb) {\n var cmdGroup = ckb[keyId];\n if (cmdGroup == command) {\n delete ckb[keyId];\n }\n else if (Array.isArray(cmdGroup)) {\n var i = cmdGroup.indexOf(command);\n if (i != -1) {\n cmdGroup.splice(i, 1);\n if (cmdGroup.length == 1)\n ckb[keyId] = cmdGroup[0];\n }\n }\n }\n };\n MultiHashHandler.prototype.bindKey = function (key, command, position) {\n if (typeof key == \"object\" && key) {\n if (position == undefined)\n position = key.position;\n key = key[this.platform];\n }\n if (!key)\n return;\n if (typeof command == \"function\")\n return this.addCommand({ exec: command, bindKey: key, name: command.name || key });\n key.split(\"|\").forEach(function (keyPart) {\n var chain = \"\";\n if (keyPart.indexOf(\" \") != -1) {\n var parts = keyPart.split(/\\s+/);\n keyPart = parts.pop();\n parts.forEach(function (keyPart) {\n var binding = this.parseKeys(keyPart);\n var id = KEY_MODS[binding.hashId] + binding.key;\n chain += (chain ? \" \" : \"\") + id;\n this._addCommandToBinding(chain, \"chainKeys\");\n }, this);\n chain += \" \";\n }\n var binding = this.parseKeys(keyPart);\n var id = KEY_MODS[binding.hashId] + binding.key;\n this._addCommandToBinding(chain + id, command, position);\n }, this);\n };\n MultiHashHandler.prototype._addCommandToBinding = function (keyId, command, position) {\n var ckb = this.commandKeyBinding, i;\n if (!command) {\n delete ckb[keyId];\n }\n else if (!ckb[keyId] || this.$singleCommand) {\n ckb[keyId] = command;\n }\n else {\n if (!Array.isArray(ckb[keyId])) {\n ckb[keyId] = [ckb[keyId]];\n }\n else if ((i = ckb[keyId].indexOf(command)) != -1) {\n ckb[keyId].splice(i, 1);\n }\n if (typeof position != \"number\") {\n position = getPosition(command);\n }\n var commands = ckb[keyId];\n for (i = 0; i < commands.length; i++) {\n var other = commands[i];\n var otherPos = getPosition(other);\n if (otherPos > position)\n break;\n }\n commands.splice(i, 0, command);\n }\n };\n MultiHashHandler.prototype.addCommands = function (commands) {\n commands && Object.keys(commands).forEach(function (name) {\n var command = commands[name];\n if (!command)\n return;\n if (typeof command === \"string\")\n return this.bindKey(command, name);\n if (typeof command === \"function\")\n command = { exec: command };\n if (typeof command !== \"object\")\n return;\n if (!command.name)\n command.name = name;\n this.addCommand(command);\n }, this);\n };\n MultiHashHandler.prototype.removeCommands = function (commands) {\n Object.keys(commands).forEach(function (name) {\n this.removeCommand(commands[name]);\n }, this);\n };\n MultiHashHandler.prototype.bindKeys = function (keyList) {\n Object.keys(keyList).forEach(function (key) {\n this.bindKey(key, keyList[key]);\n }, this);\n };\n MultiHashHandler.prototype._buildKeyHash = function (command) {\n this.bindKey(command.bindKey, command);\n };\n MultiHashHandler.prototype.parseKeys = function (keys) {\n var parts = keys.toLowerCase().split(/[\\-\\+]([\\-\\+])?/).filter(function (x) { return x; });\n var key = parts.pop();\n var keyCode = keyUtil[key];\n if (keyUtil.FUNCTION_KEYS[keyCode])\n key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase();\n else if (!parts.length)\n return { key: key, hashId: -1 };\n else if (parts.length == 1 && parts[0] == \"shift\")\n return { key: key.toUpperCase(), hashId: -1 };\n var hashId = 0;\n for (var i = parts.length; i--;) {\n var modifier = keyUtil.KEY_MODS[parts[i]];\n if (modifier == null) {\n if (typeof console != \"undefined\")\n console.error(\"invalid modifier \" + parts[i] + \" in \" + keys);\n return false;\n }\n hashId |= modifier;\n }\n return { key: key, hashId: hashId };\n };\n MultiHashHandler.prototype.findKeyCommand = function (hashId, keyString) {\n var key = KEY_MODS[hashId] + keyString;\n return this.commandKeyBinding[key];\n };\n MultiHashHandler.prototype.handleKeyboard = function (data, hashId, keyString, keyCode) {\n if (keyCode < 0)\n return;\n var key = KEY_MODS[hashId] + keyString;\n var command = this.commandKeyBinding[key];\n if (data.$keyChain) {\n data.$keyChain += \" \" + key;\n command = this.commandKeyBinding[data.$keyChain] || command;\n }\n if (command) {\n if (command == \"chainKeys\" || command[command.length - 1] == \"chainKeys\") {\n data.$keyChain = data.$keyChain || key;\n return { command: \"null\" };\n }\n }\n if (data.$keyChain) {\n if ((!hashId || hashId == 4) && keyString.length == 1)\n data.$keyChain = data.$keyChain.slice(0, -key.length - 1); // wait for input\n else if (hashId == -1 || keyCode > 0)\n data.$keyChain = \"\"; // reset keyChain\n }\n return { command: command };\n };\n MultiHashHandler.prototype.getStatusText = function (editor, data) {\n return data.$keyChain || \"\";\n };\n return MultiHashHandler;\n}());\nfunction getPosition(command) {\n return typeof command == \"object\" && command.bindKey\n && command.bindKey.position\n || (command.isDefault ? -100 : 0);\n}\nvar HashHandler = /** @class */ (function (_super) {\n __extends(HashHandler, _super);\n function HashHandler(config, platform) {\n var _this = _super.call(this, config, platform) || this;\n _this.$singleCommand = true;\n return _this;\n }\n return HashHandler;\n}(MultiHashHandler));\nHashHandler.call = function (thisArg, config, platform) {\n MultiHashHandler.prototype.$init.call(thisArg, config, platform, true);\n};\nMultiHashHandler.call = function (thisArg, config, platform) {\n MultiHashHandler.prototype.$init.call(thisArg, config, platform, false);\n};\nexports.HashHandler = HashHandler;\nexports.MultiHashHandler = MultiHashHandler;\n\n});\n\nace.define(\"ace/commands/command_manager\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/keyboard/hash_handler\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar __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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar oop = require(\"../lib/oop\");\nvar MultiHashHandler = require(\"../keyboard/hash_handler\").MultiHashHandler;\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar CommandManager = /** @class */ (function (_super) {\n __extends(CommandManager, _super);\n function CommandManager(platform, commands) {\n var _this = _super.call(this, commands, platform) || this;\n _this.byName = _this.commands;\n _this.setDefaultHandler(\"exec\", function (e) {\n if (!e.args) {\n return e.command.exec(e.editor, {}, e.event, true);\n }\n return e.command.exec(e.editor, e.args, e.event, false);\n });\n return _this;\n }\n CommandManager.prototype.exec = function (command, editor, args) {\n if (Array.isArray(command)) {\n for (var i = command.length; i--;) {\n if (this.exec(command[i], editor, args))\n return true;\n }\n return false;\n }\n if (typeof command === \"string\")\n command = this.commands[command];\n if (!command)\n return false;\n if (editor && editor.$readOnly && !command.readOnly)\n return false;\n if (this.$checkCommandState != false && command.isAvailable && !command.isAvailable(editor))\n return false;\n var e = { editor: editor, command: command, args: args };\n e.returnValue = this._emit(\"exec\", e);\n this._signal(\"afterExec\", e);\n return e.returnValue === false ? false : true;\n };\n CommandManager.prototype.toggleRecording = function (editor) {\n if (this.$inReplay)\n return;\n editor && editor._emit(\"changeStatus\");\n if (this.recording) {\n this.macro.pop();\n this.off(\"exec\", this.$addCommandToMacro);\n if (!this.macro.length)\n this.macro = this.oldMacro;\n return this.recording = false;\n }\n if (!this.$addCommandToMacro) {\n this.$addCommandToMacro = function (e) {\n this.macro.push([e.command, e.args]);\n }.bind(this);\n }\n this.oldMacro = this.macro;\n this.macro = [];\n this.on(\"exec\", this.$addCommandToMacro);\n return this.recording = true;\n };\n CommandManager.prototype.replay = function (editor) {\n if (this.$inReplay || !this.macro)\n return;\n if (this.recording)\n return this.toggleRecording(editor);\n try {\n this.$inReplay = true;\n this.macro.forEach(function (x) {\n if (typeof x == \"string\")\n this.exec(x, editor);\n else\n this.exec(x[0], editor, x[1]);\n }, this);\n }\n finally {\n this.$inReplay = false;\n }\n };\n CommandManager.prototype.trimMacro = function (m) {\n return m.map(function (x) {\n if (typeof x[0] != \"string\")\n x[0] = x[0].name;\n if (!x[1])\n x = x[0];\n return x;\n });\n };\n return CommandManager;\n}(MultiHashHandler));\noop.implement(CommandManager.prototype, EventEmitter);\nexports.CommandManager = CommandManager;\n\n});\n\nace.define(\"ace/commands/default_commands\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/config\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"../lib/lang\");\nvar config = require(\"../config\");\nvar Range = require(\"../range\").Range;\nfunction bindKey(win, mac) {\n return { win: win, mac: mac };\n}\nexports.commands = [{\n name: \"showSettingsMenu\",\n description: \"Show settings menu\",\n bindKey: bindKey(\"Ctrl-,\", \"Command-,\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/settings_menu\", function (module) {\n module.init(editor);\n editor.showSettingsMenu();\n });\n },\n readOnly: true\n }, {\n name: \"goToNextError\",\n description: \"Go to next error\",\n bindKey: bindKey(\"Alt-E\", \"F4\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/error_marker\", function (module) {\n module.showErrorMarker(editor, 1);\n });\n },\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"goToPreviousError\",\n description: \"Go to previous error\",\n bindKey: bindKey(\"Alt-Shift-E\", \"Shift-F4\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/error_marker\", function (module) {\n module.showErrorMarker(editor, -1);\n });\n },\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"selectall\",\n description: \"Select all\",\n bindKey: bindKey(\"Ctrl-A\", \"Command-A\"),\n exec: function (editor) { editor.selectAll(); },\n readOnly: true\n }, {\n name: \"centerselection\",\n description: \"Center selection\",\n bindKey: bindKey(null, \"Ctrl-L\"),\n exec: function (editor) { editor.centerSelection(); },\n readOnly: true\n }, {\n name: \"gotoline\",\n description: \"Go to line...\",\n bindKey: bindKey(\"Ctrl-L\", \"Command-L\"),\n exec: function (editor, line) {\n if (typeof line === \"number\" && !isNaN(line))\n editor.gotoLine(line);\n editor.prompt({ $type: \"gotoLine\" });\n },\n readOnly: true\n }, {\n name: \"fold\",\n bindKey: bindKey(\"Alt-L|Ctrl-F1\", \"Command-Alt-L|Command-F1\"),\n exec: function (editor) { editor.session.toggleFold(false); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"unfold\",\n bindKey: bindKey(\"Alt-Shift-L|Ctrl-Shift-F1\", \"Command-Alt-Shift-L|Command-Shift-F1\"),\n exec: function (editor) { editor.session.toggleFold(true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"toggleFoldWidget\",\n description: \"Toggle fold widget\",\n bindKey: bindKey(\"F2\", \"F2\"),\n exec: function (editor) { editor.session.toggleFoldWidget(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"toggleParentFoldWidget\",\n description: \"Toggle parent fold widget\",\n bindKey: bindKey(\"Alt-F2\", \"Alt-F2\"),\n exec: function (editor) { editor.session.toggleFoldWidget(true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"foldall\",\n description: \"Fold all\",\n bindKey: bindKey(null, \"Ctrl-Command-Option-0\"),\n exec: function (editor) { editor.session.foldAll(); },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"foldAllComments\",\n description: \"Fold all comments\",\n bindKey: bindKey(null, \"Ctrl-Command-Option-0\"),\n exec: function (editor) { editor.session.foldAllComments(); },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"foldOther\",\n description: \"Fold other\",\n bindKey: bindKey(\"Alt-0\", \"Command-Option-0\"),\n exec: function (editor) {\n editor.session.foldAll();\n editor.session.unfold(editor.selection.getAllRanges());\n },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"unfoldall\",\n description: \"Unfold all\",\n bindKey: bindKey(\"Alt-Shift-0\", \"Command-Option-Shift-0\"),\n exec: function (editor) { editor.session.unfold(); },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"findnext\",\n description: \"Find next\",\n bindKey: bindKey(\"Ctrl-K\", \"Command-G\"),\n exec: function (editor) { editor.findNext(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"findprevious\",\n description: \"Find previous\",\n bindKey: bindKey(\"Ctrl-Shift-K\", \"Command-Shift-G\"),\n exec: function (editor) { editor.findPrevious(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"selectOrFindNext\",\n description: \"Select or find next\",\n bindKey: bindKey(\"Alt-K\", \"Ctrl-G\"),\n exec: function (editor) {\n if (editor.selection.isEmpty())\n editor.selection.selectWord();\n else\n editor.findNext();\n },\n readOnly: true\n }, {\n name: \"selectOrFindPrevious\",\n description: \"Select or find previous\",\n bindKey: bindKey(\"Alt-Shift-K\", \"Ctrl-Shift-G\"),\n exec: function (editor) {\n if (editor.selection.isEmpty())\n editor.selection.selectWord();\n else\n editor.findPrevious();\n },\n readOnly: true\n }, {\n name: \"find\",\n description: \"Find\",\n bindKey: bindKey(\"Ctrl-F\", \"Command-F\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/searchbox\", function (e) { e.Search(editor); });\n },\n readOnly: true\n }, {\n name: \"overwrite\",\n description: \"Overwrite\",\n bindKey: \"Insert\",\n exec: function (editor) { editor.toggleOverwrite(); },\n readOnly: true\n }, {\n name: \"selecttostart\",\n description: \"Select to start\",\n bindKey: bindKey(\"Ctrl-Shift-Home\", \"Command-Shift-Home|Command-Shift-Up\"),\n exec: function (editor) { editor.getSelection().selectFileStart(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"gotostart\",\n description: \"Go to start\",\n bindKey: bindKey(\"Ctrl-Home\", \"Command-Home|Command-Up\"),\n exec: function (editor) { editor.navigateFileStart(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"selectup\",\n description: \"Select up\",\n bindKey: bindKey(\"Shift-Up\", \"Shift-Up|Ctrl-Shift-P\"),\n exec: function (editor) { editor.getSelection().selectUp(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"golineup\",\n description: \"Go line up\",\n bindKey: bindKey(\"Up\", \"Up|Ctrl-P\"),\n exec: function (editor, args) { editor.navigateUp(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selecttoend\",\n description: \"Select to end\",\n bindKey: bindKey(\"Ctrl-Shift-End\", \"Command-Shift-End|Command-Shift-Down\"),\n exec: function (editor) { editor.getSelection().selectFileEnd(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"gotoend\",\n description: \"Go to end\",\n bindKey: bindKey(\"Ctrl-End\", \"Command-End|Command-Down\"),\n exec: function (editor) { editor.navigateFileEnd(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"selectdown\",\n description: \"Select down\",\n bindKey: bindKey(\"Shift-Down\", \"Shift-Down|Ctrl-Shift-N\"),\n exec: function (editor) { editor.getSelection().selectDown(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"golinedown\",\n description: \"Go line down\",\n bindKey: bindKey(\"Down\", \"Down|Ctrl-N\"),\n exec: function (editor, args) { editor.navigateDown(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectwordleft\",\n description: \"Select word left\",\n bindKey: bindKey(\"Ctrl-Shift-Left\", \"Option-Shift-Left\"),\n exec: function (editor) { editor.getSelection().selectWordLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotowordleft\",\n description: \"Go to word left\",\n bindKey: bindKey(\"Ctrl-Left\", \"Option-Left\"),\n exec: function (editor) { editor.navigateWordLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selecttolinestart\",\n description: \"Select to line start\",\n bindKey: bindKey(\"Alt-Shift-Left\", \"Command-Shift-Left|Ctrl-Shift-A\"),\n exec: function (editor) { editor.getSelection().selectLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotolinestart\",\n description: \"Go to line start\",\n bindKey: bindKey(\"Alt-Left|Home\", \"Command-Left|Home|Ctrl-A\"),\n exec: function (editor) { editor.navigateLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectleft\",\n description: \"Select left\",\n bindKey: bindKey(\"Shift-Left\", \"Shift-Left|Ctrl-Shift-B\"),\n exec: function (editor) { editor.getSelection().selectLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotoleft\",\n description: \"Go to left\",\n bindKey: bindKey(\"Left\", \"Left|Ctrl-B\"),\n exec: function (editor, args) { editor.navigateLeft(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectwordright\",\n description: \"Select word right\",\n bindKey: bindKey(\"Ctrl-Shift-Right\", \"Option-Shift-Right\"),\n exec: function (editor) { editor.getSelection().selectWordRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotowordright\",\n description: \"Go to word right\",\n bindKey: bindKey(\"Ctrl-Right\", \"Option-Right\"),\n exec: function (editor) { editor.navigateWordRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selecttolineend\",\n description: \"Select to line end\",\n bindKey: bindKey(\"Alt-Shift-Right\", \"Command-Shift-Right|Shift-End|Ctrl-Shift-E\"),\n exec: function (editor) { editor.getSelection().selectLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotolineend\",\n description: \"Go to line end\",\n bindKey: bindKey(\"Alt-Right|End\", \"Command-Right|End|Ctrl-E\"),\n exec: function (editor) { editor.navigateLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectright\",\n description: \"Select right\",\n bindKey: bindKey(\"Shift-Right\", \"Shift-Right\"),\n exec: function (editor) { editor.getSelection().selectRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotoright\",\n description: \"Go to right\",\n bindKey: bindKey(\"Right\", \"Right|Ctrl-F\"),\n exec: function (editor, args) { editor.navigateRight(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectpagedown\",\n description: \"Select page down\",\n bindKey: \"Shift-PageDown\",\n exec: function (editor) { editor.selectPageDown(); },\n readOnly: true\n }, {\n name: \"pagedown\",\n description: \"Page down\",\n bindKey: bindKey(null, \"Option-PageDown\"),\n exec: function (editor) { editor.scrollPageDown(); },\n readOnly: true\n }, {\n name: \"gotopagedown\",\n description: \"Go to page down\",\n bindKey: bindKey(\"PageDown\", \"PageDown|Ctrl-V\"),\n exec: function (editor) { editor.gotoPageDown(); },\n readOnly: true\n }, {\n name: \"selectpageup\",\n description: \"Select page up\",\n bindKey: \"Shift-PageUp\",\n exec: function (editor) { editor.selectPageUp(); },\n readOnly: true\n }, {\n name: \"pageup\",\n description: \"Page up\",\n bindKey: bindKey(null, \"Option-PageUp\"),\n exec: function (editor) { editor.scrollPageUp(); },\n readOnly: true\n }, {\n name: \"gotopageup\",\n description: \"Go to page up\",\n bindKey: \"PageUp\",\n exec: function (editor) { editor.gotoPageUp(); },\n readOnly: true\n }, {\n name: \"scrollup\",\n description: \"Scroll up\",\n bindKey: bindKey(\"Ctrl-Up\", null),\n exec: function (e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); },\n readOnly: true\n }, {\n name: \"scrolldown\",\n description: \"Scroll down\",\n bindKey: bindKey(\"Ctrl-Down\", null),\n exec: function (e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); },\n readOnly: true\n }, {\n name: \"selectlinestart\",\n description: \"Select line start\",\n bindKey: \"Shift-Home\",\n exec: function (editor) { editor.getSelection().selectLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectlineend\",\n description: \"Select line end\",\n bindKey: \"Shift-End\",\n exec: function (editor) { editor.getSelection().selectLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"togglerecording\",\n description: \"Toggle recording\",\n bindKey: bindKey(\"Ctrl-Alt-E\", \"Command-Option-E\"),\n exec: function (editor) { editor.commands.toggleRecording(editor); },\n readOnly: true\n }, {\n name: \"replaymacro\",\n description: \"Replay macro\",\n bindKey: bindKey(\"Ctrl-Shift-E\", \"Command-Shift-E\"),\n exec: function (editor) { editor.commands.replay(editor); },\n readOnly: true\n }, {\n name: \"jumptomatching\",\n description: \"Jump to matching\",\n bindKey: bindKey(\"Ctrl-\\\\|Ctrl-P\", \"Command-\\\\\"),\n exec: function (editor) { editor.jumpToMatching(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"selecttomatching\",\n description: \"Select to matching\",\n bindKey: bindKey(\"Ctrl-Shift-\\\\|Ctrl-Shift-P\", \"Command-Shift-\\\\\"),\n exec: function (editor) { editor.jumpToMatching(true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"expandToMatching\",\n description: \"Expand to matching\",\n bindKey: bindKey(\"Ctrl-Shift-M\", \"Ctrl-Shift-M\"),\n exec: function (editor) { editor.jumpToMatching(true, true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"passKeysToBrowser\",\n description: \"Pass keys to browser\",\n bindKey: bindKey(null, null),\n exec: function () { },\n passEvent: true,\n readOnly: true\n }, {\n name: \"copy\",\n description: \"Copy\",\n exec: function (editor) {\n },\n readOnly: true\n },\n {\n name: \"cut\",\n description: \"Cut\",\n exec: function (editor) {\n var cutLine = editor.$copyWithEmptySelection && editor.selection.isEmpty();\n var range = cutLine ? editor.selection.getLineRange() : editor.selection.getRange();\n editor._emit(\"cut\", range);\n if (!range.isEmpty())\n editor.session.remove(range);\n editor.clearSelection();\n },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"paste\",\n description: \"Paste\",\n exec: function (editor, args) {\n editor.$handlePaste(args);\n },\n scrollIntoView: \"cursor\"\n }, {\n name: \"removeline\",\n description: \"Remove line\",\n bindKey: bindKey(\"Ctrl-D\", \"Command-D\"),\n exec: function (editor) { editor.removeLines(); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEachLine\"\n }, {\n name: \"duplicateSelection\",\n description: \"Duplicate selection\",\n bindKey: bindKey(\"Ctrl-Shift-D\", \"Command-Shift-D\"),\n exec: function (editor) { editor.duplicateSelection(); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"sortlines\",\n description: \"Sort lines\",\n bindKey: bindKey(\"Ctrl-Alt-S\", \"Command-Alt-S\"),\n exec: function (editor) { editor.sortLines(); },\n scrollIntoView: \"selection\",\n multiSelectAction: \"forEachLine\"\n }, {\n name: \"togglecomment\",\n description: \"Toggle comment\",\n bindKey: bindKey(\"Ctrl-/\", \"Command-/\"),\n exec: function (editor) { editor.toggleCommentLines(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"toggleBlockComment\",\n description: \"Toggle block comment\",\n bindKey: bindKey(\"Ctrl-Shift-/\", \"Command-Shift-/\"),\n exec: function (editor) { editor.toggleBlockComment(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"modifyNumberUp\",\n description: \"Modify number up\",\n bindKey: bindKey(\"Ctrl-Shift-Up\", \"Alt-Shift-Up\"),\n exec: function (editor) { editor.modifyNumber(1); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"modifyNumberDown\",\n description: \"Modify number down\",\n bindKey: bindKey(\"Ctrl-Shift-Down\", \"Alt-Shift-Down\"),\n exec: function (editor) { editor.modifyNumber(-1); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"replace\",\n description: \"Replace\",\n bindKey: bindKey(\"Ctrl-H\", \"Command-Option-F\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/searchbox\", function (e) { e.Search(editor, true); });\n }\n }, {\n name: \"undo\",\n description: \"Undo\",\n bindKey: bindKey(\"Ctrl-Z\", \"Command-Z\"),\n exec: function (editor) { editor.undo(); }\n }, {\n name: \"redo\",\n description: \"Redo\",\n bindKey: bindKey(\"Ctrl-Shift-Z|Ctrl-Y\", \"Command-Shift-Z|Command-Y\"),\n exec: function (editor) { editor.redo(); }\n }, {\n name: \"copylinesup\",\n description: \"Copy lines up\",\n bindKey: bindKey(\"Alt-Shift-Up\", \"Command-Option-Up\"),\n exec: function (editor) { editor.copyLinesUp(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"movelinesup\",\n description: \"Move lines up\",\n bindKey: bindKey(\"Alt-Up\", \"Option-Up\"),\n exec: function (editor) { editor.moveLinesUp(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"copylinesdown\",\n description: \"Copy lines down\",\n bindKey: bindKey(\"Alt-Shift-Down\", \"Command-Option-Down\"),\n exec: function (editor) { editor.copyLinesDown(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"movelinesdown\",\n description: \"Move lines down\",\n bindKey: bindKey(\"Alt-Down\", \"Option-Down\"),\n exec: function (editor) { editor.moveLinesDown(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"del\",\n description: \"Delete\",\n bindKey: bindKey(\"Delete\", \"Delete|Ctrl-D|Shift-Delete\"),\n exec: function (editor) { editor.remove(\"right\"); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"backspace\",\n description: \"Backspace\",\n bindKey: bindKey(\"Shift-Backspace|Backspace\", \"Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H\"),\n exec: function (editor) { editor.remove(\"left\"); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"cut_or_delete\",\n description: \"Cut or delete\",\n bindKey: bindKey(\"Shift-Delete\", null),\n exec: function (editor) {\n if (editor.selection.isEmpty()) {\n editor.remove(\"left\");\n }\n else {\n return false;\n }\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolinestart\",\n description: \"Remove to line start\",\n bindKey: bindKey(\"Alt-Backspace\", \"Command-Backspace\"),\n exec: function (editor) { editor.removeToLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolineend\",\n description: \"Remove to line end\",\n bindKey: bindKey(\"Alt-Delete\", \"Ctrl-K|Command-Delete\"),\n exec: function (editor) { editor.removeToLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolinestarthard\",\n description: \"Remove to line start hard\",\n bindKey: bindKey(\"Ctrl-Shift-Backspace\", null),\n exec: function (editor) {\n var range = editor.selection.getRange();\n range.start.column = 0;\n editor.session.remove(range);\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolineendhard\",\n description: \"Remove to line end hard\",\n bindKey: bindKey(\"Ctrl-Shift-Delete\", null),\n exec: function (editor) {\n var range = editor.selection.getRange();\n range.end.column = Number.MAX_VALUE;\n editor.session.remove(range);\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removewordleft\",\n description: \"Remove word left\",\n bindKey: bindKey(\"Ctrl-Backspace\", \"Alt-Backspace|Ctrl-Alt-Backspace\"),\n exec: function (editor) { editor.removeWordLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removewordright\",\n description: \"Remove word right\",\n bindKey: bindKey(\"Ctrl-Delete\", \"Alt-Delete\"),\n exec: function (editor) { editor.removeWordRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"outdent\",\n description: \"Outdent\",\n bindKey: bindKey(\"Shift-Tab\", \"Shift-Tab\"),\n exec: function (editor) { editor.blockOutdent(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"indent\",\n description: \"Indent\",\n bindKey: bindKey(\"Tab\", \"Tab\"),\n exec: function (editor) { editor.indent(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"blockoutdent\",\n description: \"Block outdent\",\n bindKey: bindKey(\"Ctrl-[\", \"Ctrl-[\"),\n exec: function (editor) { editor.blockOutdent(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"blockindent\",\n description: \"Block indent\",\n bindKey: bindKey(\"Ctrl-]\", \"Ctrl-]\"),\n exec: function (editor) { editor.blockIndent(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"insertstring\",\n description: \"Insert string\",\n exec: function (editor, str) { editor.insert(str); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"inserttext\",\n description: \"Insert text\",\n exec: function (editor, args) {\n editor.insert(lang.stringRepeat(args.text || \"\", args.times || 1));\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"splitline\",\n description: \"Split line\",\n bindKey: bindKey(null, \"Ctrl-O\"),\n exec: function (editor) { editor.splitLine(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"transposeletters\",\n description: \"Transpose letters\",\n bindKey: bindKey(\"Alt-Shift-X\", \"Ctrl-T\"),\n exec: function (editor) { editor.transposeLetters(); },\n multiSelectAction: function (editor) { editor.transposeSelections(1); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"touppercase\",\n description: \"To uppercase\",\n bindKey: bindKey(\"Ctrl-U\", \"Ctrl-U\"),\n exec: function (editor) { editor.toUpperCase(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"tolowercase\",\n description: \"To lowercase\",\n bindKey: bindKey(\"Ctrl-Shift-U\", \"Ctrl-Shift-U\"),\n exec: function (editor) { editor.toLowerCase(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"autoindent\",\n description: \"Auto Indent\",\n bindKey: bindKey(null, null),\n exec: function (editor) { editor.autoIndent(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"animate\"\n }, {\n name: \"expandtoline\",\n description: \"Expand to line\",\n bindKey: bindKey(\"Ctrl-Shift-L\", \"Command-Shift-L\"),\n exec: function (editor) {\n var range = editor.selection.getRange();\n range.start.column = range.end.column = 0;\n range.end.row++;\n editor.selection.setRange(range, false);\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"openlink\",\n bindKey: bindKey(\"Ctrl+F3\", \"F3\"),\n exec: function (editor) { editor.openLink(); }\n }, {\n name: \"joinlines\",\n description: \"Join lines\",\n bindKey: bindKey(null, null),\n exec: function (editor) {\n var isBackwards = editor.selection.isBackwards();\n var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor();\n var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead();\n var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length;\n var selectedText = editor.session.doc.getTextRange(editor.selection.getRange());\n var selectedCount = selectedText.replace(/\\n\\s*/, \" \").length;\n var insertLine = editor.session.doc.getLine(selectionStart.row);\n for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) {\n var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i)));\n if (curLine.length !== 0) {\n curLine = \" \" + curLine;\n }\n insertLine += curLine;\n }\n if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) {\n insertLine += editor.session.doc.getNewLineCharacter();\n }\n editor.clearSelection();\n editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine);\n if (selectedCount > 0) {\n editor.selection.moveCursorTo(selectionStart.row, selectionStart.column);\n editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount);\n }\n else {\n firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol;\n editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol);\n }\n },\n multiSelectAction: \"forEach\",\n readOnly: true\n }, {\n name: \"invertSelection\",\n description: \"Invert selection\",\n bindKey: bindKey(null, null),\n exec: function (editor) {\n var endRow = editor.session.doc.getLength() - 1;\n var endCol = editor.session.doc.getLine(endRow).length;\n var ranges = editor.selection.rangeList.ranges;\n var newRanges = [];\n if (ranges.length < 1) {\n ranges = [editor.selection.getRange()];\n }\n for (var i = 0; i < ranges.length; i++) {\n if (i == (ranges.length - 1)) {\n if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) {\n newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol));\n }\n }\n if (i === 0) {\n if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) {\n newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column));\n }\n }\n else {\n newRanges.push(new Range(ranges[i - 1].end.row, ranges[i - 1].end.column, ranges[i].start.row, ranges[i].start.column));\n }\n }\n editor.exitMultiSelectMode();\n editor.clearSelection();\n for (var i = 0; i < newRanges.length; i++) {\n editor.selection.addRange(newRanges[i], false);\n }\n },\n readOnly: true,\n scrollIntoView: \"none\"\n }, {\n name: \"addLineAfter\",\n description: \"Add new line after the current line\",\n exec: function (editor) {\n editor.selection.clearSelection();\n editor.navigateLineEnd();\n editor.insert(\"\\n\");\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"addLineBefore\",\n description: \"Add new line before the current line\",\n exec: function (editor) {\n editor.selection.clearSelection();\n var cursor = editor.getCursorPosition();\n editor.selection.moveTo(cursor.row - 1, Number.MAX_VALUE);\n editor.insert(\"\\n\");\n if (cursor.row === 0)\n editor.navigateUp();\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"openCommandPallete\",\n description: \"Open command palette\",\n bindKey: bindKey(\"F1\", \"F1\"),\n exec: function (editor) {\n editor.prompt({ $type: \"commands\" });\n },\n readOnly: true\n }, {\n name: \"modeSelect\",\n description: \"Change language mode...\",\n bindKey: bindKey(null, null),\n exec: function (editor) {\n editor.prompt({ $type: \"modes\" });\n },\n readOnly: true\n }];\nfor (var i = 1; i < 9; i++) {\n exports.commands.push({\n name: \"foldToLevel\" + i,\n description: \"Fold To Level \" + i,\n level: i,\n exec: function (editor) { editor.session.foldToLevel(this.level); },\n scrollIntoView: \"center\",\n readOnly: true\n });\n}\n\n});\n\nace.define(\"ace/line_widgets\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"./lib/dom\");\nvar LineWidgets = /** @class */ (function () {\n function LineWidgets(session) {\n this.session = session;\n this.session.widgetManager = this;\n this.session.getRowLength = this.getRowLength;\n this.session.$getWidgetScreenLength = this.$getWidgetScreenLength;\n this.updateOnChange = this.updateOnChange.bind(this);\n this.renderWidgets = this.renderWidgets.bind(this);\n this.measureWidgets = this.measureWidgets.bind(this);\n this.session._changedWidgets = [];\n this.$onChangeEditor = this.$onChangeEditor.bind(this);\n this.session.on(\"change\", this.updateOnChange);\n this.session.on(\"changeFold\", this.updateOnFold);\n this.session.on(\"changeEditor\", this.$onChangeEditor);\n }\n LineWidgets.prototype.getRowLength = function (row) {\n var h;\n if (this.lineWidgets)\n h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;\n else\n h = 0;\n if (!this.$useWrapMode || !this.$wrapData[row]) {\n return 1 + h;\n }\n else {\n return this.$wrapData[row].length + 1 + h;\n }\n };\n LineWidgets.prototype.$getWidgetScreenLength = function () {\n var screenRows = 0;\n this.lineWidgets.forEach(function (w) {\n if (w && w.rowCount && !w.hidden)\n screenRows += w.rowCount;\n });\n return screenRows;\n };\n LineWidgets.prototype.$onChangeEditor = function (e) {\n this.attach(e.editor);\n };\n LineWidgets.prototype.attach = function (editor) {\n if (editor && editor.widgetManager && editor.widgetManager != this)\n editor.widgetManager.detach();\n if (this.editor == editor)\n return;\n this.detach();\n this.editor = editor;\n if (editor) {\n editor.widgetManager = this;\n editor.renderer.on(\"beforeRender\", this.measureWidgets);\n editor.renderer.on(\"afterRender\", this.renderWidgets);\n }\n };\n LineWidgets.prototype.detach = function (e) {\n var editor = this.editor;\n if (!editor)\n return;\n this.editor = null;\n editor.widgetManager = null;\n editor.renderer.off(\"beforeRender\", this.measureWidgets);\n editor.renderer.off(\"afterRender\", this.renderWidgets);\n var lineWidgets = this.session.lineWidgets;\n lineWidgets && lineWidgets.forEach(function (w) {\n if (w && w.el && w.el.parentNode) {\n w._inDocument = false;\n w.el.parentNode.removeChild(w.el);\n }\n });\n };\n LineWidgets.prototype.updateOnFold = function (e, session) {\n var lineWidgets = session.lineWidgets;\n if (!lineWidgets || !e.action)\n return;\n var fold = e.data;\n var start = fold.start.row;\n var end = fold.end.row;\n var hide = e.action == \"add\";\n for (var i = start + 1; i < end; i++) {\n if (lineWidgets[i])\n lineWidgets[i].hidden = hide;\n }\n if (lineWidgets[end]) {\n if (hide) {\n if (!lineWidgets[start])\n lineWidgets[start] = lineWidgets[end];\n else\n lineWidgets[end].hidden = hide;\n }\n else {\n if (lineWidgets[start] == lineWidgets[end])\n lineWidgets[start] = undefined;\n lineWidgets[end].hidden = hide;\n }\n }\n };\n LineWidgets.prototype.updateOnChange = function (delta) {\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets)\n return;\n var startRow = delta.start.row;\n var len = delta.end.row - startRow;\n if (len === 0) {\n }\n else if (delta.action == \"remove\") {\n var removed = lineWidgets.splice(startRow + 1, len);\n if (!lineWidgets[startRow] && removed[removed.length - 1]) {\n lineWidgets[startRow] = removed.pop();\n }\n removed.forEach(function (w) {\n w && this.removeLineWidget(w);\n }, this);\n this.$updateRows();\n }\n else {\n var args = new Array(len);\n if (lineWidgets[startRow] && lineWidgets[startRow].column != null) {\n if (delta.start.column > lineWidgets[startRow].column)\n startRow++;\n }\n args.unshift(startRow, 0);\n lineWidgets.splice.apply(lineWidgets, args);\n this.$updateRows();\n }\n };\n LineWidgets.prototype.$updateRows = function () {\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets)\n return;\n var noWidgets = true;\n lineWidgets.forEach(function (w, i) {\n if (w) {\n noWidgets = false;\n w.row = i;\n while (w.$oldWidget) {\n w.$oldWidget.row = i;\n w = w.$oldWidget;\n }\n }\n });\n if (noWidgets)\n this.session.lineWidgets = null;\n };\n LineWidgets.prototype.$registerLineWidget = function (w) {\n if (!this.session.lineWidgets)\n this.session.lineWidgets = new Array(this.session.getLength());\n var old = this.session.lineWidgets[w.row];\n if (old) {\n w.$oldWidget = old;\n if (old.el && old.el.parentNode) {\n old.el.parentNode.removeChild(old.el);\n old._inDocument = false;\n }\n }\n this.session.lineWidgets[w.row] = w;\n return w;\n };\n LineWidgets.prototype.addLineWidget = function (w) {\n this.$registerLineWidget(w);\n w.session = this.session;\n if (!this.editor)\n return w;\n var renderer = this.editor.renderer;\n if (w.html && !w.el) {\n w.el = dom.createElement(\"div\");\n w.el.innerHTML = w.html;\n }\n if (w.text && !w.el) {\n w.el = dom.createElement(\"div\");\n w.el.textContent = w.text;\n }\n if (w.el) {\n dom.addCssClass(w.el, \"ace_lineWidgetContainer\");\n if (w.className) {\n dom.addCssClass(w.el, w.className);\n }\n w.el.style.position = \"absolute\";\n w.el.style.zIndex = 5;\n renderer.container.appendChild(w.el);\n w._inDocument = true;\n if (!w.coverGutter) {\n w.el.style.zIndex = 3;\n }\n if (w.pixelHeight == null) {\n w.pixelHeight = w.el.offsetHeight;\n }\n }\n if (w.rowCount == null) {\n w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight;\n }\n var fold = this.session.getFoldAt(w.row, 0);\n w.$fold = fold;\n if (fold) {\n var lineWidgets = this.session.lineWidgets;\n if (w.row == fold.end.row && !lineWidgets[fold.start.row])\n lineWidgets[fold.start.row] = w;\n else\n w.hidden = true;\n }\n this.session._emit(\"changeFold\", { data: { start: { row: w.row } } });\n this.$updateRows();\n this.renderWidgets(null, renderer);\n this.onWidgetChanged(w);\n return w;\n };\n LineWidgets.prototype.removeLineWidget = function (w) {\n w._inDocument = false;\n w.session = null;\n if (w.el && w.el.parentNode)\n w.el.parentNode.removeChild(w.el);\n if (w.editor && w.editor.destroy)\n try {\n w.editor.destroy();\n }\n catch (e) { }\n if (this.session.lineWidgets) {\n var w1 = this.session.lineWidgets[w.row];\n if (w1 == w) {\n this.session.lineWidgets[w.row] = w.$oldWidget;\n if (w.$oldWidget)\n this.onWidgetChanged(w.$oldWidget);\n }\n else {\n while (w1) {\n if (w1.$oldWidget == w) {\n w1.$oldWidget = w.$oldWidget;\n break;\n }\n w1 = w1.$oldWidget;\n }\n }\n }\n this.session._emit(\"changeFold\", { data: { start: { row: w.row } } });\n this.$updateRows();\n };\n LineWidgets.prototype.getWidgetsAtRow = function (row) {\n var lineWidgets = this.session.lineWidgets;\n var w = lineWidgets && lineWidgets[row];\n var list = [];\n while (w) {\n list.push(w);\n w = w.$oldWidget;\n }\n return list;\n };\n LineWidgets.prototype.onWidgetChanged = function (w) {\n this.session._changedWidgets.push(w);\n this.editor && this.editor.renderer.updateFull();\n };\n LineWidgets.prototype.measureWidgets = function (e, renderer) {\n var changedWidgets = this.session._changedWidgets;\n var config = renderer.layerConfig;\n if (!changedWidgets || !changedWidgets.length)\n return;\n var min = Infinity;\n for (var i = 0; i < changedWidgets.length; i++) {\n var w = changedWidgets[i];\n if (!w || !w.el)\n continue;\n if (w.session != this.session)\n continue;\n if (!w._inDocument) {\n if (this.session.lineWidgets[w.row] != w)\n continue;\n w._inDocument = true;\n renderer.container.appendChild(w.el);\n }\n w.h = w.el.offsetHeight;\n if (!w.fixedWidth) {\n w.w = w.el.offsetWidth;\n w.screenWidth = Math.ceil(w.w / config.characterWidth);\n }\n var rowCount = w.h / config.lineHeight;\n if (w.coverLine) {\n rowCount -= this.session.getRowLineCount(w.row);\n if (rowCount < 0)\n rowCount = 0;\n }\n if (w.rowCount != rowCount) {\n w.rowCount = rowCount;\n if (w.row < min)\n min = w.row;\n }\n }\n if (min != Infinity) {\n this.session._emit(\"changeFold\", { data: { start: { row: min } } });\n this.session.lineWidgetWidth = null;\n }\n this.session._changedWidgets = [];\n };\n LineWidgets.prototype.renderWidgets = function (e, renderer) {\n var config = renderer.layerConfig;\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets)\n return;\n var first = Math.min(this.firstRow, config.firstRow);\n var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length);\n while (first > 0 && !lineWidgets[first])\n first--;\n this.firstRow = config.firstRow;\n this.lastRow = config.lastRow;\n renderer.$cursorLayer.config = config;\n for (var i = first; i <= last; i++) {\n var w = lineWidgets[i];\n if (!w || !w.el)\n continue;\n if (w.hidden) {\n w.el.style.top = -100 - (w.pixelHeight || 0) + \"px\";\n continue;\n }\n if (!w._inDocument) {\n w._inDocument = true;\n renderer.container.appendChild(w.el);\n }\n var top = renderer.$cursorLayer.getPixelPosition({ row: i, column: 0 }, true).top;\n if (!w.coverLine)\n top += config.lineHeight * this.session.getRowLineCount(w.row);\n w.el.style.top = top - config.offset + \"px\";\n var left = w.coverGutter ? 0 : renderer.gutterWidth;\n if (!w.fixedWidth)\n left -= renderer.scrollLeft;\n w.el.style.left = left + \"px\";\n if (w.fullWidth && w.screenWidth) {\n w.el.style.minWidth = config.width + 2 * config.padding + \"px\";\n }\n if (w.fixedWidth) {\n w.el.style.right = renderer.scrollBar.getWidth() + \"px\";\n }\n else {\n w.el.style.right = \"\";\n }\n }\n };\n return LineWidgets;\n}());\nexports.LineWidgets = LineWidgets;\n\n});\n\nace.define(\"ace/keyboard/gutter_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/keys\",\"ace/mouse/default_gutter_handler\"], function(require, exports, module){\"use strict\";\nvar keys = require('../lib/keys');\nvar GutterTooltip = require(\"../mouse/default_gutter_handler\").GutterTooltip;\nvar GutterKeyboardHandler = /** @class */ (function () {\n function GutterKeyboardHandler(editor) {\n this.editor = editor;\n this.gutterLayer = editor.renderer.$gutterLayer;\n this.element = editor.renderer.$gutter;\n this.lines = editor.renderer.$gutterLayer.$lines;\n this.activeRowIndex = null;\n this.activeLane = null;\n this.annotationTooltip = new GutterTooltip(this.editor);\n }\n GutterKeyboardHandler.prototype.addListener = function () {\n this.element.addEventListener(\"keydown\", this.$onGutterKeyDown.bind(this));\n this.element.addEventListener(\"focusout\", this.$blurGutter.bind(this));\n this.editor.on(\"mousewheel\", this.$blurGutter.bind(this));\n };\n GutterKeyboardHandler.prototype.removeListener = function () {\n this.element.removeEventListener(\"keydown\", this.$onGutterKeyDown.bind(this));\n this.element.removeEventListener(\"focusout\", this.$blurGutter.bind(this));\n this.editor.off(\"mousewheel\", this.$blurGutter.bind(this));\n };\n GutterKeyboardHandler.prototype.$onGutterKeyDown = function (e) {\n if (this.annotationTooltip.isOpen) {\n e.preventDefault();\n if (e.keyCode === keys[\"escape\"])\n this.annotationTooltip.hideTooltip();\n return;\n }\n if (e.target === this.element) {\n if (e.keyCode != keys[\"enter\"]) {\n return;\n }\n e.preventDefault();\n var row = this.editor.getCursorPosition().row;\n if (!this.editor.isRowVisible(row))\n this.editor.scrollToLine(row, true, true);\n setTimeout(function () {\n var index = this.$rowToRowIndex(this.gutterLayer.$cursorCell.row);\n var nearestFoldIndex = this.$findNearestFoldWidget(index);\n var nearestAnnotationIndex = this.$findNearestAnnotation(index);\n if (nearestFoldIndex === null && nearestAnnotationIndex === null)\n return;\n if (nearestFoldIndex === null && nearestAnnotationIndex !== null) {\n this.activeRowIndex = nearestAnnotationIndex;\n this.activeLane = \"annotation\";\n this.$focusAnnotation(this.activeRowIndex);\n return;\n }\n if (nearestFoldIndex !== null && nearestAnnotationIndex === null) {\n this.activeRowIndex = nearestFoldIndex;\n this.activeLane = \"fold\";\n this.$focusFoldWidget(this.activeRowIndex);\n return;\n }\n if (Math.abs(nearestAnnotationIndex - index) < Math.abs(nearestFoldIndex - index)) {\n this.activeRowIndex = nearestAnnotationIndex;\n this.activeLane = \"annotation\";\n this.$focusAnnotation(this.activeRowIndex);\n return;\n }\n else {\n this.activeRowIndex = nearestFoldIndex;\n this.activeLane = \"fold\";\n this.$focusFoldWidget(this.activeRowIndex);\n return;\n }\n }.bind(this), 10);\n return;\n }\n this.$handleGutterKeyboardInteraction(e);\n setTimeout(function () {\n this.editor._signal(\"gutterkeydown\", new GutterKeyboardEvent(e, this));\n }.bind(this), 10);\n };\n GutterKeyboardHandler.prototype.$handleGutterKeyboardInteraction = function (e) {\n if (e.keyCode === keys[\"tab\"]) {\n e.preventDefault();\n return;\n }\n if (e.keyCode === keys[\"escape\"]) {\n e.preventDefault();\n this.$blurGutter();\n this.element.focus();\n this.lane = null;\n return;\n }\n if (e.keyCode === keys[\"up\"]) {\n e.preventDefault();\n switch (this.activeLane) {\n case \"fold\":\n this.$moveFoldWidgetUp();\n break;\n case \"annotation\":\n this.$moveAnnotationUp();\n break;\n }\n return;\n }\n if (e.keyCode === keys[\"down\"]) {\n e.preventDefault();\n switch (this.activeLane) {\n case \"fold\":\n this.$moveFoldWidgetDown();\n break;\n case \"annotation\":\n this.$moveAnnotationDown();\n break;\n }\n return;\n }\n if (e.keyCode === keys[\"left\"]) {\n e.preventDefault();\n this.$switchLane(\"annotation\");\n return;\n }\n if (e.keyCode === keys[\"right\"]) {\n e.preventDefault();\n this.$switchLane(\"fold\");\n return;\n }\n if (e.keyCode === keys[\"enter\"] || e.keyCode === keys[\"space\"]) {\n e.preventDefault();\n switch (this.activeLane) {\n case \"fold\":\n if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === 'start') {\n var rowFoldingWidget = this.$rowIndexToRow(this.activeRowIndex);\n this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex), e);\n setTimeout(function () {\n if (this.$rowIndexToRow(this.activeRowIndex) !== rowFoldingWidget) {\n this.$blurFoldWidget(this.activeRowIndex);\n this.activeRowIndex = this.$rowToRowIndex(rowFoldingWidget);\n this.$focusFoldWidget(this.activeRowIndex);\n }\n }.bind(this), 10);\n break;\n }\n else if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === 'end') {\n break;\n }\n return;\n case \"annotation\":\n var gutterElement = this.lines.cells[this.activeRowIndex].element.childNodes[2];\n var rect = gutterElement.getBoundingClientRect();\n var style = this.annotationTooltip.getElement().style;\n style.left = rect.right + \"px\";\n style.top = rect.bottom + \"px\";\n this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));\n break;\n }\n return;\n }\n };\n GutterKeyboardHandler.prototype.$blurGutter = function () {\n if (this.activeRowIndex !== null) {\n switch (this.activeLane) {\n case \"fold\":\n this.$blurFoldWidget(this.activeRowIndex);\n break;\n case \"annotation\":\n this.$blurAnnotation(this.activeRowIndex);\n break;\n }\n }\n if (this.annotationTooltip.isOpen)\n this.annotationTooltip.hideTooltip();\n return;\n };\n GutterKeyboardHandler.prototype.$isFoldWidgetVisible = function (index) {\n var isRowFullyVisible = this.editor.isRowFullyVisible(this.$rowIndexToRow(index));\n var isIconVisible = this.$getFoldWidget(index).style.display !== \"none\";\n return isRowFullyVisible && isIconVisible;\n };\n GutterKeyboardHandler.prototype.$isAnnotationVisible = function (index) {\n var isRowFullyVisible = this.editor.isRowFullyVisible(this.$rowIndexToRow(index));\n var isIconVisible = this.$getAnnotation(index).style.display !== \"none\";\n return isRowFullyVisible && isIconVisible;\n };\n GutterKeyboardHandler.prototype.$getFoldWidget = function (index) {\n var cell = this.lines.get(index);\n var element = cell.element;\n return element.childNodes[1];\n };\n GutterKeyboardHandler.prototype.$getAnnotation = function (index) {\n var cell = this.lines.get(index);\n var element = cell.element;\n return element.childNodes[2];\n };\n GutterKeyboardHandler.prototype.$findNearestFoldWidget = function (index) {\n if (this.$isFoldWidgetVisible(index))\n return index;\n var i = 0;\n while (index - i > 0 || index + i < this.lines.getLength() - 1) {\n i++;\n if (index - i >= 0 && this.$isFoldWidgetVisible(index - i))\n return index - i;\n if (index + i <= this.lines.getLength() - 1 && this.$isFoldWidgetVisible(index + i))\n return index + i;\n }\n return null;\n };\n GutterKeyboardHandler.prototype.$findNearestAnnotation = function (index) {\n if (this.$isAnnotationVisible(index))\n return index;\n var i = 0;\n while (index - i > 0 || index + i < this.lines.getLength() - 1) {\n i++;\n if (index - i >= 0 && this.$isAnnotationVisible(index - i))\n return index - i;\n if (index + i <= this.lines.getLength() - 1 && this.$isAnnotationVisible(index + i))\n return index + i;\n }\n return null;\n };\n GutterKeyboardHandler.prototype.$focusFoldWidget = function (index) {\n if (index == null)\n return;\n var foldWidget = this.$getFoldWidget(index);\n foldWidget.classList.add(this.editor.renderer.keyboardFocusClassName);\n foldWidget.focus();\n };\n GutterKeyboardHandler.prototype.$focusAnnotation = function (index) {\n if (index == null)\n return;\n var annotation = this.$getAnnotation(index);\n annotation.classList.add(this.editor.renderer.keyboardFocusClassName);\n annotation.focus();\n };\n GutterKeyboardHandler.prototype.$blurFoldWidget = function (index) {\n var foldWidget = this.$getFoldWidget(index);\n foldWidget.classList.remove(this.editor.renderer.keyboardFocusClassName);\n foldWidget.blur();\n };\n GutterKeyboardHandler.prototype.$blurAnnotation = function (index) {\n var annotation = this.$getAnnotation(index);\n annotation.classList.remove(this.editor.renderer.keyboardFocusClassName);\n annotation.blur();\n };\n GutterKeyboardHandler.prototype.$moveFoldWidgetUp = function () {\n var index = this.activeRowIndex;\n while (index > 0) {\n index--;\n if (this.$isFoldWidgetVisible(index)) {\n this.$blurFoldWidget(this.activeRowIndex);\n this.activeRowIndex = index;\n this.$focusFoldWidget(this.activeRowIndex);\n return;\n }\n }\n return;\n };\n GutterKeyboardHandler.prototype.$moveFoldWidgetDown = function () {\n var index = this.activeRowIndex;\n while (index < this.lines.getLength() - 1) {\n index++;\n if (this.$isFoldWidgetVisible(index)) {\n this.$blurFoldWidget(this.activeRowIndex);\n this.activeRowIndex = index;\n this.$focusFoldWidget(this.activeRowIndex);\n return;\n }\n }\n return;\n };\n GutterKeyboardHandler.prototype.$moveAnnotationUp = function () {\n var index = this.activeRowIndex;\n while (index > 0) {\n index--;\n if (this.$isAnnotationVisible(index)) {\n this.$blurAnnotation(this.activeRowIndex);\n this.activeRowIndex = index;\n this.$focusAnnotation(this.activeRowIndex);\n return;\n }\n }\n return;\n };\n GutterKeyboardHandler.prototype.$moveAnnotationDown = function () {\n var index = this.activeRowIndex;\n while (index < this.lines.getLength() - 1) {\n index++;\n if (this.$isAnnotationVisible(index)) {\n this.$blurAnnotation(this.activeRowIndex);\n this.activeRowIndex = index;\n this.$focusAnnotation(this.activeRowIndex);\n return;\n }\n }\n return;\n };\n GutterKeyboardHandler.prototype.$switchLane = function (desinationLane) {\n switch (desinationLane) {\n case \"annotation\":\n if (this.activeLane === \"annotation\") {\n break;\n }\n var annotationIndex = this.$findNearestAnnotation(this.activeRowIndex);\n if (annotationIndex == null) {\n break;\n }\n this.activeLane = \"annotation\";\n this.$blurFoldWidget(this.activeRowIndex);\n this.activeRowIndex = annotationIndex;\n this.$focusAnnotation(this.activeRowIndex);\n break;\n case \"fold\":\n if (this.activeLane === \"fold\") {\n break;\n }\n var foldWidgetIndex = this.$findNearestFoldWidget(this.activeRowIndex);\n if (foldWidgetIndex == null) {\n break;\n }\n this.activeLane = \"fold\";\n this.$blurAnnotation(this.activeRowIndex);\n this.activeRowIndex = foldWidgetIndex;\n this.$focusFoldWidget(this.activeRowIndex);\n break;\n }\n return;\n };\n GutterKeyboardHandler.prototype.$rowIndexToRow = function (index) {\n var cell = this.lines.get(index);\n if (cell)\n return cell.row;\n return null;\n };\n GutterKeyboardHandler.prototype.$rowToRowIndex = function (row) {\n for (var i = 0; i < this.lines.getLength(); i++) {\n var cell = this.lines.get(i);\n if (cell.row == row)\n return i;\n }\n return null;\n };\n return GutterKeyboardHandler;\n}());\nexports.GutterKeyboardHandler = GutterKeyboardHandler;\nvar GutterKeyboardEvent = /** @class */ (function () {\n function GutterKeyboardEvent(domEvent, gutterKeyboardHandler) {\n this.gutterKeyboardHandler = gutterKeyboardHandler;\n this.domEvent = domEvent;\n }\n GutterKeyboardEvent.prototype.getKey = function () {\n return keys.keyCodeToString(this.domEvent.keyCode);\n };\n GutterKeyboardEvent.prototype.getRow = function () {\n return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex);\n };\n GutterKeyboardEvent.prototype.isInAnnotationLane = function () {\n return this.gutterKeyboardHandler.activeLane === \"annotation\";\n };\n GutterKeyboardEvent.prototype.isInFoldLane = function () {\n return this.gutterKeyboardHandler.activeLane === \"fold\";\n };\n return GutterKeyboardEvent;\n}());\nexports.GutterKeyboardEvent = GutterKeyboardEvent;\n\n});\n\nace.define(\"ace/editor\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/lib/useragent\",\"ace/keyboard/textinput\",\"ace/mouse/mouse_handler\",\"ace/mouse/fold_handler\",\"ace/keyboard/keybinding\",\"ace/edit_session\",\"ace/search\",\"ace/range\",\"ace/lib/event_emitter\",\"ace/commands/command_manager\",\"ace/commands/default_commands\",\"ace/config\",\"ace/token_iterator\",\"ace/line_widgets\",\"ace/keyboard/gutter_handler\",\"ace/config\",\"ace/clipboard\",\"ace/lib/keys\"], function(require, exports, module){\"use strict\";\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar lang = require(\"./lib/lang\");\nvar useragent = require(\"./lib/useragent\");\nvar TextInput = require(\"./keyboard/textinput\").TextInput;\nvar MouseHandler = require(\"./mouse/mouse_handler\").MouseHandler;\nvar FoldHandler = require(\"./mouse/fold_handler\").FoldHandler;\nvar KeyBinding = require(\"./keyboard/keybinding\").KeyBinding;\nvar EditSession = require(\"./edit_session\").EditSession;\nvar Search = require(\"./search\").Search;\nvar Range = require(\"./range\").Range;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar CommandManager = require(\"./commands/command_manager\").CommandManager;\nvar defaultCommands = require(\"./commands/default_commands\").commands;\nvar config = require(\"./config\");\nvar TokenIterator = require(\"./token_iterator\").TokenIterator;\nvar LineWidgets = require(\"./line_widgets\").LineWidgets;\nvar GutterKeyboardHandler = require(\"./keyboard/gutter_handler\").GutterKeyboardHandler;\nvar nls = require(\"./config\").nls;\nvar clipboard = require(\"./clipboard\");\nvar keys = require('./lib/keys');\nvar Editor = /** @class */ (function () {\n function Editor(renderer, session, options) {\n this.$toDestroy = [];\n var container = renderer.getContainerElement();\n this.container = container;\n this.renderer = renderer;\n this.id = \"editor\" + (++Editor.$uid);\n this.commands = new CommandManager(useragent.isMac ? \"mac\" : \"win\", defaultCommands);\n if (typeof document == \"object\") {\n this.textInput = new TextInput(renderer.getTextAreaContainer(), this);\n this.renderer.textarea = this.textInput.getElement();\n this.$mouseHandler = new MouseHandler(this);\n new FoldHandler(this);\n }\n this.keyBinding = new KeyBinding(this);\n this.$search = new Search().set({\n wrap: true\n });\n this.$historyTracker = this.$historyTracker.bind(this);\n this.commands.on(\"exec\", this.$historyTracker);\n this.$initOperationListeners();\n this._$emitInputEvent = lang.delayedCall(function () {\n this._signal(\"input\", {});\n if (this.session && !this.session.destroyed)\n this.session.bgTokenizer.scheduleStart();\n }.bind(this));\n this.on(\"change\", function (_, _self) {\n _self._$emitInputEvent.schedule(31);\n });\n this.setSession(session || options && options.session || new EditSession(\"\"));\n config.resetOptions(this);\n if (options)\n this.setOptions(options);\n config._signal(\"editor\", this);\n }\n Editor.prototype.$initOperationListeners = function () {\n this.commands.on(\"exec\", this.startOperation.bind(this), true);\n this.commands.on(\"afterExec\", this.endOperation.bind(this), true);\n this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this, true));\n this.on(\"change\", function () {\n if (!this.curOp) {\n this.startOperation();\n this.curOp.selectionBefore = this.$lastSel;\n }\n this.curOp.docChanged = true;\n }.bind(this), true);\n this.on(\"changeSelection\", function () {\n if (!this.curOp) {\n this.startOperation();\n this.curOp.selectionBefore = this.$lastSel;\n }\n this.curOp.selectionChanged = true;\n }.bind(this), true);\n };\n Editor.prototype.startOperation = function (commandEvent) {\n if (this.curOp) {\n if (!commandEvent || this.curOp.command)\n return;\n this.prevOp = this.curOp;\n }\n if (!commandEvent) {\n this.previousCommand = null;\n commandEvent = {};\n }\n this.$opResetTimer.schedule();\n this.curOp = this.session.curOp = {\n command: commandEvent.command || {},\n args: commandEvent.args,\n scrollTop: this.renderer.scrollTop\n };\n this.curOp.selectionBefore = this.selection.toJSON();\n };\n Editor.prototype.endOperation = function (e) {\n if (this.curOp && this.session) {\n if (e && e.returnValue === false || !this.session)\n return (this.curOp = null);\n if (e == true && this.curOp.command && this.curOp.command.name == \"mouse\")\n return;\n this._signal(\"beforeEndOperation\");\n if (!this.curOp)\n return;\n var command = this.curOp.command;\n var scrollIntoView = command && command.scrollIntoView;\n if (scrollIntoView) {\n switch (scrollIntoView) {\n case \"center-animate\":\n scrollIntoView = \"animate\";\n case \"center\":\n this.renderer.scrollCursorIntoView(null, 0.5);\n break;\n case \"animate\":\n case \"cursor\":\n this.renderer.scrollCursorIntoView();\n break;\n case \"selectionPart\":\n var range = this.selection.getRange();\n var config = this.renderer.layerConfig;\n if (range.start.row >= config.lastRow || range.end.row <= config.firstRow) {\n this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead);\n }\n break;\n default:\n break;\n }\n if (scrollIntoView == \"animate\")\n this.renderer.animateScrolling(this.curOp.scrollTop);\n }\n var sel = this.selection.toJSON();\n this.curOp.selectionAfter = sel;\n this.$lastSel = this.selection.toJSON();\n this.session.getUndoManager().addSelection(sel);\n this.prevOp = this.curOp;\n this.curOp = null;\n }\n };\n Editor.prototype.$historyTracker = function (e) {\n if (!this.$mergeUndoDeltas)\n return;\n var prev = this.prevOp;\n var mergeableCommands = this.$mergeableCommands;\n var shouldMerge = prev.command && (e.command.name == prev.command.name);\n if (e.command.name == \"insertstring\") {\n var text = e.args;\n if (this.mergeNextCommand === undefined)\n this.mergeNextCommand = true;\n shouldMerge = shouldMerge\n && this.mergeNextCommand // previous command allows to coalesce with\n && (!/\\s/.test(text) || /\\s/.test(prev.args)); // previous insertion was of same type\n this.mergeNextCommand = true;\n }\n else {\n shouldMerge = shouldMerge\n && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable\n }\n if (this.$mergeUndoDeltas != \"always\"\n && Date.now() - this.sequenceStartTime > 2000) {\n shouldMerge = false; // the sequence is too long\n }\n if (shouldMerge)\n this.session.mergeUndoDeltas = true;\n else if (mergeableCommands.indexOf(e.command.name) !== -1)\n this.sequenceStartTime = Date.now();\n };\n Editor.prototype.setKeyboardHandler = function (keyboardHandler, cb) {\n if (keyboardHandler && typeof keyboardHandler === \"string\" && keyboardHandler != \"ace\") {\n this.$keybindingId = keyboardHandler;\n var _self = this;\n config.loadModule([\"keybinding\", keyboardHandler], function (module) {\n if (_self.$keybindingId == keyboardHandler)\n _self.keyBinding.setKeyboardHandler(module && module.handler);\n cb && cb();\n });\n }\n else {\n this.$keybindingId = null;\n this.keyBinding.setKeyboardHandler(keyboardHandler);\n cb && cb();\n }\n };\n Editor.prototype.getKeyboardHandler = function () {\n return this.keyBinding.getKeyboardHandler();\n };\n Editor.prototype.setSession = function (session) {\n if (this.session == session)\n return;\n if (this.curOp)\n this.endOperation();\n this.curOp = {};\n var oldSession = this.session;\n if (oldSession) {\n this.session.off(\"change\", this.$onDocumentChange);\n this.session.off(\"changeMode\", this.$onChangeMode);\n this.session.off(\"tokenizerUpdate\", this.$onTokenizerUpdate);\n this.session.off(\"changeTabSize\", this.$onChangeTabSize);\n this.session.off(\"changeWrapLimit\", this.$onChangeWrapLimit);\n this.session.off(\"changeWrapMode\", this.$onChangeWrapMode);\n this.session.off(\"changeFold\", this.$onChangeFold);\n this.session.off(\"changeFrontMarker\", this.$onChangeFrontMarker);\n this.session.off(\"changeBackMarker\", this.$onChangeBackMarker);\n this.session.off(\"changeBreakpoint\", this.$onChangeBreakpoint);\n this.session.off(\"changeAnnotation\", this.$onChangeAnnotation);\n this.session.off(\"changeOverwrite\", this.$onCursorChange);\n this.session.off(\"changeScrollTop\", this.$onScrollTopChange);\n this.session.off(\"changeScrollLeft\", this.$onScrollLeftChange);\n var selection = this.session.getSelection();\n selection.off(\"changeCursor\", this.$onCursorChange);\n selection.off(\"changeSelection\", this.$onSelectionChange);\n }\n this.session = session;\n if (session) {\n this.$onDocumentChange = this.onDocumentChange.bind(this);\n session.on(\"change\", this.$onDocumentChange);\n this.renderer.setSession(session);\n this.$onChangeMode = this.onChangeMode.bind(this);\n session.on(\"changeMode\", this.$onChangeMode);\n this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this);\n session.on(\"tokenizerUpdate\", this.$onTokenizerUpdate);\n this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer);\n session.on(\"changeTabSize\", this.$onChangeTabSize);\n this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this);\n session.on(\"changeWrapLimit\", this.$onChangeWrapLimit);\n this.$onChangeWrapMode = this.onChangeWrapMode.bind(this);\n session.on(\"changeWrapMode\", this.$onChangeWrapMode);\n this.$onChangeFold = this.onChangeFold.bind(this);\n session.on(\"changeFold\", this.$onChangeFold);\n this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this);\n this.session.on(\"changeFrontMarker\", this.$onChangeFrontMarker);\n this.$onChangeBackMarker = this.onChangeBackMarker.bind(this);\n this.session.on(\"changeBackMarker\", this.$onChangeBackMarker);\n this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this);\n this.session.on(\"changeBreakpoint\", this.$onChangeBreakpoint);\n this.$onChangeAnnotation = this.onChangeAnnotation.bind(this);\n this.session.on(\"changeAnnotation\", this.$onChangeAnnotation);\n this.$onCursorChange = this.onCursorChange.bind(this);\n this.session.on(\"changeOverwrite\", this.$onCursorChange);\n this.$onScrollTopChange = this.onScrollTopChange.bind(this);\n this.session.on(\"changeScrollTop\", this.$onScrollTopChange);\n this.$onScrollLeftChange = this.onScrollLeftChange.bind(this);\n this.session.on(\"changeScrollLeft\", this.$onScrollLeftChange);\n this.selection = session.getSelection();\n this.selection.on(\"changeCursor\", this.$onCursorChange);\n this.$onSelectionChange = this.onSelectionChange.bind(this);\n this.selection.on(\"changeSelection\", this.$onSelectionChange);\n this.onChangeMode();\n this.onCursorChange();\n this.onScrollTopChange();\n this.onScrollLeftChange();\n this.onSelectionChange();\n this.onChangeFrontMarker();\n this.onChangeBackMarker();\n this.onChangeBreakpoint();\n this.onChangeAnnotation();\n this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();\n this.renderer.updateFull();\n }\n else {\n this.selection = null;\n this.renderer.setSession(session);\n }\n this._signal(\"changeSession\", {\n session: session,\n oldSession: oldSession\n });\n this.curOp = null;\n oldSession && oldSession._signal(\"changeEditor\", { oldEditor: this });\n session && session._signal(\"changeEditor\", { editor: this });\n if (session && !session.destroyed)\n session.bgTokenizer.scheduleStart();\n };\n Editor.prototype.getSession = function () {\n return this.session;\n };\n Editor.prototype.setValue = function (val, cursorPos) {\n this.session.doc.setValue(val);\n if (!cursorPos)\n this.selectAll();\n else if (cursorPos == 1)\n this.navigateFileEnd();\n else if (cursorPos == -1)\n this.navigateFileStart();\n return val;\n };\n Editor.prototype.getValue = function () {\n return this.session.getValue();\n };\n Editor.prototype.getSelection = function () {\n return this.selection;\n };\n Editor.prototype.resize = function (force) {\n this.renderer.onResize(force);\n };\n Editor.prototype.setTheme = function (theme, cb) {\n this.renderer.setTheme(theme, cb);\n };\n Editor.prototype.getTheme = function () {\n return this.renderer.getTheme();\n };\n Editor.prototype.setStyle = function (style) {\n this.renderer.setStyle(style);\n };\n Editor.prototype.unsetStyle = function (style) {\n this.renderer.unsetStyle(style);\n };\n Editor.prototype.getFontSize = function () {\n return this.getOption(\"fontSize\") ||\n dom.computedStyle(this.container).fontSize;\n };\n Editor.prototype.setFontSize = function (size) {\n this.setOption(\"fontSize\", size);\n };\n Editor.prototype.$highlightBrackets = function () {\n if (this.$highlightPending) {\n return;\n }\n var self = this;\n this.$highlightPending = true;\n setTimeout(function () {\n self.$highlightPending = false;\n var session = self.session;\n if (!session || session.destroyed)\n return;\n if (session.$bracketHighlight) {\n session.$bracketHighlight.markerIds.forEach(function (id) {\n session.removeMarker(id);\n });\n session.$bracketHighlight = null;\n }\n var pos = self.getCursorPosition();\n var handler = self.getKeyboardHandler();\n var isBackwards = handler && handler.$getDirectionForHighlight && handler.$getDirectionForHighlight(self);\n var ranges = session.getMatchingBracketRanges(pos, isBackwards);\n if (!ranges) {\n var iterator = new TokenIterator(session, pos.row, pos.column);\n var token = iterator.getCurrentToken();\n if (token && /\\b(?:tag-open|tag-name)/.test(token.type)) {\n var tagNamesRanges = session.getMatchingTags(pos);\n if (tagNamesRanges)\n ranges = [tagNamesRanges.openTagName, tagNamesRanges.closeTagName];\n }\n }\n if (!ranges && session.$mode.getMatching)\n ranges = session.$mode.getMatching(self.session);\n if (!ranges) {\n if (self.getHighlightIndentGuides())\n self.renderer.$textLayer.$highlightIndentGuide();\n return;\n }\n var markerType = \"ace_bracket\";\n if (!Array.isArray(ranges)) {\n ranges = [ranges];\n }\n else if (ranges.length == 1) {\n markerType = \"ace_error_bracket\";\n }\n if (ranges.length == 2) {\n if (Range.comparePoints(ranges[0].end, ranges[1].start) == 0)\n ranges = [Range.fromPoints(ranges[0].start, ranges[1].end)];\n else if (Range.comparePoints(ranges[0].start, ranges[1].end) == 0)\n ranges = [Range.fromPoints(ranges[1].start, ranges[0].end)];\n }\n session.$bracketHighlight = {\n ranges: ranges,\n markerIds: ranges.map(function (range) {\n return session.addMarker(range, markerType, \"text\");\n })\n };\n if (self.getHighlightIndentGuides())\n self.renderer.$textLayer.$highlightIndentGuide();\n }, 50);\n };\n Editor.prototype.focus = function () {\n this.textInput.focus();\n };\n Editor.prototype.isFocused = function () {\n return this.textInput.isFocused();\n };\n Editor.prototype.blur = function () {\n this.textInput.blur();\n };\n Editor.prototype.onFocus = function (e) {\n if (this.$isFocused)\n return;\n this.$isFocused = true;\n this.renderer.showCursor();\n this.renderer.visualizeFocus();\n this._emit(\"focus\", e);\n };\n Editor.prototype.onBlur = function (e) {\n if (!this.$isFocused)\n return;\n this.$isFocused = false;\n this.renderer.hideCursor();\n this.renderer.visualizeBlur();\n this._emit(\"blur\", e);\n };\n Editor.prototype.$cursorChange = function () {\n this.renderer.updateCursor();\n this.$highlightBrackets();\n this.$updateHighlightActiveLine();\n };\n Editor.prototype.onDocumentChange = function (delta) {\n var wrap = this.session.$useWrapMode;\n var lastRow = (delta.start.row == delta.end.row ? delta.end.row : Infinity);\n this.renderer.updateLines(delta.start.row, lastRow, wrap);\n this._signal(\"change\", delta);\n this.$cursorChange();\n };\n Editor.prototype.onTokenizerUpdate = function (e) {\n var rows = e.data;\n this.renderer.updateLines(rows.first, rows.last);\n };\n Editor.prototype.onScrollTopChange = function () {\n this.renderer.scrollToY(this.session.getScrollTop());\n };\n Editor.prototype.onScrollLeftChange = function () {\n this.renderer.scrollToX(this.session.getScrollLeft());\n };\n Editor.prototype.onCursorChange = function () {\n this.$cursorChange();\n this._signal(\"changeSelection\");\n };\n Editor.prototype.$updateHighlightActiveLine = function () {\n var session = this.getSession();\n var highlight;\n if (this.$highlightActiveLine) {\n if (this.$selectionStyle != \"line\" || !this.selection.isMultiLine())\n highlight = this.getCursorPosition();\n if (this.renderer.theme && this.renderer.theme.$selectionColorConflict && !this.selection.isEmpty())\n highlight = false;\n if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1))\n highlight = false;\n }\n if (session.$highlightLineMarker && !highlight) {\n session.removeMarker(session.$highlightLineMarker.id);\n session.$highlightLineMarker = null;\n }\n else if (!session.$highlightLineMarker && highlight) {\n var range = new Range(highlight.row, highlight.column, highlight.row, Infinity);\n range.id = session.addMarker(range, \"ace_active-line\", \"screenLine\");\n session.$highlightLineMarker = range;\n }\n else if (highlight) {\n session.$highlightLineMarker.start.row = highlight.row;\n session.$highlightLineMarker.end.row = highlight.row;\n session.$highlightLineMarker.start.column = highlight.column;\n session._signal(\"changeBackMarker\");\n }\n };\n Editor.prototype.onSelectionChange = function (e) {\n var session = this.session;\n if (session.$selectionMarker) {\n session.removeMarker(session.$selectionMarker);\n }\n session.$selectionMarker = null;\n if (!this.selection.isEmpty()) {\n var range = this.selection.getRange();\n var style = this.getSelectionStyle();\n session.$selectionMarker = session.addMarker(range, \"ace_selection\", style);\n }\n else {\n this.$updateHighlightActiveLine();\n }\n var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();\n this.session.highlight(re);\n this._signal(\"changeSelection\");\n };\n Editor.prototype.$getSelectionHighLightRegexp = function () {\n var session = this.session;\n var selection = this.getSelectionRange();\n if (selection.isEmpty() || selection.isMultiLine())\n return;\n var startColumn = selection.start.column;\n var endColumn = selection.end.column;\n var line = session.getLine(selection.start.row);\n var needle = line.substring(startColumn, endColumn);\n if (needle.length > 5000 || !/[\\w\\d]/.test(needle))\n return;\n var re = this.$search.$assembleRegExp({\n wholeWord: true,\n caseSensitive: true,\n needle: needle\n });\n var wordWithBoundary = line.substring(startColumn - 1, endColumn + 1);\n if (!re.test(wordWithBoundary))\n return;\n return re;\n };\n Editor.prototype.onChangeFrontMarker = function () {\n this.renderer.updateFrontMarkers();\n };\n Editor.prototype.onChangeBackMarker = function () {\n this.renderer.updateBackMarkers();\n };\n Editor.prototype.onChangeBreakpoint = function () {\n this.renderer.updateBreakpoints();\n };\n Editor.prototype.onChangeAnnotation = function () {\n this.renderer.setAnnotations(this.session.getAnnotations());\n };\n Editor.prototype.onChangeMode = function (e) {\n this.renderer.updateText();\n this._emit(\"changeMode\", e);\n };\n Editor.prototype.onChangeWrapLimit = function () {\n this.renderer.updateFull();\n };\n Editor.prototype.onChangeWrapMode = function () {\n this.renderer.onResize(true);\n };\n Editor.prototype.onChangeFold = function () {\n this.$updateHighlightActiveLine();\n this.renderer.updateFull();\n };\n Editor.prototype.getSelectedText = function () {\n return this.session.getTextRange(this.getSelectionRange());\n };\n Editor.prototype.getCopyText = function () {\n var text = this.getSelectedText();\n var nl = this.session.doc.getNewLineCharacter();\n var copyLine = false;\n if (!text && this.$copyWithEmptySelection) {\n copyLine = true;\n var ranges = this.selection.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (i && ranges[i - 1].start.row == range.start.row)\n continue;\n text += this.session.getLine(range.start.row) + nl;\n }\n }\n var e = { text: text };\n this._signal(\"copy\", e);\n clipboard.lineMode = copyLine ? e.text : false;\n return e.text;\n };\n Editor.prototype.onCopy = function () {\n this.commands.exec(\"copy\", this);\n };\n Editor.prototype.onCut = function () {\n this.commands.exec(\"cut\", this);\n };\n Editor.prototype.onPaste = function (text, event) {\n var e = { text: text, event: event };\n this.commands.exec(\"paste\", this, e);\n };\n Editor.prototype.$handlePaste = function (e) {\n if (typeof e == \"string\")\n e = { text: e };\n this._signal(\"paste\", e);\n var text = e.text;\n var lineMode = text === clipboard.lineMode;\n var session = this.session;\n if (!this.inMultiSelectMode || this.inVirtualSelectionMode) {\n if (lineMode)\n session.insert({ row: this.selection.lead.row, column: 0 }, text);\n else\n this.insert(text);\n }\n else if (lineMode) {\n this.selection.rangeList.ranges.forEach(function (range) {\n session.insert({ row: range.start.row, column: 0 }, text);\n });\n }\n else {\n var lines = text.split(/\\r\\n|\\r|\\n/);\n var ranges = this.selection.rangeList.ranges;\n var isFullLine = lines.length == 2 && (!lines[0] || !lines[1]);\n if (lines.length != ranges.length || isFullLine)\n return this.commands.exec(\"insertstring\", this, text);\n for (var i = ranges.length; i--;) {\n var range = ranges[i];\n if (!range.isEmpty())\n session.remove(range);\n session.insert(range.start, lines[i]);\n }\n }\n };\n Editor.prototype.execCommand = function (command, args) {\n return this.commands.exec(command, this, args);\n };\n Editor.prototype.insert = function (text, pasted) {\n var session = this.session;\n var mode = session.getMode();\n var cursor = this.getCursorPosition();\n if (this.getBehavioursEnabled() && !pasted) {\n var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text);\n if (transform) {\n if (text !== transform.text) {\n if (!this.inVirtualSelectionMode) {\n this.session.mergeUndoDeltas = false;\n this.mergeNextCommand = false;\n }\n }\n text = transform.text;\n }\n }\n if (text == \"\\t\")\n text = this.session.getTabString();\n if (!this.selection.isEmpty()) {\n var range = this.getSelectionRange();\n cursor = this.session.remove(range);\n this.clearSelection();\n }\n else if (this.session.getOverwrite() && text.indexOf(\"\\n\") == -1) {\n var range = new Range.fromPoints(cursor, cursor);\n range.end.column += text.length;\n this.session.remove(range);\n }\n if (text == \"\\n\" || text == \"\\r\\n\") {\n var line = session.getLine(cursor.row);\n if (cursor.column > line.search(/\\S|$/)) {\n var d = line.substr(cursor.column).search(/\\S|$/);\n session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d);\n }\n }\n this.clearSelection();\n var start = cursor.column;\n var lineState = session.getState(cursor.row);\n var line = session.getLine(cursor.row);\n var shouldOutdent = mode.checkOutdent(lineState, line, text);\n session.insert(cursor, text);\n if (transform && transform.selection) {\n if (transform.selection.length == 2) { // Transform relative to the current column\n this.selection.setSelectionRange(new Range(cursor.row, start + transform.selection[0], cursor.row, start + transform.selection[1]));\n }\n else { // Transform relative to the current row.\n this.selection.setSelectionRange(new Range(cursor.row + transform.selection[0], transform.selection[1], cursor.row + transform.selection[2], transform.selection[3]));\n }\n }\n if (this.$enableAutoIndent) {\n if (session.getDocument().isNewLine(text)) {\n var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString());\n session.insert({ row: cursor.row + 1, column: 0 }, lineIndent);\n }\n if (shouldOutdent)\n mode.autoOutdent(lineState, session, cursor.row);\n }\n };\n Editor.prototype.autoIndent = function () {\n var session = this.session;\n var mode = session.getMode();\n var startRow, endRow;\n if (this.selection.isEmpty()) {\n startRow = 0;\n endRow = session.doc.getLength() - 1;\n }\n else {\n var selectedRange = this.getSelectionRange();\n startRow = selectedRange.start.row;\n endRow = selectedRange.end.row;\n }\n var prevLineState = \"\";\n var prevLine = \"\";\n var lineIndent = \"\";\n var line, currIndent, range;\n var tab = session.getTabString();\n for (var row = startRow; row <= endRow; row++) {\n if (row > 0) {\n prevLineState = session.getState(row - 1);\n prevLine = session.getLine(row - 1);\n lineIndent = mode.getNextLineIndent(prevLineState, prevLine, tab);\n }\n line = session.getLine(row);\n currIndent = mode.$getIndent(line);\n if (lineIndent !== currIndent) {\n if (currIndent.length > 0) {\n range = new Range(row, 0, row, currIndent.length);\n session.remove(range);\n }\n if (lineIndent.length > 0) {\n session.insert({ row: row, column: 0 }, lineIndent);\n }\n }\n mode.autoOutdent(prevLineState, session, row);\n }\n };\n Editor.prototype.onTextInput = function (text, composition) {\n if (!composition)\n return this.keyBinding.onTextInput(text);\n this.startOperation({ command: { name: \"insertstring\" } });\n var applyComposition = this.applyComposition.bind(this, text, composition);\n if (this.selection.rangeCount)\n this.forEachSelection(applyComposition);\n else\n applyComposition();\n this.endOperation();\n };\n Editor.prototype.applyComposition = function (text, composition) {\n if (composition.extendLeft || composition.extendRight) {\n var r = this.selection.getRange();\n r.start.column -= composition.extendLeft;\n r.end.column += composition.extendRight;\n if (r.start.column < 0) {\n r.start.row--;\n r.start.column += this.session.getLine(r.start.row).length + 1;\n }\n this.selection.setRange(r);\n if (!text && !r.isEmpty())\n this.remove();\n }\n if (text || !this.selection.isEmpty())\n this.insert(text, true);\n if (composition.restoreStart || composition.restoreEnd) {\n var r = this.selection.getRange();\n r.start.column -= composition.restoreStart;\n r.end.column -= composition.restoreEnd;\n this.selection.setRange(r);\n }\n };\n Editor.prototype.onCommandKey = function (e, hashId, keyCode) {\n return this.keyBinding.onCommandKey(e, hashId, keyCode);\n };\n Editor.prototype.setOverwrite = function (overwrite) {\n this.session.setOverwrite(overwrite);\n };\n Editor.prototype.getOverwrite = function () {\n return this.session.getOverwrite();\n };\n Editor.prototype.toggleOverwrite = function () {\n this.session.toggleOverwrite();\n };\n Editor.prototype.setScrollSpeed = function (speed) {\n this.setOption(\"scrollSpeed\", speed);\n };\n Editor.prototype.getScrollSpeed = function () {\n return this.getOption(\"scrollSpeed\");\n };\n Editor.prototype.setDragDelay = function (dragDelay) {\n this.setOption(\"dragDelay\", dragDelay);\n };\n Editor.prototype.getDragDelay = function () {\n return this.getOption(\"dragDelay\");\n };\n Editor.prototype.setSelectionStyle = function (val) {\n this.setOption(\"selectionStyle\", val);\n };\n Editor.prototype.getSelectionStyle = function () {\n return this.getOption(\"selectionStyle\");\n };\n Editor.prototype.setHighlightActiveLine = function (shouldHighlight) {\n this.setOption(\"highlightActiveLine\", shouldHighlight);\n };\n Editor.prototype.getHighlightActiveLine = function () {\n return this.getOption(\"highlightActiveLine\");\n };\n Editor.prototype.setHighlightGutterLine = function (shouldHighlight) {\n this.setOption(\"highlightGutterLine\", shouldHighlight);\n };\n Editor.prototype.getHighlightGutterLine = function () {\n return this.getOption(\"highlightGutterLine\");\n };\n Editor.prototype.setHighlightSelectedWord = function (shouldHighlight) {\n this.setOption(\"highlightSelectedWord\", shouldHighlight);\n };\n Editor.prototype.getHighlightSelectedWord = function () {\n return this.$highlightSelectedWord;\n };\n Editor.prototype.setAnimatedScroll = function (shouldAnimate) {\n this.renderer.setAnimatedScroll(shouldAnimate);\n };\n Editor.prototype.getAnimatedScroll = function () {\n return this.renderer.getAnimatedScroll();\n };\n Editor.prototype.setShowInvisibles = function (showInvisibles) {\n this.renderer.setShowInvisibles(showInvisibles);\n };\n Editor.prototype.getShowInvisibles = function () {\n return this.renderer.getShowInvisibles();\n };\n Editor.prototype.setDisplayIndentGuides = function (display) {\n this.renderer.setDisplayIndentGuides(display);\n };\n Editor.prototype.getDisplayIndentGuides = function () {\n return this.renderer.getDisplayIndentGuides();\n };\n Editor.prototype.setHighlightIndentGuides = function (highlight) {\n this.renderer.setHighlightIndentGuides(highlight);\n };\n Editor.prototype.getHighlightIndentGuides = function () {\n return this.renderer.getHighlightIndentGuides();\n };\n Editor.prototype.setShowPrintMargin = function (showPrintMargin) {\n this.renderer.setShowPrintMargin(showPrintMargin);\n };\n Editor.prototype.getShowPrintMargin = function () {\n return this.renderer.getShowPrintMargin();\n };\n Editor.prototype.setPrintMarginColumn = function (showPrintMargin) {\n this.renderer.setPrintMarginColumn(showPrintMargin);\n };\n Editor.prototype.getPrintMarginColumn = function () {\n return this.renderer.getPrintMarginColumn();\n };\n Editor.prototype.setReadOnly = function (readOnly) {\n this.setOption(\"readOnly\", readOnly);\n };\n Editor.prototype.getReadOnly = function () {\n return this.getOption(\"readOnly\");\n };\n Editor.prototype.setBehavioursEnabled = function (enabled) {\n this.setOption(\"behavioursEnabled\", enabled);\n };\n Editor.prototype.getBehavioursEnabled = function () {\n return this.getOption(\"behavioursEnabled\");\n };\n Editor.prototype.setWrapBehavioursEnabled = function (enabled) {\n this.setOption(\"wrapBehavioursEnabled\", enabled);\n };\n Editor.prototype.getWrapBehavioursEnabled = function () {\n return this.getOption(\"wrapBehavioursEnabled\");\n };\n Editor.prototype.setShowFoldWidgets = function (show) {\n this.setOption(\"showFoldWidgets\", show);\n };\n Editor.prototype.getShowFoldWidgets = function () {\n return this.getOption(\"showFoldWidgets\");\n };\n Editor.prototype.setFadeFoldWidgets = function (fade) {\n this.setOption(\"fadeFoldWidgets\", fade);\n };\n Editor.prototype.getFadeFoldWidgets = function () {\n return this.getOption(\"fadeFoldWidgets\");\n };\n Editor.prototype.remove = function (dir) {\n if (this.selection.isEmpty()) {\n if (dir == \"left\")\n this.selection.selectLeft();\n else\n this.selection.selectRight();\n }\n var range = this.getSelectionRange();\n if (this.getBehavioursEnabled()) {\n var session = this.session;\n var state = session.getState(range.start.row);\n var new_range = session.getMode().transformAction(state, 'deletion', this, session, range);\n if (range.end.column === 0) {\n var text = session.getTextRange(range);\n if (text[text.length - 1] == \"\\n\") {\n var line = session.getLine(range.end.row);\n if (/^\\s+$/.test(line)) {\n range.end.column = line.length;\n }\n }\n }\n if (new_range)\n range = new_range;\n }\n this.session.remove(range);\n this.clearSelection();\n };\n Editor.prototype.removeWordRight = function () {\n if (this.selection.isEmpty())\n this.selection.selectWordRight();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n };\n Editor.prototype.removeWordLeft = function () {\n if (this.selection.isEmpty())\n this.selection.selectWordLeft();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n };\n Editor.prototype.removeToLineStart = function () {\n if (this.selection.isEmpty())\n this.selection.selectLineStart();\n if (this.selection.isEmpty())\n this.selection.selectLeft();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n };\n Editor.prototype.removeToLineEnd = function () {\n if (this.selection.isEmpty())\n this.selection.selectLineEnd();\n var range = this.getSelectionRange();\n if (range.start.column == range.end.column && range.start.row == range.end.row) {\n range.end.column = 0;\n range.end.row++;\n }\n this.session.remove(range);\n this.clearSelection();\n };\n Editor.prototype.splitLine = function () {\n if (!this.selection.isEmpty()) {\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n }\n var cursor = this.getCursorPosition();\n this.insert(\"\\n\");\n this.moveCursorToPosition(cursor);\n };\n Editor.prototype.setGhostText = function (text, position) {\n if (!this.session.widgetManager) {\n this.session.widgetManager = new LineWidgets(this.session);\n this.session.widgetManager.attach(this);\n }\n this.renderer.setGhostText(text, position);\n };\n Editor.prototype.removeGhostText = function () {\n if (!this.session.widgetManager)\n return;\n this.renderer.removeGhostText();\n };\n Editor.prototype.transposeLetters = function () {\n if (!this.selection.isEmpty()) {\n return;\n }\n var cursor = this.getCursorPosition();\n var column = cursor.column;\n if (column === 0)\n return;\n var line = this.session.getLine(cursor.row);\n var swap, range;\n if (column < line.length) {\n swap = line.charAt(column) + line.charAt(column - 1);\n range = new Range(cursor.row, column - 1, cursor.row, column + 1);\n }\n else {\n swap = line.charAt(column - 1) + line.charAt(column - 2);\n range = new Range(cursor.row, column - 2, cursor.row, column);\n }\n this.session.replace(range, swap);\n this.session.selection.moveToPosition(range.end);\n };\n Editor.prototype.toLowerCase = function () {\n var originalRange = this.getSelectionRange();\n if (this.selection.isEmpty()) {\n this.selection.selectWord();\n }\n var range = this.getSelectionRange();\n var text = this.session.getTextRange(range);\n this.session.replace(range, text.toLowerCase());\n this.selection.setSelectionRange(originalRange);\n };\n Editor.prototype.toUpperCase = function () {\n var originalRange = this.getSelectionRange();\n if (this.selection.isEmpty()) {\n this.selection.selectWord();\n }\n var range = this.getSelectionRange();\n var text = this.session.getTextRange(range);\n this.session.replace(range, text.toUpperCase());\n this.selection.setSelectionRange(originalRange);\n };\n Editor.prototype.indent = function () {\n var session = this.session;\n var range = this.getSelectionRange();\n if (range.start.row < range.end.row) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n }\n else if (range.start.column < range.end.column) {\n var text = session.getTextRange(range);\n if (!/^\\s+$/.test(text)) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n }\n }\n var line = session.getLine(range.start.row);\n var position = range.start;\n var size = session.getTabSize();\n var column = session.documentToScreenColumn(position.row, position.column);\n if (this.session.getUseSoftTabs()) {\n var count = (size - column % size);\n var indentString = lang.stringRepeat(\" \", count);\n }\n else {\n var count = column % size;\n while (line[range.start.column - 1] == \" \" && count) {\n range.start.column--;\n count--;\n }\n this.selection.setSelectionRange(range);\n indentString = \"\\t\";\n }\n return this.insert(indentString);\n };\n Editor.prototype.blockIndent = function () {\n var rows = this.$getSelectedRows();\n this.session.indentRows(rows.first, rows.last, \"\\t\");\n };\n Editor.prototype.blockOutdent = function () {\n var selection = this.session.getSelection();\n this.session.outdentRows(selection.getRange());\n };\n Editor.prototype.sortLines = function () {\n var rows = this.$getSelectedRows();\n var session = this.session;\n var lines = [];\n for (var i = rows.first; i <= rows.last; i++)\n lines.push(session.getLine(i));\n lines.sort(function (a, b) {\n if (a.toLowerCase() < b.toLowerCase())\n return -1;\n if (a.toLowerCase() > b.toLowerCase())\n return 1;\n return 0;\n });\n var deleteRange = new Range(0, 0, 0, 0);\n for (var i = rows.first; i <= rows.last; i++) {\n var line = session.getLine(i);\n deleteRange.start.row = i;\n deleteRange.end.row = i;\n deleteRange.end.column = line.length;\n session.replace(deleteRange, lines[i - rows.first]);\n }\n };\n Editor.prototype.toggleCommentLines = function () {\n var state = this.session.getState(this.getCursorPosition().row);\n var rows = this.$getSelectedRows();\n this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last);\n };\n Editor.prototype.toggleBlockComment = function () {\n var cursor = this.getCursorPosition();\n var state = this.session.getState(cursor.row);\n var range = this.getSelectionRange();\n this.session.getMode().toggleBlockComment(state, this.session, range, cursor);\n };\n Editor.prototype.getNumberAt = function (row, column) {\n var _numberRx = /[\\-]?[0-9]+(?:\\.[0-9]+)?/g;\n _numberRx.lastIndex = 0;\n var s = this.session.getLine(row);\n while (_numberRx.lastIndex < column) {\n var m = _numberRx.exec(s);\n if (m.index <= column && m.index + m[0].length >= column) {\n var number = {\n value: m[0],\n start: m.index,\n end: m.index + m[0].length\n };\n return number;\n }\n }\n return null;\n };\n Editor.prototype.modifyNumber = function (amount) {\n var row = this.selection.getCursor().row;\n var column = this.selection.getCursor().column;\n var charRange = new Range(row, column - 1, row, column);\n var c = this.session.getTextRange(charRange);\n if (!isNaN(parseFloat(c)) && isFinite(c)) {\n var nr = this.getNumberAt(row, column);\n if (nr) {\n var fp = nr.value.indexOf(\".\") >= 0 ? nr.start + nr.value.indexOf(\".\") + 1 : nr.end;\n var decimals = nr.start + nr.value.length - fp;\n var t = parseFloat(nr.value);\n t *= Math.pow(10, decimals);\n if (fp !== nr.end && column < fp) {\n amount *= Math.pow(10, nr.end - column - 1);\n }\n else {\n amount *= Math.pow(10, nr.end - column);\n }\n t += amount;\n t /= Math.pow(10, decimals);\n var nnr = t.toFixed(decimals);\n var replaceRange = new Range(row, nr.start, row, nr.end);\n this.session.replace(replaceRange, nnr);\n this.moveCursorTo(row, Math.max(nr.start + 1, column + nnr.length - nr.value.length));\n }\n }\n else {\n this.toggleWord();\n }\n };\n Editor.prototype.toggleWord = function () {\n var row = this.selection.getCursor().row;\n var column = this.selection.getCursor().column;\n this.selection.selectWord();\n var currentState = this.getSelectedText();\n var currWordStart = this.selection.getWordRange().start.column;\n var wordParts = currentState.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g, '$1 ').split(/\\s/);\n var delta = column - currWordStart - 1;\n if (delta < 0)\n delta = 0;\n var curLength = 0, itLength = 0;\n var that = this;\n if (currentState.match(/[A-Za-z0-9_]+/)) {\n wordParts.forEach(function (item, i) {\n itLength = curLength + item.length;\n if (delta >= curLength && delta <= itLength) {\n currentState = item;\n that.selection.clearSelection();\n that.moveCursorTo(row, curLength + currWordStart);\n that.selection.selectTo(row, itLength + currWordStart);\n }\n curLength = itLength;\n });\n }\n var wordPairs = this.$toggleWordPairs;\n var reg;\n for (var i = 0; i < wordPairs.length; i++) {\n var item = wordPairs[i];\n for (var j = 0; j <= 1; j++) {\n var negate = +!j;\n var firstCondition = currentState.match(new RegExp('^\\\\s?_?(' + lang.escapeRegExp(item[j]) + ')\\\\s?$', 'i'));\n if (firstCondition) {\n var secondCondition = currentState.match(new RegExp('([_]|^|\\\\s)(' + lang.escapeRegExp(firstCondition[1]) + ')($|\\\\s)', 'g'));\n if (secondCondition) {\n reg = currentState.replace(new RegExp(lang.escapeRegExp(item[j]), 'i'), function (result) {\n var res = item[negate];\n if (result.toUpperCase() == result) {\n res = res.toUpperCase();\n }\n else if (result.charAt(0).toUpperCase() == result.charAt(0)) {\n res = res.substr(0, 0) + item[negate].charAt(0).toUpperCase() + res.substr(1);\n }\n return res;\n });\n this.insert(reg);\n reg = \"\";\n }\n }\n }\n }\n };\n Editor.prototype.findLinkAt = function (row, column) {\n var e_1, _a;\n var line = this.session.getLine(row);\n var wordParts = line.split(/((?:https?|ftp):\\/\\/[\\S]+)/);\n var columnPosition = column;\n if (columnPosition < 0)\n columnPosition = 0;\n var previousPosition = 0, currentPosition = 0, match;\n try {\n for (var wordParts_1 = __values(wordParts), wordParts_1_1 = wordParts_1.next(); !wordParts_1_1.done; wordParts_1_1 = wordParts_1.next()) {\n var item = wordParts_1_1.value;\n currentPosition = previousPosition + item.length;\n if (columnPosition >= previousPosition && columnPosition <= currentPosition) {\n if (item.match(/((?:https?|ftp):\\/\\/[\\S]+)/)) {\n match = item.replace(/[\\s:.,'\";}\\]]+$/, \"\");\n break;\n }\n }\n previousPosition = currentPosition;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (wordParts_1_1 && !wordParts_1_1.done && (_a = wordParts_1.return)) _a.call(wordParts_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return match;\n };\n Editor.prototype.openLink = function () {\n var cursor = this.selection.getCursor();\n var url = this.findLinkAt(cursor.row, cursor.column);\n if (url)\n window.open(url, '_blank');\n return url != null;\n };\n Editor.prototype.removeLines = function () {\n var rows = this.$getSelectedRows();\n this.session.removeFullLines(rows.first, rows.last);\n this.clearSelection();\n };\n Editor.prototype.duplicateSelection = function () {\n var sel = this.selection;\n var doc = this.session;\n var range = sel.getRange();\n var reverse = sel.isBackwards();\n if (range.isEmpty()) {\n var row = range.start.row;\n doc.duplicateLines(row, row);\n }\n else {\n var point = reverse ? range.start : range.end;\n var endPoint = doc.insert(point, doc.getTextRange(range), false);\n range.start = point;\n range.end = endPoint;\n sel.setSelectionRange(range, reverse);\n }\n };\n Editor.prototype.moveLinesDown = function () {\n this.$moveLines(1, false);\n };\n Editor.prototype.moveLinesUp = function () {\n this.$moveLines(-1, false);\n };\n Editor.prototype.moveText = function (range, toPosition, copy) {\n return this.session.moveText(range, toPosition, copy);\n };\n Editor.prototype.copyLinesUp = function () {\n this.$moveLines(-1, true);\n };\n Editor.prototype.copyLinesDown = function () {\n this.$moveLines(1, true);\n };\n Editor.prototype.$moveLines = function (dir, copy) {\n var rows, moved;\n var selection = this.selection;\n if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) {\n var range = selection.toOrientedRange();\n rows = this.$getSelectedRows(range);\n moved = this.session.$moveLines(rows.first, rows.last, copy ? 0 : dir);\n if (copy && dir == -1)\n moved = 0;\n range.moveBy(moved, 0);\n selection.fromOrientedRange(range);\n }\n else {\n var ranges = selection.rangeList.ranges;\n selection.rangeList.detach(this.session);\n this.inVirtualSelectionMode = true;\n var diff = 0;\n var totalDiff = 0;\n var l = ranges.length;\n for (var i = 0; i < l; i++) {\n var rangeIndex = i;\n ranges[i].moveBy(diff, 0);\n rows = this.$getSelectedRows(ranges[i]);\n var first = rows.first;\n var last = rows.last;\n while (++i < l) {\n if (totalDiff)\n ranges[i].moveBy(totalDiff, 0);\n var subRows = this.$getSelectedRows(ranges[i]);\n if (copy && subRows.first != last)\n break;\n else if (!copy && subRows.first > last + 1)\n break;\n last = subRows.last;\n }\n i--;\n diff = this.session.$moveLines(first, last, copy ? 0 : dir);\n if (copy && dir == -1)\n rangeIndex = i + 1;\n while (rangeIndex <= i) {\n ranges[rangeIndex].moveBy(diff, 0);\n rangeIndex++;\n }\n if (!copy)\n diff = 0;\n totalDiff += diff;\n }\n selection.fromOrientedRange(selection.ranges[0]);\n selection.rangeList.attach(this.session);\n this.inVirtualSelectionMode = false;\n }\n };\n Editor.prototype.$getSelectedRows = function (range) {\n range = (range || this.getSelectionRange()).collapseRows();\n return {\n first: this.session.getRowFoldStart(range.start.row),\n last: this.session.getRowFoldEnd(range.end.row)\n };\n };\n Editor.prototype.onCompositionStart = function (compositionState) {\n this.renderer.showComposition(compositionState);\n };\n Editor.prototype.onCompositionUpdate = function (text) {\n this.renderer.setCompositionText(text);\n };\n Editor.prototype.onCompositionEnd = function () {\n this.renderer.hideComposition();\n };\n Editor.prototype.getFirstVisibleRow = function () {\n return this.renderer.getFirstVisibleRow();\n };\n Editor.prototype.getLastVisibleRow = function () {\n return this.renderer.getLastVisibleRow();\n };\n Editor.prototype.isRowVisible = function (row) {\n return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());\n };\n Editor.prototype.isRowFullyVisible = function (row) {\n return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow());\n };\n Editor.prototype.$getVisibleRowCount = function () {\n return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;\n };\n Editor.prototype.$moveByPage = function (dir, select) {\n var renderer = this.renderer;\n var config = this.renderer.layerConfig;\n var rows = dir * Math.floor(config.height / config.lineHeight);\n if (select === true) {\n this.selection.$moveSelection(function () {\n this.moveCursorBy(rows, 0);\n });\n }\n else if (select === false) {\n this.selection.moveCursorBy(rows, 0);\n this.selection.clearSelection();\n }\n var scrollTop = renderer.scrollTop;\n renderer.scrollBy(0, rows * config.lineHeight);\n if (select != null)\n renderer.scrollCursorIntoView(null, 0.5);\n renderer.animateScrolling(scrollTop);\n };\n Editor.prototype.selectPageDown = function () {\n this.$moveByPage(1, true);\n };\n Editor.prototype.selectPageUp = function () {\n this.$moveByPage(-1, true);\n };\n Editor.prototype.gotoPageDown = function () {\n this.$moveByPage(1, false);\n };\n Editor.prototype.gotoPageUp = function () {\n this.$moveByPage(-1, false);\n };\n Editor.prototype.scrollPageDown = function () {\n this.$moveByPage(1);\n };\n Editor.prototype.scrollPageUp = function () {\n this.$moveByPage(-1);\n };\n Editor.prototype.scrollToRow = function (row) {\n this.renderer.scrollToRow(row);\n };\n Editor.prototype.scrollToLine = function (line, center, animate, callback) {\n this.renderer.scrollToLine(line, center, animate, callback);\n };\n Editor.prototype.centerSelection = function () {\n var range = this.getSelectionRange();\n var pos = {\n row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2),\n column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2)\n };\n this.renderer.alignCursor(pos, 0.5);\n };\n Editor.prototype.getCursorPosition = function () {\n return this.selection.getCursor();\n };\n Editor.prototype.getCursorPositionScreen = function () {\n return this.session.documentToScreenPosition(this.getCursorPosition());\n };\n Editor.prototype.getSelectionRange = function () {\n return this.selection.getRange();\n };\n Editor.prototype.selectAll = function () {\n this.selection.selectAll();\n };\n Editor.prototype.clearSelection = function () {\n this.selection.clearSelection();\n };\n Editor.prototype.moveCursorTo = function (row, column) {\n this.selection.moveCursorTo(row, column);\n };\n Editor.prototype.moveCursorToPosition = function (pos) {\n this.selection.moveCursorToPosition(pos);\n };\n Editor.prototype.jumpToMatching = function (select, expand) {\n var cursor = this.getCursorPosition();\n var iterator = new TokenIterator(this.session, cursor.row, cursor.column);\n var prevToken = iterator.getCurrentToken();\n var tokenCount = 0;\n if (prevToken && prevToken.type.indexOf('tag-name') !== -1) {\n prevToken = iterator.stepBackward();\n }\n var token = prevToken || iterator.stepForward();\n if (!token)\n return;\n var matchType;\n var found = false;\n var depth = {};\n var i = cursor.column - token.start;\n var bracketType;\n var brackets = {\n \")\": \"(\",\n \"(\": \"(\",\n \"]\": \"[\",\n \"[\": \"[\",\n \"{\": \"{\",\n \"}\": \"{\"\n };\n do {\n if (token.value.match(/[{}()\\[\\]]/g)) {\n for (; i < token.value.length && !found; i++) {\n if (!brackets[token.value[i]]) {\n continue;\n }\n bracketType = brackets[token.value[i]] + '.' + token.type.replace(\"rparen\", \"lparen\");\n if (isNaN(depth[bracketType])) {\n depth[bracketType] = 0;\n }\n switch (token.value[i]) {\n case '(':\n case '[':\n case '{':\n depth[bracketType]++;\n break;\n case ')':\n case ']':\n case '}':\n depth[bracketType]--;\n if (depth[bracketType] === -1) {\n matchType = 'bracket';\n found = true;\n }\n break;\n }\n }\n }\n else if (token.type.indexOf('tag-name') !== -1) {\n if (isNaN(depth[token.value])) {\n depth[token.value] = 0;\n }\n if (prevToken.value === '<' && tokenCount > 1) {\n depth[token.value]++;\n }\n else if (prevToken.value === '') {\n depth[token.value]--;\n }\n if (depth[token.value] === -1) {\n matchType = 'tag';\n found = true;\n }\n }\n if (!found) {\n prevToken = token;\n tokenCount++;\n token = iterator.stepForward();\n i = 0;\n }\n } while (token && !found);\n if (!matchType)\n return;\n var range, pos;\n if (matchType === 'bracket') {\n range = this.session.getBracketRange(cursor);\n if (!range) {\n range = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + i - 1, iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + i - 1);\n pos = range.start;\n if (expand || pos.row === cursor.row && Math.abs(pos.column - cursor.column)\n < 2)\n range = this.session.getBracketRange(pos);\n }\n }\n else if (matchType === 'tag') {\n if (!token || token.type.indexOf('tag-name') === -1)\n return;\n range = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() - 2, iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() - 2);\n if (range.compare(cursor.row, cursor.column) === 0) {\n var tagsRanges = this.session.getMatchingTags(cursor);\n if (tagsRanges) {\n if (tagsRanges.openTag.contains(cursor.row, cursor.column)) {\n range = tagsRanges.closeTag;\n pos = range.start;\n }\n else {\n range = tagsRanges.openTag;\n if (tagsRanges.closeTag.start.row === cursor.row && tagsRanges.closeTag.start.column\n === cursor.column)\n pos = range.end;\n else\n pos = range.start;\n }\n }\n }\n pos = pos || range.start;\n }\n pos = range && range.cursor || pos;\n if (pos) {\n if (select) {\n if (range && expand) {\n this.selection.setRange(range);\n }\n else if (range && range.isEqual(this.getSelectionRange())) {\n this.clearSelection();\n }\n else {\n this.selection.selectTo(pos.row, pos.column);\n }\n }\n else {\n this.selection.moveTo(pos.row, pos.column);\n }\n }\n };\n Editor.prototype.gotoLine = function (lineNumber, column, animate) {\n this.selection.clearSelection();\n this.session.unfold({ row: lineNumber - 1, column: column || 0 });\n this.exitMultiSelectMode && this.exitMultiSelectMode();\n this.moveCursorTo(lineNumber - 1, column || 0);\n if (!this.isRowFullyVisible(lineNumber - 1))\n this.scrollToLine(lineNumber - 1, true, animate);\n };\n Editor.prototype.navigateTo = function (row, column) {\n this.selection.moveTo(row, column);\n };\n Editor.prototype.navigateUp = function (times) {\n if (this.selection.isMultiLine() && !this.selection.isBackwards()) {\n var selectionStart = this.selection.anchor.getPosition();\n return this.moveCursorToPosition(selectionStart);\n }\n this.selection.clearSelection();\n this.selection.moveCursorBy(-times || -1, 0);\n };\n Editor.prototype.navigateDown = function (times) {\n if (this.selection.isMultiLine() && this.selection.isBackwards()) {\n var selectionEnd = this.selection.anchor.getPosition();\n return this.moveCursorToPosition(selectionEnd);\n }\n this.selection.clearSelection();\n this.selection.moveCursorBy(times || 1, 0);\n };\n Editor.prototype.navigateLeft = function (times) {\n if (!this.selection.isEmpty()) {\n var selectionStart = this.getSelectionRange().start;\n this.moveCursorToPosition(selectionStart);\n }\n else {\n times = times || 1;\n while (times--) {\n this.selection.moveCursorLeft();\n }\n }\n this.clearSelection();\n };\n Editor.prototype.navigateRight = function (times) {\n if (!this.selection.isEmpty()) {\n var selectionEnd = this.getSelectionRange().end;\n this.moveCursorToPosition(selectionEnd);\n }\n else {\n times = times || 1;\n while (times--) {\n this.selection.moveCursorRight();\n }\n }\n this.clearSelection();\n };\n Editor.prototype.navigateLineStart = function () {\n this.selection.moveCursorLineStart();\n this.clearSelection();\n };\n Editor.prototype.navigateLineEnd = function () {\n this.selection.moveCursorLineEnd();\n this.clearSelection();\n };\n Editor.prototype.navigateFileEnd = function () {\n this.selection.moveCursorFileEnd();\n this.clearSelection();\n };\n Editor.prototype.navigateFileStart = function () {\n this.selection.moveCursorFileStart();\n this.clearSelection();\n };\n Editor.prototype.navigateWordRight = function () {\n this.selection.moveCursorWordRight();\n this.clearSelection();\n };\n Editor.prototype.navigateWordLeft = function () {\n this.selection.moveCursorWordLeft();\n this.clearSelection();\n };\n Editor.prototype.replace = function (replacement, options) {\n if (options)\n this.$search.set(options);\n var range = this.$search.find(this.session);\n var replaced = 0;\n if (!range)\n return replaced;\n if (this.$tryReplace(range, replacement)) {\n replaced = 1;\n }\n this.selection.setSelectionRange(range);\n this.renderer.scrollSelectionIntoView(range.start, range.end);\n return replaced;\n };\n Editor.prototype.replaceAll = function (replacement, options) {\n if (options) {\n this.$search.set(options);\n }\n var ranges = this.$search.findAll(this.session);\n var replaced = 0;\n if (!ranges.length)\n return replaced;\n var selection = this.getSelectionRange();\n this.selection.moveTo(0, 0);\n for (var i = ranges.length - 1; i >= 0; --i) {\n if (this.$tryReplace(ranges[i], replacement)) {\n replaced++;\n }\n }\n this.selection.setSelectionRange(selection);\n return replaced;\n };\n Editor.prototype.$tryReplace = function (range, replacement) {\n var input = this.session.getTextRange(range);\n replacement = this.$search.replace(input, replacement);\n if (replacement !== null) {\n range.end = this.session.replace(range, replacement);\n return range;\n }\n else {\n return null;\n }\n };\n Editor.prototype.getLastSearchOptions = function () {\n return this.$search.getOptions();\n };\n Editor.prototype.find = function (needle, options, animate) {\n if (!options)\n options = {};\n if (typeof needle == \"string\" || needle instanceof RegExp)\n options.needle = needle;\n else if (typeof needle == \"object\")\n oop.mixin(options, needle);\n var range = this.selection.getRange();\n if (options.needle == null) {\n needle = this.session.getTextRange(range)\n || this.$search.$options.needle;\n if (!needle) {\n range = this.session.getWordRange(range.start.row, range.start.column);\n needle = this.session.getTextRange(range);\n }\n this.$search.set({ needle: needle });\n }\n this.$search.set(options);\n if (!options.start)\n this.$search.set({ start: range });\n var newRange = this.$search.find(this.session);\n if (options.preventScroll)\n return newRange;\n if (newRange) {\n this.revealRange(newRange, animate);\n return newRange;\n }\n if (options.backwards)\n range.start = range.end;\n else\n range.end = range.start;\n this.selection.setRange(range);\n };\n Editor.prototype.findNext = function (options, animate) {\n this.find({ skipCurrent: true, backwards: false }, options, animate);\n };\n Editor.prototype.findPrevious = function (options, animate) {\n this.find(options, { skipCurrent: true, backwards: true }, animate);\n };\n Editor.prototype.revealRange = function (range, animate) {\n this.session.unfold(range);\n this.selection.setSelectionRange(range);\n var scrollTop = this.renderer.scrollTop;\n this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5);\n if (animate !== false)\n this.renderer.animateScrolling(scrollTop);\n };\n Editor.prototype.undo = function () {\n this.session.getUndoManager().undo(this.session);\n this.renderer.scrollCursorIntoView(null, 0.5);\n };\n Editor.prototype.redo = function () {\n this.session.getUndoManager().redo(this.session);\n this.renderer.scrollCursorIntoView(null, 0.5);\n };\n Editor.prototype.destroy = function () {\n if (this.$toDestroy) {\n this.$toDestroy.forEach(function (el) {\n el.destroy();\n });\n this.$toDestroy = null;\n }\n if (this.$mouseHandler)\n this.$mouseHandler.destroy();\n this.renderer.destroy();\n this._signal(\"destroy\", this);\n if (this.session)\n this.session.destroy();\n if (this._$emitInputEvent)\n this._$emitInputEvent.cancel();\n this.removeAllListeners();\n };\n Editor.prototype.setAutoScrollEditorIntoView = function (enable) {\n if (!enable)\n return;\n var rect;\n var self = this;\n var shouldScroll = false;\n if (!this.$scrollAnchor)\n this.$scrollAnchor = document.createElement(\"div\");\n var scrollAnchor = this.$scrollAnchor;\n scrollAnchor.style.cssText = \"position:absolute\";\n this.container.insertBefore(scrollAnchor, this.container.firstChild);\n var onChangeSelection = this.on(\"changeSelection\", function () {\n shouldScroll = true;\n });\n var onBeforeRender = this.renderer.on(\"beforeRender\", function () {\n if (shouldScroll)\n rect = self.renderer.container.getBoundingClientRect();\n });\n var onAfterRender = this.renderer.on(\"afterRender\", function () {\n if (shouldScroll && rect && (self.isFocused()\n || self.searchBox && self.searchBox.isFocused())) {\n var renderer = self.renderer;\n var pos = renderer.$cursorLayer.$pixelPos;\n var config = renderer.layerConfig;\n var top = pos.top - config.offset;\n if (pos.top >= 0 && top + rect.top < 0) {\n shouldScroll = true;\n }\n else if (pos.top < config.height &&\n pos.top + rect.top + config.lineHeight > window.innerHeight) {\n shouldScroll = false;\n }\n else {\n shouldScroll = null;\n }\n if (shouldScroll != null) {\n scrollAnchor.style.top = top + \"px\";\n scrollAnchor.style.left = pos.left + \"px\";\n scrollAnchor.style.height = config.lineHeight + \"px\";\n scrollAnchor.scrollIntoView(shouldScroll);\n }\n shouldScroll = rect = null;\n }\n });\n this.setAutoScrollEditorIntoView = function (enable) {\n if (enable)\n return;\n delete this.setAutoScrollEditorIntoView;\n this.off(\"changeSelection\", onChangeSelection);\n this.renderer.off(\"afterRender\", onAfterRender);\n this.renderer.off(\"beforeRender\", onBeforeRender);\n };\n };\n Editor.prototype.$resetCursorStyle = function () {\n var style = this.$cursorStyle || \"ace\";\n var cursorLayer = this.renderer.$cursorLayer;\n if (!cursorLayer)\n return;\n cursorLayer.setSmoothBlinking(/smooth/.test(style));\n cursorLayer.isBlinking = !this.$readOnly && style != \"wide\";\n dom.setCssClass(cursorLayer.element, \"ace_slim-cursors\", /slim/.test(style));\n };\n Editor.prototype.prompt = function (message, options, callback) {\n var editor = this;\n config.loadModule(\"ace/ext/prompt\", function (module) {\n module.prompt(editor, message, options, callback);\n });\n };\n return Editor;\n}());\nEditor.$uid = 0;\nEditor.prototype.curOp = null;\nEditor.prototype.prevOp = {};\nEditor.prototype.$mergeableCommands = [\"backspace\", \"del\", \"insertstring\"];\nEditor.prototype.$toggleWordPairs = [\n [\"first\", \"last\"],\n [\"true\", \"false\"],\n [\"yes\", \"no\"],\n [\"width\", \"height\"],\n [\"top\", \"bottom\"],\n [\"right\", \"left\"],\n [\"on\", \"off\"],\n [\"x\", \"y\"],\n [\"get\", \"set\"],\n [\"max\", \"min\"],\n [\"horizontal\", \"vertical\"],\n [\"show\", \"hide\"],\n [\"add\", \"remove\"],\n [\"up\", \"down\"],\n [\"before\", \"after\"],\n [\"even\", \"odd\"],\n [\"in\", \"out\"],\n [\"inside\", \"outside\"],\n [\"next\", \"previous\"],\n [\"increase\", \"decrease\"],\n [\"attach\", \"detach\"],\n [\"&&\", \"||\"],\n [\"==\", \"!=\"]\n];\noop.implement(Editor.prototype, EventEmitter);\nconfig.defineOptions(Editor.prototype, \"editor\", {\n selectionStyle: {\n set: function (style) {\n this.onSelectionChange();\n this._signal(\"changeSelectionStyle\", { data: style });\n },\n initialValue: \"line\"\n },\n highlightActiveLine: {\n set: function () { this.$updateHighlightActiveLine(); },\n initialValue: true\n },\n highlightSelectedWord: {\n set: function (shouldHighlight) { this.$onSelectionChange(); },\n initialValue: true\n },\n readOnly: {\n set: function (readOnly) {\n this.textInput.setReadOnly(readOnly);\n this.$resetCursorStyle();\n },\n initialValue: false\n },\n copyWithEmptySelection: {\n set: function (value) {\n this.textInput.setCopyWithEmptySelection(value);\n },\n initialValue: false\n },\n cursorStyle: {\n set: function (val) { this.$resetCursorStyle(); },\n values: [\"ace\", \"slim\", \"smooth\", \"wide\"],\n initialValue: \"ace\"\n },\n mergeUndoDeltas: {\n values: [false, true, \"always\"],\n initialValue: true\n },\n behavioursEnabled: { initialValue: true },\n wrapBehavioursEnabled: { initialValue: true },\n enableAutoIndent: { initialValue: true },\n autoScrollEditorIntoView: {\n set: function (val) { this.setAutoScrollEditorIntoView(val); }\n },\n keyboardHandler: {\n set: function (val) { this.setKeyboardHandler(val); },\n get: function () { return this.$keybindingId; },\n handlesSet: true\n },\n value: {\n set: function (val) { this.session.setValue(val); },\n get: function () { return this.getValue(); },\n handlesSet: true,\n hidden: true\n },\n session: {\n set: function (val) { this.setSession(val); },\n get: function () { return this.session; },\n handlesSet: true,\n hidden: true\n },\n showLineNumbers: {\n set: function (show) {\n this.renderer.$gutterLayer.setShowLineNumbers(show);\n this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER);\n if (show && this.$relativeLineNumbers)\n relativeNumberRenderer.attach(this);\n else\n relativeNumberRenderer.detach(this);\n },\n initialValue: true\n },\n relativeLineNumbers: {\n set: function (value) {\n if (this.$showLineNumbers && value)\n relativeNumberRenderer.attach(this);\n else\n relativeNumberRenderer.detach(this);\n }\n },\n placeholder: {\n set: function (message) {\n if (!this.$updatePlaceholder) {\n this.$updatePlaceholder = function () {\n var hasValue = this.session && (this.renderer.$composition ||\n this.session.getLength() > 1 || this.session.getLine(0).length > 0);\n if (hasValue && this.renderer.placeholderNode) {\n this.renderer.off(\"afterRender\", this.$updatePlaceholder);\n dom.removeCssClass(this.container, \"ace_hasPlaceholder\");\n this.renderer.placeholderNode.remove();\n this.renderer.placeholderNode = null;\n }\n else if (!hasValue && !this.renderer.placeholderNode) {\n this.renderer.on(\"afterRender\", this.$updatePlaceholder);\n dom.addCssClass(this.container, \"ace_hasPlaceholder\");\n var el = dom.createElement(\"div\");\n el.className = \"ace_placeholder\";\n el.textContent = this.$placeholder || \"\";\n this.renderer.placeholderNode = el;\n this.renderer.content.appendChild(this.renderer.placeholderNode);\n }\n else if (!hasValue && this.renderer.placeholderNode) {\n this.renderer.placeholderNode.textContent = this.$placeholder || \"\";\n }\n }.bind(this);\n this.on(\"input\", this.$updatePlaceholder);\n }\n this.$updatePlaceholder();\n }\n },\n enableKeyboardAccessibility: {\n set: function (value) {\n var blurCommand = {\n name: \"blurTextInput\",\n description: \"Set focus to the editor content div to allow tabbing through the page\",\n bindKey: \"Esc\",\n exec: function (editor) {\n editor.blur();\n editor.renderer.scroller.focus();\n },\n readOnly: true\n };\n var focusOnEnterKeyup = function (e) {\n if (e.target == this.renderer.scroller && e.keyCode === keys['enter']) {\n e.preventDefault();\n var row = this.getCursorPosition().row;\n if (!this.isRowVisible(row))\n this.scrollToLine(row, true, true);\n this.focus();\n }\n };\n var gutterKeyboardHandler;\n if (value) {\n this.renderer.enableKeyboardAccessibility = true;\n this.renderer.keyboardFocusClassName = \"ace_keyboard-focus\";\n this.textInput.getElement().setAttribute(\"tabindex\", -1);\n this.textInput.setNumberOfExtraLines(useragent.isWin ? 3 : 0);\n this.renderer.scroller.setAttribute(\"tabindex\", 0);\n this.renderer.scroller.setAttribute(\"role\", \"group\");\n this.renderer.scroller.setAttribute(\"aria-roledescription\", nls(\"editor\"));\n this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName);\n this.renderer.scroller.setAttribute(\"aria-label\", nls(\"Editor content, press Enter to start editing, press Escape to exit\"));\n this.renderer.scroller.addEventListener(\"keyup\", focusOnEnterKeyup.bind(this));\n this.commands.addCommand(blurCommand);\n this.renderer.$gutter.setAttribute(\"tabindex\", 0);\n this.renderer.$gutter.setAttribute(\"aria-hidden\", false);\n this.renderer.$gutter.setAttribute(\"role\", \"group\");\n this.renderer.$gutter.setAttribute(\"aria-roledescription\", nls(\"editor\"));\n this.renderer.$gutter.setAttribute(\"aria-label\", nls(\"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit\"));\n this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName);\n this.renderer.content.setAttribute(\"aria-hidden\", true);\n if (!gutterKeyboardHandler)\n gutterKeyboardHandler = new GutterKeyboardHandler(this);\n gutterKeyboardHandler.addListener();\n }\n else {\n this.renderer.enableKeyboardAccessibility = false;\n this.textInput.getElement().setAttribute(\"tabindex\", 0);\n this.textInput.setNumberOfExtraLines(0);\n this.renderer.scroller.setAttribute(\"tabindex\", -1);\n this.renderer.scroller.removeAttribute(\"role\");\n this.renderer.scroller.removeAttribute(\"aria-roledescription\");\n this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName);\n this.renderer.scroller.removeAttribute(\"aria-label\");\n this.renderer.scroller.removeEventListener(\"keyup\", focusOnEnterKeyup.bind(this));\n this.commands.removeCommand(blurCommand);\n this.renderer.content.removeAttribute(\"aria-hidden\");\n this.renderer.$gutter.setAttribute(\"tabindex\", -1);\n this.renderer.$gutter.setAttribute(\"aria-hidden\", true);\n this.renderer.$gutter.removeAttribute(\"role\");\n this.renderer.$gutter.removeAttribute(\"aria-roledescription\");\n this.renderer.$gutter.removeAttribute(\"aria-label\");\n this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName);\n if (gutterKeyboardHandler)\n gutterKeyboardHandler.removeListener();\n }\n },\n initialValue: false\n },\n customScrollbar: \"renderer\",\n hScrollBarAlwaysVisible: \"renderer\",\n vScrollBarAlwaysVisible: \"renderer\",\n highlightGutterLine: \"renderer\",\n animatedScroll: \"renderer\",\n showInvisibles: \"renderer\",\n showPrintMargin: \"renderer\",\n printMarginColumn: \"renderer\",\n printMargin: \"renderer\",\n fadeFoldWidgets: \"renderer\",\n showFoldWidgets: \"renderer\",\n displayIndentGuides: \"renderer\",\n highlightIndentGuides: \"renderer\",\n showGutter: \"renderer\",\n fontSize: \"renderer\",\n fontFamily: \"renderer\",\n maxLines: \"renderer\",\n minLines: \"renderer\",\n scrollPastEnd: \"renderer\",\n fixedWidthGutter: \"renderer\",\n theme: \"renderer\",\n hasCssTransforms: \"renderer\",\n maxPixelHeight: \"renderer\",\n useTextareaForIME: \"renderer\",\n useResizeObserver: \"renderer\",\n useSvgGutterIcons: \"renderer\",\n showFoldedAnnotations: \"renderer\",\n scrollSpeed: \"$mouseHandler\",\n dragDelay: \"$mouseHandler\",\n dragEnabled: \"$mouseHandler\",\n focusTimeout: \"$mouseHandler\",\n tooltipFollowsMouse: \"$mouseHandler\",\n firstLineNumber: \"session\",\n overwrite: \"session\",\n newLineMode: \"session\",\n useWorker: \"session\",\n useSoftTabs: \"session\",\n navigateWithinSoftTabs: \"session\",\n tabSize: \"session\",\n wrap: \"session\",\n indentedSoftWrap: \"session\",\n foldStyle: \"session\",\n mode: \"session\"\n});\nvar relativeNumberRenderer = {\n getText: function (session, row) {\n return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9 ? \"\\xb7\" : \"\"))) + \"\";\n },\n getWidth: function (session, lastLineNumber, config) {\n return Math.max(lastLineNumber.toString().length, (config.lastRow + 1).toString().length, 2) * config.characterWidth;\n },\n update: function (e, editor) {\n editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER);\n },\n attach: function (editor) {\n editor.renderer.$gutterLayer.$renderer = this;\n editor.on(\"changeSelection\", this.update);\n this.update(null, editor);\n },\n detach: function (editor) {\n if (editor.renderer.$gutterLayer.$renderer == this)\n editor.renderer.$gutterLayer.$renderer = null;\n editor.off(\"changeSelection\", this.update);\n this.update(null, editor);\n }\n};\nexports.Editor = Editor;\n\n});\n\nace.define(\"ace/undomanager\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar UndoManager = /** @class */ (function () {\n function UndoManager() {\n this.$maxRev = 0;\n this.$fromUndo = false;\n this.$undoDepth = Infinity;\n this.reset();\n }\n UndoManager.prototype.addSession = function (session) {\n this.$session = session;\n };\n UndoManager.prototype.add = function (delta, allowMerge, session) {\n if (this.$fromUndo)\n return;\n if (delta == this.$lastDelta)\n return;\n if (!this.$keepRedoStack)\n this.$redoStack.length = 0;\n if (allowMerge === false || !this.lastDeltas) {\n this.lastDeltas = [];\n var undoStackLength = this.$undoStack.length;\n if (undoStackLength > this.$undoDepth - 1) {\n this.$undoStack.splice(0, undoStackLength - this.$undoDepth + 1);\n }\n this.$undoStack.push(this.lastDeltas);\n delta.id = this.$rev = ++this.$maxRev;\n }\n if (delta.action == \"remove\" || delta.action == \"insert\")\n this.$lastDelta = delta;\n this.lastDeltas.push(delta);\n };\n UndoManager.prototype.addSelection = function (selection, rev) {\n this.selections.push({\n value: selection,\n rev: rev || this.$rev\n });\n };\n UndoManager.prototype.startNewGroup = function () {\n this.lastDeltas = null;\n return this.$rev;\n };\n UndoManager.prototype.markIgnored = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n var stack = this.$undoStack;\n for (var i = stack.length; i--;) {\n var delta = stack[i][0];\n if (delta.id <= from)\n break;\n if (delta.id < to)\n delta.ignore = true;\n }\n this.lastDeltas = null;\n };\n UndoManager.prototype.getSelection = function (rev, after) {\n var stack = this.selections;\n for (var i = stack.length; i--;) {\n var selection = stack[i];\n if (selection.rev < rev) {\n if (after)\n selection = stack[i + 1];\n return selection;\n }\n }\n };\n UndoManager.prototype.getRevision = function () {\n return this.$rev;\n };\n UndoManager.prototype.getDeltas = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n var stack = this.$undoStack;\n var end = null, start = 0;\n for (var i = stack.length; i--;) {\n var delta = stack[i][0];\n if (delta.id < to && !end)\n end = i + 1;\n if (delta.id <= from) {\n start = i + 1;\n break;\n }\n }\n return stack.slice(start, end);\n };\n UndoManager.prototype.getChangedRanges = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n };\n UndoManager.prototype.getChangedLines = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n };\n UndoManager.prototype.undo = function (session, dontSelect) {\n this.lastDeltas = null;\n var stack = this.$undoStack;\n if (!rearrangeUndoStack(stack, stack.length))\n return;\n if (!session)\n session = this.$session;\n if (this.$redoStackBaseRev !== this.$rev && this.$redoStack.length)\n this.$redoStack = [];\n this.$fromUndo = true;\n var deltaSet = stack.pop();\n var undoSelectionRange = null;\n if (deltaSet) {\n undoSelectionRange = session.undoChanges(deltaSet, dontSelect);\n this.$redoStack.push(deltaSet);\n this.$syncRev();\n }\n this.$fromUndo = false;\n return undoSelectionRange;\n };\n UndoManager.prototype.redo = function (session, dontSelect) {\n this.lastDeltas = null;\n if (!session)\n session = this.$session;\n this.$fromUndo = true;\n if (this.$redoStackBaseRev != this.$rev) {\n var diff = this.getDeltas(this.$redoStackBaseRev, this.$rev + 1);\n rebaseRedoStack(this.$redoStack, diff);\n this.$redoStackBaseRev = this.$rev;\n this.$redoStack.forEach(function (x) {\n x[0].id = ++this.$maxRev;\n }, this);\n }\n var deltaSet = this.$redoStack.pop();\n var redoSelectionRange = null;\n if (deltaSet) {\n redoSelectionRange = session.redoChanges(deltaSet, dontSelect);\n this.$undoStack.push(deltaSet);\n this.$syncRev();\n }\n this.$fromUndo = false;\n return redoSelectionRange;\n };\n UndoManager.prototype.$syncRev = function () {\n var stack = this.$undoStack;\n var nextDelta = stack[stack.length - 1];\n var id = nextDelta && nextDelta[0].id || 0;\n this.$redoStackBaseRev = id;\n this.$rev = id;\n };\n UndoManager.prototype.reset = function () {\n this.lastDeltas = null;\n this.$lastDelta = null;\n this.$undoStack = [];\n this.$redoStack = [];\n this.$rev = 0;\n this.mark = 0;\n this.$redoStackBaseRev = this.$rev;\n this.selections = [];\n };\n UndoManager.prototype.canUndo = function () {\n return this.$undoStack.length > 0;\n };\n UndoManager.prototype.canRedo = function () {\n return this.$redoStack.length > 0;\n };\n UndoManager.prototype.bookmark = function (rev) {\n if (rev == undefined)\n rev = this.$rev;\n this.mark = rev;\n };\n UndoManager.prototype.isAtBookmark = function () {\n return this.$rev === this.mark;\n };\n UndoManager.prototype.toJSON = function () {\n };\n UndoManager.prototype.fromJSON = function () {\n };\n UndoManager.prototype.$prettyPrint = function (delta) {\n if (delta)\n return stringifyDelta(delta);\n return stringifyDelta(this.$undoStack) + \"\\n---\\n\" + stringifyDelta(this.$redoStack);\n };\n return UndoManager;\n}());\nUndoManager.prototype.hasUndo = UndoManager.prototype.canUndo;\nUndoManager.prototype.hasRedo = UndoManager.prototype.canRedo;\nUndoManager.prototype.isClean = UndoManager.prototype.isAtBookmark;\nUndoManager.prototype.markClean = UndoManager.prototype.bookmark;\nfunction rearrangeUndoStack(stack, pos) {\n for (var i = pos; i--;) {\n var deltaSet = stack[i];\n if (deltaSet && !deltaSet[0].ignore) {\n while (i < pos - 1) {\n var swapped = swapGroups(stack[i], stack[i + 1]);\n stack[i] = swapped[0];\n stack[i + 1] = swapped[1];\n i++;\n }\n return true;\n }\n }\n}\nvar Range = require(\"./range\").Range;\nvar cmp = Range.comparePoints;\nvar comparePoints = Range.comparePoints;\nfunction $updateMarkers(delta) {\n var isInsert = delta.action == \"insert\";\n var start = delta.start;\n var end = delta.end;\n var rowShift = (end.row - start.row) * (isInsert ? 1 : -1);\n var colShift = (end.column - start.column) * (isInsert ? 1 : -1);\n if (isInsert)\n end = start;\n for (var i in this.marks) {\n var point = this.marks[i];\n var cmp = comparePoints(point, start);\n if (cmp < 0) {\n continue; // delta starts after the range\n }\n if (cmp === 0) {\n if (isInsert) {\n if (point.bias == 1) {\n cmp = 1;\n }\n else {\n point.bias == -1;\n continue;\n }\n }\n }\n var cmp2 = isInsert ? cmp : comparePoints(point, end);\n if (cmp2 > 0) {\n point.row += rowShift;\n point.column += point.row == end.row ? colShift : 0;\n continue;\n }\n if (!isInsert && cmp2 <= 0) {\n point.row = start.row;\n point.column = start.column;\n if (cmp2 === 0)\n point.bias = 1;\n }\n }\n}\nfunction clonePos(pos) {\n return { row: pos.row, column: pos.column };\n}\nfunction cloneDelta(d) {\n return {\n start: clonePos(d.start),\n end: clonePos(d.end),\n action: d.action,\n lines: d.lines.slice()\n };\n}\nfunction stringifyDelta(d) {\n d = d || this;\n if (Array.isArray(d)) {\n return d.map(stringifyDelta).join(\"\\n\");\n }\n var type = \"\";\n if (d.action) {\n type = d.action == \"insert\" ? \"+\" : \"-\";\n type += \"[\" + d.lines + \"]\";\n }\n else if (d.value) {\n if (Array.isArray(d.value)) {\n type = d.value.map(stringifyRange).join(\"\\n\");\n }\n else {\n type = stringifyRange(d.value);\n }\n }\n if (d.start) {\n type += stringifyRange(d);\n }\n if (d.id || d.rev) {\n type += \"\\t(\" + (d.id || d.rev) + \")\";\n }\n return type;\n}\nfunction stringifyRange(r) {\n return r.start.row + \":\" + r.start.column\n + \"=>\" + r.end.row + \":\" + r.end.column;\n}\nfunction swap(d1, d2) {\n var i1 = d1.action == \"insert\";\n var i2 = d2.action == \"insert\";\n if (i1 && i2) {\n if (cmp(d2.start, d1.end) >= 0) {\n shift(d2, d1, -1);\n }\n else if (cmp(d2.start, d1.start) <= 0) {\n shift(d1, d2, +1);\n }\n else {\n return null;\n }\n }\n else if (i1 && !i2) {\n if (cmp(d2.start, d1.end) >= 0) {\n shift(d2, d1, -1);\n }\n else if (cmp(d2.end, d1.start) <= 0) {\n shift(d1, d2, -1);\n }\n else {\n return null;\n }\n }\n else if (!i1 && i2) {\n if (cmp(d2.start, d1.start) >= 0) {\n shift(d2, d1, +1);\n }\n else if (cmp(d2.start, d1.start) <= 0) {\n shift(d1, d2, +1);\n }\n else {\n return null;\n }\n }\n else if (!i1 && !i2) {\n if (cmp(d2.start, d1.start) >= 0) {\n shift(d2, d1, +1);\n }\n else if (cmp(d2.end, d1.start) <= 0) {\n shift(d1, d2, -1);\n }\n else {\n return null;\n }\n }\n return [d2, d1];\n}\nfunction swapGroups(ds1, ds2) {\n for (var i = ds1.length; i--;) {\n for (var j = 0; j < ds2.length; j++) {\n if (!swap(ds1[i], ds2[j])) {\n while (i < ds1.length) {\n while (j--) {\n swap(ds2[j], ds1[i]);\n }\n j = ds2.length;\n i++;\n }\n return [ds1, ds2];\n }\n }\n }\n ds1.selectionBefore = ds2.selectionBefore =\n ds1.selectionAfter = ds2.selectionAfter = null;\n return [ds2, ds1];\n}\nfunction xform(d1, c1) {\n var i1 = d1.action == \"insert\";\n var i2 = c1.action == \"insert\";\n if (i1 && i2) {\n if (cmp(d1.start, c1.start) < 0) {\n shift(c1, d1, 1);\n }\n else {\n shift(d1, c1, 1);\n }\n }\n else if (i1 && !i2) {\n if (cmp(d1.start, c1.end) >= 0) {\n shift(d1, c1, -1);\n }\n else if (cmp(d1.start, c1.start) <= 0) {\n shift(c1, d1, +1);\n }\n else {\n shift(d1, Range.fromPoints(c1.start, d1.start), -1);\n shift(c1, d1, +1);\n }\n }\n else if (!i1 && i2) {\n if (cmp(c1.start, d1.end) >= 0) {\n shift(c1, d1, -1);\n }\n else if (cmp(c1.start, d1.start) <= 0) {\n shift(d1, c1, +1);\n }\n else {\n shift(c1, Range.fromPoints(d1.start, c1.start), -1);\n shift(d1, c1, +1);\n }\n }\n else if (!i1 && !i2) {\n if (cmp(c1.start, d1.end) >= 0) {\n shift(c1, d1, -1);\n }\n else if (cmp(c1.end, d1.start) <= 0) {\n shift(d1, c1, -1);\n }\n else {\n var before, after;\n if (cmp(d1.start, c1.start) < 0) {\n before = d1;\n d1 = splitDelta(d1, c1.start);\n }\n if (cmp(d1.end, c1.end) > 0) {\n after = splitDelta(d1, c1.end);\n }\n shiftPos(c1.end, d1.start, d1.end, -1);\n if (after && !before) {\n d1.lines = after.lines;\n d1.start = after.start;\n d1.end = after.end;\n after = d1;\n }\n return [c1, before, after].filter(Boolean);\n }\n }\n return [c1, d1];\n}\nfunction shift(d1, d2, dir) {\n shiftPos(d1.start, d2.start, d2.end, dir);\n shiftPos(d1.end, d2.start, d2.end, dir);\n}\nfunction shiftPos(pos, start, end, dir) {\n if (pos.row == (dir == 1 ? start : end).row) {\n pos.column += dir * (end.column - start.column);\n }\n pos.row += dir * (end.row - start.row);\n}\nfunction splitDelta(c, pos) {\n var lines = c.lines;\n var end = c.end;\n c.end = clonePos(pos);\n var rowsBefore = c.end.row - c.start.row;\n var otherLines = lines.splice(rowsBefore, lines.length);\n var col = rowsBefore ? pos.column : pos.column - c.start.column;\n lines.push(otherLines[0].substring(0, col));\n otherLines[0] = otherLines[0].substr(col);\n var rest = {\n start: clonePos(pos),\n end: end,\n lines: otherLines,\n action: c.action\n };\n return rest;\n}\nfunction moveDeltasByOne(redoStack, d) {\n d = cloneDelta(d);\n for (var j = redoStack.length; j--;) {\n var deltaSet = redoStack[j];\n for (var i = 0; i < deltaSet.length; i++) {\n var x = deltaSet[i];\n var xformed = xform(x, d);\n d = xformed[0];\n if (xformed.length != 2) {\n if (xformed[2]) {\n deltaSet.splice(i + 1, 1, xformed[1], xformed[2]);\n i++;\n }\n else if (!xformed[1]) {\n deltaSet.splice(i, 1);\n i--;\n }\n }\n }\n if (!deltaSet.length) {\n redoStack.splice(j, 1);\n }\n }\n return redoStack;\n}\nfunction rebaseRedoStack(redoStack, deltaSets) {\n for (var i = 0; i < deltaSets.length; i++) {\n var deltas = deltaSets[i];\n for (var j = 0; j < deltas.length; j++) {\n moveDeltasByOne(redoStack, deltas[j]);\n }\n }\n}\nexports.UndoManager = UndoManager;\n\n});\n\nace.define(\"ace/layer/lines\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar Lines = /** @class */ (function () {\n function Lines(element, canvasHeight) {\n this.element = element;\n this.canvasHeight = canvasHeight || 500000;\n this.element.style.height = (this.canvasHeight * 2) + \"px\";\n this.cells = [];\n this.cellCache = [];\n this.$offsetCoefficient = 0;\n }\n Lines.prototype.moveContainer = function (config) {\n dom.translate(this.element, 0, -((config.firstRowScreen * config.lineHeight) % this.canvasHeight) - config.offset * this.$offsetCoefficient);\n };\n Lines.prototype.pageChanged = function (oldConfig, newConfig) {\n return (Math.floor((oldConfig.firstRowScreen * oldConfig.lineHeight) / this.canvasHeight) !==\n Math.floor((newConfig.firstRowScreen * newConfig.lineHeight) / this.canvasHeight));\n };\n Lines.prototype.computeLineTop = function (row, config, session) {\n var screenTop = config.firstRowScreen * config.lineHeight;\n var screenPage = Math.floor(screenTop / this.canvasHeight);\n var lineTop = session.documentToScreenRow(row, 0) * config.lineHeight;\n return lineTop - (screenPage * this.canvasHeight);\n };\n Lines.prototype.computeLineHeight = function (row, config, session) {\n return config.lineHeight * session.getRowLineCount(row);\n };\n Lines.prototype.getLength = function () {\n return this.cells.length;\n };\n Lines.prototype.get = function (index) {\n return this.cells[index];\n };\n Lines.prototype.shift = function () {\n this.$cacheCell(this.cells.shift());\n };\n Lines.prototype.pop = function () {\n this.$cacheCell(this.cells.pop());\n };\n Lines.prototype.push = function (cell) {\n if (Array.isArray(cell)) {\n this.cells.push.apply(this.cells, cell);\n var fragment = dom.createFragment(this.element);\n for (var i = 0; i < cell.length; i++) {\n fragment.appendChild(cell[i].element);\n }\n this.element.appendChild(fragment);\n }\n else {\n this.cells.push(cell);\n this.element.appendChild(cell.element);\n }\n };\n Lines.prototype.unshift = function (cell) {\n if (Array.isArray(cell)) {\n this.cells.unshift.apply(this.cells, cell);\n var fragment = dom.createFragment(this.element);\n for (var i = 0; i < cell.length; i++) {\n fragment.appendChild(cell[i].element);\n }\n if (this.element.firstChild)\n this.element.insertBefore(fragment, this.element.firstChild);\n else\n this.element.appendChild(fragment);\n }\n else {\n this.cells.unshift(cell);\n this.element.insertAdjacentElement(\"afterbegin\", cell.element);\n }\n };\n Lines.prototype.last = function () {\n if (this.cells.length)\n return this.cells[this.cells.length - 1];\n else\n return null;\n };\n Lines.prototype.$cacheCell = function (cell) {\n if (!cell)\n return;\n cell.element.remove();\n this.cellCache.push(cell);\n };\n Lines.prototype.createCell = function (row, config, session, initElement) {\n var cell = this.cellCache.pop();\n if (!cell) {\n var element = dom.createElement(\"div\");\n if (initElement)\n initElement(element);\n this.element.appendChild(element);\n cell = {\n element: element,\n text: \"\",\n row: row\n };\n }\n cell.row = row;\n return cell;\n };\n return Lines;\n}());\nexports.Lines = Lines;\n\n});\n\nace.define(\"ace/layer/gutter\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/lib/event_emitter\",\"ace/layer/lines\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar oop = require(\"../lib/oop\");\nvar lang = require(\"../lib/lang\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar Lines = require(\"./lines\").Lines;\nvar nls = require(\"../config\").nls;\nvar Gutter = /** @class */ (function () {\n function Gutter(parentEl) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_gutter-layer\";\n parentEl.appendChild(this.element);\n this.setShowFoldWidgets(this.$showFoldWidgets);\n this.gutterWidth = 0;\n this.$annotations = [];\n this.$updateAnnotations = this.$updateAnnotations.bind(this);\n this.$lines = new Lines(this.element);\n this.$lines.$offsetCoefficient = 1;\n }\n Gutter.prototype.setSession = function (session) {\n if (this.session)\n this.session.off(\"change\", this.$updateAnnotations);\n this.session = session;\n if (session)\n session.on(\"change\", this.$updateAnnotations);\n };\n Gutter.prototype.addGutterDecoration = function (row, className) {\n if (window.console)\n console.warn && console.warn(\"deprecated use session.addGutterDecoration\");\n this.session.addGutterDecoration(row, className);\n };\n Gutter.prototype.removeGutterDecoration = function (row, className) {\n if (window.console)\n console.warn && console.warn(\"deprecated use session.removeGutterDecoration\");\n this.session.removeGutterDecoration(row, className);\n };\n Gutter.prototype.setAnnotations = function (annotations) {\n this.$annotations = [];\n for (var i = 0; i < annotations.length; i++) {\n var annotation = annotations[i];\n var row = annotation.row;\n var rowInfo = this.$annotations[row];\n if (!rowInfo)\n rowInfo = this.$annotations[row] = { text: [], type: [] };\n var annoText = annotation.text;\n var annoType = annotation.type;\n annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || \"\";\n if (rowInfo.text.indexOf(annoText) === -1) {\n rowInfo.text.push(annoText);\n rowInfo.type.push(annoType);\n }\n var className = annotation.className;\n if (className)\n rowInfo.className = className;\n else if (annoType == \"error\")\n rowInfo.className = \" ace_error\";\n else if (annoType == \"warning\" && rowInfo.className != \" ace_error\")\n rowInfo.className = \" ace_warning\";\n else if (annoType == \"info\" && (!rowInfo.className))\n rowInfo.className = \" ace_info\";\n }\n };\n Gutter.prototype.$updateAnnotations = function (delta) {\n if (!this.$annotations.length)\n return;\n var firstRow = delta.start.row;\n var len = delta.end.row - firstRow;\n if (len === 0) {\n }\n else if (delta.action == 'remove') {\n this.$annotations.splice(firstRow, len + 1, null);\n }\n else {\n var args = new Array(len + 1);\n args.unshift(firstRow, 1);\n this.$annotations.splice.apply(this.$annotations, args);\n }\n };\n Gutter.prototype.update = function (config) {\n this.config = config;\n var session = this.session;\n var firstRow = config.firstRow;\n var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar\n session.getLength() - 1);\n this.oldLastRow = lastRow;\n this.config = config;\n this.$lines.moveContainer(config);\n this.$updateCursorRow();\n var fold = session.getNextFoldLine(firstRow);\n var foldStart = fold ? fold.start.row : Infinity;\n var cell = null;\n var index = -1;\n var row = firstRow;\n while (true) {\n if (row > foldStart) {\n row = fold.end.row + 1;\n fold = session.getNextFoldLine(row, fold);\n foldStart = fold ? fold.start.row : Infinity;\n }\n if (row > lastRow) {\n while (this.$lines.getLength() > index + 1)\n this.$lines.pop();\n break;\n }\n cell = this.$lines.get(++index);\n if (cell) {\n cell.row = row;\n }\n else {\n cell = this.$lines.createCell(row, config, this.session, onCreateCell);\n this.$lines.push(cell);\n }\n this.$renderCell(cell, config, fold, row);\n row++;\n }\n this._signal(\"afterRender\");\n this.$updateGutterWidth(config);\n };\n Gutter.prototype.$updateGutterWidth = function (config) {\n var session = this.session;\n var gutterRenderer = session.gutterRenderer || this.$renderer;\n var firstLineNumber = session.$firstLineNumber;\n var lastLineText = this.$lines.last() ? this.$lines.last().text : \"\";\n if (this.$fixedWidth || session.$useWrapMode)\n lastLineText = session.getLength() + firstLineNumber - 1;\n var gutterWidth = gutterRenderer\n ? gutterRenderer.getWidth(session, lastLineText, config)\n : lastLineText.toString().length * config.characterWidth;\n var padding = this.$padding || this.$computePadding();\n gutterWidth += padding.left + padding.right;\n if (gutterWidth !== this.gutterWidth && !isNaN(gutterWidth)) {\n this.gutterWidth = gutterWidth;\n this.element.parentNode.style.width =\n this.element.style.width = Math.ceil(this.gutterWidth) + \"px\";\n this._signal(\"changeGutterWidth\", gutterWidth);\n }\n };\n Gutter.prototype.$updateCursorRow = function () {\n if (!this.$highlightGutterLine)\n return;\n var position = this.session.selection.getCursor();\n if (this.$cursorRow === position.row)\n return;\n this.$cursorRow = position.row;\n };\n Gutter.prototype.updateLineHighlight = function () {\n if (!this.$highlightGutterLine)\n return;\n var row = this.session.selection.cursor.row;\n this.$cursorRow = row;\n if (this.$cursorCell && this.$cursorCell.row == row)\n return;\n if (this.$cursorCell)\n this.$cursorCell.element.className = this.$cursorCell.element.className.replace(\"ace_gutter-active-line \", \"\");\n var cells = this.$lines.cells;\n this.$cursorCell = null;\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n if (cell.row >= this.$cursorRow) {\n if (cell.row > this.$cursorRow) {\n var fold = this.session.getFoldLine(this.$cursorRow);\n if (i > 0 && fold && fold.start.row == cells[i - 1].row)\n cell = cells[i - 1];\n else\n break;\n }\n cell.element.className = \"ace_gutter-active-line \" + cell.element.className;\n this.$cursorCell = cell;\n break;\n }\n }\n };\n Gutter.prototype.scrollLines = function (config) {\n var oldConfig = this.config;\n this.config = config;\n this.$updateCursorRow();\n if (this.$lines.pageChanged(oldConfig, config))\n return this.update(config);\n this.$lines.moveContainer(config);\n var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar\n this.session.getLength() - 1);\n var oldLastRow = this.oldLastRow;\n this.oldLastRow = lastRow;\n if (!oldConfig || oldLastRow < config.firstRow)\n return this.update(config);\n if (lastRow < oldConfig.firstRow)\n return this.update(config);\n if (oldConfig.firstRow < config.firstRow)\n for (var row = this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row > 0; row--)\n this.$lines.shift();\n if (oldLastRow > lastRow)\n for (var row = this.session.getFoldedRowCount(lastRow + 1, oldLastRow); row > 0; row--)\n this.$lines.pop();\n if (config.firstRow < oldConfig.firstRow) {\n this.$lines.unshift(this.$renderLines(config, config.firstRow, oldConfig.firstRow - 1));\n }\n if (lastRow > oldLastRow) {\n this.$lines.push(this.$renderLines(config, oldLastRow + 1, lastRow));\n }\n this.updateLineHighlight();\n this._signal(\"afterRender\");\n this.$updateGutterWidth(config);\n };\n Gutter.prototype.$renderLines = function (config, firstRow, lastRow) {\n var fragment = [];\n var row = firstRow;\n var foldLine = this.session.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (true) {\n if (row > foldStart) {\n row = foldLine.end.row + 1;\n foldLine = this.session.getNextFoldLine(row, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (row > lastRow)\n break;\n var cell = this.$lines.createCell(row, config, this.session, onCreateCell);\n this.$renderCell(cell, config, foldLine, row);\n fragment.push(cell);\n row++;\n }\n return fragment;\n };\n Gutter.prototype.$renderCell = function (cell, config, fold, row) {\n var element = cell.element;\n var session = this.session;\n var textNode = element.childNodes[0];\n var foldWidget = element.childNodes[1];\n var annotationNode = element.childNodes[2];\n var annotationIconNode = annotationNode.firstChild;\n var firstLineNumber = session.$firstLineNumber;\n var breakpoints = session.$breakpoints;\n var decorations = session.$decorations;\n var gutterRenderer = session.gutterRenderer || this.$renderer;\n var foldWidgets = this.$showFoldWidgets && session.foldWidgets;\n var foldStart = fold ? fold.start.row : Number.MAX_VALUE;\n var lineHeight = config.lineHeight + \"px\";\n var className = this.$useSvgGutterIcons ? \"ace_gutter-cell_svg-icons \" : \"ace_gutter-cell \";\n var iconClassName = this.$useSvgGutterIcons ? \"ace_icon_svg\" : \"ace_icon\";\n var rowText = (gutterRenderer\n ? gutterRenderer.getText(session, row)\n : row + firstLineNumber).toString();\n if (this.$highlightGutterLine) {\n if (row == this.$cursorRow || (fold && row < this.$cursorRow && row >= foldStart && this.$cursorRow <= fold.end.row)) {\n className += \"ace_gutter-active-line \";\n if (this.$cursorCell != cell) {\n if (this.$cursorCell)\n this.$cursorCell.element.className = this.$cursorCell.element.className.replace(\"ace_gutter-active-line \", \"\");\n this.$cursorCell = cell;\n }\n }\n }\n if (breakpoints[row])\n className += breakpoints[row];\n if (decorations[row])\n className += decorations[row];\n if (this.$annotations[row] && row !== foldStart)\n className += this.$annotations[row].className;\n if (foldWidgets) {\n var c = foldWidgets[row];\n if (c == null)\n c = foldWidgets[row] = session.getFoldWidget(row);\n }\n if (c) {\n var foldClass = \"ace_fold-widget ace_\" + c;\n var isClosedFold = c == \"start\" && row == foldStart && row < fold.end.row;\n if (isClosedFold) {\n foldClass += \" ace_closed\";\n var foldAnnotationClass = '';\n var annotationInFold = false;\n for (var i = row + 1; i <= fold.end.row; i++) {\n if (!this.$annotations[i])\n continue;\n if (this.$annotations[i].className === \" ace_error\") {\n annotationInFold = true;\n foldAnnotationClass = \" ace_error_fold\";\n break;\n }\n if (this.$annotations[i].className === \" ace_warning\") {\n annotationInFold = true;\n foldAnnotationClass = \" ace_warning_fold\";\n continue;\n }\n }\n className += foldAnnotationClass;\n }\n else\n foldClass += \" ace_open\";\n if (foldWidget.className != foldClass)\n foldWidget.className = foldClass;\n dom.setStyle(foldWidget.style, \"height\", lineHeight);\n dom.setStyle(foldWidget.style, \"display\", \"inline-block\");\n foldWidget.setAttribute(\"role\", \"button\");\n foldWidget.setAttribute(\"tabindex\", \"-1\");\n var foldRange = session.getFoldWidgetRange(row);\n if (foldRange)\n foldWidget.setAttribute(\"aria-label\", nls(\"Toggle code folding, rows $0 through $1\", [foldRange.start.row + 1, foldRange.end.row + 1]));\n else {\n if (fold)\n foldWidget.setAttribute(\"aria-label\", nls(\"Toggle code folding, rows $0 through $1\", [fold.start.row + 1, fold.end.row + 1]));\n else\n foldWidget.setAttribute(\"aria-label\", nls(\"Toggle code folding, row $0\", [row + 1]));\n }\n if (isClosedFold) {\n foldWidget.setAttribute(\"aria-expanded\", \"false\");\n foldWidget.setAttribute(\"title\", nls(\"Unfold code\"));\n }\n else {\n foldWidget.setAttribute(\"aria-expanded\", \"true\");\n foldWidget.setAttribute(\"title\", nls(\"Fold code\"));\n }\n }\n else {\n if (foldWidget) {\n dom.setStyle(foldWidget.style, \"display\", \"none\");\n foldWidget.setAttribute(\"tabindex\", \"0\");\n foldWidget.removeAttribute(\"role\");\n foldWidget.removeAttribute(\"aria-label\");\n }\n }\n if (annotationInFold && this.$showFoldedAnnotations) {\n annotationNode.className = \"ace_gutter_annotation\";\n annotationIconNode.className = iconClassName;\n annotationIconNode.className += foldAnnotationClass;\n dom.setStyle(annotationIconNode.style, \"height\", lineHeight);\n dom.setStyle(annotationNode.style, \"display\", \"block\");\n dom.setStyle(annotationNode.style, \"height\", lineHeight);\n annotationNode.setAttribute(\"aria-label\", nls(\"Read annotations row $0\", [rowText]));\n annotationNode.setAttribute(\"tabindex\", \"-1\");\n annotationNode.setAttribute(\"role\", \"button\");\n }\n else if (this.$annotations[row]) {\n annotationNode.className = \"ace_gutter_annotation\";\n annotationIconNode.className = iconClassName;\n if (this.$useSvgGutterIcons)\n annotationIconNode.className += this.$annotations[row].className;\n else\n element.classList.add(this.$annotations[row].className.replace(\" \", \"\"));\n dom.setStyle(annotationIconNode.style, \"height\", lineHeight);\n dom.setStyle(annotationNode.style, \"display\", \"block\");\n dom.setStyle(annotationNode.style, \"height\", lineHeight);\n annotationNode.setAttribute(\"aria-label\", nls(\"Read annotations row $0\", [rowText]));\n annotationNode.setAttribute(\"tabindex\", \"-1\");\n annotationNode.setAttribute(\"role\", \"button\");\n }\n else {\n dom.setStyle(annotationNode.style, \"display\", \"none\");\n annotationNode.removeAttribute(\"aria-label\");\n annotationNode.removeAttribute(\"role\");\n annotationNode.setAttribute(\"tabindex\", \"0\");\n }\n if (rowText !== textNode.data) {\n textNode.data = rowText;\n }\n if (element.className != className)\n element.className = className;\n dom.setStyle(cell.element.style, \"height\", this.$lines.computeLineHeight(row, config, session) + \"px\");\n dom.setStyle(cell.element.style, \"top\", this.$lines.computeLineTop(row, config, session) + \"px\");\n cell.text = rowText;\n if (annotationNode.style.display === \"none\" && foldWidget.style.display === \"none\")\n cell.element.setAttribute(\"aria-hidden\", true);\n else\n cell.element.setAttribute(\"aria-hidden\", false);\n return cell;\n };\n Gutter.prototype.setHighlightGutterLine = function (highlightGutterLine) {\n this.$highlightGutterLine = highlightGutterLine;\n };\n Gutter.prototype.setShowLineNumbers = function (show) {\n this.$renderer = !show && {\n getWidth: function () { return 0; },\n getText: function () { return \"\"; }\n };\n };\n Gutter.prototype.getShowLineNumbers = function () {\n return this.$showLineNumbers;\n };\n Gutter.prototype.setShowFoldWidgets = function (show) {\n if (show)\n dom.addCssClass(this.element, \"ace_folding-enabled\");\n else\n dom.removeCssClass(this.element, \"ace_folding-enabled\");\n this.$showFoldWidgets = show;\n this.$padding = null;\n };\n Gutter.prototype.getShowFoldWidgets = function () {\n return this.$showFoldWidgets;\n };\n Gutter.prototype.$computePadding = function () {\n if (!this.element.firstChild)\n return { left: 0, right: 0 };\n var style = dom.computedStyle(this.element.firstChild);\n this.$padding = {};\n this.$padding.left = (parseInt(style.borderLeftWidth) || 0)\n + (parseInt(style.paddingLeft) || 0) + 1;\n this.$padding.right = (parseInt(style.borderRightWidth) || 0)\n + (parseInt(style.paddingRight) || 0);\n return this.$padding;\n };\n Gutter.prototype.getRegion = function (point) {\n var padding = this.$padding || this.$computePadding();\n var rect = this.element.getBoundingClientRect();\n if (point.x < padding.left + rect.left)\n return \"markers\";\n if (this.$showFoldWidgets && point.x > rect.right - padding.right)\n return \"foldWidgets\";\n };\n return Gutter;\n}());\nGutter.prototype.$fixedWidth = false;\nGutter.prototype.$highlightGutterLine = true;\nGutter.prototype.$renderer = \"\";\nGutter.prototype.$showLineNumbers = true;\nGutter.prototype.$showFoldWidgets = true;\noop.implement(Gutter.prototype, EventEmitter);\nfunction onCreateCell(element) {\n var textNode = document.createTextNode('');\n element.appendChild(textNode);\n var foldWidget = dom.createElement(\"span\");\n element.appendChild(foldWidget);\n var annotationNode = dom.createElement(\"span\");\n element.appendChild(annotationNode);\n var annotationIconNode = dom.createElement(\"span\");\n annotationNode.appendChild(annotationIconNode);\n return element;\n}\nexports.Gutter = Gutter;\n\n});\n\nace.define(\"ace/layer/marker\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nvar dom = require(\"../lib/dom\");\nvar Marker = /** @class */ (function () {\n function Marker(parentEl) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_marker-layer\";\n parentEl.appendChild(this.element);\n }\n Marker.prototype.setPadding = function (padding) {\n this.$padding = padding;\n };\n Marker.prototype.setSession = function (session) {\n this.session = session;\n };\n Marker.prototype.setMarkers = function (markers) {\n this.markers = markers;\n };\n Marker.prototype.elt = function (className, css) {\n var x = this.i != -1 && this.element.childNodes[this.i];\n if (!x) {\n x = document.createElement(\"div\");\n this.element.appendChild(x);\n this.i = -1;\n }\n else {\n this.i++;\n }\n x.style.cssText = css;\n x.className = className;\n };\n Marker.prototype.update = function (config) {\n if (!config)\n return;\n this.config = config;\n this.i = 0;\n var html;\n for (var key in this.markers) {\n var marker = this.markers[key];\n if (!marker.range) {\n marker.update(html, this, this.session, config);\n continue;\n }\n var range = marker.range.clipRows(config.firstRow, config.lastRow);\n if (range.isEmpty())\n continue;\n range = range.toScreenRange(this.session);\n if (marker.renderer) {\n var top = this.$getTop(range.start.row, config);\n var left = this.$padding + range.start.column * config.characterWidth;\n marker.renderer(html, range, left, top, config);\n }\n else if (marker.type == \"fullLine\") {\n this.drawFullLineMarker(html, range, marker.clazz, config);\n }\n else if (marker.type == \"screenLine\") {\n this.drawScreenLineMarker(html, range, marker.clazz, config);\n }\n else if (range.isMultiLine()) {\n if (marker.type == \"text\")\n this.drawTextMarker(html, range, marker.clazz, config);\n else\n this.drawMultiLineMarker(html, range, marker.clazz, config);\n }\n else {\n this.drawSingleLineMarker(html, range, marker.clazz + \" ace_start\" + \" ace_br15\", config);\n }\n }\n if (this.i != -1) {\n while (this.i < this.element.childElementCount)\n this.element.removeChild(this.element.lastChild);\n }\n };\n Marker.prototype.$getTop = function (row, layerConfig) {\n return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight;\n };\n Marker.prototype.drawTextMarker = function (stringBuilder, range, clazz, layerConfig, extraStyle) {\n var session = this.session;\n var start = range.start.row;\n var end = range.end.row;\n var row = start;\n var prev = 0;\n var curr = 0;\n var next = session.getScreenLastRowColumn(row);\n var lineRange = new Range(row, range.start.column, row, curr);\n for (; row <= end; row++) {\n lineRange.start.row = lineRange.end.row = row;\n lineRange.start.column = row == start ? range.start.column : session.getRowWrapIndent(row);\n lineRange.end.column = next;\n prev = curr;\n curr = next;\n next = row + 1 < end ? session.getScreenLastRowColumn(row + 1) : row == end ? 0 : range.end.column;\n this.drawSingleLineMarker(stringBuilder, lineRange, clazz + (row == start ? \" ace_start\" : \"\") + \" ace_br\"\n + getBorderClass(row == start || row == start + 1 && range.start.column, prev < curr, curr > next, row == end), layerConfig, row == end ? 0 : 1, extraStyle);\n }\n };\n Marker.prototype.drawMultiLineMarker = function (stringBuilder, range, clazz, config, extraStyle) {\n var padding = this.$padding;\n var height = config.lineHeight;\n var top = this.$getTop(range.start.row, config);\n var left = padding + range.start.column * config.characterWidth;\n extraStyle = extraStyle || \"\";\n if (this.session.$bidiHandler.isBidiRow(range.start.row)) {\n var range1 = range.clone();\n range1.end.row = range1.start.row;\n range1.end.column = this.session.getLine(range1.start.row).length;\n this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + \" ace_br1 ace_start\", config, null, extraStyle);\n }\n else {\n this.elt(clazz + \" ace_br1 ace_start\", \"height:\" + height + \"px;\" + \"right:0;\" + \"top:\" + top + \"px;left:\" + left + \"px;\" + (extraStyle || \"\"));\n }\n if (this.session.$bidiHandler.isBidiRow(range.end.row)) {\n var range1 = range.clone();\n range1.start.row = range1.end.row;\n range1.start.column = 0;\n this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + \" ace_br12\", config, null, extraStyle);\n }\n else {\n top = this.$getTop(range.end.row, config);\n var width = range.end.column * config.characterWidth;\n this.elt(clazz + \" ace_br12\", \"height:\" + height + \"px;\" +\n \"width:\" + width + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + padding + \"px;\" + (extraStyle || \"\"));\n }\n height = (range.end.row - range.start.row - 1) * config.lineHeight;\n if (height <= 0)\n return;\n top = this.$getTop(range.start.row + 1, config);\n var radiusClass = (range.start.column ? 1 : 0) | (range.end.column ? 0 : 8);\n this.elt(clazz + (radiusClass ? \" ace_br\" + radiusClass : \"\"), \"height:\" + height + \"px;\" +\n \"right:0;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + padding + \"px;\" + (extraStyle || \"\"));\n };\n Marker.prototype.drawSingleLineMarker = function (stringBuilder, range, clazz, config, extraLength, extraStyle) {\n if (this.session.$bidiHandler.isBidiRow(range.start.row))\n return this.drawBidiSingleLineMarker(stringBuilder, range, clazz, config, extraLength, extraStyle);\n var height = config.lineHeight;\n var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth;\n var top = this.$getTop(range.start.row, config);\n var left = this.$padding + range.start.column * config.characterWidth;\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"width:\" + width + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + left + \"px;\" + (extraStyle || \"\"));\n };\n Marker.prototype.drawBidiSingleLineMarker = function (stringBuilder, range, clazz, config, extraLength, extraStyle) {\n var height = config.lineHeight, top = this.$getTop(range.start.row, config), padding = this.$padding;\n var selections = this.session.$bidiHandler.getSelections(range.start.column, range.end.column);\n selections.forEach(function (selection) {\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"width:\" + (selection.width + (extraLength || 0)) + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + (padding + selection.left) + \"px;\" + (extraStyle || \"\"));\n }, this);\n };\n Marker.prototype.drawFullLineMarker = function (stringBuilder, range, clazz, config, extraStyle) {\n var top = this.$getTop(range.start.row, config);\n var height = config.lineHeight;\n if (range.start.row != range.end.row)\n height += this.$getTop(range.end.row, config) - top;\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:0;right:0;\" + (extraStyle || \"\"));\n };\n Marker.prototype.drawScreenLineMarker = function (stringBuilder, range, clazz, config, extraStyle) {\n var top = this.$getTop(range.start.row, config);\n var height = config.lineHeight;\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:0;right:0;\" + (extraStyle || \"\"));\n };\n return Marker;\n}());\nMarker.prototype.$padding = 0;\nfunction getBorderClass(tl, tr, br, bl) {\n return (tl ? 1 : 0) | (tr ? 2 : 0) | (br ? 4 : 0) | (bl ? 8 : 0);\n}\nexports.Marker = Marker;\n\n});\n\nace.define(\"ace/layer/text\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/layer/lines\",\"ace/lib/event_emitter\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../lib/oop\");\nvar dom = require(\"../lib/dom\");\nvar lang = require(\"../lib/lang\");\nvar Lines = require(\"./lines\").Lines;\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar nls = require(\"../config\").nls;\nvar Text = /** @class */ (function () {\n function Text(parentEl) {\n this.dom = dom;\n this.element = this.dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_text-layer\";\n parentEl.appendChild(this.element);\n this.$updateEolChar = this.$updateEolChar.bind(this);\n this.$lines = new Lines(this.element);\n }\n Text.prototype.$updateEolChar = function () {\n var doc = this.session.doc;\n var unixMode = doc.getNewLineCharacter() == \"\\n\" && doc.getNewLineMode() != \"windows\";\n var EOL_CHAR = unixMode ? this.EOL_CHAR_LF : this.EOL_CHAR_CRLF;\n if (this.EOL_CHAR != EOL_CHAR) {\n this.EOL_CHAR = EOL_CHAR;\n return true;\n }\n };\n Text.prototype.setPadding = function (padding) {\n this.$padding = padding;\n this.element.style.margin = \"0 \" + padding + \"px\";\n };\n Text.prototype.getLineHeight = function () {\n return this.$fontMetrics.$characterSize.height || 0;\n };\n Text.prototype.getCharacterWidth = function () {\n return this.$fontMetrics.$characterSize.width || 0;\n };\n Text.prototype.$setFontMetrics = function (measure) {\n this.$fontMetrics = measure;\n this.$fontMetrics.on(\"changeCharacterSize\", function (e) {\n this._signal(\"changeCharacterSize\", e);\n }.bind(this));\n this.$pollSizeChanges();\n };\n Text.prototype.checkForSizeChanges = function () {\n this.$fontMetrics.checkForSizeChanges();\n };\n Text.prototype.$pollSizeChanges = function () {\n return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges();\n };\n Text.prototype.setSession = function (session) {\n this.session = session;\n if (session)\n this.$computeTabString();\n };\n Text.prototype.setShowInvisibles = function (showInvisibles) {\n if (this.showInvisibles == showInvisibles)\n return false;\n this.showInvisibles = showInvisibles;\n if (typeof showInvisibles == \"string\") {\n this.showSpaces = /tab/i.test(showInvisibles);\n this.showTabs = /space/i.test(showInvisibles);\n this.showEOL = /eol/i.test(showInvisibles);\n }\n else {\n this.showSpaces = this.showTabs = this.showEOL = showInvisibles;\n }\n this.$computeTabString();\n return true;\n };\n Text.prototype.setDisplayIndentGuides = function (display) {\n if (this.displayIndentGuides == display)\n return false;\n this.displayIndentGuides = display;\n this.$computeTabString();\n return true;\n };\n Text.prototype.setHighlightIndentGuides = function (highlight) {\n if (this.$highlightIndentGuides === highlight)\n return false;\n this.$highlightIndentGuides = highlight;\n return highlight;\n };\n Text.prototype.$computeTabString = function () {\n var tabSize = this.session.getTabSize();\n this.tabSize = tabSize;\n var tabStr = this.$tabStrings = [0];\n for (var i = 1; i < tabSize + 1; i++) {\n if (this.showTabs) {\n var span = this.dom.createElement(\"span\");\n span.className = \"ace_invisible ace_invisible_tab\";\n span.textContent = lang.stringRepeat(this.TAB_CHAR, i);\n tabStr.push(span);\n }\n else {\n tabStr.push(this.dom.createTextNode(lang.stringRepeat(\" \", i), this.element));\n }\n }\n if (this.displayIndentGuides) {\n this.$indentGuideRe = /\\s\\S| \\t|\\t |\\s$/;\n var className = \"ace_indent-guide\";\n var spaceClass = this.showSpaces ? \" ace_invisible ace_invisible_space\" : \"\";\n var spaceContent = this.showSpaces\n ? lang.stringRepeat(this.SPACE_CHAR, this.tabSize)\n : lang.stringRepeat(\" \", this.tabSize);\n var tabClass = this.showTabs ? \" ace_invisible ace_invisible_tab\" : \"\";\n var tabContent = this.showTabs\n ? lang.stringRepeat(this.TAB_CHAR, this.tabSize)\n : spaceContent;\n var span = this.dom.createElement(\"span\");\n span.className = className + spaceClass;\n span.textContent = spaceContent;\n this.$tabStrings[\" \"] = span;\n var span = this.dom.createElement(\"span\");\n span.className = className + tabClass;\n span.textContent = tabContent;\n this.$tabStrings[\"\\t\"] = span;\n }\n };\n Text.prototype.updateLines = function (config, firstRow, lastRow) {\n if (this.config.lastRow != config.lastRow ||\n this.config.firstRow != config.firstRow) {\n return this.update(config);\n }\n this.config = config;\n var first = Math.max(firstRow, config.firstRow);\n var last = Math.min(lastRow, config.lastRow);\n var lineElements = this.element.childNodes;\n var lineElementsIdx = 0;\n for (var row = config.firstRow; row < first; row++) {\n var foldLine = this.session.getFoldLine(row);\n if (foldLine) {\n if (foldLine.containsRow(first)) {\n first = foldLine.start.row;\n break;\n }\n else {\n row = foldLine.end.row;\n }\n }\n lineElementsIdx++;\n }\n var heightChanged = false;\n var row = first;\n var foldLine = this.session.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (true) {\n if (row > foldStart) {\n row = foldLine.end.row + 1;\n foldLine = this.session.getNextFoldLine(row, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (row > last)\n break;\n var lineElement = lineElements[lineElementsIdx++];\n if (lineElement) {\n this.dom.removeChildren(lineElement);\n this.$renderLine(lineElement, row, row == foldStart ? foldLine : false);\n if (heightChanged)\n lineElement.style.top = this.$lines.computeLineTop(row, config, this.session) + \"px\";\n var height = (config.lineHeight * this.session.getRowLength(row)) + \"px\";\n if (lineElement.style.height != height) {\n heightChanged = true;\n lineElement.style.height = height;\n }\n }\n row++;\n }\n if (heightChanged) {\n while (lineElementsIdx < this.$lines.cells.length) {\n var cell = this.$lines.cells[lineElementsIdx++];\n cell.element.style.top = this.$lines.computeLineTop(cell.row, config, this.session) + \"px\";\n }\n }\n };\n Text.prototype.scrollLines = function (config) {\n var oldConfig = this.config;\n this.config = config;\n if (this.$lines.pageChanged(oldConfig, config))\n return this.update(config);\n this.$lines.moveContainer(config);\n var lastRow = config.lastRow;\n var oldLastRow = oldConfig ? oldConfig.lastRow : -1;\n if (!oldConfig || oldLastRow < config.firstRow)\n return this.update(config);\n if (lastRow < oldConfig.firstRow)\n return this.update(config);\n if (!oldConfig || oldConfig.lastRow < config.firstRow)\n return this.update(config);\n if (config.lastRow < oldConfig.firstRow)\n return this.update(config);\n if (oldConfig.firstRow < config.firstRow)\n for (var row = this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row > 0; row--)\n this.$lines.shift();\n if (oldConfig.lastRow > config.lastRow)\n for (var row = this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row > 0; row--)\n this.$lines.pop();\n if (config.firstRow < oldConfig.firstRow) {\n this.$lines.unshift(this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1));\n }\n if (config.lastRow > oldConfig.lastRow) {\n this.$lines.push(this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow));\n }\n this.$highlightIndentGuide();\n };\n Text.prototype.$renderLinesFragment = function (config, firstRow, lastRow) {\n var fragment = [];\n var row = firstRow;\n var foldLine = this.session.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (true) {\n if (row > foldStart) {\n row = foldLine.end.row + 1;\n foldLine = this.session.getNextFoldLine(row, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (row > lastRow)\n break;\n var line = this.$lines.createCell(row, config, this.session);\n var lineEl = line.element;\n this.dom.removeChildren(lineEl);\n dom.setStyle(lineEl.style, \"height\", this.$lines.computeLineHeight(row, config, this.session) + \"px\");\n dom.setStyle(lineEl.style, \"top\", this.$lines.computeLineTop(row, config, this.session) + \"px\");\n this.$renderLine(lineEl, row, row == foldStart ? foldLine : false);\n if (this.$useLineGroups()) {\n lineEl.className = \"ace_line_group\";\n }\n else {\n lineEl.className = \"ace_line\";\n }\n fragment.push(line);\n row++;\n }\n return fragment;\n };\n Text.prototype.update = function (config) {\n this.$lines.moveContainer(config);\n this.config = config;\n var firstRow = config.firstRow;\n var lastRow = config.lastRow;\n var lines = this.$lines;\n while (lines.getLength())\n lines.pop();\n lines.push(this.$renderLinesFragment(config, firstRow, lastRow));\n };\n Text.prototype.$renderToken = function (parent, screenColumn, token, value) {\n var self = this;\n var re = /(\\t)|( +)|([\\x00-\\x1f\\x80-\\xa0\\xad\\u1680\\u180E\\u2000-\\u200f\\u2028\\u2029\\u202F\\u205F\\uFEFF\\uFFF9-\\uFFFC\\u2066\\u2067\\u2068\\u202A\\u202B\\u202D\\u202E\\u202C\\u2069]+)|(\\u3000)|([\\u1100-\\u115F\\u11A3-\\u11A7\\u11FA-\\u11FF\\u2329-\\u232A\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3001-\\u303E\\u3041-\\u3096\\u3099-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u3190-\\u31BA\\u31C0-\\u31E3\\u31F0-\\u321E\\u3220-\\u3247\\u3250-\\u32FE\\u3300-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFAFF\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE66\\uFE68-\\uFE6B\\uFF01-\\uFF60\\uFFE0-\\uFFE6]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])/g;\n var valueFragment = this.dom.createFragment(this.element);\n var m;\n var i = 0;\n while (m = re.exec(value)) {\n var tab = m[1];\n var simpleSpace = m[2];\n var controlCharacter = m[3];\n var cjkSpace = m[4];\n var cjk = m[5];\n if (!self.showSpaces && simpleSpace)\n continue;\n var before = i != m.index ? value.slice(i, m.index) : \"\";\n i = m.index + m[0].length;\n if (before) {\n valueFragment.appendChild(this.dom.createTextNode(before, this.element));\n }\n if (tab) {\n var tabSize = self.session.getScreenTabSize(screenColumn + m.index);\n valueFragment.appendChild(self.$tabStrings[tabSize].cloneNode(true));\n screenColumn += tabSize - 1;\n }\n else if (simpleSpace) {\n if (self.showSpaces) {\n var span = this.dom.createElement(\"span\");\n span.className = \"ace_invisible ace_invisible_space\";\n span.textContent = lang.stringRepeat(self.SPACE_CHAR, simpleSpace.length);\n valueFragment.appendChild(span);\n }\n else {\n valueFragment.appendChild(this.com.createTextNode(simpleSpace, this.element));\n }\n }\n else if (controlCharacter) {\n var span = this.dom.createElement(\"span\");\n span.className = \"ace_invisible ace_invisible_space ace_invalid\";\n span.textContent = lang.stringRepeat(self.SPACE_CHAR, controlCharacter.length);\n valueFragment.appendChild(span);\n }\n else if (cjkSpace) {\n screenColumn += 1;\n var span = this.dom.createElement(\"span\");\n span.style.width = (self.config.characterWidth * 2) + \"px\";\n span.className = self.showSpaces ? \"ace_cjk ace_invisible ace_invisible_space\" : \"ace_cjk\";\n span.textContent = self.showSpaces ? self.SPACE_CHAR : cjkSpace;\n valueFragment.appendChild(span);\n }\n else if (cjk) {\n screenColumn += 1;\n var span = this.dom.createElement(\"span\");\n span.style.width = (self.config.characterWidth * 2) + \"px\";\n span.className = \"ace_cjk\";\n span.textContent = cjk;\n valueFragment.appendChild(span);\n }\n }\n valueFragment.appendChild(this.dom.createTextNode(i ? value.slice(i) : value, this.element));\n if (!this.$textToken[token.type]) {\n var classes = \"ace_\" + token.type.replace(/\\./g, \" ace_\");\n var span = this.dom.createElement(\"span\");\n if (token.type == \"fold\") {\n span.style.width = (token.value.length * this.config.characterWidth) + \"px\";\n span.setAttribute(\"title\", nls(\"Unfold code\"));\n }\n span.className = classes;\n span.appendChild(valueFragment);\n parent.appendChild(span);\n }\n else {\n parent.appendChild(valueFragment);\n }\n return screenColumn + value.length;\n };\n Text.prototype.renderIndentGuide = function (parent, value, max) {\n var cols = value.search(this.$indentGuideRe);\n if (cols <= 0 || cols >= max)\n return value;\n if (value[0] == \" \") {\n cols -= cols % this.tabSize;\n var count = cols / this.tabSize;\n for (var i = 0; i < count; i++) {\n parent.appendChild(this.$tabStrings[\" \"].cloneNode(true));\n }\n this.$highlightIndentGuide();\n return value.substr(cols);\n }\n else if (value[0] == \"\\t\") {\n for (var i = 0; i < cols; i++) {\n parent.appendChild(this.$tabStrings[\"\\t\"].cloneNode(true));\n }\n this.$highlightIndentGuide();\n return value.substr(cols);\n }\n this.$highlightIndentGuide();\n return value;\n };\n Text.prototype.$highlightIndentGuide = function () {\n if (!this.$highlightIndentGuides || !this.displayIndentGuides)\n return;\n this.$highlightIndentGuideMarker = {\n indentLevel: undefined,\n start: undefined,\n end: undefined,\n dir: undefined\n };\n var lines = this.session.doc.$lines;\n if (!lines)\n return;\n var cursor = this.session.selection.getCursor();\n var initialIndent = /^\\s*/.exec(this.session.doc.getLine(cursor.row))[0].length;\n var elementIndentLevel = Math.floor(initialIndent / this.tabSize);\n this.$highlightIndentGuideMarker = {\n indentLevel: elementIndentLevel,\n start: cursor.row\n };\n var bracketHighlight = this.session.$bracketHighlight;\n if (bracketHighlight) {\n var ranges = this.session.$bracketHighlight.ranges;\n for (var i = 0; i < ranges.length; i++) {\n if (cursor.row !== ranges[i].start.row) {\n this.$highlightIndentGuideMarker.end = ranges[i].start.row;\n if (cursor.row > ranges[i].start.row) {\n this.$highlightIndentGuideMarker.dir = -1;\n }\n else {\n this.$highlightIndentGuideMarker.dir = 1;\n }\n break;\n }\n }\n }\n if (!this.$highlightIndentGuideMarker.end) {\n if (lines[cursor.row] !== '' && cursor.column === lines[cursor.row].length) {\n this.$highlightIndentGuideMarker.dir = 1;\n for (var i = cursor.row + 1; i < lines.length; i++) {\n var line = lines[i];\n var currentIndent = /^\\s*/.exec(line)[0].length;\n if (line !== '') {\n this.$highlightIndentGuideMarker.end = i;\n if (currentIndent <= initialIndent)\n break;\n }\n }\n }\n }\n this.$renderHighlightIndentGuide();\n };\n Text.prototype.$clearActiveIndentGuide = function () {\n var cells = this.$lines.cells;\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n var childNodes = cell.element.childNodes;\n if (childNodes.length > 0) {\n for (var j = 0; j < childNodes.length; j++) {\n if (childNodes[j].classList && childNodes[j].classList.contains(\"ace_indent-guide-active\")) {\n childNodes[j].classList.remove(\"ace_indent-guide-active\");\n break;\n }\n }\n }\n }\n };\n Text.prototype.$setIndentGuideActive = function (cell, indentLevel) {\n var line = this.session.doc.getLine(cell.row);\n if (line !== \"\") {\n var childNodes = cell.element.childNodes;\n if (childNodes) {\n var node = childNodes[indentLevel - 1];\n if (node && node.classList && node.classList.contains(\"ace_indent-guide\"))\n node.classList.add(\"ace_indent-guide-active\");\n }\n }\n };\n Text.prototype.$renderHighlightIndentGuide = function () {\n if (!this.$lines)\n return;\n var cells = this.$lines.cells;\n this.$clearActiveIndentGuide();\n var indentLevel = this.$highlightIndentGuideMarker.indentLevel;\n if (indentLevel !== 0) {\n if (this.$highlightIndentGuideMarker.dir === 1) {\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n if (this.$highlightIndentGuideMarker.end && cell.row >= this.$highlightIndentGuideMarker.start\n + 1) {\n if (cell.row >= this.$highlightIndentGuideMarker.end)\n break;\n this.$setIndentGuideActive(cell, indentLevel);\n }\n }\n }\n else {\n for (var i = cells.length - 1; i >= 0; i--) {\n var cell = cells[i];\n if (this.$highlightIndentGuideMarker.end && cell.row < this.$highlightIndentGuideMarker.start) {\n if (cell.row <= this.$highlightIndentGuideMarker.end)\n break;\n this.$setIndentGuideActive(cell, indentLevel);\n }\n }\n }\n }\n };\n Text.prototype.$createLineElement = function (parent) {\n var lineEl = this.dom.createElement(\"div\");\n lineEl.className = \"ace_line\";\n lineEl.style.height = this.config.lineHeight + \"px\";\n return lineEl;\n };\n Text.prototype.$renderWrappedLine = function (parent, tokens, splits) {\n var chars = 0;\n var split = 0;\n var splitChars = splits[0];\n var screenColumn = 0;\n var lineEl = this.$createLineElement();\n parent.appendChild(lineEl);\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n var value = token.value;\n if (i == 0 && this.displayIndentGuides) {\n chars = value.length;\n value = this.renderIndentGuide(lineEl, value, splitChars);\n if (!value)\n continue;\n chars -= value.length;\n }\n if (chars + value.length < splitChars) {\n screenColumn = this.$renderToken(lineEl, screenColumn, token, value);\n chars += value.length;\n }\n else {\n while (chars + value.length >= splitChars) {\n screenColumn = this.$renderToken(lineEl, screenColumn, token, value.substring(0, splitChars - chars));\n value = value.substring(splitChars - chars);\n chars = splitChars;\n lineEl = this.$createLineElement();\n parent.appendChild(lineEl);\n lineEl.appendChild(this.dom.createTextNode(lang.stringRepeat(\"\\xa0\", splits.indent), this.element));\n split++;\n screenColumn = 0;\n splitChars = splits[split] || Number.MAX_VALUE;\n }\n if (value.length != 0) {\n chars += value.length;\n screenColumn = this.$renderToken(lineEl, screenColumn, token, value);\n }\n }\n }\n if (splits[splits.length - 1] > this.MAX_LINE_LENGTH)\n this.$renderOverflowMessage(lineEl, screenColumn, null, \"\", true);\n };\n Text.prototype.$renderSimpleLine = function (parent, tokens) {\n var screenColumn = 0;\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n var value = token.value;\n if (i == 0 && this.displayIndentGuides) {\n value = this.renderIndentGuide(parent, value);\n if (!value)\n continue;\n }\n if (screenColumn + value.length > this.MAX_LINE_LENGTH)\n return this.$renderOverflowMessage(parent, screenColumn, token, value);\n screenColumn = this.$renderToken(parent, screenColumn, token, value);\n }\n };\n Text.prototype.$renderOverflowMessage = function (parent, screenColumn, token, value, hide) {\n token && this.$renderToken(parent, screenColumn, token, value.slice(0, this.MAX_LINE_LENGTH - screenColumn));\n var overflowEl = this.dom.createElement(\"span\");\n overflowEl.className = \"ace_inline_button ace_keyword ace_toggle_wrap\";\n overflowEl.textContent = hide ? \"\" : \"\";\n parent.appendChild(overflowEl);\n };\n Text.prototype.$renderLine = function (parent, row, foldLine) {\n if (!foldLine && foldLine != false)\n foldLine = this.session.getFoldLine(row);\n if (foldLine)\n var tokens = this.$getFoldLineTokens(row, foldLine);\n else\n var tokens = this.session.getTokens(row);\n var lastLineEl = parent;\n if (tokens.length) {\n var splits = this.session.getRowSplitData(row);\n if (splits && splits.length) {\n this.$renderWrappedLine(parent, tokens, splits);\n var lastLineEl = parent.lastChild;\n }\n else {\n var lastLineEl = parent;\n if (this.$useLineGroups()) {\n lastLineEl = this.$createLineElement();\n parent.appendChild(lastLineEl);\n }\n this.$renderSimpleLine(lastLineEl, tokens);\n }\n }\n else if (this.$useLineGroups()) {\n lastLineEl = this.$createLineElement();\n parent.appendChild(lastLineEl);\n }\n if (this.showEOL && lastLineEl) {\n if (foldLine)\n row = foldLine.end.row;\n var invisibleEl = this.dom.createElement(\"span\");\n invisibleEl.className = \"ace_invisible ace_invisible_eol\";\n invisibleEl.textContent = row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR;\n lastLineEl.appendChild(invisibleEl);\n }\n };\n Text.prototype.$getFoldLineTokens = function (row, foldLine) {\n var session = this.session;\n var renderTokens = [];\n function addTokens(tokens, from, to) {\n var idx = 0, col = 0;\n while ((col + tokens[idx].value.length) < from) {\n col += tokens[idx].value.length;\n idx++;\n if (idx == tokens.length)\n return;\n }\n if (col != from) {\n var value = tokens[idx].value.substring(from - col);\n if (value.length > (to - from))\n value = value.substring(0, to - from);\n renderTokens.push({\n type: tokens[idx].type,\n value: value\n });\n col = from + value.length;\n idx += 1;\n }\n while (col < to && idx < tokens.length) {\n var value = tokens[idx].value;\n if (value.length + col > to) {\n renderTokens.push({\n type: tokens[idx].type,\n value: value.substring(0, to - col)\n });\n }\n else\n renderTokens.push(tokens[idx]);\n col += value.length;\n idx += 1;\n }\n }\n var tokens = session.getTokens(row);\n foldLine.walk(function (placeholder, row, column, lastColumn, isNewRow) {\n if (placeholder != null) {\n renderTokens.push({\n type: \"fold\",\n value: placeholder\n });\n }\n else {\n if (isNewRow)\n tokens = session.getTokens(row);\n if (tokens.length)\n addTokens(tokens, lastColumn, column);\n }\n }, foldLine.end.row, this.session.getLine(foldLine.end.row).length);\n return renderTokens;\n };\n Text.prototype.$useLineGroups = function () {\n return this.session.getUseWrapMode();\n };\n return Text;\n}());\nText.prototype.$textToken = {\n \"text\": true,\n \"rparen\": true,\n \"lparen\": true\n};\nText.prototype.EOF_CHAR = \"\\xB6\";\nText.prototype.EOL_CHAR_LF = \"\\xAC\";\nText.prototype.EOL_CHAR_CRLF = \"\\xa4\";\nText.prototype.EOL_CHAR = Text.prototype.EOL_CHAR_LF;\nText.prototype.TAB_CHAR = \"\\u2014\"; //\"\\u21E5\";\nText.prototype.SPACE_CHAR = \"\\xB7\";\nText.prototype.$padding = 0;\nText.prototype.MAX_LINE_LENGTH = 10000;\nText.prototype.showInvisibles = false;\nText.prototype.showSpaces = false;\nText.prototype.showTabs = false;\nText.prototype.showEOL = false;\nText.prototype.displayIndentGuides = true;\nText.prototype.$highlightIndentGuides = true;\nText.prototype.$tabStrings = [];\nText.prototype.destroy = {};\nText.prototype.onChangeTabSize = Text.prototype.$computeTabString;\noop.implement(Text.prototype, EventEmitter);\nexports.Text = Text;\n\n});\n\nace.define(\"ace/layer/cursor\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar Cursor = /** @class */ (function () {\n function Cursor(parentEl) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_cursor-layer\";\n parentEl.appendChild(this.element);\n this.isVisible = false;\n this.isBlinking = true;\n this.blinkInterval = 1000;\n this.smoothBlinking = false;\n this.cursors = [];\n this.cursor = this.addCursor();\n dom.addCssClass(this.element, \"ace_hidden-cursors\");\n this.$updateCursors = this.$updateOpacity.bind(this);\n }\n Cursor.prototype.$updateOpacity = function (val) {\n var cursors = this.cursors;\n for (var i = cursors.length; i--;)\n dom.setStyle(cursors[i].style, \"opacity\", val ? \"\" : \"0\");\n };\n Cursor.prototype.$startCssAnimation = function () {\n var cursors = this.cursors;\n for (var i = cursors.length; i--;)\n cursors[i].style.animationDuration = this.blinkInterval + \"ms\";\n this.$isAnimating = true;\n setTimeout(function () {\n if (this.$isAnimating) {\n dom.addCssClass(this.element, \"ace_animate-blinking\");\n }\n }.bind(this));\n };\n Cursor.prototype.$stopCssAnimation = function () {\n this.$isAnimating = false;\n dom.removeCssClass(this.element, \"ace_animate-blinking\");\n };\n Cursor.prototype.setPadding = function (padding) {\n this.$padding = padding;\n };\n Cursor.prototype.setSession = function (session) {\n this.session = session;\n };\n Cursor.prototype.setBlinking = function (blinking) {\n if (blinking != this.isBlinking) {\n this.isBlinking = blinking;\n this.restartTimer();\n }\n };\n Cursor.prototype.setBlinkInterval = function (blinkInterval) {\n if (blinkInterval != this.blinkInterval) {\n this.blinkInterval = blinkInterval;\n this.restartTimer();\n }\n };\n Cursor.prototype.setSmoothBlinking = function (smoothBlinking) {\n if (smoothBlinking != this.smoothBlinking) {\n this.smoothBlinking = smoothBlinking;\n dom.setCssClass(this.element, \"ace_smooth-blinking\", smoothBlinking);\n this.$updateCursors(true);\n this.restartTimer();\n }\n };\n Cursor.prototype.addCursor = function () {\n var el = dom.createElement(\"div\");\n el.className = \"ace_cursor\";\n this.element.appendChild(el);\n this.cursors.push(el);\n return el;\n };\n Cursor.prototype.removeCursor = function () {\n if (this.cursors.length > 1) {\n var el = this.cursors.pop();\n el.parentNode.removeChild(el);\n return el;\n }\n };\n Cursor.prototype.hideCursor = function () {\n this.isVisible = false;\n dom.addCssClass(this.element, \"ace_hidden-cursors\");\n this.restartTimer();\n };\n Cursor.prototype.showCursor = function () {\n this.isVisible = true;\n dom.removeCssClass(this.element, \"ace_hidden-cursors\");\n this.restartTimer();\n };\n Cursor.prototype.restartTimer = function () {\n var update = this.$updateCursors;\n clearInterval(this.intervalId);\n clearTimeout(this.timeoutId);\n this.$stopCssAnimation();\n if (this.smoothBlinking) {\n this.$isSmoothBlinking = false;\n dom.removeCssClass(this.element, \"ace_smooth-blinking\");\n }\n update(true);\n if (!this.isBlinking || !this.blinkInterval || !this.isVisible) {\n this.$stopCssAnimation();\n return;\n }\n if (this.smoothBlinking) {\n this.$isSmoothBlinking = true;\n setTimeout(function () {\n if (this.$isSmoothBlinking) {\n dom.addCssClass(this.element, \"ace_smooth-blinking\");\n }\n }.bind(this));\n }\n if (dom.HAS_CSS_ANIMATION) {\n this.$startCssAnimation();\n }\n else {\n var blink = function () {\n this.timeoutId = setTimeout(function () {\n update(false);\n }, 0.6 * this.blinkInterval);\n }.bind(this);\n this.intervalId = setInterval(function () {\n update(true);\n blink();\n }, this.blinkInterval);\n blink();\n }\n };\n Cursor.prototype.getPixelPosition = function (position, onScreen) {\n if (!this.config || !this.session)\n return { left: 0, top: 0 };\n if (!position)\n position = this.session.selection.getCursor();\n var pos = this.session.documentToScreenPosition(position);\n var cursorLeft = this.$padding + (this.session.$bidiHandler.isBidiRow(pos.row, position.row)\n ? this.session.$bidiHandler.getPosLeft(pos.column)\n : pos.column * this.config.characterWidth);\n var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) *\n this.config.lineHeight;\n return { left: cursorLeft, top: cursorTop };\n };\n Cursor.prototype.isCursorInView = function (pixelPos, config) {\n return pixelPos.top >= 0 && pixelPos.top < config.maxHeight;\n };\n Cursor.prototype.update = function (config) {\n this.config = config;\n var selections = this.session.$selectionMarkers;\n var i = 0, cursorIndex = 0;\n if (selections === undefined || selections.length === 0) {\n selections = [{ cursor: null }];\n }\n for (var i = 0, n = selections.length; i < n; i++) {\n var pixelPos = this.getPixelPosition(selections[i].cursor, true);\n if ((pixelPos.top > config.height + config.offset ||\n pixelPos.top < 0) && i > 1) {\n continue;\n }\n var element = this.cursors[cursorIndex++] || this.addCursor();\n var style = element.style;\n if (!this.drawCursor) {\n if (!this.isCursorInView(pixelPos, config)) {\n dom.setStyle(style, \"display\", \"none\");\n }\n else {\n dom.setStyle(style, \"display\", \"block\");\n dom.translate(element, pixelPos.left, pixelPos.top);\n dom.setStyle(style, \"width\", Math.round(config.characterWidth) + \"px\");\n dom.setStyle(style, \"height\", config.lineHeight + \"px\");\n }\n }\n else {\n this.drawCursor(element, pixelPos, config, selections[i], this.session);\n }\n }\n while (this.cursors.length > cursorIndex)\n this.removeCursor();\n var overwrite = this.session.getOverwrite();\n this.$setOverwrite(overwrite);\n this.$pixelPos = pixelPos;\n this.restartTimer();\n };\n Cursor.prototype.$setOverwrite = function (overwrite) {\n if (overwrite != this.overwrite) {\n this.overwrite = overwrite;\n if (overwrite)\n dom.addCssClass(this.element, \"ace_overwrite-cursors\");\n else\n dom.removeCssClass(this.element, \"ace_overwrite-cursors\");\n }\n };\n Cursor.prototype.destroy = function () {\n clearInterval(this.intervalId);\n clearTimeout(this.timeoutId);\n };\n return Cursor;\n}());\nCursor.prototype.$padding = 0;\nCursor.prototype.drawCursor = null;\nexports.Cursor = Cursor;\n\n});\n\nace.define(\"ace/scrollbar\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar __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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar event = require(\"./lib/event\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar MAX_SCROLL_H = 0x8000;\nvar Scrollbar = /** @class */ (function () {\n function Scrollbar(parent, classSuffix) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_scrollbar ace_scrollbar\" + classSuffix;\n this.inner = dom.createElement(\"div\");\n this.inner.className = \"ace_scrollbar-inner\";\n this.inner.textContent = \"\\xa0\";\n this.element.appendChild(this.inner);\n parent.appendChild(this.element);\n this.setVisible(false);\n this.skipEvent = false;\n event.addListener(this.element, \"scroll\", this.onScroll.bind(this));\n event.addListener(this.element, \"mousedown\", event.preventDefault);\n }\n Scrollbar.prototype.setVisible = function (isVisible) {\n this.element.style.display = isVisible ? \"\" : \"none\";\n this.isVisible = isVisible;\n this.coeff = 1;\n };\n return Scrollbar;\n}());\noop.implement(Scrollbar.prototype, EventEmitter);\nvar VScrollBar = /** @class */ (function (_super) {\n __extends(VScrollBar, _super);\n function VScrollBar(parent, renderer) {\n var _this = _super.call(this, parent, '-v') || this;\n _this.scrollTop = 0;\n _this.scrollHeight = 0;\n renderer.$scrollbarWidth =\n _this.width = dom.scrollbarWidth(parent.ownerDocument);\n _this.inner.style.width =\n _this.element.style.width = (_this.width || 15) + 5 + \"px\";\n _this.$minWidth = 0;\n return _this;\n }\n VScrollBar.prototype.onScroll = function () {\n if (!this.skipEvent) {\n this.scrollTop = this.element.scrollTop;\n if (this.coeff != 1) {\n var h = this.element.clientHeight / this.scrollHeight;\n this.scrollTop = this.scrollTop * (1 - h) / (this.coeff - h);\n }\n this._emit(\"scroll\", { data: this.scrollTop });\n }\n this.skipEvent = false;\n };\n VScrollBar.prototype.getWidth = function () {\n return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);\n };\n VScrollBar.prototype.setHeight = function (height) {\n this.element.style.height = height + \"px\";\n };\n VScrollBar.prototype.setScrollHeight = function (height) {\n this.scrollHeight = height;\n if (height > MAX_SCROLL_H) {\n this.coeff = MAX_SCROLL_H / height;\n height = MAX_SCROLL_H;\n }\n else if (this.coeff != 1) {\n this.coeff = 1;\n }\n this.inner.style.height = height + \"px\";\n };\n VScrollBar.prototype.setScrollTop = function (scrollTop) {\n if (this.scrollTop != scrollTop) {\n this.skipEvent = true;\n this.scrollTop = scrollTop;\n this.element.scrollTop = scrollTop * this.coeff;\n }\n };\n return VScrollBar;\n}(Scrollbar));\nVScrollBar.prototype.setInnerHeight = VScrollBar.prototype.setScrollHeight;\nvar HScrollBar = /** @class */ (function (_super) {\n __extends(HScrollBar, _super);\n function HScrollBar(parent, renderer) {\n var _this = _super.call(this, parent, '-h') || this;\n _this.scrollLeft = 0;\n _this.height = renderer.$scrollbarWidth;\n _this.inner.style.height =\n _this.element.style.height = (_this.height || 15) + 5 + \"px\";\n return _this;\n }\n HScrollBar.prototype.onScroll = function () {\n if (!this.skipEvent) {\n this.scrollLeft = this.element.scrollLeft;\n this._emit(\"scroll\", { data: this.scrollLeft });\n }\n this.skipEvent = false;\n };\n HScrollBar.prototype.getHeight = function () {\n return this.isVisible ? this.height : 0;\n };\n HScrollBar.prototype.setWidth = function (width) {\n this.element.style.width = width + \"px\";\n };\n HScrollBar.prototype.setInnerWidth = function (width) {\n this.inner.style.width = width + \"px\";\n };\n HScrollBar.prototype.setScrollWidth = function (width) {\n this.inner.style.width = width + \"px\";\n };\n HScrollBar.prototype.setScrollLeft = function (scrollLeft) {\n if (this.scrollLeft != scrollLeft) {\n this.skipEvent = true;\n this.scrollLeft = this.element.scrollLeft = scrollLeft;\n }\n };\n return HScrollBar;\n}(Scrollbar));\nexports.ScrollBar = VScrollBar; // backward compatibility\nexports.ScrollBarV = VScrollBar; // backward compatibility\nexports.ScrollBarH = HScrollBar; // backward compatibility\nexports.VScrollBar = VScrollBar;\nexports.HScrollBar = HScrollBar;\n\n});\n\nace.define(\"ace/scrollbar_custom\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar __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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar event = require(\"./lib/event\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\ndom.importCssString(\".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\\n position: absolute;\\n background: rgba(128, 128, 128, 0.6);\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n border: 1px solid #bbb;\\n border-radius: 2px;\\n z-index: 8;\\n}\\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\\n position: absolute;\\n z-index: 6;\\n background: none;\\n overflow: hidden!important;\\n}\\n.ace_editor>.ace_sb-v {\\n z-index: 6;\\n right: 0;\\n top: 0;\\n width: 12px;\\n}\\n.ace_editor>.ace_sb-v div {\\n z-index: 8;\\n right: 0;\\n width: 100%;\\n}\\n.ace_editor>.ace_sb-h {\\n bottom: 0;\\n left: 0;\\n height: 12px;\\n}\\n.ace_editor>.ace_sb-h div {\\n bottom: 0;\\n height: 100%;\\n}\\n.ace_editor>.ace_sb_grabbed {\\n z-index: 8;\\n background: #000;\\n}\", \"ace_scrollbar.css\", false);\nvar ScrollBar = /** @class */ (function () {\n function ScrollBar(parent, classSuffix) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_sb\" + classSuffix;\n this.inner = dom.createElement(\"div\");\n this.inner.className = \"\";\n this.element.appendChild(this.inner);\n this.VScrollWidth = 12;\n this.HScrollHeight = 12;\n parent.appendChild(this.element);\n this.setVisible(false);\n this.skipEvent = false;\n event.addMultiMouseDownListener(this.element, [500, 300, 300], this, \"onMouseDown\");\n }\n ScrollBar.prototype.setVisible = function (isVisible) {\n this.element.style.display = isVisible ? \"\" : \"none\";\n this.isVisible = isVisible;\n this.coeff = 1;\n };\n return ScrollBar;\n}());\noop.implement(ScrollBar.prototype, EventEmitter);\nvar VScrollBar = /** @class */ (function (_super) {\n __extends(VScrollBar, _super);\n function VScrollBar(parent, renderer) {\n var _this = _super.call(this, parent, '-v') || this;\n _this.scrollTop = 0;\n _this.scrollHeight = 0;\n _this.parent = parent;\n _this.width = _this.VScrollWidth;\n _this.renderer = renderer;\n _this.inner.style.width = _this.element.style.width = (_this.width || 15) + \"px\";\n _this.$minWidth = 0;\n return _this;\n }\n VScrollBar.prototype.onMouseDown = function (eType, e) {\n if (eType !== \"mousedown\")\n return;\n if (event.getButton(e) !== 0 || e.detail === 2) {\n return;\n }\n if (e.target === this.inner) {\n var self = this;\n var mousePageY = e.clientY;\n var onMouseMove = function (e) {\n mousePageY = e.clientY;\n };\n var onMouseUp = function () {\n clearInterval(timerId);\n };\n var startY = e.clientY;\n var startTop = this.thumbTop;\n var onScrollInterval = function () {\n if (mousePageY === undefined)\n return;\n var scrollTop = self.scrollTopFromThumbTop(startTop + mousePageY - startY);\n if (scrollTop === self.scrollTop)\n return;\n self._emit(\"scroll\", { data: scrollTop });\n };\n event.capture(this.inner, onMouseMove, onMouseUp);\n var timerId = setInterval(onScrollInterval, 20);\n return event.preventDefault(e);\n }\n var top = e.clientY - this.element.getBoundingClientRect().top - this.thumbHeight / 2;\n this._emit(\"scroll\", { data: this.scrollTopFromThumbTop(top) });\n return event.preventDefault(e);\n };\n VScrollBar.prototype.getHeight = function () {\n return this.height;\n };\n VScrollBar.prototype.scrollTopFromThumbTop = function (thumbTop) {\n var scrollTop = thumbTop * (this.pageHeight - this.viewHeight) / (this.slideHeight - this.thumbHeight);\n scrollTop = scrollTop >> 0;\n if (scrollTop < 0) {\n scrollTop = 0;\n }\n else if (scrollTop > this.pageHeight - this.viewHeight) {\n scrollTop = this.pageHeight - this.viewHeight;\n }\n return scrollTop;\n };\n VScrollBar.prototype.getWidth = function () {\n return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);\n };\n VScrollBar.prototype.setHeight = function (height) {\n this.height = Math.max(0, height);\n this.slideHeight = this.height;\n this.viewHeight = this.height;\n this.setScrollHeight(this.pageHeight, true);\n };\n VScrollBar.prototype.setScrollHeight = function (height, force) {\n if (this.pageHeight === height && !force)\n return;\n this.pageHeight = height;\n this.thumbHeight = this.slideHeight * this.viewHeight / this.pageHeight;\n if (this.thumbHeight > this.slideHeight)\n this.thumbHeight = this.slideHeight;\n if (this.thumbHeight < 15)\n this.thumbHeight = 15;\n this.inner.style.height = this.thumbHeight + \"px\";\n if (this.scrollTop > (this.pageHeight - this.viewHeight)) {\n this.scrollTop = (this.pageHeight - this.viewHeight);\n if (this.scrollTop < 0)\n this.scrollTop = 0;\n this._emit(\"scroll\", { data: this.scrollTop });\n }\n };\n VScrollBar.prototype.setScrollTop = function (scrollTop) {\n this.scrollTop = scrollTop;\n if (scrollTop < 0)\n scrollTop = 0;\n this.thumbTop = scrollTop * (this.slideHeight - this.thumbHeight) / (this.pageHeight - this.viewHeight);\n this.inner.style.top = this.thumbTop + \"px\";\n };\n return VScrollBar;\n}(ScrollBar));\nVScrollBar.prototype.setInnerHeight = VScrollBar.prototype.setScrollHeight;\nvar HScrollBar = /** @class */ (function (_super) {\n __extends(HScrollBar, _super);\n function HScrollBar(parent, renderer) {\n var _this = _super.call(this, parent, '-h') || this;\n _this.scrollLeft = 0;\n _this.scrollWidth = 0;\n _this.height = _this.HScrollHeight;\n _this.inner.style.height = _this.element.style.height = (_this.height || 12) + \"px\";\n _this.renderer = renderer;\n return _this;\n }\n HScrollBar.prototype.onMouseDown = function (eType, e) {\n if (eType !== \"mousedown\")\n return;\n if (event.getButton(e) !== 0 || e.detail === 2) {\n return;\n }\n if (e.target === this.inner) {\n var self = this;\n var mousePageX = e.clientX;\n var onMouseMove = function (e) {\n mousePageX = e.clientX;\n };\n var onMouseUp = function () {\n clearInterval(timerId);\n };\n var startX = e.clientX;\n var startLeft = this.thumbLeft;\n var onScrollInterval = function () {\n if (mousePageX === undefined)\n return;\n var scrollLeft = self.scrollLeftFromThumbLeft(startLeft + mousePageX - startX);\n if (scrollLeft === self.scrollLeft)\n return;\n self._emit(\"scroll\", { data: scrollLeft });\n };\n event.capture(this.inner, onMouseMove, onMouseUp);\n var timerId = setInterval(onScrollInterval, 20);\n return event.preventDefault(e);\n }\n var left = e.clientX - this.element.getBoundingClientRect().left - this.thumbWidth / 2;\n this._emit(\"scroll\", { data: this.scrollLeftFromThumbLeft(left) });\n return event.preventDefault(e);\n };\n HScrollBar.prototype.getHeight = function () {\n return this.isVisible ? this.height : 0;\n };\n HScrollBar.prototype.scrollLeftFromThumbLeft = function (thumbLeft) {\n var scrollLeft = thumbLeft * (this.pageWidth - this.viewWidth) / (this.slideWidth - this.thumbWidth);\n scrollLeft = scrollLeft >> 0;\n if (scrollLeft < 0) {\n scrollLeft = 0;\n }\n else if (scrollLeft > this.pageWidth - this.viewWidth) {\n scrollLeft = this.pageWidth - this.viewWidth;\n }\n return scrollLeft;\n };\n HScrollBar.prototype.setWidth = function (width) {\n this.width = Math.max(0, width);\n this.element.style.width = this.width + \"px\";\n this.slideWidth = this.width;\n this.viewWidth = this.width;\n this.setScrollWidth(this.pageWidth, true);\n };\n HScrollBar.prototype.setScrollWidth = function (width, force) {\n if (this.pageWidth === width && !force)\n return;\n this.pageWidth = width;\n this.thumbWidth = this.slideWidth * this.viewWidth / this.pageWidth;\n if (this.thumbWidth > this.slideWidth)\n this.thumbWidth = this.slideWidth;\n if (this.thumbWidth < 15)\n this.thumbWidth = 15;\n this.inner.style.width = this.thumbWidth + \"px\";\n if (this.scrollLeft > (this.pageWidth - this.viewWidth)) {\n this.scrollLeft = (this.pageWidth - this.viewWidth);\n if (this.scrollLeft < 0)\n this.scrollLeft = 0;\n this._emit(\"scroll\", { data: this.scrollLeft });\n }\n };\n HScrollBar.prototype.setScrollLeft = function (scrollLeft) {\n this.scrollLeft = scrollLeft;\n if (scrollLeft < 0)\n scrollLeft = 0;\n this.thumbLeft = scrollLeft * (this.slideWidth - this.thumbWidth) / (this.pageWidth - this.viewWidth);\n this.inner.style.left = (this.thumbLeft) + \"px\";\n };\n return HScrollBar;\n}(ScrollBar));\nHScrollBar.prototype.setInnerWidth = HScrollBar.prototype.setScrollWidth;\nexports.ScrollBar = VScrollBar; // backward compatibility\nexports.ScrollBarV = VScrollBar; // backward compatibility\nexports.ScrollBarH = HScrollBar; // backward compatibility\nexports.VScrollBar = VScrollBar;\nexports.HScrollBar = HScrollBar;\n\n});\n\nace.define(\"ace/renderloop\",[\"require\",\"exports\",\"module\",\"ace/lib/event\"], function(require, exports, module){\"use strict\";\nvar event = require(\"./lib/event\");\nvar RenderLoop = /** @class */ (function () {\n function RenderLoop(onRender, win) {\n this.onRender = onRender;\n this.pending = false;\n this.changes = 0;\n this.$recursionLimit = 2;\n this.window = win || window;\n var _self = this;\n this._flush = function (ts) {\n _self.pending = false;\n var changes = _self.changes;\n if (changes) {\n event.blockIdle(100);\n _self.changes = 0;\n _self.onRender(changes);\n }\n if (_self.changes) {\n if (_self.$recursionLimit-- < 0)\n return;\n _self.schedule();\n }\n else {\n _self.$recursionLimit = 2;\n }\n };\n }\n RenderLoop.prototype.schedule = function (change) {\n this.changes = this.changes | change;\n if (this.changes && !this.pending) {\n event.nextFrame(this._flush);\n this.pending = true;\n }\n };\n RenderLoop.prototype.clear = function (change) {\n var changes = this.changes;\n this.changes = 0;\n return changes;\n };\n return RenderLoop;\n}());\nexports.RenderLoop = RenderLoop;\n\n});\n\nace.define(\"ace/layer/font_metrics\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/lib/event\",\"ace/lib/useragent\",\"ace/lib/event_emitter\"], function(require, exports, module){var oop = require(\"../lib/oop\");\nvar dom = require(\"../lib/dom\");\nvar lang = require(\"../lib/lang\");\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar CHAR_COUNT = 512;\nvar USE_OBSERVER = typeof ResizeObserver == \"function\";\nvar L = 200;\nvar FontMetrics = /** @class */ (function () {\n function FontMetrics(parentEl) {\n this.el = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.el.style, true);\n this.$main = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.$main.style);\n this.$measureNode = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.$measureNode.style);\n this.el.appendChild(this.$main);\n this.el.appendChild(this.$measureNode);\n parentEl.appendChild(this.el);\n this.$measureNode.textContent = lang.stringRepeat(\"X\", CHAR_COUNT);\n this.$characterSize = { width: 0, height: 0 };\n if (USE_OBSERVER)\n this.$addObserver();\n else\n this.checkForSizeChanges();\n }\n FontMetrics.prototype.$setMeasureNodeStyles = function (style, isRoot) {\n style.width = style.height = \"auto\";\n style.left = style.top = \"0px\";\n style.visibility = \"hidden\";\n style.position = \"absolute\";\n style.whiteSpace = \"pre\";\n if (useragent.isIE < 8) {\n style[\"font-family\"] = \"inherit\";\n }\n else {\n style.font = \"inherit\";\n }\n style.overflow = isRoot ? \"hidden\" : \"visible\";\n };\n FontMetrics.prototype.checkForSizeChanges = function (size) {\n if (size === undefined)\n size = this.$measureSizes();\n if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) {\n this.$measureNode.style.fontWeight = \"bold\";\n var boldSize = this.$measureSizes();\n this.$measureNode.style.fontWeight = \"\";\n this.$characterSize = size;\n this.charSizes = Object.create(null);\n this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height;\n this._emit(\"changeCharacterSize\", { data: size });\n }\n };\n FontMetrics.prototype.$addObserver = function () {\n var self = this;\n this.$observer = new window.ResizeObserver(function (e) {\n self.checkForSizeChanges();\n });\n this.$observer.observe(this.$measureNode);\n };\n FontMetrics.prototype.$pollSizeChanges = function () {\n if (this.$pollSizeChangesTimer || this.$observer)\n return this.$pollSizeChangesTimer;\n var self = this;\n return this.$pollSizeChangesTimer = event.onIdle(function cb() {\n self.checkForSizeChanges();\n event.onIdle(cb, 500);\n }, 500);\n };\n FontMetrics.prototype.setPolling = function (val) {\n if (val) {\n this.$pollSizeChanges();\n }\n else if (this.$pollSizeChangesTimer) {\n clearInterval(this.$pollSizeChangesTimer);\n this.$pollSizeChangesTimer = 0;\n }\n };\n FontMetrics.prototype.$measureSizes = function (node) {\n var size = {\n height: (node || this.$measureNode).clientHeight,\n width: (node || this.$measureNode).clientWidth / CHAR_COUNT\n };\n if (size.width === 0 || size.height === 0)\n return null;\n return size;\n };\n FontMetrics.prototype.$measureCharWidth = function (ch) {\n this.$main.textContent = lang.stringRepeat(ch, CHAR_COUNT);\n var rect = this.$main.getBoundingClientRect();\n return rect.width / CHAR_COUNT;\n };\n FontMetrics.prototype.getCharacterWidth = function (ch) {\n var w = this.charSizes[ch];\n if (w === undefined) {\n w = this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width;\n }\n return w;\n };\n FontMetrics.prototype.destroy = function () {\n clearInterval(this.$pollSizeChangesTimer);\n if (this.$observer)\n this.$observer.disconnect();\n if (this.el && this.el.parentNode)\n this.el.parentNode.removeChild(this.el);\n };\n FontMetrics.prototype.$getZoom = function (element) {\n if (!element || !element.parentElement)\n return 1;\n return (window.getComputedStyle(element).zoom || 1) * this.$getZoom(element.parentElement);\n };\n FontMetrics.prototype.$initTransformMeasureNodes = function () {\n var t = function (t, l) {\n return [\"div\", {\n style: \"position: absolute;top:\" + t + \"px;left:\" + l + \"px;\"\n }];\n };\n this.els = dom.buildDom([t(0, 0), t(L, 0), t(0, L), t(L, L)], this.el);\n };\n FontMetrics.prototype.transformCoordinates = function (clientPos, elPos) {\n if (clientPos) {\n var zoom = this.$getZoom(this.el);\n clientPos = mul(1 / zoom, clientPos);\n }\n function solve(l1, l2, r) {\n var det = l1[1] * l2[0] - l1[0] * l2[1];\n return [\n (-l2[1] * r[0] + l2[0] * r[1]) / det,\n (+l1[1] * r[0] - l1[0] * r[1]) / det\n ];\n }\n function sub(a, b) { return [a[0] - b[0], a[1] - b[1]]; }\n function add(a, b) { return [a[0] + b[0], a[1] + b[1]]; }\n function mul(a, b) { return [a * b[0], a * b[1]]; }\n if (!this.els)\n this.$initTransformMeasureNodes();\n function p(el) {\n var r = el.getBoundingClientRect();\n return [r.left, r.top];\n }\n var a = p(this.els[0]);\n var b = p(this.els[1]);\n var c = p(this.els[2]);\n var d = p(this.els[3]);\n var h = solve(sub(d, b), sub(d, c), sub(add(b, c), add(d, a)));\n var m1 = mul(1 + h[0], sub(b, a));\n var m2 = mul(1 + h[1], sub(c, a));\n if (elPos) {\n var x = elPos;\n var k = h[0] * x[0] / L + h[1] * x[1] / L + 1;\n var ut = add(mul(x[0], m1), mul(x[1], m2));\n return add(mul(1 / k / L, ut), a);\n }\n var u = sub(clientPos, a);\n var f = solve(sub(m1, mul(h[0], u)), sub(m2, mul(h[1], u)), u);\n return mul(L, f);\n };\n return FontMetrics;\n}());\nFontMetrics.prototype.$characterSize = { width: 0, height: 0 };\noop.implement(FontMetrics.prototype, EventEmitter);\nexports.FontMetrics = FontMetrics;\n\n});\n\nace.define(\"ace/css/editor-css\",[\"require\",\"exports\",\"module\"], function(require, exports, module){/*\nstyles = []\nfor (var i = 1; i < 16; i++) {\n styles.push(\".ace_br\" + i + \"{\" + (\n [\"top-left\", \"top-right\", \"bottom-right\", \"bottom-left\"]\n ).map(function(x, j) {\n return i & (1< .ace_line, .ace_text-layer > .ace_line_group {\\n contain: style size layout;\\n position: absolute;\\n top: 0;\\n left: 0;\\n right: 0;\\n}\\n\\n.ace_hidpi .ace_text-layer,\\n.ace_hidpi .ace_gutter-layer,\\n.ace_hidpi .ace_content,\\n.ace_hidpi .ace_gutter {\\n contain: strict;\\n}\\n.ace_hidpi .ace_text-layer > .ace_line, \\n.ace_hidpi .ace_text-layer > .ace_line_group {\\n contain: strict;\\n}\\n\\n.ace_cjk {\\n display: inline-block;\\n text-align: center;\\n}\\n\\n.ace_cursor-layer {\\n z-index: 4;\\n}\\n\\n.ace_cursor {\\n z-index: 4;\\n position: absolute;\\n box-sizing: border-box;\\n border-left: 2px solid;\\n /* workaround for smooth cursor repaintng whole screen in chrome */\\n transform: translatez(0);\\n}\\n\\n.ace_multiselect .ace_cursor {\\n border-left-width: 1px;\\n}\\n\\n.ace_slim-cursors .ace_cursor {\\n border-left-width: 1px;\\n}\\n\\n.ace_overwrite-cursors .ace_cursor {\\n border-left-width: 0;\\n border-bottom: 1px solid;\\n}\\n\\n.ace_hidden-cursors .ace_cursor {\\n opacity: 0.2;\\n}\\n\\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\\n opacity: 0;\\n}\\n\\n.ace_smooth-blinking .ace_cursor {\\n transition: opacity 0.18s;\\n}\\n\\n.ace_animate-blinking .ace_cursor {\\n animation-duration: 1000ms;\\n animation-timing-function: step-end;\\n animation-name: blink-ace-animate;\\n animation-iteration-count: infinite;\\n}\\n\\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\\n animation-duration: 1000ms;\\n animation-timing-function: ease-in-out;\\n animation-name: blink-ace-animate-smooth;\\n}\\n \\n@keyframes blink-ace-animate {\\n from, to { opacity: 1; }\\n 60% { opacity: 0; }\\n}\\n\\n@keyframes blink-ace-animate-smooth {\\n from, to { opacity: 1; }\\n 45% { opacity: 1; }\\n 60% { opacity: 0; }\\n 85% { opacity: 0; }\\n}\\n\\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\\n position: absolute;\\n z-index: 3;\\n}\\n\\n.ace_marker-layer .ace_selection {\\n position: absolute;\\n z-index: 5;\\n}\\n\\n.ace_marker-layer .ace_bracket {\\n position: absolute;\\n z-index: 6;\\n}\\n\\n.ace_marker-layer .ace_error_bracket {\\n position: absolute;\\n border-bottom: 1px solid #DE5555;\\n border-radius: 0;\\n}\\n\\n.ace_marker-layer .ace_active-line {\\n position: absolute;\\n z-index: 2;\\n}\\n\\n.ace_marker-layer .ace_selected-word {\\n position: absolute;\\n z-index: 4;\\n box-sizing: border-box;\\n}\\n\\n.ace_line .ace_fold {\\n box-sizing: border-box;\\n\\n display: inline-block;\\n height: 11px;\\n margin-top: -2px;\\n vertical-align: middle;\\n\\n background-image:\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\\\"),\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\\\");\\n background-repeat: no-repeat, repeat-x;\\n background-position: center center, top left;\\n color: transparent;\\n\\n border: 1px solid black;\\n border-radius: 2px;\\n\\n cursor: pointer;\\n pointer-events: auto;\\n}\\n\\n.ace_dark .ace_fold {\\n}\\n\\n.ace_fold:hover{\\n background-image:\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\\\"),\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\\\");\\n}\\n\\n.ace_tooltip {\\n background-color: #f5f5f5;\\n border: 1px solid gray;\\n border-radius: 1px;\\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\\n color: black;\\n max-width: 100%;\\n padding: 3px 4px;\\n position: fixed;\\n z-index: 999999;\\n box-sizing: border-box;\\n cursor: default;\\n white-space: pre;\\n word-wrap: break-word;\\n line-height: normal;\\n font-style: normal;\\n font-weight: normal;\\n letter-spacing: normal;\\n pointer-events: none;\\n}\\n\\n.ace_tooltip.ace_dark {\\n background-color: #636363;\\n color: #fff;\\n}\\n\\n.ace_tooltip:focus {\\n outline: 1px solid #5E9ED6;\\n}\\n\\n.ace_icon {\\n display: inline-block;\\n width: 18px;\\n vertical-align: top;\\n}\\n\\n.ace_icon_svg {\\n display: inline-block;\\n width: 12px;\\n vertical-align: top;\\n -webkit-mask-repeat: no-repeat;\\n -webkit-mask-size: 12px;\\n -webkit-mask-position: center;\\n}\\n\\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\\n padding-right: 13px;\\n}\\n\\n.ace_fold-widget {\\n box-sizing: border-box;\\n\\n margin: 0 -12px 0 1px;\\n display: none;\\n width: 11px;\\n vertical-align: top;\\n\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\\\");\\n background-repeat: no-repeat;\\n background-position: center;\\n\\n border-radius: 3px;\\n \\n border: 1px solid transparent;\\n cursor: pointer;\\n}\\n\\n.ace_folding-enabled .ace_fold-widget {\\n display: inline-block; \\n}\\n\\n.ace_fold-widget.ace_end {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\\\");\\n}\\n\\n.ace_fold-widget.ace_closed {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\\\");\\n}\\n\\n.ace_fold-widget:hover {\\n border: 1px solid rgba(0, 0, 0, 0.3);\\n background-color: rgba(255, 255, 255, 0.2);\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\\n}\\n\\n.ace_fold-widget:active {\\n border: 1px solid rgba(0, 0, 0, 0.4);\\n background-color: rgba(0, 0, 0, 0.05);\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\\n}\\n/**\\n * Dark version for fold widgets\\n */\\n.ace_dark .ace_fold-widget {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\\\");\\n}\\n.ace_dark .ace_fold-widget.ace_end {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\\\");\\n}\\n.ace_dark .ace_fold-widget.ace_closed {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\\\");\\n}\\n.ace_dark .ace_fold-widget:hover {\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\\n background-color: rgba(255, 255, 255, 0.1);\\n}\\n.ace_dark .ace_fold-widget:active {\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\\n}\\n\\n.ace_inline_button {\\n border: 1px solid lightgray;\\n display: inline-block;\\n margin: -1px 8px;\\n padding: 0 5px;\\n pointer-events: auto;\\n cursor: pointer;\\n}\\n.ace_inline_button:hover {\\n border-color: gray;\\n background: rgba(200,200,200,0.2);\\n display: inline-block;\\n pointer-events: auto;\\n}\\n\\n.ace_fold-widget.ace_invalid {\\n background-color: #FFB4B4;\\n border-color: #DE5555;\\n}\\n\\n.ace_fade-fold-widgets .ace_fold-widget {\\n transition: opacity 0.4s ease 0.05s;\\n opacity: 0;\\n}\\n\\n.ace_fade-fold-widgets:hover .ace_fold-widget {\\n transition: opacity 0.05s ease 0.05s;\\n opacity:1;\\n}\\n\\n.ace_underline {\\n text-decoration: underline;\\n}\\n\\n.ace_bold {\\n font-weight: bold;\\n}\\n\\n.ace_nobold .ace_bold {\\n font-weight: normal;\\n}\\n\\n.ace_italic {\\n font-style: italic;\\n}\\n\\n\\n.ace_error-marker {\\n background-color: rgba(255, 0, 0,0.2);\\n position: absolute;\\n z-index: 9;\\n}\\n\\n.ace_highlight-marker {\\n background-color: rgba(255, 255, 0,0.2);\\n position: absolute;\\n z-index: 8;\\n}\\n\\n.ace_mobile-menu {\\n position: absolute;\\n line-height: 1.5;\\n border-radius: 4px;\\n -ms-user-select: none;\\n -moz-user-select: none;\\n -webkit-user-select: none;\\n user-select: none;\\n background: white;\\n box-shadow: 1px 3px 2px grey;\\n border: 1px solid #dcdcdc;\\n color: black;\\n}\\n.ace_dark > .ace_mobile-menu {\\n background: #333;\\n color: #ccc;\\n box-shadow: 1px 3px 2px grey;\\n border: 1px solid #444;\\n\\n}\\n.ace_mobile-button {\\n padding: 2px;\\n cursor: pointer;\\n overflow: hidden;\\n}\\n.ace_mobile-button:hover {\\n background-color: #eee;\\n opacity:1;\\n}\\n.ace_mobile-button:active {\\n background-color: #ddd;\\n}\\n\\n.ace_placeholder {\\n font-family: arial;\\n transform: scale(0.9);\\n transform-origin: left;\\n white-space: pre;\\n opacity: 0.7;\\n margin: 0 10px;\\n}\\n\\n.ace_ghost_text {\\n opacity: 0.5;\\n font-style: italic;\\n white-space: pre;\\n}\";\n\n});\n\nace.define(\"ace/layer/decorators\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar oop = require(\"../lib/oop\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar Decorator = /** @class */ (function () {\n function Decorator(parent, renderer) {\n this.canvas = dom.createElement(\"canvas\");\n this.renderer = renderer;\n this.pixelRatio = 1;\n this.maxHeight = renderer.layerConfig.maxHeight;\n this.lineHeight = renderer.layerConfig.lineHeight;\n this.canvasHeight = parent.parent.scrollHeight;\n this.heightRatio = this.canvasHeight / this.maxHeight;\n this.canvasWidth = parent.width;\n this.minDecorationHeight = (2 * this.pixelRatio) | 0;\n this.halfMinDecorationHeight = (this.minDecorationHeight / 2) | 0;\n this.canvas.width = this.canvasWidth;\n this.canvas.height = this.canvasHeight;\n this.canvas.style.top = 0 + \"px\";\n this.canvas.style.right = 0 + \"px\";\n this.canvas.style.zIndex = 7 + \"px\";\n this.canvas.style.position = \"absolute\";\n this.colors = {};\n this.colors.dark = {\n \"error\": \"rgba(255, 18, 18, 1)\",\n \"warning\": \"rgba(18, 136, 18, 1)\",\n \"info\": \"rgba(18, 18, 136, 1)\"\n };\n this.colors.light = {\n \"error\": \"rgb(255,51,51)\",\n \"warning\": \"rgb(32,133,72)\",\n \"info\": \"rgb(35,68,138)\"\n };\n parent.element.appendChild(this.canvas);\n }\n Decorator.prototype.$updateDecorators = function (config) {\n var colors = (this.renderer.theme.isDark === true) ? this.colors.dark : this.colors.light;\n if (config) {\n this.maxHeight = config.maxHeight;\n this.lineHeight = config.lineHeight;\n this.canvasHeight = config.height;\n var allLineHeight = (config.lastRow + 1) * this.lineHeight;\n if (allLineHeight < this.canvasHeight) {\n this.heightRatio = 1;\n }\n else {\n this.heightRatio = this.canvasHeight / this.maxHeight;\n }\n }\n var ctx = this.canvas.getContext(\"2d\");\n function compare(a, b) {\n if (a.priority < b.priority)\n return -1;\n if (a.priority > b.priority)\n return 1;\n return 0;\n }\n var annotations = this.renderer.session.$annotations;\n ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n if (annotations) {\n var priorities = {\n \"info\": 1,\n \"warning\": 2,\n \"error\": 3\n };\n annotations.forEach(function (item) {\n item.priority = priorities[item.type] || null;\n });\n annotations = annotations.sort(compare);\n var foldData = this.renderer.session.$foldData;\n for (var i = 0; i < annotations.length; i++) {\n var row = annotations[i].row;\n var compensateFold = this.compensateFoldRows(row, foldData);\n var currentY = Math.round((row - compensateFold) * this.lineHeight * this.heightRatio);\n var y1 = Math.round(((row - compensateFold) * this.lineHeight * this.heightRatio));\n var y2 = Math.round((((row - compensateFold) * this.lineHeight + this.lineHeight) * this.heightRatio));\n var height = y2 - y1;\n if (height < this.minDecorationHeight) {\n var yCenter = ((y1 + y2) / 2) | 0;\n if (yCenter < this.halfMinDecorationHeight) {\n yCenter = this.halfMinDecorationHeight;\n }\n else if (yCenter + this.halfMinDecorationHeight > this.canvasHeight) {\n yCenter = this.canvasHeight - this.halfMinDecorationHeight;\n }\n y1 = Math.round(yCenter - this.halfMinDecorationHeight);\n y2 = Math.round(yCenter + this.halfMinDecorationHeight);\n }\n ctx.fillStyle = colors[annotations[i].type] || null;\n ctx.fillRect(0, currentY, this.canvasWidth, y2 - y1);\n }\n }\n var cursor = this.renderer.session.selection.getCursor();\n if (cursor) {\n var compensateFold = this.compensateFoldRows(cursor.row, foldData);\n var currentY = Math.round((cursor.row - compensateFold) * this.lineHeight * this.heightRatio);\n ctx.fillStyle = \"rgba(0, 0, 0, 0.5)\";\n ctx.fillRect(0, currentY, this.canvasWidth, 2);\n }\n };\n Decorator.prototype.compensateFoldRows = function (row, foldData) {\n var compensateFold = 0;\n if (foldData && foldData.length > 0) {\n for (var j = 0; j < foldData.length; j++) {\n if (row > foldData[j].start.row && row < foldData[j].end.row) {\n compensateFold += row - foldData[j].start.row;\n }\n else if (row >= foldData[j].end.row) {\n compensateFold += foldData[j].end.row - foldData[j].start.row;\n }\n }\n }\n return compensateFold;\n };\n return Decorator;\n}());\noop.implement(Decorator.prototype, EventEmitter);\nexports.Decorator = Decorator;\n\n});\n\nace.define(\"ace/virtual_renderer\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/config\",\"ace/layer/gutter\",\"ace/layer/marker\",\"ace/layer/text\",\"ace/layer/cursor\",\"ace/scrollbar\",\"ace/scrollbar\",\"ace/scrollbar_custom\",\"ace/scrollbar_custom\",\"ace/renderloop\",\"ace/layer/font_metrics\",\"ace/lib/event_emitter\",\"ace/css/editor-css\",\"ace/layer/decorators\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar lang = require(\"./lib/lang\");\nvar config = require(\"./config\");\nvar GutterLayer = require(\"./layer/gutter\").Gutter;\nvar MarkerLayer = require(\"./layer/marker\").Marker;\nvar TextLayer = require(\"./layer/text\").Text;\nvar CursorLayer = require(\"./layer/cursor\").Cursor;\nvar HScrollBar = require(\"./scrollbar\").HScrollBar;\nvar VScrollBar = require(\"./scrollbar\").VScrollBar;\nvar HScrollBarCustom = require(\"./scrollbar_custom\").HScrollBar;\nvar VScrollBarCustom = require(\"./scrollbar_custom\").VScrollBar;\nvar RenderLoop = require(\"./renderloop\").RenderLoop;\nvar FontMetrics = require(\"./layer/font_metrics\").FontMetrics;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar editorCss = require(\"./css/editor-css\");\nvar Decorator = require(\"./layer/decorators\").Decorator;\nvar useragent = require(\"./lib/useragent\");\ndom.importCssString(editorCss, \"ace_editor.css\", false);\nvar VirtualRenderer = /** @class */ (function () {\n function VirtualRenderer(container, theme) {\n var _self = this;\n this.container = container || dom.createElement(\"div\");\n dom.addCssClass(this.container, \"ace_editor\");\n if (dom.HI_DPI)\n dom.addCssClass(this.container, \"ace_hidpi\");\n this.setTheme(theme);\n if (config.get(\"useStrictCSP\") == null)\n config.set(\"useStrictCSP\", false);\n this.$gutter = dom.createElement(\"div\");\n this.$gutter.className = \"ace_gutter\";\n this.container.appendChild(this.$gutter);\n this.$gutter.setAttribute(\"aria-hidden\", true);\n this.scroller = dom.createElement(\"div\");\n this.scroller.className = \"ace_scroller\";\n this.container.appendChild(this.scroller);\n this.content = dom.createElement(\"div\");\n this.content.className = \"ace_content\";\n this.scroller.appendChild(this.content);\n this.$gutterLayer = new GutterLayer(this.$gutter);\n this.$gutterLayer.on(\"changeGutterWidth\", this.onGutterResize.bind(this));\n this.$markerBack = new MarkerLayer(this.content);\n var textLayer = this.$textLayer = new TextLayer(this.content);\n this.canvas = textLayer.element;\n this.$markerFront = new MarkerLayer(this.content);\n this.$cursorLayer = new CursorLayer(this.content);\n this.$horizScroll = false;\n this.$vScroll = false;\n this.scrollBar =\n this.scrollBarV = new VScrollBar(this.container, this);\n this.scrollBarH = new HScrollBar(this.container, this);\n this.scrollBarV.on(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollTop(e.data - _self.scrollMargin.top);\n });\n this.scrollBarH.on(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollLeft(e.data - _self.scrollMargin.left);\n });\n this.scrollTop = 0;\n this.scrollLeft = 0;\n this.cursorPos = {\n row: 0,\n column: 0\n };\n this.$fontMetrics = new FontMetrics(this.container);\n this.$textLayer.$setFontMetrics(this.$fontMetrics);\n this.$textLayer.on(\"changeCharacterSize\", function (e) {\n _self.updateCharacterSize();\n _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height);\n _self._signal(\"changeCharacterSize\", e);\n });\n this.$size = {\n width: 0,\n height: 0,\n scrollerHeight: 0,\n scrollerWidth: 0,\n $dirty: true\n };\n this.layerConfig = {\n width: 1,\n padding: 0,\n firstRow: 0,\n firstRowScreen: 0,\n lastRow: 0,\n lineHeight: 0,\n characterWidth: 0,\n minHeight: 1,\n maxHeight: 1,\n offset: 0,\n height: 1,\n gutterOffset: 1\n };\n this.scrollMargin = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n v: 0,\n h: 0\n };\n this.margin = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n v: 0,\n h: 0\n };\n this.$keepTextAreaAtCursor = !useragent.isIOS;\n this.$loop = new RenderLoop(this.$renderChanges.bind(this), this.container.ownerDocument.defaultView);\n this.$loop.schedule(this.CHANGE_FULL);\n this.updateCharacterSize();\n this.setPadding(4);\n this.$addResizeObserver();\n config.resetOptions(this);\n config._signal(\"renderer\", this);\n }\n VirtualRenderer.prototype.updateCharacterSize = function () {\n if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) {\n this.$allowBoldFonts = this.$textLayer.allowBoldFonts;\n this.setStyle(\"ace_nobold\", !this.$allowBoldFonts);\n }\n this.layerConfig.characterWidth =\n this.characterWidth = this.$textLayer.getCharacterWidth();\n this.layerConfig.lineHeight =\n this.lineHeight = this.$textLayer.getLineHeight();\n this.$updatePrintMargin();\n dom.setStyle(this.scroller.style, \"line-height\", this.lineHeight + \"px\");\n };\n VirtualRenderer.prototype.setSession = function (session) {\n if (this.session)\n this.session.doc.off(\"changeNewLineMode\", this.onChangeNewLineMode);\n this.session = session;\n if (session && this.scrollMargin.top && session.getScrollTop() <= 0)\n session.setScrollTop(-this.scrollMargin.top);\n this.$cursorLayer.setSession(session);\n this.$markerBack.setSession(session);\n this.$markerFront.setSession(session);\n this.$gutterLayer.setSession(session);\n this.$textLayer.setSession(session);\n if (!session)\n return;\n this.$loop.schedule(this.CHANGE_FULL);\n this.session.$setFontMetrics(this.$fontMetrics);\n this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null;\n this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this);\n this.onChangeNewLineMode();\n this.session.doc.on(\"changeNewLineMode\", this.onChangeNewLineMode);\n };\n VirtualRenderer.prototype.updateLines = function (firstRow, lastRow, force) {\n if (lastRow === undefined)\n lastRow = Infinity;\n if (!this.$changedLines) {\n this.$changedLines = {\n firstRow: firstRow,\n lastRow: lastRow\n };\n }\n else {\n if (this.$changedLines.firstRow > firstRow)\n this.$changedLines.firstRow = firstRow;\n if (this.$changedLines.lastRow < lastRow)\n this.$changedLines.lastRow = lastRow;\n }\n if (this.$changedLines.lastRow < this.layerConfig.firstRow) {\n if (force)\n this.$changedLines.lastRow = this.layerConfig.lastRow;\n else\n return;\n }\n if (this.$changedLines.firstRow > this.layerConfig.lastRow)\n return;\n this.$loop.schedule(this.CHANGE_LINES);\n };\n VirtualRenderer.prototype.onChangeNewLineMode = function () {\n this.$loop.schedule(this.CHANGE_TEXT);\n this.$textLayer.$updateEolChar();\n this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR);\n };\n VirtualRenderer.prototype.onChangeTabSize = function () {\n this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER);\n this.$textLayer.onChangeTabSize();\n };\n VirtualRenderer.prototype.updateText = function () {\n this.$loop.schedule(this.CHANGE_TEXT);\n };\n VirtualRenderer.prototype.updateFull = function (force) {\n if (force)\n this.$renderChanges(this.CHANGE_FULL, true);\n else\n this.$loop.schedule(this.CHANGE_FULL);\n };\n VirtualRenderer.prototype.updateFontSize = function () {\n this.$textLayer.checkForSizeChanges();\n };\n VirtualRenderer.prototype.$updateSizeAsync = function () {\n if (this.$loop.pending)\n this.$size.$dirty = true;\n else\n this.onResize();\n };\n VirtualRenderer.prototype.onResize = function (force, gutterWidth, width, height) {\n if (this.resizing > 2)\n return;\n else if (this.resizing > 0)\n this.resizing++;\n else\n this.resizing = force ? 1 : 0;\n var el = this.container;\n if (!height)\n height = el.clientHeight || el.scrollHeight;\n if (!width)\n width = el.clientWidth || el.scrollWidth;\n var changes = this.$updateCachedSize(force, gutterWidth, width, height);\n if (this.$resizeTimer)\n this.$resizeTimer.cancel();\n if (!this.$size.scrollerHeight || (!width && !height))\n return this.resizing = 0;\n if (force)\n this.$gutterLayer.$padding = null;\n if (force)\n this.$renderChanges(changes | this.$changes, true);\n else\n this.$loop.schedule(changes | this.$changes);\n if (this.resizing)\n this.resizing = 0;\n this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null;\n if (this.$customScrollbar) {\n this.$updateCustomScrollbar(true);\n }\n };\n VirtualRenderer.prototype.$updateCachedSize = function (force, gutterWidth, width, height) {\n height -= (this.$extraHeight || 0);\n var changes = 0;\n var size = this.$size;\n var oldSize = {\n width: size.width,\n height: size.height,\n scrollerHeight: size.scrollerHeight,\n scrollerWidth: size.scrollerWidth\n };\n if (height && (force || size.height != height)) {\n size.height = height;\n changes |= this.CHANGE_SIZE;\n size.scrollerHeight = size.height;\n if (this.$horizScroll)\n size.scrollerHeight -= this.scrollBarH.getHeight();\n this.scrollBarV.setHeight(size.scrollerHeight);\n this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + \"px\";\n changes = changes | this.CHANGE_SCROLL;\n }\n if (width && (force || size.width != width)) {\n changes |= this.CHANGE_SIZE;\n size.width = width;\n if (gutterWidth == null)\n gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0;\n this.gutterWidth = gutterWidth;\n dom.setStyle(this.scrollBarH.element.style, \"left\", gutterWidth + \"px\");\n dom.setStyle(this.scroller.style, \"left\", gutterWidth + this.margin.left + \"px\");\n size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth() - this.margin.h);\n dom.setStyle(this.$gutter.style, \"left\", this.margin.left + \"px\");\n var right = this.scrollBarV.getWidth() + \"px\";\n dom.setStyle(this.scrollBarH.element.style, \"right\", right);\n dom.setStyle(this.scroller.style, \"right\", right);\n dom.setStyle(this.scroller.style, \"bottom\", this.scrollBarH.getHeight());\n this.scrollBarH.setWidth(size.scrollerWidth);\n if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) {\n changes |= this.CHANGE_FULL;\n }\n }\n size.$dirty = !width || !height;\n if (changes)\n this._signal(\"resize\", oldSize);\n return changes;\n };\n VirtualRenderer.prototype.onGutterResize = function (width) {\n var gutterWidth = this.$showGutter ? width : 0;\n if (gutterWidth != this.gutterWidth)\n this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height);\n if (this.session.getUseWrapMode() && this.adjustWrapLimit()) {\n this.$loop.schedule(this.CHANGE_FULL);\n }\n else if (this.$size.$dirty) {\n this.$loop.schedule(this.CHANGE_FULL);\n }\n else {\n this.$computeLayerConfig();\n }\n };\n VirtualRenderer.prototype.adjustWrapLimit = function () {\n var availableWidth = this.$size.scrollerWidth - this.$padding * 2;\n var limit = Math.floor(availableWidth / this.characterWidth);\n return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn);\n };\n VirtualRenderer.prototype.setAnimatedScroll = function (shouldAnimate) {\n this.setOption(\"animatedScroll\", shouldAnimate);\n };\n VirtualRenderer.prototype.getAnimatedScroll = function () {\n return this.$animatedScroll;\n };\n VirtualRenderer.prototype.setShowInvisibles = function (showInvisibles) {\n this.setOption(\"showInvisibles\", showInvisibles);\n this.session.$bidiHandler.setShowInvisibles(showInvisibles);\n };\n VirtualRenderer.prototype.getShowInvisibles = function () {\n return this.getOption(\"showInvisibles\");\n };\n VirtualRenderer.prototype.getDisplayIndentGuides = function () {\n return this.getOption(\"displayIndentGuides\");\n };\n VirtualRenderer.prototype.setDisplayIndentGuides = function (display) {\n this.setOption(\"displayIndentGuides\", display);\n };\n VirtualRenderer.prototype.getHighlightIndentGuides = function () {\n return this.getOption(\"highlightIndentGuides\");\n };\n VirtualRenderer.prototype.setHighlightIndentGuides = function (highlight) {\n this.setOption(\"highlightIndentGuides\", highlight);\n };\n VirtualRenderer.prototype.setShowPrintMargin = function (showPrintMargin) {\n this.setOption(\"showPrintMargin\", showPrintMargin);\n };\n VirtualRenderer.prototype.getShowPrintMargin = function () {\n return this.getOption(\"showPrintMargin\");\n };\n VirtualRenderer.prototype.setPrintMarginColumn = function (showPrintMargin) {\n this.setOption(\"printMarginColumn\", showPrintMargin);\n };\n VirtualRenderer.prototype.getPrintMarginColumn = function () {\n return this.getOption(\"printMarginColumn\");\n };\n VirtualRenderer.prototype.getShowGutter = function () {\n return this.getOption(\"showGutter\");\n };\n VirtualRenderer.prototype.setShowGutter = function (show) {\n return this.setOption(\"showGutter\", show);\n };\n VirtualRenderer.prototype.getFadeFoldWidgets = function () {\n return this.getOption(\"fadeFoldWidgets\");\n };\n VirtualRenderer.prototype.setFadeFoldWidgets = function (show) {\n this.setOption(\"fadeFoldWidgets\", show);\n };\n VirtualRenderer.prototype.setHighlightGutterLine = function (shouldHighlight) {\n this.setOption(\"highlightGutterLine\", shouldHighlight);\n };\n VirtualRenderer.prototype.getHighlightGutterLine = function () {\n return this.getOption(\"highlightGutterLine\");\n };\n VirtualRenderer.prototype.$updatePrintMargin = function () {\n if (!this.$showPrintMargin && !this.$printMarginEl)\n return;\n if (!this.$printMarginEl) {\n var containerEl = dom.createElement(\"div\");\n containerEl.className = \"ace_layer ace_print-margin-layer\";\n this.$printMarginEl = dom.createElement(\"div\");\n this.$printMarginEl.className = \"ace_print-margin\";\n containerEl.appendChild(this.$printMarginEl);\n this.content.insertBefore(containerEl, this.content.firstChild);\n }\n var style = this.$printMarginEl.style;\n style.left = Math.round(this.characterWidth * this.$printMarginColumn + this.$padding) + \"px\";\n style.visibility = this.$showPrintMargin ? \"visible\" : \"hidden\";\n if (this.session && this.session.$wrap == -1)\n this.adjustWrapLimit();\n };\n VirtualRenderer.prototype.getContainerElement = function () {\n return this.container;\n };\n VirtualRenderer.prototype.getMouseEventTarget = function () {\n return this.scroller;\n };\n VirtualRenderer.prototype.getTextAreaContainer = function () {\n return this.container;\n };\n VirtualRenderer.prototype.$moveTextAreaToCursor = function () {\n if (this.$isMousePressed)\n return;\n var style = this.textarea.style;\n var composition = this.$composition;\n if (!this.$keepTextAreaAtCursor && !composition) {\n dom.translate(this.textarea, -100, 0);\n return;\n }\n var pixelPos = this.$cursorLayer.$pixelPos;\n if (!pixelPos)\n return;\n if (composition && composition.markerRange)\n pixelPos = this.$cursorLayer.getPixelPosition(composition.markerRange.start, true);\n var config = this.layerConfig;\n var posTop = pixelPos.top;\n var posLeft = pixelPos.left;\n posTop -= config.offset;\n var h = composition && composition.useTextareaForIME || useragent.isMobile ? this.lineHeight : 1;\n if (posTop < 0 || posTop > config.height - h) {\n dom.translate(this.textarea, 0, 0);\n return;\n }\n var w = 1;\n var maxTop = this.$size.height - h;\n if (!composition) {\n posTop += this.lineHeight;\n }\n else {\n if (composition.useTextareaForIME) {\n var val = this.textarea.value;\n w = this.characterWidth * (this.session.$getStringScreenWidth(val)[0]);\n }\n else {\n posTop += this.lineHeight + 2;\n }\n }\n posLeft -= this.scrollLeft;\n if (posLeft > this.$size.scrollerWidth - w)\n posLeft = this.$size.scrollerWidth - w;\n posLeft += this.gutterWidth + this.margin.left;\n dom.setStyle(style, \"height\", h + \"px\");\n dom.setStyle(style, \"width\", w + \"px\");\n dom.translate(this.textarea, Math.min(posLeft, this.$size.scrollerWidth - w), Math.min(posTop, maxTop));\n };\n VirtualRenderer.prototype.getFirstVisibleRow = function () {\n return this.layerConfig.firstRow;\n };\n VirtualRenderer.prototype.getFirstFullyVisibleRow = function () {\n return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);\n };\n VirtualRenderer.prototype.getLastFullyVisibleRow = function () {\n var config = this.layerConfig;\n var lastRow = config.lastRow;\n var top = this.session.documentToScreenRow(lastRow, 0) * config.lineHeight;\n if (top - this.session.getScrollTop() > config.height - config.lineHeight)\n return lastRow - 1;\n return lastRow;\n };\n VirtualRenderer.prototype.getLastVisibleRow = function () {\n return this.layerConfig.lastRow;\n };\n VirtualRenderer.prototype.setPadding = function (padding) {\n this.$padding = padding;\n this.$textLayer.setPadding(padding);\n this.$cursorLayer.setPadding(padding);\n this.$markerFront.setPadding(padding);\n this.$markerBack.setPadding(padding);\n this.$loop.schedule(this.CHANGE_FULL);\n this.$updatePrintMargin();\n };\n VirtualRenderer.prototype.setScrollMargin = function (top, bottom, left, right) {\n var sm = this.scrollMargin;\n sm.top = top | 0;\n sm.bottom = bottom | 0;\n sm.right = right | 0;\n sm.left = left | 0;\n sm.v = sm.top + sm.bottom;\n sm.h = sm.left + sm.right;\n if (sm.top && this.scrollTop <= 0 && this.session)\n this.session.setScrollTop(-sm.top);\n this.updateFull();\n };\n VirtualRenderer.prototype.setMargin = function (top, bottom, left, right) {\n var sm = this.margin;\n sm.top = top | 0;\n sm.bottom = bottom | 0;\n sm.right = right | 0;\n sm.left = left | 0;\n sm.v = sm.top + sm.bottom;\n sm.h = sm.left + sm.right;\n this.$updateCachedSize(true, this.gutterWidth, this.$size.width, this.$size.height);\n this.updateFull();\n };\n VirtualRenderer.prototype.getHScrollBarAlwaysVisible = function () {\n return this.$hScrollBarAlwaysVisible;\n };\n VirtualRenderer.prototype.setHScrollBarAlwaysVisible = function (alwaysVisible) {\n this.setOption(\"hScrollBarAlwaysVisible\", alwaysVisible);\n };\n VirtualRenderer.prototype.getVScrollBarAlwaysVisible = function () {\n return this.$vScrollBarAlwaysVisible;\n };\n VirtualRenderer.prototype.setVScrollBarAlwaysVisible = function (alwaysVisible) {\n this.setOption(\"vScrollBarAlwaysVisible\", alwaysVisible);\n };\n VirtualRenderer.prototype.$updateScrollBarV = function () {\n var scrollHeight = this.layerConfig.maxHeight;\n var scrollerHeight = this.$size.scrollerHeight;\n if (!this.$maxLines && this.$scrollPastEnd) {\n scrollHeight -= (scrollerHeight - this.lineHeight) * this.$scrollPastEnd;\n if (this.scrollTop > scrollHeight - scrollerHeight) {\n scrollHeight = this.scrollTop + scrollerHeight;\n this.scrollBarV.scrollTop = null;\n }\n }\n this.scrollBarV.setScrollHeight(scrollHeight + this.scrollMargin.v);\n this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top);\n };\n VirtualRenderer.prototype.$updateScrollBarH = function () {\n this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h);\n this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left);\n };\n VirtualRenderer.prototype.freeze = function () {\n this.$frozen = true;\n };\n VirtualRenderer.prototype.unfreeze = function () {\n this.$frozen = false;\n };\n VirtualRenderer.prototype.$renderChanges = function (changes, force) {\n if (this.$changes) {\n changes |= this.$changes;\n this.$changes = 0;\n }\n if ((!this.session || !this.container.offsetWidth || this.$frozen) || (!changes && !force)) {\n this.$changes |= changes;\n return;\n }\n if (this.$size.$dirty) {\n this.$changes |= changes;\n return this.onResize(true);\n }\n if (!this.lineHeight) {\n this.$textLayer.checkForSizeChanges();\n }\n this._signal(\"beforeRender\", changes);\n if (this.session && this.session.$bidiHandler)\n this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);\n var config = this.layerConfig;\n if (changes & this.CHANGE_FULL ||\n changes & this.CHANGE_SIZE ||\n changes & this.CHANGE_TEXT ||\n changes & this.CHANGE_LINES ||\n changes & this.CHANGE_SCROLL ||\n changes & this.CHANGE_H_SCROLL) {\n changes |= this.$computeLayerConfig() | this.$loop.clear();\n if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) {\n var st = this.scrollTop + (config.firstRow - Math.max(this.layerConfig.firstRow, 0)) * this.lineHeight;\n if (st > 0) {\n this.scrollTop = st;\n changes = changes | this.CHANGE_SCROLL;\n changes |= this.$computeLayerConfig() | this.$loop.clear();\n }\n }\n config = this.layerConfig;\n this.$updateScrollBarV();\n if (changes & this.CHANGE_H_SCROLL)\n this.$updateScrollBarH();\n dom.translate(this.content, -this.scrollLeft, -config.offset);\n var width = config.width + 2 * this.$padding + \"px\";\n var height = config.minHeight + \"px\";\n dom.setStyle(this.content.style, \"width\", width);\n dom.setStyle(this.content.style, \"height\", height);\n }\n if (changes & this.CHANGE_H_SCROLL) {\n dom.translate(this.content, -this.scrollLeft, -config.offset);\n this.scroller.className = this.scrollLeft <= 0 ? \"ace_scroller \" : \"ace_scroller ace_scroll-left \";\n if (this.enableKeyboardAccessibility)\n this.scroller.className += this.keyboardFocusClassName;\n }\n if (changes & this.CHANGE_FULL) {\n this.$changedLines = null;\n this.$textLayer.update(config);\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n this.$markerBack.update(config);\n this.$markerFront.update(config);\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n this._signal(\"afterRender\", changes);\n return;\n }\n if (changes & this.CHANGE_SCROLL) {\n this.$changedLines = null;\n if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES)\n this.$textLayer.update(config);\n else\n this.$textLayer.scrollLines(config);\n if (this.$showGutter) {\n if (changes & this.CHANGE_GUTTER || changes & this.CHANGE_LINES)\n this.$gutterLayer.update(config);\n else\n this.$gutterLayer.scrollLines(config);\n }\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n this.$markerBack.update(config);\n this.$markerFront.update(config);\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n this._signal(\"afterRender\", changes);\n return;\n }\n if (changes & this.CHANGE_TEXT) {\n this.$changedLines = null;\n this.$textLayer.update(config);\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n else if (changes & this.CHANGE_LINES) {\n if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) {\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n else if (changes & this.CHANGE_CURSOR) {\n if (this.$highlightGutterLine)\n this.$gutterLayer.updateLineHighlight(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n if (changes & this.CHANGE_CURSOR) {\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n }\n if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) {\n this.$markerFront.update(config);\n }\n if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) {\n this.$markerBack.update(config);\n }\n this._signal(\"afterRender\", changes);\n };\n VirtualRenderer.prototype.$autosize = function () {\n var height = this.session.getScreenLength() * this.lineHeight;\n var maxHeight = this.$maxLines * this.lineHeight;\n var desiredHeight = Math.min(maxHeight, Math.max((this.$minLines || 1) * this.lineHeight, height)) + this.scrollMargin.v + (this.$extraHeight || 0);\n if (this.$horizScroll)\n desiredHeight += this.scrollBarH.getHeight();\n if (this.$maxPixelHeight && desiredHeight > this.$maxPixelHeight)\n desiredHeight = this.$maxPixelHeight;\n var hideScrollbars = desiredHeight <= 2 * this.lineHeight;\n var vScroll = !hideScrollbars && height > maxHeight;\n if (desiredHeight != this.desiredHeight ||\n this.$size.height != this.desiredHeight || vScroll != this.$vScroll) {\n if (vScroll != this.$vScroll) {\n this.$vScroll = vScroll;\n this.scrollBarV.setVisible(vScroll);\n }\n var w = this.container.clientWidth;\n this.container.style.height = desiredHeight + \"px\";\n this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight);\n this.desiredHeight = desiredHeight;\n this._signal(\"autosize\");\n }\n };\n VirtualRenderer.prototype.$computeLayerConfig = function () {\n var session = this.session;\n var size = this.$size;\n var hideScrollbars = size.height <= 2 * this.lineHeight;\n var screenLines = this.session.getScreenLength();\n var maxHeight = screenLines * this.lineHeight;\n var longestLine = this.$getLongestLine();\n var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible ||\n size.scrollerWidth - longestLine - 2 * this.$padding < 0);\n var hScrollChanged = this.$horizScroll !== horizScroll;\n if (hScrollChanged) {\n this.$horizScroll = horizScroll;\n this.scrollBarH.setVisible(horizScroll);\n }\n var vScrollBefore = this.$vScroll; // autosize can change vscroll value in which case we need to update longestLine\n if (this.$maxLines && this.lineHeight > 1)\n this.$autosize();\n var minHeight = size.scrollerHeight + this.lineHeight;\n var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd\n ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd\n : 0;\n maxHeight += scrollPastEnd;\n var sm = this.scrollMargin;\n this.session.setScrollTop(Math.max(-sm.top, Math.min(this.scrollTop, maxHeight - size.scrollerHeight + sm.bottom)));\n this.session.setScrollLeft(Math.max(-sm.left, Math.min(this.scrollLeft, longestLine + 2 * this.$padding - size.scrollerWidth + sm.right)));\n var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||\n size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop > sm.top);\n var vScrollChanged = vScrollBefore !== vScroll;\n if (vScrollChanged) {\n this.$vScroll = vScroll;\n this.scrollBarV.setVisible(vScroll);\n }\n var offset = this.scrollTop % this.lineHeight;\n var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;\n var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));\n var lastRow = firstRow + lineCount;\n var firstRowScreen, firstRowHeight;\n var lineHeight = this.lineHeight;\n firstRow = session.screenToDocumentRow(firstRow, 0);\n var foldLine = session.getFoldLine(firstRow);\n if (foldLine) {\n firstRow = foldLine.start.row;\n }\n firstRowScreen = session.documentToScreenRow(firstRow, 0);\n firstRowHeight = session.getRowLength(firstRow) * lineHeight;\n lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1);\n minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight +\n firstRowHeight;\n offset = this.scrollTop - firstRowScreen * lineHeight;\n var changes = 0;\n if (this.layerConfig.width != longestLine || hScrollChanged)\n changes = this.CHANGE_H_SCROLL;\n if (hScrollChanged || vScrollChanged) {\n changes |= this.$updateCachedSize(true, this.gutterWidth, size.width, size.height);\n this._signal(\"scrollbarVisibilityChanged\");\n if (vScrollChanged)\n longestLine = this.$getLongestLine();\n }\n this.layerConfig = {\n width: longestLine,\n padding: this.$padding,\n firstRow: firstRow,\n firstRowScreen: firstRowScreen,\n lastRow: lastRow,\n lineHeight: lineHeight,\n characterWidth: this.characterWidth,\n minHeight: minHeight,\n maxHeight: maxHeight,\n offset: offset,\n gutterOffset: lineHeight ? Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)) : 0,\n height: this.$size.scrollerHeight\n };\n if (this.session.$bidiHandler)\n this.session.$bidiHandler.setContentWidth(longestLine - this.$padding);\n return changes;\n };\n VirtualRenderer.prototype.$updateLines = function () {\n if (!this.$changedLines)\n return;\n var firstRow = this.$changedLines.firstRow;\n var lastRow = this.$changedLines.lastRow;\n this.$changedLines = null;\n var layerConfig = this.layerConfig;\n if (firstRow > layerConfig.lastRow + 1) {\n return;\n }\n if (lastRow < layerConfig.firstRow) {\n return;\n }\n if (lastRow === Infinity) {\n if (this.$showGutter)\n this.$gutterLayer.update(layerConfig);\n this.$textLayer.update(layerConfig);\n return;\n }\n this.$textLayer.updateLines(layerConfig, firstRow, lastRow);\n return true;\n };\n VirtualRenderer.prototype.$getLongestLine = function () {\n var charCount = this.session.getScreenWidth();\n if (this.showInvisibles && !this.session.$useWrapMode)\n charCount += 1;\n if (this.$textLayer && charCount > this.$textLayer.MAX_LINE_LENGTH)\n charCount = this.$textLayer.MAX_LINE_LENGTH + 30;\n return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth));\n };\n VirtualRenderer.prototype.updateFrontMarkers = function () {\n this.$markerFront.setMarkers(this.session.getMarkers(true));\n this.$loop.schedule(this.CHANGE_MARKER_FRONT);\n };\n VirtualRenderer.prototype.updateBackMarkers = function () {\n this.$markerBack.setMarkers(this.session.getMarkers());\n this.$loop.schedule(this.CHANGE_MARKER_BACK);\n };\n VirtualRenderer.prototype.addGutterDecoration = function (row, className) {\n this.$gutterLayer.addGutterDecoration(row, className);\n };\n VirtualRenderer.prototype.removeGutterDecoration = function (row, className) {\n this.$gutterLayer.removeGutterDecoration(row, className);\n };\n VirtualRenderer.prototype.updateBreakpoints = function (rows) {\n this.$loop.schedule(this.CHANGE_GUTTER);\n };\n VirtualRenderer.prototype.setAnnotations = function (annotations) {\n this.$gutterLayer.setAnnotations(annotations);\n this.$loop.schedule(this.CHANGE_GUTTER);\n };\n VirtualRenderer.prototype.updateCursor = function () {\n this.$loop.schedule(this.CHANGE_CURSOR);\n };\n VirtualRenderer.prototype.hideCursor = function () {\n this.$cursorLayer.hideCursor();\n };\n VirtualRenderer.prototype.showCursor = function () {\n this.$cursorLayer.showCursor();\n };\n VirtualRenderer.prototype.scrollSelectionIntoView = function (anchor, lead, offset) {\n this.scrollCursorIntoView(anchor, offset);\n this.scrollCursorIntoView(lead, offset);\n };\n VirtualRenderer.prototype.scrollCursorIntoView = function (cursor, offset, $viewMargin) {\n if (this.$size.scrollerHeight === 0)\n return;\n var pos = this.$cursorLayer.getPixelPosition(cursor);\n var newLeft = pos.left;\n var newTop = pos.top;\n var topMargin = $viewMargin && $viewMargin.top || 0;\n var bottomMargin = $viewMargin && $viewMargin.bottom || 0;\n if (this.$scrollAnimation) {\n this.$stopAnimation = true;\n }\n var currentTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop;\n if (currentTop + topMargin > newTop) {\n if (offset && currentTop + topMargin > newTop + this.lineHeight)\n newTop -= offset * this.$size.scrollerHeight;\n if (newTop === 0)\n newTop = -this.scrollMargin.top;\n this.session.setScrollTop(newTop);\n }\n else if (currentTop + this.$size.scrollerHeight - bottomMargin < newTop + this.lineHeight) {\n if (offset && currentTop + this.$size.scrollerHeight - bottomMargin < newTop - this.lineHeight)\n newTop += offset * this.$size.scrollerHeight;\n this.session.setScrollTop(newTop + this.lineHeight + bottomMargin - this.$size.scrollerHeight);\n }\n var currentLeft = this.scrollLeft;\n var twoCharsWidth = 2 * this.layerConfig.characterWidth;\n if (newLeft - twoCharsWidth < currentLeft) {\n newLeft -= twoCharsWidth;\n if (newLeft < this.$padding + twoCharsWidth) {\n newLeft = -this.scrollMargin.left;\n }\n this.session.setScrollLeft(newLeft);\n }\n else {\n newLeft += twoCharsWidth;\n if (currentLeft + this.$size.scrollerWidth < newLeft + this.characterWidth) {\n this.session.setScrollLeft(Math.round(newLeft + this.characterWidth - this.$size.scrollerWidth));\n }\n else if (currentLeft <= this.$padding && newLeft - currentLeft < this.characterWidth) {\n this.session.setScrollLeft(0);\n }\n }\n };\n VirtualRenderer.prototype.getScrollTop = function () {\n return this.session.getScrollTop();\n };\n VirtualRenderer.prototype.getScrollLeft = function () {\n return this.session.getScrollLeft();\n };\n VirtualRenderer.prototype.getScrollTopRow = function () {\n return this.scrollTop / this.lineHeight;\n };\n VirtualRenderer.prototype.getScrollBottomRow = function () {\n return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);\n };\n VirtualRenderer.prototype.scrollToRow = function (row) {\n this.session.setScrollTop(row * this.lineHeight);\n };\n VirtualRenderer.prototype.alignCursor = function (cursor, alignment) {\n if (typeof cursor == \"number\")\n cursor = { row: cursor, column: 0 };\n var pos = this.$cursorLayer.getPixelPosition(cursor);\n var h = this.$size.scrollerHeight - this.lineHeight;\n var offset = pos.top - h * (alignment || 0);\n this.session.setScrollTop(offset);\n return offset;\n };\n VirtualRenderer.prototype.$calcSteps = function (fromValue, toValue) {\n var i = 0;\n var l = this.STEPS;\n var steps = [];\n var func = function (t, x_min, dx) {\n return dx * (Math.pow(t - 1, 3) + 1) + x_min;\n };\n for (i = 0; i < l; ++i)\n steps.push(func(i / this.STEPS, fromValue, toValue - fromValue));\n return steps;\n };\n VirtualRenderer.prototype.scrollToLine = function (line, center, animate, callback) {\n var pos = this.$cursorLayer.getPixelPosition({ row: line, column: 0 });\n var offset = pos.top;\n if (center)\n offset -= this.$size.scrollerHeight / 2;\n var initialScroll = this.scrollTop;\n this.session.setScrollTop(offset);\n if (animate !== false)\n this.animateScrolling(initialScroll, callback);\n };\n VirtualRenderer.prototype.animateScrolling = function (fromValue, callback) {\n var toValue = this.scrollTop;\n if (!this.$animatedScroll)\n return;\n var _self = this;\n if (fromValue == toValue)\n return;\n if (this.$scrollAnimation) {\n var oldSteps = this.$scrollAnimation.steps;\n if (oldSteps.length) {\n fromValue = oldSteps[0];\n if (fromValue == toValue)\n return;\n }\n }\n var steps = _self.$calcSteps(fromValue, toValue);\n this.$scrollAnimation = { from: fromValue, to: toValue, steps: steps };\n clearInterval(this.$timer);\n _self.session.setScrollTop(steps.shift());\n _self.session.$scrollTop = toValue;\n function endAnimation() {\n _self.$timer = clearInterval(_self.$timer);\n _self.$scrollAnimation = null;\n _self.$stopAnimation = false;\n callback && callback();\n }\n this.$timer = setInterval(function () {\n if (_self.$stopAnimation) {\n endAnimation();\n return;\n }\n if (!_self.session)\n return clearInterval(_self.$timer);\n if (steps.length) {\n _self.session.setScrollTop(steps.shift());\n _self.session.$scrollTop = toValue;\n }\n else if (toValue != null) {\n _self.session.$scrollTop = -1;\n _self.session.setScrollTop(toValue);\n toValue = null;\n }\n else {\n endAnimation();\n }\n }, 10);\n };\n VirtualRenderer.prototype.scrollToY = function (scrollTop) {\n if (this.scrollTop !== scrollTop) {\n this.$loop.schedule(this.CHANGE_SCROLL);\n this.scrollTop = scrollTop;\n }\n };\n VirtualRenderer.prototype.scrollToX = function (scrollLeft) {\n if (this.scrollLeft !== scrollLeft)\n this.scrollLeft = scrollLeft;\n this.$loop.schedule(this.CHANGE_H_SCROLL);\n };\n VirtualRenderer.prototype.scrollTo = function (x, y) {\n this.session.setScrollTop(y);\n this.session.setScrollLeft(x);\n };\n VirtualRenderer.prototype.scrollBy = function (deltaX, deltaY) {\n deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);\n deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX);\n };\n VirtualRenderer.prototype.isScrollableBy = function (deltaX, deltaY) {\n if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top)\n return true;\n if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight\n - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom)\n return true;\n if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left)\n return true;\n if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth\n - this.layerConfig.width < -1 + this.scrollMargin.right)\n return true;\n };\n VirtualRenderer.prototype.pixelToScreenCoordinates = function (x, y) {\n var canvasPos;\n if (this.$hasCssTransforms) {\n canvasPos = { top: 0, left: 0 };\n var p = this.$fontMetrics.transformCoordinates([x, y]);\n x = p[1] - this.gutterWidth - this.margin.left;\n y = p[0];\n }\n else {\n canvasPos = this.scroller.getBoundingClientRect();\n }\n var offsetX = x + this.scrollLeft - canvasPos.left - this.$padding;\n var offset = offsetX / this.characterWidth;\n var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight);\n var col = this.$blockCursor ? Math.floor(offset) : Math.round(offset);\n return { row: row, column: col, side: offset - col > 0 ? 1 : -1, offsetX: offsetX };\n };\n VirtualRenderer.prototype.screenToTextCoordinates = function (x, y) {\n var canvasPos;\n if (this.$hasCssTransforms) {\n canvasPos = { top: 0, left: 0 };\n var p = this.$fontMetrics.transformCoordinates([x, y]);\n x = p[1] - this.gutterWidth - this.margin.left;\n y = p[0];\n }\n else {\n canvasPos = this.scroller.getBoundingClientRect();\n }\n var offsetX = x + this.scrollLeft - canvasPos.left - this.$padding;\n var offset = offsetX / this.characterWidth;\n var col = this.$blockCursor ? Math.floor(offset) : Math.round(offset);\n var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight);\n return this.session.screenToDocumentPosition(row, Math.max(col, 0), offsetX);\n };\n VirtualRenderer.prototype.textToScreenCoordinates = function (row, column) {\n var canvasPos = this.scroller.getBoundingClientRect();\n var pos = this.session.documentToScreenPosition(row, column);\n var x = this.$padding + (this.session.$bidiHandler.isBidiRow(pos.row, row)\n ? this.session.$bidiHandler.getPosLeft(pos.column)\n : Math.round(pos.column * this.characterWidth));\n var y = pos.row * this.lineHeight;\n return {\n pageX: canvasPos.left + x - this.scrollLeft,\n pageY: canvasPos.top + y - this.scrollTop\n };\n };\n VirtualRenderer.prototype.visualizeFocus = function () {\n dom.addCssClass(this.container, \"ace_focus\");\n };\n VirtualRenderer.prototype.visualizeBlur = function () {\n dom.removeCssClass(this.container, \"ace_focus\");\n };\n VirtualRenderer.prototype.showComposition = function (composition) {\n this.$composition = composition;\n if (!composition.cssText) {\n composition.cssText = this.textarea.style.cssText;\n }\n if (composition.useTextareaForIME == undefined)\n composition.useTextareaForIME = this.$useTextareaForIME;\n if (this.$useTextareaForIME) {\n dom.addCssClass(this.textarea, \"ace_composition\");\n this.textarea.style.cssText = \"\";\n this.$moveTextAreaToCursor();\n this.$cursorLayer.element.style.display = \"none\";\n }\n else {\n composition.markerId = this.session.addMarker(composition.markerRange, \"ace_composition_marker\", \"text\");\n }\n };\n VirtualRenderer.prototype.setCompositionText = function (text) {\n var cursor = this.session.selection.cursor;\n this.addToken(text, \"composition_placeholder\", cursor.row, cursor.column);\n this.$moveTextAreaToCursor();\n };\n VirtualRenderer.prototype.hideComposition = function () {\n if (!this.$composition)\n return;\n if (this.$composition.markerId)\n this.session.removeMarker(this.$composition.markerId);\n dom.removeCssClass(this.textarea, \"ace_composition\");\n this.textarea.style.cssText = this.$composition.cssText;\n var cursor = this.session.selection.cursor;\n this.removeExtraToken(cursor.row, cursor.column);\n this.$composition = null;\n this.$cursorLayer.element.style.display = \"\";\n };\n VirtualRenderer.prototype.setGhostText = function (text, position) {\n var cursor = this.session.selection.cursor;\n var insertPosition = position || { row: cursor.row, column: cursor.column };\n this.removeGhostText();\n var textLines = text.split(\"\\n\");\n this.addToken(textLines[0], \"ghost_text\", insertPosition.row, insertPosition.column);\n this.$ghostText = {\n text: text,\n position: {\n row: insertPosition.row,\n column: insertPosition.column\n }\n };\n if (textLines.length > 1) {\n this.$ghostTextWidget = {\n text: textLines.slice(1).join(\"\\n\"),\n row: insertPosition.row,\n column: insertPosition.column,\n className: \"ace_ghost_text\"\n };\n this.session.widgetManager.addLineWidget(this.$ghostTextWidget);\n }\n };\n VirtualRenderer.prototype.removeGhostText = function () {\n if (!this.$ghostText)\n return;\n var position = this.$ghostText.position;\n this.removeExtraToken(position.row, position.column);\n if (this.$ghostTextWidget) {\n this.session.widgetManager.removeLineWidget(this.$ghostTextWidget);\n this.$ghostTextWidget = null;\n }\n this.$ghostText = null;\n };\n VirtualRenderer.prototype.addToken = function (text, type, row, column) {\n var session = this.session;\n session.bgTokenizer.lines[row] = null;\n var newToken = { type: type, value: text };\n var tokens = session.getTokens(row);\n if (column == null || !tokens.length) {\n tokens.push(newToken);\n }\n else {\n var l = 0;\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n l += token.value.length;\n if (column <= l) {\n var diff = token.value.length - (l - column);\n var before = token.value.slice(0, diff);\n var after = token.value.slice(diff);\n tokens.splice(i, 1, { type: token.type, value: before }, newToken, { type: token.type, value: after });\n break;\n }\n }\n }\n this.updateLines(row, row);\n };\n VirtualRenderer.prototype.removeExtraToken = function (row, column) {\n this.session.bgTokenizer.lines[row] = null;\n this.updateLines(row, row);\n };\n VirtualRenderer.prototype.setTheme = function (theme, cb) {\n var _self = this;\n this.$themeId = theme;\n _self._dispatchEvent('themeChange', { theme: theme });\n if (!theme || typeof theme == \"string\") {\n var moduleName = theme || this.$options.theme.initialValue;\n config.loadModule([\"theme\", moduleName], afterLoad);\n }\n else {\n afterLoad(theme);\n }\n function afterLoad(module) {\n if (_self.$themeId != theme)\n return cb && cb();\n if (!module || !module.cssClass)\n throw new Error(\"couldn't load module \" + theme + \" or it didn't call define\");\n if (module.$id)\n _self.$themeId = module.$id;\n dom.importCssString(module.cssText, module.cssClass, _self.container);\n if (_self.theme)\n dom.removeCssClass(_self.container, _self.theme.cssClass);\n var padding = \"padding\" in module ? module.padding\n : \"padding\" in (_self.theme || {}) ? 4 : _self.$padding;\n if (_self.$padding && padding != _self.$padding)\n _self.setPadding(padding);\n _self.$theme = module.cssClass;\n _self.theme = module;\n dom.addCssClass(_self.container, module.cssClass);\n dom.setCssClass(_self.container, \"ace_dark\", module.isDark);\n if (_self.$size) {\n _self.$size.width = 0;\n _self.$updateSizeAsync();\n }\n _self._dispatchEvent('themeLoaded', { theme: module });\n cb && cb();\n }\n };\n VirtualRenderer.prototype.getTheme = function () {\n return this.$themeId;\n };\n VirtualRenderer.prototype.setStyle = function (style, include) {\n dom.setCssClass(this.container, style, include !== false);\n };\n VirtualRenderer.prototype.unsetStyle = function (style) {\n dom.removeCssClass(this.container, style);\n };\n VirtualRenderer.prototype.setCursorStyle = function (style) {\n dom.setStyle(this.scroller.style, \"cursor\", style);\n };\n VirtualRenderer.prototype.setMouseCursor = function (cursorStyle) {\n dom.setStyle(this.scroller.style, \"cursor\", cursorStyle);\n };\n VirtualRenderer.prototype.attachToShadowRoot = function () {\n dom.importCssString(editorCss, \"ace_editor.css\", this.container);\n };\n VirtualRenderer.prototype.destroy = function () {\n this.freeze();\n this.$fontMetrics.destroy();\n this.$cursorLayer.destroy();\n this.removeAllListeners();\n this.container.textContent = \"\";\n this.setOption(\"useResizeObserver\", false);\n };\n VirtualRenderer.prototype.$updateCustomScrollbar = function (val) {\n var _self = this;\n this.$horizScroll = this.$vScroll = null;\n this.scrollBarV.element.remove();\n this.scrollBarH.element.remove();\n if (this.$scrollDecorator) {\n delete this.$scrollDecorator;\n }\n if (val === true) {\n this.scrollBarV = new VScrollBarCustom(this.container, this);\n this.scrollBarH = new HScrollBarCustom(this.container, this);\n this.scrollBarV.setHeight(this.$size.scrollerHeight);\n this.scrollBarH.setWidth(this.$size.scrollerWidth);\n this.scrollBarV.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollTop(e.data - _self.scrollMargin.top);\n });\n this.scrollBarH.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollLeft(e.data - _self.scrollMargin.left);\n });\n this.$scrollDecorator = new Decorator(this.scrollBarV, this);\n this.$scrollDecorator.$updateDecorators();\n }\n else {\n this.scrollBarV = new VScrollBar(this.container, this);\n this.scrollBarH = new HScrollBar(this.container, this);\n this.scrollBarV.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollTop(e.data - _self.scrollMargin.top);\n });\n this.scrollBarH.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollLeft(e.data - _self.scrollMargin.left);\n });\n }\n };\n VirtualRenderer.prototype.$addResizeObserver = function () {\n if (!window.ResizeObserver || this.$resizeObserver)\n return;\n var self = this;\n this.$resizeTimer = lang.delayedCall(function () {\n if (!self.destroyed)\n self.onResize();\n }, 50);\n this.$resizeObserver = new window.ResizeObserver(function (e) {\n var w = e[0].contentRect.width;\n var h = e[0].contentRect.height;\n if (Math.abs(self.$size.width - w) > 1\n || Math.abs(self.$size.height - h) > 1) {\n self.$resizeTimer.delay();\n }\n else {\n self.$resizeTimer.cancel();\n }\n });\n this.$resizeObserver.observe(this.container);\n };\n return VirtualRenderer;\n}());\nVirtualRenderer.prototype.CHANGE_CURSOR = 1;\nVirtualRenderer.prototype.CHANGE_MARKER = 2;\nVirtualRenderer.prototype.CHANGE_GUTTER = 4;\nVirtualRenderer.prototype.CHANGE_SCROLL = 8;\nVirtualRenderer.prototype.CHANGE_LINES = 16;\nVirtualRenderer.prototype.CHANGE_TEXT = 32;\nVirtualRenderer.prototype.CHANGE_SIZE = 64;\nVirtualRenderer.prototype.CHANGE_MARKER_BACK = 128;\nVirtualRenderer.prototype.CHANGE_MARKER_FRONT = 256;\nVirtualRenderer.prototype.CHANGE_FULL = 512;\nVirtualRenderer.prototype.CHANGE_H_SCROLL = 1024;\nVirtualRenderer.prototype.$changes = 0;\nVirtualRenderer.prototype.$padding = null;\nVirtualRenderer.prototype.$frozen = false;\nVirtualRenderer.prototype.STEPS = 8;\noop.implement(VirtualRenderer.prototype, EventEmitter);\nconfig.defineOptions(VirtualRenderer.prototype, \"renderer\", {\n useResizeObserver: {\n set: function (value) {\n if (!value && this.$resizeObserver) {\n this.$resizeObserver.disconnect();\n this.$resizeTimer.cancel();\n this.$resizeTimer = this.$resizeObserver = null;\n }\n else if (value && !this.$resizeObserver) {\n this.$addResizeObserver();\n }\n }\n },\n animatedScroll: { initialValue: false },\n showInvisibles: {\n set: function (value) {\n if (this.$textLayer.setShowInvisibles(value))\n this.$loop.schedule(this.CHANGE_TEXT);\n },\n initialValue: false\n },\n showPrintMargin: {\n set: function () { this.$updatePrintMargin(); },\n initialValue: true\n },\n printMarginColumn: {\n set: function () { this.$updatePrintMargin(); },\n initialValue: 80\n },\n printMargin: {\n set: function (val) {\n if (typeof val == \"number\")\n this.$printMarginColumn = val;\n this.$showPrintMargin = !!val;\n this.$updatePrintMargin();\n },\n get: function () {\n return this.$showPrintMargin && this.$printMarginColumn;\n }\n },\n showGutter: {\n set: function (show) {\n this.$gutter.style.display = show ? \"block\" : \"none\";\n this.$loop.schedule(this.CHANGE_FULL);\n this.onGutterResize();\n },\n initialValue: true\n },\n useSvgGutterIcons: {\n set: function (value) {\n this.$gutterLayer.$useSvgGutterIcons = value;\n },\n initialValue: false\n },\n showFoldedAnnotations: {\n set: function (value) {\n this.$gutterLayer.$showFoldedAnnotations = value;\n },\n initialValue: false\n },\n fadeFoldWidgets: {\n set: function (show) {\n dom.setCssClass(this.$gutter, \"ace_fade-fold-widgets\", show);\n },\n initialValue: false\n },\n showFoldWidgets: {\n set: function (show) {\n this.$gutterLayer.setShowFoldWidgets(show);\n this.$loop.schedule(this.CHANGE_GUTTER);\n },\n initialValue: true\n },\n displayIndentGuides: {\n set: function (show) {\n if (this.$textLayer.setDisplayIndentGuides(show))\n this.$loop.schedule(this.CHANGE_TEXT);\n },\n initialValue: true\n },\n highlightIndentGuides: {\n set: function (show) {\n if (this.$textLayer.setHighlightIndentGuides(show) == true) {\n this.$textLayer.$highlightIndentGuide();\n }\n else {\n this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells);\n }\n },\n initialValue: true\n },\n highlightGutterLine: {\n set: function (shouldHighlight) {\n this.$gutterLayer.setHighlightGutterLine(shouldHighlight);\n this.$loop.schedule(this.CHANGE_GUTTER);\n },\n initialValue: true\n },\n hScrollBarAlwaysVisible: {\n set: function (val) {\n if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll)\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: false\n },\n vScrollBarAlwaysVisible: {\n set: function (val) {\n if (!this.$vScrollBarAlwaysVisible || !this.$vScroll)\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: false\n },\n fontSize: {\n set: function (size) {\n if (typeof size == \"number\")\n size = size + \"px\";\n this.container.style.fontSize = size;\n this.updateFontSize();\n },\n initialValue: 12\n },\n fontFamily: {\n set: function (name) {\n this.container.style.fontFamily = name;\n this.updateFontSize();\n }\n },\n maxLines: {\n set: function (val) {\n this.updateFull();\n }\n },\n minLines: {\n set: function (val) {\n if (!(this.$minLines < 0x1ffffffffffff))\n this.$minLines = 0;\n this.updateFull();\n }\n },\n maxPixelHeight: {\n set: function (val) {\n this.updateFull();\n },\n initialValue: 0\n },\n scrollPastEnd: {\n set: function (val) {\n val = +val || 0;\n if (this.$scrollPastEnd == val)\n return;\n this.$scrollPastEnd = val;\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: 0,\n handlesSet: true\n },\n fixedWidthGutter: {\n set: function (val) {\n this.$gutterLayer.$fixedWidth = !!val;\n this.$loop.schedule(this.CHANGE_GUTTER);\n }\n },\n customScrollbar: {\n set: function (val) {\n this.$updateCustomScrollbar(val);\n },\n initialValue: false\n },\n theme: {\n set: function (val) { this.setTheme(val); },\n get: function () { return this.$themeId || this.theme; },\n initialValue: \"./theme/textmate\",\n handlesSet: true\n },\n hasCssTransforms: {},\n useTextareaForIME: {\n initialValue: !useragent.isMobile && !useragent.isIE\n }\n});\nexports.VirtualRenderer = VirtualRenderer;\n\n});\n\nace.define(\"ace/worker/worker_client\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/net\",\"ace/lib/event_emitter\",\"ace/config\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar net = require(\"../lib/net\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar config = require(\"../config\");\n\nfunction $workerBlob(workerUrl) {\n var script = \"importScripts('\" + net.qualifyURL(workerUrl) + \"');\";\n try {\n return new Blob([script], {\"type\": \"application/javascript\"});\n } catch (e) { // Backwards-compatibility\n var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;\n var blobBuilder = new BlobBuilder();\n blobBuilder.append(script);\n return blobBuilder.getBlob(\"application/javascript\");\n }\n}\n\nfunction createWorker(workerUrl) {\n if (typeof Worker == \"undefined\")\n return { postMessage: function() {}, terminate: function() {} };\n if (config.get(\"loadWorkerFromBlob\")) {\n var blob = $workerBlob(workerUrl);\n var URL = window.URL || window.webkitURL;\n var blobURL = URL.createObjectURL(blob);\n return new Worker(blobURL);\n }\n return new Worker(workerUrl);\n}\n\nvar WorkerClient = function(worker) {\n if (!worker.postMessage)\n worker = this.$createWorkerFromOldConfig.apply(this, arguments);\n\n this.$worker = worker;\n this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);\n this.changeListener = this.changeListener.bind(this);\n this.onMessage = this.onMessage.bind(this);\n\n this.callbackId = 1;\n this.callbacks = {};\n\n this.$worker.onmessage = this.onMessage;\n};\n\n(function(){\n\n oop.implement(this, EventEmitter);\n\n this.$createWorkerFromOldConfig = function(topLevelNamespaces, mod, classname, workerUrl, importScripts) {\n if (require.nameToUrl && !require.toUrl)\n require.toUrl = require.nameToUrl;\n\n if (config.get(\"packaged\") || !require.toUrl) {\n workerUrl = workerUrl || config.moduleUrl(mod, \"worker\");\n } else {\n var normalizePath = this.$normalizePath;\n workerUrl = workerUrl || normalizePath(require.toUrl(\"ace/worker/worker.js\", null, \"_\"));\n\n var tlns = {};\n topLevelNamespaces.forEach(function(ns) {\n tlns[ns] = normalizePath(require.toUrl(ns, null, \"_\").replace(/(\\.js)?(\\?.*)?$/, \"\"));\n });\n }\n\n this.$worker = createWorker(workerUrl);\n if (importScripts) {\n this.send(\"importScripts\", importScripts);\n }\n this.$worker.postMessage({\n init : true,\n tlns : tlns,\n module : mod,\n classname : classname\n });\n return this.$worker;\n };\n\n this.onMessage = function(e) {\n var msg = e.data;\n switch (msg.type) {\n case \"event\":\n this._signal(msg.name, {data: msg.data});\n break;\n case \"call\":\n var callback = this.callbacks[msg.id];\n if (callback) {\n callback(msg.data);\n delete this.callbacks[msg.id];\n }\n break;\n case \"error\":\n this.reportError(msg.data);\n break;\n case \"log\":\n window.console && console.log && console.log.apply(console, msg.data);\n break;\n }\n };\n \n this.reportError = function(err) {\n window.console && console.error && console.error(err);\n };\n\n this.$normalizePath = function(path) {\n return net.qualifyURL(path);\n };\n\n this.terminate = function() {\n this._signal(\"terminate\", {});\n this.deltaQueue = null;\n this.$worker.terminate();\n this.$worker.onerror = function(e) {\n e.preventDefault();\n };\n this.$worker = null;\n if (this.$doc)\n this.$doc.off(\"change\", this.changeListener);\n this.$doc = null;\n };\n\n this.send = function(cmd, args) {\n this.$worker.postMessage({command: cmd, args: args});\n };\n\n this.call = function(cmd, args, callback) {\n if (callback) {\n var id = this.callbackId++;\n this.callbacks[id] = callback;\n args.push(id);\n }\n this.send(cmd, args);\n };\n\n this.emit = function(event, data) {\n try {\n if (data.data && data.data.err)\n data.data.err = {message: data.data.err.message, stack: data.data.err.stack, code: data.data.err.code};\n this.$worker && this.$worker.postMessage({event: event, data: {data: data.data}});\n }\n catch(ex) {\n console.error(ex.stack);\n }\n };\n\n this.attachToDocument = function(doc) {\n if (this.$doc)\n this.terminate();\n\n this.$doc = doc;\n this.call(\"setValue\", [doc.getValue()]);\n doc.on(\"change\", this.changeListener, true);\n };\n\n this.changeListener = function(delta) {\n if (!this.deltaQueue) {\n this.deltaQueue = [];\n setTimeout(this.$sendDeltaQueue, 0);\n }\n if (delta.action == \"insert\")\n this.deltaQueue.push(delta.start, delta.lines);\n else\n this.deltaQueue.push(delta.start, delta.end);\n };\n\n this.$sendDeltaQueue = function() {\n var q = this.deltaQueue;\n if (!q) return;\n this.deltaQueue = null;\n if (q.length > 50 && q.length > this.$doc.getLength() >> 1) {\n this.call(\"setValue\", [this.$doc.getValue()]);\n } else\n this.emit(\"change\", {data: q});\n };\n\n}).call(WorkerClient.prototype);\n\n\nvar UIWorkerClient = function(topLevelNamespaces, mod, classname) {\n var main = null;\n var emitSync = false;\n var sender = Object.create(EventEmitter);\n\n var messageBuffer = [];\n var workerClient = new WorkerClient({\n messageBuffer: messageBuffer,\n terminate: function() {},\n postMessage: function(e) {\n messageBuffer.push(e);\n if (!main) return;\n if (emitSync)\n setTimeout(processNext);\n else\n processNext();\n }\n });\n\n workerClient.setEmitSync = function(val) { emitSync = val; };\n\n var processNext = function() {\n var msg = messageBuffer.shift();\n if (msg.command)\n main[msg.command].apply(main, msg.args);\n else if (msg.event)\n sender._signal(msg.event, msg.data);\n };\n\n sender.postMessage = function(msg) {\n workerClient.onMessage({data: msg});\n };\n sender.callback = function(data, callbackId) {\n this.postMessage({type: \"call\", id: callbackId, data: data});\n };\n sender.emit = function(name, data) {\n this.postMessage({type: \"event\", name: name, data: data});\n };\n\n config.loadModule([\"worker\", mod], function(Main) {\n main = new Main[classname](sender);\n while (messageBuffer.length)\n processNext();\n });\n\n return workerClient;\n};\n\nexports.UIWorkerClient = UIWorkerClient;\nexports.WorkerClient = WorkerClient;\nexports.createWorker = createWorker;\n\n\n});\n\nace.define(\"ace/placeholder\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/lib/event_emitter\",\"ace/lib/oop\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"./range\").Range;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar oop = require(\"./lib/oop\");\nvar PlaceHolder = /** @class */ (function () {\n function PlaceHolder(session, length, pos, others, mainClass, othersClass) {\n var _self = this;\n this.length = length;\n this.session = session;\n this.doc = session.getDocument();\n this.mainClass = mainClass;\n this.othersClass = othersClass;\n this.$onUpdate = this.onUpdate.bind(this);\n this.doc.on(\"change\", this.$onUpdate, true);\n this.$others = others;\n this.$onCursorChange = function () {\n setTimeout(function () {\n _self.onCursorChange();\n });\n };\n this.$pos = pos;\n var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || { length: -1 };\n this.$undoStackDepth = undoStack.length;\n this.setup();\n session.selection.on(\"changeCursor\", this.$onCursorChange);\n }\n PlaceHolder.prototype.setup = function () {\n var _self = this;\n var doc = this.doc;\n var session = this.session;\n this.selectionBefore = session.selection.toJSON();\n if (session.selection.inMultiSelectMode)\n session.selection.toSingleRange();\n this.pos = doc.createAnchor(this.$pos.row, this.$pos.column);\n var pos = this.pos;\n pos.$insertRight = true;\n pos.detach();\n pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false);\n this.others = [];\n this.$others.forEach(function (other) {\n var anchor = doc.createAnchor(other.row, other.column);\n anchor.$insertRight = true;\n anchor.detach();\n _self.others.push(anchor);\n });\n session.setUndoSelect(false);\n };\n PlaceHolder.prototype.showOtherMarkers = function () {\n if (this.othersActive)\n return;\n var session = this.session;\n var _self = this;\n this.othersActive = true;\n this.others.forEach(function (anchor) {\n anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column + _self.length), _self.othersClass, null, false);\n });\n };\n PlaceHolder.prototype.hideOtherMarkers = function () {\n if (!this.othersActive)\n return;\n this.othersActive = false;\n for (var i = 0; i < this.others.length; i++) {\n this.session.removeMarker(this.others[i].markerId);\n }\n };\n PlaceHolder.prototype.onUpdate = function (delta) {\n if (this.$updating)\n return this.updateAnchors(delta);\n var range = delta;\n if (range.start.row !== range.end.row)\n return;\n if (range.start.row !== this.pos.row)\n return;\n this.$updating = true;\n var lengthDiff = delta.action === \"insert\" ? range.end.column - range.start.column : range.start.column - range.end.column;\n var inMainRange = range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1;\n var distanceFromStart = range.start.column - this.pos.column;\n this.updateAnchors(delta);\n if (inMainRange)\n this.length += lengthDiff;\n if (inMainRange && !this.session.$fromUndo) {\n if (delta.action === 'insert') {\n for (var i = this.others.length - 1; i >= 0; i--) {\n var otherPos = this.others[i];\n var newPos = { row: otherPos.row, column: otherPos.column + distanceFromStart };\n this.doc.insertMergedLines(newPos, delta.lines);\n }\n }\n else if (delta.action === 'remove') {\n for (var i = this.others.length - 1; i >= 0; i--) {\n var otherPos = this.others[i];\n var newPos = { row: otherPos.row, column: otherPos.column + distanceFromStart };\n this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff));\n }\n }\n }\n this.$updating = false;\n this.updateMarkers();\n };\n PlaceHolder.prototype.updateAnchors = function (delta) {\n this.pos.onChange(delta);\n for (var i = this.others.length; i--;)\n this.others[i].onChange(delta);\n this.updateMarkers();\n };\n PlaceHolder.prototype.updateMarkers = function () {\n if (this.$updating)\n return;\n var _self = this;\n var session = this.session;\n var updateMarker = function (pos, className) {\n session.removeMarker(pos.markerId);\n pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + _self.length), className, null, false);\n };\n updateMarker(this.pos, this.mainClass);\n for (var i = this.others.length; i--;)\n updateMarker(this.others[i], this.othersClass);\n };\n PlaceHolder.prototype.onCursorChange = function (event) {\n if (this.$updating || !this.session)\n return;\n var pos = this.session.selection.getCursor();\n if (pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) {\n this.showOtherMarkers();\n this._emit(\"cursorEnter\", event);\n }\n else {\n this.hideOtherMarkers();\n this._emit(\"cursorLeave\", event);\n }\n };\n PlaceHolder.prototype.detach = function () {\n this.session.removeMarker(this.pos && this.pos.markerId);\n this.hideOtherMarkers();\n this.doc.off(\"change\", this.$onUpdate);\n this.session.selection.off(\"changeCursor\", this.$onCursorChange);\n this.session.setUndoSelect(true);\n this.session = null;\n };\n PlaceHolder.prototype.cancel = function () {\n if (this.$undoStackDepth === -1)\n return;\n var undoManager = this.session.getUndoManager();\n var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth;\n for (var i = 0; i < undosRequired; i++) {\n undoManager.undo(this.session, true);\n }\n if (this.selectionBefore)\n this.session.selection.fromJSON(this.selectionBefore);\n };\n return PlaceHolder;\n}());\noop.implement(PlaceHolder.prototype, EventEmitter);\nexports.PlaceHolder = PlaceHolder;\n\n});\n\nace.define(\"ace/mouse/multi_select_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\"], function(require, exports, module){var event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nfunction isSamePoint(p1, p2) {\n return p1.row == p2.row && p1.column == p2.column;\n}\nfunction onMouseDown(e) {\n var ev = e.domEvent;\n var alt = ev.altKey;\n var shift = ev.shiftKey;\n var ctrl = ev.ctrlKey;\n var accel = e.getAccelKey();\n var button = e.getButton();\n if (ctrl && useragent.isMac)\n button = ev.button;\n if (e.editor.inMultiSelectMode && button == 2) {\n e.editor.textInput.onContextMenu(e.domEvent);\n return;\n }\n if (!ctrl && !alt && !accel) {\n if (button === 0 && e.editor.inMultiSelectMode)\n e.editor.exitMultiSelectMode();\n return;\n }\n if (button !== 0)\n return;\n var editor = e.editor;\n var selection = editor.selection;\n var isMultiSelect = editor.inMultiSelectMode;\n var pos = e.getDocumentPosition();\n var cursor = selection.getCursor();\n var inSelection = e.inSelection() || (selection.isEmpty() && isSamePoint(pos, cursor));\n var mouseX = e.x, mouseY = e.y;\n var onMouseSelection = function (e) {\n mouseX = e.clientX;\n mouseY = e.clientY;\n };\n var session = editor.session;\n var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);\n var screenCursor = screenAnchor;\n var selectionMode;\n if (editor.$mouseHandler.$enableJumpToDef) {\n if (ctrl && alt || accel && alt)\n selectionMode = shift ? \"block\" : \"add\";\n else if (alt && editor.$blockSelectEnabled)\n selectionMode = \"block\";\n }\n else {\n if (accel && !alt) {\n selectionMode = \"add\";\n if (!isMultiSelect && shift)\n return;\n }\n else if (alt && editor.$blockSelectEnabled) {\n selectionMode = \"block\";\n }\n }\n if (selectionMode && useragent.isMac && ev.ctrlKey) {\n editor.$mouseHandler.cancelContextMenu();\n }\n if (selectionMode == \"add\") {\n if (!isMultiSelect && inSelection)\n return; // dragging\n if (!isMultiSelect) {\n var range = selection.toOrientedRange();\n editor.addSelectionMarker(range);\n }\n var oldRange = selection.rangeList.rangeAtPoint(pos);\n editor.inVirtualSelectionMode = true;\n if (shift) {\n oldRange = null;\n range = selection.ranges[0] || range;\n editor.removeSelectionMarker(range);\n }\n editor.once(\"mouseup\", function () {\n var tmpSel = selection.toOrientedRange();\n if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor))\n selection.substractPoint(tmpSel.cursor);\n else {\n if (shift) {\n selection.substractPoint(range.cursor);\n }\n else if (range) {\n editor.removeSelectionMarker(range);\n selection.addRange(range);\n }\n selection.addRange(tmpSel);\n }\n editor.inVirtualSelectionMode = false;\n });\n }\n else if (selectionMode == \"block\") {\n e.stop();\n editor.inVirtualSelectionMode = true;\n var initialRange;\n var rectSel = [];\n var blockSelect = function () {\n var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);\n var cursor = session.screenToDocumentPosition(newCursor.row, newCursor.column, newCursor.offsetX);\n if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor, selection.lead))\n return;\n screenCursor = newCursor;\n editor.selection.moveToPosition(cursor);\n editor.renderer.scrollCursorIntoView();\n editor.removeSelectionMarkers(rectSel);\n rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor);\n if (editor.$mouseHandler.$clickSelection && rectSel.length == 1 && rectSel[0].isEmpty())\n rectSel[0] = editor.$mouseHandler.$clickSelection.clone();\n rectSel.forEach(editor.addSelectionMarker, editor);\n editor.updateSelectionMarkers();\n };\n if (isMultiSelect && !accel) {\n selection.toSingleRange();\n }\n else if (!isMultiSelect && accel) {\n initialRange = selection.toOrientedRange();\n editor.addSelectionMarker(initialRange);\n }\n if (shift)\n screenAnchor = session.documentToScreenPosition(selection.lead);\n else\n selection.moveToPosition(pos);\n screenCursor = { row: -1, column: -1 };\n var onMouseSelectionEnd = function (e) {\n blockSelect();\n clearInterval(timerId);\n editor.removeSelectionMarkers(rectSel);\n if (!rectSel.length)\n rectSel = [selection.toOrientedRange()];\n if (initialRange) {\n editor.removeSelectionMarker(initialRange);\n selection.toSingleRange(initialRange);\n }\n for (var i = 0; i < rectSel.length; i++)\n selection.addRange(rectSel[i]);\n editor.inVirtualSelectionMode = false;\n editor.$mouseHandler.$clickSelection = null;\n };\n var onSelectionInterval = blockSelect;\n event.capture(editor.container, onMouseSelection, onMouseSelectionEnd);\n var timerId = setInterval(function () { onSelectionInterval(); }, 20);\n return e.preventDefault();\n }\n}\nexports.onMouseDown = onMouseDown;\n\n});\n\nace.define(\"ace/commands/multi_select_commands\",[\"require\",\"exports\",\"module\",\"ace/keyboard/hash_handler\"], function(require, exports, module){// commands to enter multiselect mode\nexports.defaultCommands = [{\n name: \"addCursorAbove\",\n description: \"Add cursor above\",\n exec: function (editor) { editor.selectMoreLines(-1); },\n bindKey: { win: \"Ctrl-Alt-Up\", mac: \"Ctrl-Alt-Up\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"addCursorBelow\",\n description: \"Add cursor below\",\n exec: function (editor) { editor.selectMoreLines(1); },\n bindKey: { win: \"Ctrl-Alt-Down\", mac: \"Ctrl-Alt-Down\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"addCursorAboveSkipCurrent\",\n description: \"Add cursor above (skip current)\",\n exec: function (editor) { editor.selectMoreLines(-1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Up\", mac: \"Ctrl-Alt-Shift-Up\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"addCursorBelowSkipCurrent\",\n description: \"Add cursor below (skip current)\",\n exec: function (editor) { editor.selectMoreLines(1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Down\", mac: \"Ctrl-Alt-Shift-Down\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectMoreBefore\",\n description: \"Select more before\",\n exec: function (editor) { editor.selectMore(-1); },\n bindKey: { win: \"Ctrl-Alt-Left\", mac: \"Ctrl-Alt-Left\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectMoreAfter\",\n description: \"Select more after\",\n exec: function (editor) { editor.selectMore(1); },\n bindKey: { win: \"Ctrl-Alt-Right\", mac: \"Ctrl-Alt-Right\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectNextBefore\",\n description: \"Select next before\",\n exec: function (editor) { editor.selectMore(-1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Left\", mac: \"Ctrl-Alt-Shift-Left\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectNextAfter\",\n description: \"Select next after\",\n exec: function (editor) { editor.selectMore(1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Right\", mac: \"Ctrl-Alt-Shift-Right\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"toggleSplitSelectionIntoLines\",\n description: \"Split selection into lines\",\n exec: function (editor) {\n if (editor.multiSelect.rangeCount > 1)\n editor.multiSelect.joinSelections();\n else\n editor.multiSelect.splitIntoLines();\n },\n bindKey: { win: \"Ctrl-Alt-L\", mac: \"Ctrl-Alt-L\" },\n readOnly: true\n }, {\n name: \"splitSelectionIntoLines\",\n description: \"Split into lines\",\n exec: function (editor) { editor.multiSelect.splitIntoLines(); },\n readOnly: true\n }, {\n name: \"alignCursors\",\n description: \"Align cursors\",\n exec: function (editor) { editor.alignCursors(); },\n bindKey: { win: \"Ctrl-Alt-A\", mac: \"Ctrl-Alt-A\" },\n scrollIntoView: \"cursor\"\n }, {\n name: \"findAll\",\n description: \"Find all\",\n exec: function (editor) { editor.findAll(); },\n bindKey: { win: \"Ctrl-Alt-K\", mac: \"Ctrl-Alt-G\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }];\nexports.multiSelectCommands = [{\n name: \"singleSelection\",\n description: \"Single selection\",\n bindKey: \"esc\",\n exec: function (editor) { editor.exitMultiSelectMode(); },\n scrollIntoView: \"cursor\",\n readOnly: true,\n isAvailable: function (editor) { return editor && editor.inMultiSelectMode; }\n }];\nvar HashHandler = require(\"../keyboard/hash_handler\").HashHandler;\nexports.keyboardHandler = new HashHandler(exports.multiSelectCommands);\n\n});\n\nace.define(\"ace/multi_select\",[\"require\",\"exports\",\"module\",\"ace/range_list\",\"ace/range\",\"ace/selection\",\"ace/mouse/multi_select_handler\",\"ace/lib/event\",\"ace/lib/lang\",\"ace/commands/multi_select_commands\",\"ace/search\",\"ace/edit_session\",\"ace/editor\",\"ace/config\"], function(require, exports, module){var RangeList = require(\"./range_list\").RangeList;\nvar Range = require(\"./range\").Range;\nvar Selection = require(\"./selection\").Selection;\nvar onMouseDown = require(\"./mouse/multi_select_handler\").onMouseDown;\nvar event = require(\"./lib/event\");\nvar lang = require(\"./lib/lang\");\nvar commands = require(\"./commands/multi_select_commands\");\nexports.commands = commands.defaultCommands.concat(commands.multiSelectCommands);\nvar Search = require(\"./search\").Search;\nvar search = new Search();\nfunction find(session, needle, dir) {\n search.$options.wrap = true;\n search.$options.needle = needle;\n search.$options.backwards = dir == -1;\n return search.find(session);\n}\nvar EditSession = require(\"./edit_session\").EditSession;\n(function () {\n this.getSelectionMarkers = function () {\n return this.$selectionMarkers;\n };\n}).call(EditSession.prototype);\n(function () {\n this.ranges = null;\n this.rangeList = null;\n this.addRange = function (range, $blockChangeEvents) {\n if (!range)\n return;\n if (!this.inMultiSelectMode && this.rangeCount === 0) {\n var oldRange = this.toOrientedRange();\n this.rangeList.add(oldRange);\n this.rangeList.add(range);\n if (this.rangeList.ranges.length != 2) {\n this.rangeList.removeAll();\n return $blockChangeEvents || this.fromOrientedRange(range);\n }\n this.rangeList.removeAll();\n this.rangeList.add(oldRange);\n this.$onAddRange(oldRange);\n }\n if (!range.cursor)\n range.cursor = range.end;\n var removed = this.rangeList.add(range);\n this.$onAddRange(range);\n if (removed.length)\n this.$onRemoveRange(removed);\n if (this.rangeCount > 1 && !this.inMultiSelectMode) {\n this._signal(\"multiSelect\");\n this.inMultiSelectMode = true;\n this.session.$undoSelect = false;\n this.rangeList.attach(this.session);\n }\n return $blockChangeEvents || this.fromOrientedRange(range);\n };\n this.toSingleRange = function (range) {\n range = range || this.ranges[0];\n var removed = this.rangeList.removeAll();\n if (removed.length)\n this.$onRemoveRange(removed);\n range && this.fromOrientedRange(range);\n };\n this.substractPoint = function (pos) {\n var removed = this.rangeList.substractPoint(pos);\n if (removed) {\n this.$onRemoveRange(removed);\n return removed[0];\n }\n };\n this.mergeOverlappingRanges = function () {\n var removed = this.rangeList.merge();\n if (removed.length)\n this.$onRemoveRange(removed);\n };\n this.$onAddRange = function (range) {\n this.rangeCount = this.rangeList.ranges.length;\n this.ranges.unshift(range);\n this._signal(\"addRange\", { range: range });\n };\n this.$onRemoveRange = function (removed) {\n this.rangeCount = this.rangeList.ranges.length;\n if (this.rangeCount == 1 && this.inMultiSelectMode) {\n var lastRange = this.rangeList.ranges.pop();\n removed.push(lastRange);\n this.rangeCount = 0;\n }\n for (var i = removed.length; i--;) {\n var index = this.ranges.indexOf(removed[i]);\n this.ranges.splice(index, 1);\n }\n this._signal(\"removeRange\", { ranges: removed });\n if (this.rangeCount === 0 && this.inMultiSelectMode) {\n this.inMultiSelectMode = false;\n this._signal(\"singleSelect\");\n this.session.$undoSelect = true;\n this.rangeList.detach(this.session);\n }\n lastRange = lastRange || this.ranges[0];\n if (lastRange && !lastRange.isEqual(this.getRange()))\n this.fromOrientedRange(lastRange);\n };\n this.$initRangeList = function () {\n if (this.rangeList)\n return;\n this.rangeList = new RangeList();\n this.ranges = [];\n this.rangeCount = 0;\n };\n this.getAllRanges = function () {\n return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()];\n };\n this.splitIntoLines = function () {\n var ranges = this.ranges.length ? this.ranges : [this.getRange()];\n var newRanges = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var row = range.start.row;\n var endRow = range.end.row;\n if (row === endRow) {\n newRanges.push(range.clone());\n }\n else {\n newRanges.push(new Range(row, range.start.column, row, this.session.getLine(row).length));\n while (++row < endRow)\n newRanges.push(this.getLineRange(row, true));\n newRanges.push(new Range(endRow, 0, endRow, range.end.column));\n }\n if (i == 0 && !this.isBackwards())\n newRanges = newRanges.reverse();\n }\n this.toSingleRange();\n for (var i = newRanges.length; i--;)\n this.addRange(newRanges[i]);\n };\n this.joinSelections = function () {\n var ranges = this.rangeList.ranges;\n var lastRange = ranges[ranges.length - 1];\n var range = Range.fromPoints(ranges[0].start, lastRange.end);\n this.toSingleRange();\n this.setSelectionRange(range, lastRange.cursor == lastRange.start);\n };\n this.toggleBlockSelection = function () {\n if (this.rangeCount > 1) {\n var ranges = this.rangeList.ranges;\n var lastRange = ranges[ranges.length - 1];\n var range = Range.fromPoints(ranges[0].start, lastRange.end);\n this.toSingleRange();\n this.setSelectionRange(range, lastRange.cursor == lastRange.start);\n }\n else {\n var cursor = this.session.documentToScreenPosition(this.cursor);\n var anchor = this.session.documentToScreenPosition(this.anchor);\n var rectSel = this.rectangularRangeBlock(cursor, anchor);\n rectSel.forEach(this.addRange, this);\n }\n };\n this.rectangularRangeBlock = function (screenCursor, screenAnchor, includeEmptyLines) {\n var rectSel = [];\n var xBackwards = screenCursor.column < screenAnchor.column;\n if (xBackwards) {\n var startColumn = screenCursor.column;\n var endColumn = screenAnchor.column;\n var startOffsetX = screenCursor.offsetX;\n var endOffsetX = screenAnchor.offsetX;\n }\n else {\n var startColumn = screenAnchor.column;\n var endColumn = screenCursor.column;\n var startOffsetX = screenAnchor.offsetX;\n var endOffsetX = screenCursor.offsetX;\n }\n var yBackwards = screenCursor.row < screenAnchor.row;\n if (yBackwards) {\n var startRow = screenCursor.row;\n var endRow = screenAnchor.row;\n }\n else {\n var startRow = screenAnchor.row;\n var endRow = screenCursor.row;\n }\n if (startColumn < 0)\n startColumn = 0;\n if (startRow < 0)\n startRow = 0;\n if (startRow == endRow)\n includeEmptyLines = true;\n var docEnd;\n for (var row = startRow; row <= endRow; row++) {\n var range = Range.fromPoints(this.session.screenToDocumentPosition(row, startColumn, startOffsetX), this.session.screenToDocumentPosition(row, endColumn, endOffsetX));\n if (range.isEmpty()) {\n if (docEnd && isSamePoint(range.end, docEnd))\n break;\n docEnd = range.end;\n }\n range.cursor = xBackwards ? range.start : range.end;\n rectSel.push(range);\n }\n if (yBackwards)\n rectSel.reverse();\n if (!includeEmptyLines) {\n var end = rectSel.length - 1;\n while (rectSel[end].isEmpty() && end > 0)\n end--;\n if (end > 0) {\n var start = 0;\n while (rectSel[start].isEmpty())\n start++;\n }\n for (var i = end; i >= start; i--) {\n if (rectSel[i].isEmpty())\n rectSel.splice(i, 1);\n }\n }\n return rectSel;\n };\n}).call(Selection.prototype);\nvar Editor = require(\"./editor\").Editor;\n(function () {\n this.updateSelectionMarkers = function () {\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.addSelectionMarker = function (orientedRange) {\n if (!orientedRange.cursor)\n orientedRange.cursor = orientedRange.end;\n var style = this.getSelectionStyle();\n orientedRange.marker = this.session.addMarker(orientedRange, \"ace_selection\", style);\n this.session.$selectionMarkers.push(orientedRange);\n this.session.selectionMarkerCount = this.session.$selectionMarkers.length;\n return orientedRange;\n };\n this.removeSelectionMarker = function (range) {\n if (!range.marker)\n return;\n this.session.removeMarker(range.marker);\n var index = this.session.$selectionMarkers.indexOf(range);\n if (index != -1)\n this.session.$selectionMarkers.splice(index, 1);\n this.session.selectionMarkerCount = this.session.$selectionMarkers.length;\n };\n this.removeSelectionMarkers = function (ranges) {\n var markerList = this.session.$selectionMarkers;\n for (var i = ranges.length; i--;) {\n var range = ranges[i];\n if (!range.marker)\n continue;\n this.session.removeMarker(range.marker);\n var index = markerList.indexOf(range);\n if (index != -1)\n markerList.splice(index, 1);\n }\n this.session.selectionMarkerCount = markerList.length;\n };\n this.$onAddRange = function (e) {\n this.addSelectionMarker(e.range);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.$onRemoveRange = function (e) {\n this.removeSelectionMarkers(e.ranges);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.$onMultiSelect = function (e) {\n if (this.inMultiSelectMode)\n return;\n this.inMultiSelectMode = true;\n this.setStyle(\"ace_multiselect\");\n this.keyBinding.addKeyboardHandler(commands.keyboardHandler);\n this.commands.setDefaultHandler(\"exec\", this.$onMultiSelectExec);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.$onSingleSelect = function (e) {\n if (this.session.multiSelect.inVirtualMode)\n return;\n this.inMultiSelectMode = false;\n this.unsetStyle(\"ace_multiselect\");\n this.keyBinding.removeKeyboardHandler(commands.keyboardHandler);\n this.commands.removeDefaultHandler(\"exec\", this.$onMultiSelectExec);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n this._emit(\"changeSelection\");\n };\n this.$onMultiSelectExec = function (e) {\n var command = e.command;\n var editor = e.editor;\n if (!editor.multiSelect)\n return;\n if (!command.multiSelectAction) {\n var result = command.exec(editor, e.args || {});\n editor.multiSelect.addRange(editor.multiSelect.toOrientedRange());\n editor.multiSelect.mergeOverlappingRanges();\n }\n else if (command.multiSelectAction == \"forEach\") {\n result = editor.forEachSelection(command, e.args);\n }\n else if (command.multiSelectAction == \"forEachLine\") {\n result = editor.forEachSelection(command, e.args, true);\n }\n else if (command.multiSelectAction == \"single\") {\n editor.exitMultiSelectMode();\n result = command.exec(editor, e.args || {});\n }\n else {\n result = command.multiSelectAction(editor, e.args || {});\n }\n return result;\n };\n this.forEachSelection = function (cmd, args, options) {\n if (this.inVirtualSelectionMode)\n return;\n var keepOrder = options && options.keepOrder;\n var $byLines = options == true || options && options.$byLines;\n var session = this.session;\n var selection = this.selection;\n var rangeList = selection.rangeList;\n var ranges = (keepOrder ? selection : rangeList).ranges;\n var result;\n if (!ranges.length)\n return cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {});\n var reg = selection._eventRegistry;\n selection._eventRegistry = {};\n var tmpSel = new Selection(session);\n this.inVirtualSelectionMode = true;\n for (var i = ranges.length; i--;) {\n if ($byLines) {\n while (i > 0 && ranges[i].start.row == ranges[i - 1].end.row)\n i--;\n }\n tmpSel.fromOrientedRange(ranges[i]);\n tmpSel.index = i;\n this.selection = session.selection = tmpSel;\n var cmdResult = cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {});\n if (!result && cmdResult !== undefined)\n result = cmdResult;\n tmpSel.toOrientedRange(ranges[i]);\n }\n tmpSel.detach();\n this.selection = session.selection = selection;\n this.inVirtualSelectionMode = false;\n selection._eventRegistry = reg;\n selection.mergeOverlappingRanges();\n if (selection.ranges[0])\n selection.fromOrientedRange(selection.ranges[0]);\n var anim = this.renderer.$scrollAnimation;\n this.onCursorChange();\n this.onSelectionChange();\n if (anim && anim.from == anim.to)\n this.renderer.animateScrolling(anim.from);\n return result;\n };\n this.exitMultiSelectMode = function () {\n if (!this.inMultiSelectMode || this.inVirtualSelectionMode)\n return;\n this.multiSelect.toSingleRange();\n };\n this.getSelectedText = function () {\n var text = \"\";\n if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {\n var ranges = this.multiSelect.rangeList.ranges;\n var buf = [];\n for (var i = 0; i < ranges.length; i++) {\n buf.push(this.session.getTextRange(ranges[i]));\n }\n var nl = this.session.getDocument().getNewLineCharacter();\n text = buf.join(nl);\n if (text.length == (buf.length - 1) * nl.length)\n text = \"\";\n }\n else if (!this.selection.isEmpty()) {\n text = this.session.getTextRange(this.getSelectionRange());\n }\n return text;\n };\n this.$checkMultiselectChange = function (e, anchor) {\n if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {\n var range = this.multiSelect.ranges[0];\n if (this.multiSelect.isEmpty() && anchor == this.multiSelect.anchor)\n return;\n var pos = anchor == this.multiSelect.anchor\n ? range.cursor == range.start ? range.end : range.start\n : range.cursor;\n if (pos.row != anchor.row\n || this.session.$clipPositionToDocument(pos.row, pos.column).column != anchor.column)\n this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange());\n else\n this.multiSelect.mergeOverlappingRanges();\n }\n };\n this.findAll = function (needle, options, additive) {\n options = options || {};\n options.needle = needle || options.needle;\n if (options.needle == undefined) {\n var range = this.selection.isEmpty()\n ? this.selection.getWordRange()\n : this.selection.getRange();\n options.needle = this.session.getTextRange(range);\n }\n this.$search.set(options);\n var ranges = this.$search.findAll(this.session);\n if (!ranges.length)\n return 0;\n var selection = this.multiSelect;\n if (!additive)\n selection.toSingleRange(ranges[0]);\n for (var i = ranges.length; i--;)\n selection.addRange(ranges[i], true);\n if (range && selection.rangeList.rangeAtPoint(range.start))\n selection.addRange(range, true);\n return ranges.length;\n };\n this.selectMoreLines = function (dir, skip) {\n var range = this.selection.toOrientedRange();\n var isBackwards = range.cursor == range.end;\n var screenLead = this.session.documentToScreenPosition(range.cursor);\n if (this.selection.$desiredColumn)\n screenLead.column = this.selection.$desiredColumn;\n var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column);\n if (!range.isEmpty()) {\n var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start);\n var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column);\n }\n else {\n var anchor = lead;\n }\n if (isBackwards) {\n var newRange = Range.fromPoints(lead, anchor);\n newRange.cursor = newRange.start;\n }\n else {\n var newRange = Range.fromPoints(anchor, lead);\n newRange.cursor = newRange.end;\n }\n newRange.desiredColumn = screenLead.column;\n if (!this.selection.inMultiSelectMode) {\n this.selection.addRange(range);\n }\n else {\n if (skip)\n var toRemove = range.cursor;\n }\n this.selection.addRange(newRange);\n if (toRemove)\n this.selection.substractPoint(toRemove);\n };\n this.transposeSelections = function (dir) {\n var session = this.session;\n var sel = session.multiSelect;\n var all = sel.ranges;\n for (var i = all.length; i--;) {\n var range = all[i];\n if (range.isEmpty()) {\n var tmp = session.getWordRange(range.start.row, range.start.column);\n range.start.row = tmp.start.row;\n range.start.column = tmp.start.column;\n range.end.row = tmp.end.row;\n range.end.column = tmp.end.column;\n }\n }\n sel.mergeOverlappingRanges();\n var words = [];\n for (var i = all.length; i--;) {\n var range = all[i];\n words.unshift(session.getTextRange(range));\n }\n if (dir < 0)\n words.unshift(words.pop());\n else\n words.push(words.shift());\n for (var i = all.length; i--;) {\n var range = all[i];\n var tmp = range.clone();\n session.replace(range, words[i]);\n range.start.row = tmp.start.row;\n range.start.column = tmp.start.column;\n }\n sel.fromOrientedRange(sel.ranges[0]);\n };\n this.selectMore = function (dir, skip, stopAtFirst) {\n var session = this.session;\n var sel = session.multiSelect;\n var range = sel.toOrientedRange();\n if (range.isEmpty()) {\n range = session.getWordRange(range.start.row, range.start.column);\n range.cursor = dir == -1 ? range.start : range.end;\n this.multiSelect.addRange(range);\n if (stopAtFirst)\n return;\n }\n var needle = session.getTextRange(range);\n var newRange = find(session, needle, dir);\n if (newRange) {\n newRange.cursor = dir == -1 ? newRange.start : newRange.end;\n this.session.unfold(newRange);\n this.multiSelect.addRange(newRange);\n this.renderer.scrollCursorIntoView(null, 0.5);\n }\n if (skip)\n this.multiSelect.substractPoint(range.cursor);\n };\n this.alignCursors = function () {\n var session = this.session;\n var sel = session.multiSelect;\n var ranges = sel.ranges;\n var row = -1;\n var sameRowRanges = ranges.filter(function (r) {\n if (r.cursor.row == row)\n return true;\n row = r.cursor.row;\n });\n if (!ranges.length || sameRowRanges.length == ranges.length - 1) {\n var range = this.selection.getRange();\n var fr = range.start.row, lr = range.end.row;\n var guessRange = fr == lr;\n if (guessRange) {\n var max = this.session.getLength();\n var line;\n do {\n line = this.session.getLine(lr);\n } while (/[=:]/.test(line) && ++lr < max);\n do {\n line = this.session.getLine(fr);\n } while (/[=:]/.test(line) && --fr > 0);\n if (fr < 0)\n fr = 0;\n if (lr >= max)\n lr = max - 1;\n }\n var lines = this.session.removeFullLines(fr, lr);\n lines = this.$reAlignText(lines, guessRange);\n this.session.insert({ row: fr, column: 0 }, lines.join(\"\\n\") + \"\\n\");\n if (!guessRange) {\n range.start.column = 0;\n range.end.column = lines[lines.length - 1].length;\n }\n this.selection.setRange(range);\n }\n else {\n sameRowRanges.forEach(function (r) {\n sel.substractPoint(r.cursor);\n });\n var maxCol = 0;\n var minSpace = Infinity;\n var spaceOffsets = ranges.map(function (r) {\n var p = r.cursor;\n var line = session.getLine(p.row);\n var spaceOffset = line.substr(p.column).search(/\\S/g);\n if (spaceOffset == -1)\n spaceOffset = 0;\n if (p.column > maxCol)\n maxCol = p.column;\n if (spaceOffset < minSpace)\n minSpace = spaceOffset;\n return spaceOffset;\n });\n ranges.forEach(function (r, i) {\n var p = r.cursor;\n var l = maxCol - p.column;\n var d = spaceOffsets[i] - minSpace;\n if (l > d)\n session.insert(p, lang.stringRepeat(\" \", l - d));\n else\n session.remove(new Range(p.row, p.column, p.row, p.column - l + d));\n r.start.column = r.end.column = maxCol;\n r.start.row = r.end.row = p.row;\n r.cursor = r.end;\n });\n sel.fromOrientedRange(ranges[0]);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n }\n };\n this.$reAlignText = function (lines, forceLeft) {\n var isLeftAligned = true, isRightAligned = true;\n var startW, textW, endW;\n return lines.map(function (line) {\n var m = line.match(/(\\s*)(.*?)(\\s*)([=:].*)/);\n if (!m)\n return [line];\n if (startW == null) {\n startW = m[1].length;\n textW = m[2].length;\n endW = m[3].length;\n return m;\n }\n if (startW + textW + endW != m[1].length + m[2].length + m[3].length)\n isRightAligned = false;\n if (startW != m[1].length)\n isLeftAligned = false;\n if (startW > m[1].length)\n startW = m[1].length;\n if (textW < m[2].length)\n textW = m[2].length;\n if (endW > m[3].length)\n endW = m[3].length;\n return m;\n }).map(forceLeft ? alignLeft :\n isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign);\n function spaces(n) {\n return lang.stringRepeat(\" \", n);\n }\n function alignLeft(m) {\n return !m[2] ? m[0] : spaces(startW) + m[2]\n + spaces(textW - m[2].length + endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n function alignRight(m) {\n return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2]\n + spaces(endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n function unAlign(m) {\n return !m[2] ? m[0] : spaces(startW) + m[2]\n + spaces(endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n };\n}).call(Editor.prototype);\nfunction isSamePoint(p1, p2) {\n return p1.row == p2.row && p1.column == p2.column;\n}\nexports.onSessionChange = function (e) {\n var session = e.session;\n if (session && !session.multiSelect) {\n session.$selectionMarkers = [];\n session.selection.$initRangeList();\n session.multiSelect = session.selection;\n }\n this.multiSelect = session && session.multiSelect;\n var oldSession = e.oldSession;\n if (oldSession) {\n oldSession.multiSelect.off(\"addRange\", this.$onAddRange);\n oldSession.multiSelect.off(\"removeRange\", this.$onRemoveRange);\n oldSession.multiSelect.off(\"multiSelect\", this.$onMultiSelect);\n oldSession.multiSelect.off(\"singleSelect\", this.$onSingleSelect);\n oldSession.multiSelect.lead.off(\"change\", this.$checkMultiselectChange);\n oldSession.multiSelect.anchor.off(\"change\", this.$checkMultiselectChange);\n }\n if (session) {\n session.multiSelect.on(\"addRange\", this.$onAddRange);\n session.multiSelect.on(\"removeRange\", this.$onRemoveRange);\n session.multiSelect.on(\"multiSelect\", this.$onMultiSelect);\n session.multiSelect.on(\"singleSelect\", this.$onSingleSelect);\n session.multiSelect.lead.on(\"change\", this.$checkMultiselectChange);\n session.multiSelect.anchor.on(\"change\", this.$checkMultiselectChange);\n }\n if (session && this.inMultiSelectMode != session.selection.inMultiSelectMode) {\n if (session.selection.inMultiSelectMode)\n this.$onMultiSelect();\n else\n this.$onSingleSelect();\n }\n};\nfunction MultiSelect(editor) {\n if (editor.$multiselectOnSessionChange)\n return;\n editor.$onAddRange = editor.$onAddRange.bind(editor);\n editor.$onRemoveRange = editor.$onRemoveRange.bind(editor);\n editor.$onMultiSelect = editor.$onMultiSelect.bind(editor);\n editor.$onSingleSelect = editor.$onSingleSelect.bind(editor);\n editor.$multiselectOnSessionChange = exports.onSessionChange.bind(editor);\n editor.$checkMultiselectChange = editor.$checkMultiselectChange.bind(editor);\n editor.$multiselectOnSessionChange(editor);\n editor.on(\"changeSession\", editor.$multiselectOnSessionChange);\n editor.on(\"mousedown\", onMouseDown);\n editor.commands.addCommands(commands.defaultCommands);\n addAltCursorListeners(editor);\n}\nfunction addAltCursorListeners(editor) {\n if (!editor.textInput)\n return;\n var el = editor.textInput.getElement();\n var altCursor = false;\n event.addListener(el, \"keydown\", function (e) {\n var altDown = e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey);\n if (editor.$blockSelectEnabled && altDown) {\n if (!altCursor) {\n editor.renderer.setMouseCursor(\"crosshair\");\n altCursor = true;\n }\n }\n else if (altCursor) {\n reset();\n }\n }, editor);\n event.addListener(el, \"keyup\", reset, editor);\n event.addListener(el, \"blur\", reset, editor);\n function reset(e) {\n if (altCursor) {\n editor.renderer.setMouseCursor(\"\");\n altCursor = false;\n }\n }\n}\nexports.MultiSelect = MultiSelect;\nrequire(\"./config\").defineOptions(Editor.prototype, \"editor\", {\n enableMultiselect: {\n set: function (val) {\n MultiSelect(this);\n if (val) {\n this.on(\"mousedown\", onMouseDown);\n }\n else {\n this.off(\"mousedown\", onMouseDown);\n }\n },\n value: true\n },\n enableBlockSelect: {\n set: function (val) {\n this.$blockSelectEnabled = val;\n },\n value: true\n }\n});\n\n});\n\nace.define(\"ace/mode/folding/fold_mode\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../../range\").Range;\nvar FoldMode = exports.FoldMode = function () { };\n(function () {\n this.foldingStartMarker = null;\n this.foldingStopMarker = null;\n this.getFoldWidget = function (session, foldStyle, row) {\n var line = session.getLine(row);\n if (this.foldingStartMarker.test(line))\n return \"start\";\n if (foldStyle == \"markbeginend\"\n && this.foldingStopMarker\n && this.foldingStopMarker.test(line))\n return \"end\";\n return \"\";\n };\n this.getFoldWidgetRange = function (session, foldStyle, row) {\n return null;\n };\n this.indentationBlock = function (session, row, column) {\n var re = /\\S/;\n var line = session.getLine(row);\n var startLevel = line.search(re);\n if (startLevel == -1)\n return;\n var startColumn = column || line.length;\n var maxRow = session.getLength();\n var startRow = row;\n var endRow = row;\n while (++row < maxRow) {\n var level = session.getLine(row).search(re);\n if (level == -1)\n continue;\n if (level <= startLevel) {\n var token = session.getTokenAt(row, 0);\n if (!token || token.type !== \"string\")\n break;\n }\n endRow = row;\n }\n if (endRow > startRow) {\n var endColumn = session.getLine(endRow).length;\n return new Range(startRow, startColumn, endRow, endColumn);\n }\n };\n this.openingBracketBlock = function (session, bracket, row, column, typeRe) {\n var start = { row: row, column: column + 1 };\n var end = session.$findClosingBracket(bracket, start, typeRe);\n if (!end)\n return;\n var fw = session.foldWidgets[end.row];\n if (fw == null)\n fw = session.getFoldWidget(end.row);\n if (fw == \"start\" && end.row > start.row) {\n end.row--;\n end.column = session.getLine(end.row).length;\n }\n return Range.fromPoints(start, end);\n };\n this.closingBracketBlock = function (session, bracket, row, column, typeRe) {\n var end = { row: row, column: column };\n var start = session.$findOpeningBracket(bracket, end);\n if (!start)\n return;\n start.column++;\n end.column--;\n return Range.fromPoints(start, end);\n };\n}).call(FoldMode.prototype);\n\n});\n\nace.define(\"ace/ext/error_marker\",[\"require\",\"exports\",\"module\",\"ace/line_widgets\",\"ace/lib/dom\",\"ace/range\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar LineWidgets = require(\"../line_widgets\").LineWidgets;\nvar dom = require(\"../lib/dom\");\nvar Range = require(\"../range\").Range;\nvar nls = require(\"../config\").nls;\nfunction binarySearch(array, needle, comparator) {\n var first = 0;\n var last = array.length - 1;\n while (first <= last) {\n var mid = (first + last) >> 1;\n var c = comparator(needle, array[mid]);\n if (c > 0)\n first = mid + 1;\n else if (c < 0)\n last = mid - 1;\n else\n return mid;\n }\n return -(first + 1);\n}\nfunction findAnnotations(session, row, dir) {\n var annotations = session.getAnnotations().sort(Range.comparePoints);\n if (!annotations.length)\n return;\n var i = binarySearch(annotations, { row: row, column: -1 }, Range.comparePoints);\n if (i < 0)\n i = -i - 1;\n if (i >= annotations.length)\n i = dir > 0 ? 0 : annotations.length - 1;\n else if (i === 0 && dir < 0)\n i = annotations.length - 1;\n var annotation = annotations[i];\n if (!annotation || !dir)\n return;\n if (annotation.row === row) {\n do {\n annotation = annotations[i += dir];\n } while (annotation && annotation.row === row);\n if (!annotation)\n return annotations.slice();\n }\n var matched = [];\n row = annotation.row;\n do {\n matched[dir < 0 ? \"unshift\" : \"push\"](annotation);\n annotation = annotations[i += dir];\n } while (annotation && annotation.row == row);\n return matched.length && matched;\n}\nexports.showErrorMarker = function (editor, dir) {\n var session = editor.session;\n if (!session.widgetManager) {\n session.widgetManager = new LineWidgets(session);\n session.widgetManager.attach(editor);\n }\n var pos = editor.getCursorPosition();\n var row = pos.row;\n var oldWidget = session.widgetManager.getWidgetsAtRow(row).filter(function (w) {\n return w.type == \"errorMarker\";\n })[0];\n if (oldWidget) {\n oldWidget.destroy();\n }\n else {\n row -= dir;\n }\n var annotations = findAnnotations(session, row, dir);\n var gutterAnno;\n if (annotations) {\n var annotation = annotations[0];\n pos.column = (annotation.pos && typeof annotation.column != \"number\"\n ? annotation.pos.sc\n : annotation.column) || 0;\n pos.row = annotation.row;\n gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row];\n }\n else if (oldWidget) {\n return;\n }\n else {\n gutterAnno = {\n text: [nls(\"Looks good!\")],\n className: \"ace_ok\"\n };\n }\n editor.session.unfold(pos.row);\n editor.selection.moveToPosition(pos);\n var w = {\n row: pos.row,\n fixedWidth: true,\n coverGutter: true,\n el: dom.createElement(\"div\"),\n type: \"errorMarker\"\n };\n var el = w.el.appendChild(dom.createElement(\"div\"));\n var arrow = w.el.appendChild(dom.createElement(\"div\"));\n arrow.className = \"error_widget_arrow \" + gutterAnno.className;\n var left = editor.renderer.$cursorLayer\n .getPixelPosition(pos).left;\n arrow.style.left = left + editor.renderer.gutterWidth - 5 + \"px\";\n w.el.className = \"error_widget_wrapper\";\n el.className = \"error_widget \" + gutterAnno.className;\n el.innerHTML = gutterAnno.text.join(\"
\");\n el.appendChild(dom.createElement(\"div\"));\n var kb = function (_, hashId, keyString) {\n if (hashId === 0 && (keyString === \"esc\" || keyString === \"return\")) {\n w.destroy();\n return { command: \"null\" };\n }\n };\n w.destroy = function () {\n if (editor.$mouseHandler.isMousePressed)\n return;\n editor.keyBinding.removeKeyboardHandler(kb);\n session.widgetManager.removeLineWidget(w);\n editor.off(\"changeSelection\", w.destroy);\n editor.off(\"changeSession\", w.destroy);\n editor.off(\"mouseup\", w.destroy);\n editor.off(\"change\", w.destroy);\n };\n editor.keyBinding.addKeyboardHandler(kb);\n editor.on(\"changeSelection\", w.destroy);\n editor.on(\"changeSession\", w.destroy);\n editor.on(\"mouseup\", w.destroy);\n editor.on(\"change\", w.destroy);\n editor.session.widgetManager.addLineWidget(w);\n w.el.onmousedown = editor.focus.bind(editor);\n editor.renderer.scrollCursorIntoView(null, 0.5, { bottom: w.el.offsetHeight });\n};\ndom.importCssString(\"\\n .error_widget_wrapper {\\n background: inherit;\\n color: inherit;\\n border:none\\n }\\n .error_widget {\\n border-top: solid 2px;\\n border-bottom: solid 2px;\\n margin: 5px 0;\\n padding: 10px 40px;\\n white-space: pre-wrap;\\n }\\n .error_widget.ace_error, .error_widget_arrow.ace_error{\\n border-color: #ff5a5a\\n }\\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\\n border-color: #F1D817\\n }\\n .error_widget.ace_info, .error_widget_arrow.ace_info{\\n border-color: #5a5a5a\\n }\\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\\n border-color: #5aaa5a\\n }\\n .error_widget_arrow {\\n position: absolute;\\n border: solid 5px;\\n border-top-color: transparent!important;\\n border-right-color: transparent!important;\\n border-left-color: transparent!important;\\n top: -5px;\\n }\\n\", \"error_marker.css\", false);\n\n});\n\nace.define(\"ace/ace\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/range\",\"ace/editor\",\"ace/edit_session\",\"ace/undomanager\",\"ace/virtual_renderer\",\"ace/worker/worker_client\",\"ace/keyboard/hash_handler\",\"ace/placeholder\",\"ace/multi_select\",\"ace/mode/folding/fold_mode\",\"ace/theme/textmate\",\"ace/ext/error_marker\",\"ace/config\",\"ace/loader_build\"], function(require, exports, module){/**\n * The main class required to set up an Ace instance in the browser.\n *\n * @class Ace\n **/\n\"use strict\";\nrequire(\"./loader_build\")(exports)\nvar dom = require(\"./lib/dom\");\nvar Range = require(\"./range\").Range;\nvar Editor = require(\"./editor\").Editor;\nvar EditSession = require(\"./edit_session\").EditSession;\nvar UndoManager = require(\"./undomanager\").UndoManager;\nvar Renderer = require(\"./virtual_renderer\").VirtualRenderer;\nrequire(\"./worker/worker_client\");\nrequire(\"./keyboard/hash_handler\");\nrequire(\"./placeholder\");\nrequire(\"./multi_select\");\nrequire(\"./mode/folding/fold_mode\");\nrequire(\"./theme/textmate\");\nrequire(\"./ext/error_marker\");\nexports.config = require(\"./config\");\nexports.edit = function (el, options) {\n if (typeof el == \"string\") {\n var _id = el;\n el = document.getElementById(_id);\n if (!el)\n throw new Error(\"ace.edit can't find div #\" + _id);\n }\n if (el && el.env && el.env.editor instanceof Editor)\n return el.env.editor;\n var value = \"\";\n if (el && /input|textarea/i.test(el.tagName)) {\n var oldNode = el;\n value = oldNode.value;\n el = dom.createElement(\"pre\");\n oldNode.parentNode.replaceChild(el, oldNode);\n }\n else if (el) {\n value = el.textContent;\n el.innerHTML = \"\";\n }\n var doc = exports.createEditSession(value);\n var editor = new Editor(new Renderer(el), doc, options);\n var env = {\n document: doc,\n editor: editor,\n onResize: editor.resize.bind(editor, null)\n };\n if (oldNode)\n env.textarea = oldNode;\n editor.on(\"destroy\", function () {\n env.editor.container.env = null; // prevent memory leak on old ie\n });\n editor.container.env = editor.env = env;\n return editor;\n};\nexports.createEditSession = function (text, mode) {\n var doc = new EditSession(text, mode);\n doc.setUndoManager(new UndoManager());\n return doc;\n};\nexports.Range = Range;\nexports.Editor = Editor;\nexports.EditSession = EditSession;\nexports.UndoManager = UndoManager;\nexports.VirtualRenderer = Renderer;\nexports.version = exports.config.version;\n\n}); (function() {\n ace.require([\"ace/ace\"], function(a) {\n if (a) {\n a.config.init(true);\n a.define = ace.define;\n }\n var global = (function () {\n return this;\n })();\n if (!global && typeof window != \"undefined\") global = window; // can happen in strict mode\n if (!global && typeof self != \"undefined\") global = self; // can happen in webworker\n \n if (!global.ace)\n global.ace = a;\n for (var key in a) if (a.hasOwnProperty(key))\n global.ace[key] = a[key];\n global.ace[\"default\"] = global.ace;\n if (typeof module == \"object\" && typeof exports == \"object\" && module) {\n module.exports = global.ace;\n }\n });\n })();\n ","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar transitionalDefaults = require('../defaults/transitional');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\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 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\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\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 * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\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","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\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","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar enhanceError = require('../core/enhanceError');\nvar transitionalDefaults = require('./transitional');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","module.exports = {\n \"version\": \"0.26.1\"\n};","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\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","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return toString.call(val) === '[object URLSearchParams]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","/**\r\n * DevExtreme (esm/__internal/m_draggable.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\r\nimport positionUtils from \"../animation/position\";\r\nimport {\r\n locate,\r\n move\r\n} from \"../animation/translator\";\r\nimport registerComponent from \"../core/component_registrator\";\r\nimport domAdapter from \"../core/dom_adapter\";\r\nimport DOMComponent from \"../core/dom_component\";\r\nimport {\r\n getPublicElement\r\n} from \"../core/element\";\r\nimport $ from \"../core/renderer\";\r\nimport {\r\n EmptyTemplate\r\n} from \"../core/templates/empty_template\";\r\nimport {\r\n noop,\r\n splitPair\r\n} from \"../core/utils/common\";\r\nimport {\r\n Deferred,\r\n fromPromise,\r\n when\r\n} from \"../core/utils/deferred\";\r\nimport {\r\n extend\r\n} from \"../core/utils/extend\";\r\nimport {\r\n dasherize\r\n} from \"../core/utils/inflector\";\r\nimport {\r\n getBoundingRect\r\n} from \"../core/utils/position\";\r\nimport {\r\n getHeight,\r\n getOuterHeight,\r\n getOuterWidth,\r\n getWidth\r\n} from \"../core/utils/size\";\r\nimport {\r\n quadToObject\r\n} from \"../core/utils/string\";\r\nimport {\r\n isFunction,\r\n isNumeric,\r\n isObject\r\n} from \"../core/utils/type\";\r\nimport {\r\n value as viewPort\r\n} from \"../core/utils/view_port\";\r\nimport {\r\n getWindow\r\n} from \"../core/utils/window\";\r\nimport eventsEngine from \"../events/core/events_engine\";\r\nimport {\r\n end as dragEventEnd,\r\n enter as dragEventEnter,\r\n leave as dragEventLeave,\r\n move as dragEventMove,\r\n start as dragEventStart\r\n} from \"../events/drag\";\r\nimport pointerEvents from \"../events/pointer\";\r\nimport {\r\n addNamespace,\r\n needSkipEvent\r\n} from \"../events/utils/index\";\r\nimport Animator from \"../ui/scroll_view/animator\";\r\nvar window = getWindow();\r\nvar KEYDOWN_EVENT = \"keydown\";\r\nvar DRAGGABLE = \"dxDraggable\";\r\nvar DRAGSTART_EVENT_NAME = addNamespace(dragEventStart, DRAGGABLE);\r\nvar DRAG_EVENT_NAME = addNamespace(dragEventMove, DRAGGABLE);\r\nvar DRAGEND_EVENT_NAME = addNamespace(dragEventEnd, DRAGGABLE);\r\nvar DRAG_ENTER_EVENT_NAME = addNamespace(dragEventEnter, DRAGGABLE);\r\nvar DRAGEND_LEAVE_EVENT_NAME = addNamespace(dragEventLeave, DRAGGABLE);\r\nvar POINTERDOWN_EVENT_NAME = addNamespace(pointerEvents.down, DRAGGABLE);\r\nvar KEYDOWN_EVENT_NAME = addNamespace(KEYDOWN_EVENT, DRAGGABLE);\r\nvar CLONE_CLASS = \"clone\";\r\nvar targetDraggable;\r\nvar sourceDraggable;\r\nvar ANONYMOUS_TEMPLATE_NAME = \"content\";\r\nvar getMousePosition = event => ({\r\n x: event.pageX - $(window).scrollLeft(),\r\n y: event.pageY - $(window).scrollTop()\r\n});\r\nvar GESTURE_COVER_CLASS = \"dx-gesture-cover\";\r\nvar OVERLAY_WRAPPER_CLASS = \"dx-overlay-wrapper\";\r\nvar OVERLAY_CONTENT_CLASS = \"dx-overlay-content\";\r\nclass ScrollHelper {\r\n constructor(orientation, component) {\r\n this._$scrollableAtPointer = null;\r\n this._preventScroll = true;\r\n this._component = component;\r\n if (\"vertical\" === orientation) {\r\n this._scrollValue = \"scrollTop\";\r\n this._overFlowAttr = \"overflowY\";\r\n this._sizeAttr = \"height\";\r\n this._scrollSizeProp = \"scrollHeight\";\r\n this._clientSizeProp = \"clientHeight\";\r\n this._limitProps = {\r\n start: \"top\",\r\n end: \"bottom\"\r\n }\r\n } else {\r\n this._scrollValue = \"scrollLeft\";\r\n this._overFlowAttr = \"overflowX\";\r\n this._sizeAttr = \"width\";\r\n this._scrollSizeProp = \"scrollWidth\";\r\n this._clientSizeProp = \"clientWidth\";\r\n this._limitProps = {\r\n start: \"left\",\r\n end: \"right\"\r\n }\r\n }\r\n }\r\n updateScrollable(elements, mousePosition) {\r\n var isScrollableFound = false;\r\n elements.some(element => {\r\n var $element = $(element);\r\n var isTargetOverOverlayWrapper = $element.hasClass(OVERLAY_WRAPPER_CLASS);\r\n var isTargetOverOverlayContent = $element.hasClass(OVERLAY_CONTENT_CLASS);\r\n if (isTargetOverOverlayWrapper || isTargetOverOverlayContent) {\r\n return true\r\n }\r\n isScrollableFound = this._trySetScrollable(element, mousePosition);\r\n return isScrollableFound\r\n });\r\n if (!isScrollableFound) {\r\n this._$scrollableAtPointer = null;\r\n this._scrollSpeed = 0\r\n }\r\n }\r\n isScrolling() {\r\n return !!this._scrollSpeed\r\n }\r\n isScrollable($element) {\r\n return (\"auto\" === $element.css(this._overFlowAttr) || $element.hasClass(\"dx-scrollable-container\")) && $element.prop(this._scrollSizeProp) > Math.ceil(\"width\" === this._sizeAttr ? getWidth($element) : getHeight($element))\r\n }\r\n _trySetScrollable(element, mousePosition) {\r\n var $element = $(element);\r\n var distanceToBorders;\r\n var sensitivity = this._component.option(\"scrollSensitivity\");\r\n var isScrollable = this.isScrollable($element);\r\n if (isScrollable) {\r\n distanceToBorders = this._calculateDistanceToBorders($element, mousePosition);\r\n if (sensitivity > distanceToBorders[this._limitProps.start]) {\r\n if (!this._preventScroll) {\r\n this._scrollSpeed = -this._calculateScrollSpeed(distanceToBorders[this._limitProps.start]);\r\n this._$scrollableAtPointer = $element\r\n }\r\n } else if (sensitivity > distanceToBorders[this._limitProps.end]) {\r\n if (!this._preventScroll) {\r\n this._scrollSpeed = this._calculateScrollSpeed(distanceToBorders[this._limitProps.end]);\r\n this._$scrollableAtPointer = $element\r\n }\r\n } else {\r\n isScrollable = false;\r\n this._preventScroll = false\r\n }\r\n }\r\n return isScrollable\r\n }\r\n _calculateDistanceToBorders($area, mousePosition) {\r\n var area = $area.get(0);\r\n var areaBoundingRect;\r\n if (area) {\r\n areaBoundingRect = getBoundingRect(area);\r\n return {\r\n left: mousePosition.x - areaBoundingRect.left,\r\n top: mousePosition.y - areaBoundingRect.top,\r\n right: areaBoundingRect.right - mousePosition.x,\r\n bottom: areaBoundingRect.bottom - mousePosition.y\r\n }\r\n }\r\n return {}\r\n }\r\n _calculateScrollSpeed(distance) {\r\n var component = this._component;\r\n var sensitivity = component.option(\"scrollSensitivity\");\r\n var maxSpeed = component.option(\"scrollSpeed\");\r\n return Math.ceil(Math.pow((sensitivity - distance) / sensitivity, 2) * maxSpeed)\r\n }\r\n scrollByStep() {\r\n if (this._$scrollableAtPointer && this._scrollSpeed) {\r\n if (this._$scrollableAtPointer.hasClass(\"dx-scrollable-container\")) {\r\n var $scrollable = this._$scrollableAtPointer.closest(\".dx-scrollable\");\r\n var scrollableInstance = $scrollable.data(\"dxScrollable\") || $scrollable.data(\"dxScrollView\");\r\n if (scrollableInstance) {\r\n var nextScrollPosition = scrollableInstance.scrollOffset()[this._limitProps.start] + this._scrollSpeed;\r\n scrollableInstance.scrollTo({\r\n [this._limitProps.start]: nextScrollPosition\r\n })\r\n }\r\n } else {\r\n var _nextScrollPosition = this._$scrollableAtPointer[this._scrollValue]() + this._scrollSpeed;\r\n this._$scrollableAtPointer[this._scrollValue](_nextScrollPosition)\r\n }\r\n var dragMoveArgs = this._component._dragMoveArgs;\r\n if (dragMoveArgs) {\r\n this._component._dragMoveHandler(dragMoveArgs)\r\n }\r\n }\r\n }\r\n reset() {\r\n this._$scrollableAtPointer = null;\r\n this._scrollSpeed = 0;\r\n this._preventScroll = true\r\n }\r\n isOutsideScrollable($scrollable, event) {\r\n if (!$scrollable) {\r\n return false\r\n }\r\n var scrollableSize = getBoundingRect($scrollable.get(0));\r\n var start = scrollableSize[this._limitProps.start];\r\n var size = scrollableSize[this._sizeAttr];\r\n var mousePosition = getMousePosition(event);\r\n var location = \"width\" === this._sizeAttr ? mousePosition.x : mousePosition.y;\r\n return location < start || location > start + size\r\n }\r\n}\r\nvar ScrollAnimator = Animator.inherit({\r\n ctor(strategy) {\r\n this.callBase();\r\n this._strategy = strategy\r\n },\r\n _step() {\r\n var horizontalScrollHelper = this._strategy._horizontalScrollHelper;\r\n var verticalScrollHelper = this._strategy._verticalScrollHelper;\r\n horizontalScrollHelper && horizontalScrollHelper.scrollByStep();\r\n verticalScrollHelper && verticalScrollHelper.scrollByStep()\r\n }\r\n});\r\nvar Draggable = DOMComponent.inherit({\r\n reset: noop,\r\n dragMove: noop,\r\n dragEnter: noop,\r\n dragLeave: noop,\r\n dragEnd(sourceEvent) {\r\n var sourceDraggable = this._getSourceDraggable();\r\n sourceDraggable._fireRemoveEvent(sourceEvent);\r\n return Deferred().resolve()\r\n },\r\n _fireRemoveEvent: noop,\r\n _getDefaultOptions() {\r\n return extend(this.callBase(), {\r\n onDragStart: null,\r\n onDragMove: null,\r\n onDragEnd: null,\r\n onDragEnter: null,\r\n onDragLeave: null,\r\n onDragCancel: null,\r\n onCancelByEsc: false,\r\n onDrop: null,\r\n immediate: true,\r\n dragDirection: \"both\",\r\n boundary: void 0,\r\n boundOffset: 0,\r\n allowMoveByClick: false,\r\n itemData: null,\r\n container: void 0,\r\n dragTemplate: void 0,\r\n contentTemplate: \"content\",\r\n handle: \"\",\r\n filter: \"\",\r\n clone: false,\r\n autoScroll: true,\r\n scrollSpeed: 30,\r\n scrollSensitivity: 60,\r\n group: void 0,\r\n data: void 0\r\n })\r\n },\r\n _setOptionsByReference() {\r\n this.callBase.apply(this, arguments);\r\n extend(this._optionsByReference, {\r\n component: true,\r\n group: true,\r\n itemData: true,\r\n data: true\r\n })\r\n },\r\n _init() {\r\n this.callBase();\r\n this._attachEventHandlers();\r\n this._scrollAnimator = new ScrollAnimator(this);\r\n this._horizontalScrollHelper = new ScrollHelper(\"horizontal\", this);\r\n this._verticalScrollHelper = new ScrollHelper(\"vertical\", this);\r\n this._initScrollTop = 0;\r\n this._initScrollLeft = 0\r\n },\r\n _normalizeCursorOffset(offset) {\r\n if (isObject(offset)) {\r\n offset = {\r\n h: offset.x,\r\n v: offset.y\r\n }\r\n }\r\n offset = splitPair(offset).map(value => parseFloat(value));\r\n return {\r\n left: offset[0],\r\n top: 1 === offset.length ? offset[0] : offset[1]\r\n }\r\n },\r\n _getNormalizedCursorOffset(offset, options) {\r\n if (isFunction(offset)) {\r\n offset = offset.call(this, options)\r\n }\r\n return this._normalizeCursorOffset(offset)\r\n },\r\n _calculateElementOffset(options) {\r\n var elementOffset;\r\n var dragElementOffset;\r\n var {\r\n event: event\r\n } = options;\r\n var $element = $(options.itemElement);\r\n var $dragElement = $(options.dragElement);\r\n var isCloned = this._dragElementIsCloned();\r\n var cursorOffset = this.option(\"cursorOffset\");\r\n var normalizedCursorOffset = {\r\n left: 0,\r\n top: 0\r\n };\r\n var currentLocate = this._initialLocate = locate($dragElement);\r\n if (isCloned || options.initialOffset || cursorOffset) {\r\n elementOffset = options.initialOffset || $element.offset();\r\n if (cursorOffset) {\r\n normalizedCursorOffset = this._getNormalizedCursorOffset(cursorOffset, options);\r\n if (isFinite(normalizedCursorOffset.left)) {\r\n elementOffset.left = event.pageX\r\n }\r\n if (isFinite(normalizedCursorOffset.top)) {\r\n elementOffset.top = event.pageY\r\n }\r\n }\r\n dragElementOffset = $dragElement.offset();\r\n elementOffset.top -= dragElementOffset.top + (normalizedCursorOffset.top || 0) - currentLocate.top;\r\n elementOffset.left -= dragElementOffset.left + (normalizedCursorOffset.left || 0) - currentLocate.left\r\n }\r\n return elementOffset\r\n },\r\n _initPosition(options) {\r\n var $dragElement = $(options.dragElement);\r\n var elementOffset = this._calculateElementOffset(options);\r\n if (elementOffset) {\r\n this._move(elementOffset, $dragElement)\r\n }\r\n this._startPosition = locate($dragElement)\r\n },\r\n _startAnimator() {\r\n if (!this._scrollAnimator.inProgress()) {\r\n this._scrollAnimator.start()\r\n }\r\n },\r\n _stopAnimator() {\r\n this._scrollAnimator.stop()\r\n },\r\n _addWidgetPrefix(className) {\r\n var componentName = this.NAME;\r\n return dasherize(componentName) + (className ? \"-\".concat(className) : \"\")\r\n },\r\n _getItemsSelector() {\r\n return this.option(\"filter\") || \"\"\r\n },\r\n _$content() {\r\n var $element = this.$element();\r\n var $wrapper = $element.children(\".dx-template-wrapper\");\r\n return $wrapper.length ? $wrapper : $element\r\n },\r\n _attachEventHandlers() {\r\n if (this.option(\"disabled\")) {\r\n return\r\n }\r\n var $element = this._$content();\r\n var itemsSelector = this._getItemsSelector();\r\n var allowMoveByClick = this.option(\"allowMoveByClick\");\r\n var data = {\r\n direction: this.option(\"dragDirection\"),\r\n immediate: this.option(\"immediate\"),\r\n checkDropTarget: ($target, event) => {\r\n var targetGroup = this.option(\"group\");\r\n var sourceGroup = this._getSourceDraggable().option(\"group\");\r\n var $scrollable = this._getScrollable($target);\r\n if (this._verticalScrollHelper.isOutsideScrollable($scrollable, event) || this._horizontalScrollHelper.isOutsideScrollable($scrollable, event)) {\r\n return false\r\n }\r\n return sourceGroup && sourceGroup === targetGroup\r\n }\r\n };\r\n if (allowMoveByClick) {\r\n $element = this._getArea();\r\n eventsEngine.on($element, POINTERDOWN_EVENT_NAME, data, this._pointerDownHandler.bind(this))\r\n }\r\n if (\">\" === itemsSelector[0]) {\r\n itemsSelector = itemsSelector.slice(1)\r\n }\r\n eventsEngine.on($element, DRAGSTART_EVENT_NAME, itemsSelector, data, this._dragStartHandler.bind(this));\r\n eventsEngine.on($element, DRAG_EVENT_NAME, data, this._dragMoveHandler.bind(this));\r\n eventsEngine.on($element, DRAGEND_EVENT_NAME, data, this._dragEndHandler.bind(this));\r\n eventsEngine.on($element, DRAG_ENTER_EVENT_NAME, data, this._dragEnterHandler.bind(this));\r\n eventsEngine.on($element, DRAGEND_LEAVE_EVENT_NAME, data, this._dragLeaveHandler.bind(this));\r\n if (this.option(\"onCancelByEsc\")) {\r\n eventsEngine.on($element, KEYDOWN_EVENT_NAME, this._keydownHandler.bind(this))\r\n }\r\n },\r\n _dragElementIsCloned() {\r\n return this._$dragElement && this._$dragElement.hasClass(this._addWidgetPrefix(CLONE_CLASS))\r\n },\r\n _getDragTemplateArgs($element, $container) {\r\n return {\r\n container: getPublicElement($container),\r\n model: {\r\n itemData: this.option(\"itemData\"),\r\n itemElement: getPublicElement($element)\r\n }\r\n }\r\n },\r\n _createDragElement($element) {\r\n var result = $element;\r\n var clone = this.option(\"clone\");\r\n var $container = this._getContainer();\r\n var template = this.option(\"dragTemplate\");\r\n if (template) {\r\n template = this._getTemplate(template);\r\n result = $(\"\").appendTo($container);\r\n template.render(this._getDragTemplateArgs($element, result))\r\n } else if (clone) {\r\n result = $(\"
\").appendTo($container);\r\n $element.clone().css({\r\n width: $element.css(\"width\"),\r\n height: $element.css(\"height\")\r\n }).appendTo(result)\r\n }\r\n return result.toggleClass(this._addWidgetPrefix(CLONE_CLASS), result.get(0) !== $element.get(0)).toggleClass(\"dx-rtl\", this.option(\"rtlEnabled\"))\r\n },\r\n _resetDragElement() {\r\n if (this._dragElementIsCloned()) {\r\n this._$dragElement.remove()\r\n } else {\r\n this._toggleDraggingClass(false)\r\n }\r\n this._$dragElement = null\r\n },\r\n _resetSourceElement() {\r\n this._toggleDragSourceClass(false);\r\n this._$sourceElement = null\r\n },\r\n _detachEventHandlers() {\r\n eventsEngine.off(this._$content(), \".\".concat(DRAGGABLE));\r\n eventsEngine.off(this._getArea(), \".\".concat(DRAGGABLE))\r\n },\r\n _move(position, $element) {\r\n move($element || this._$dragElement, position)\r\n },\r\n _getDraggableElement(e) {\r\n var $sourceElement = this._getSourceElement();\r\n if ($sourceElement) {\r\n return $sourceElement\r\n }\r\n var allowMoveByClick = this.option(\"allowMoveByClick\");\r\n if (allowMoveByClick) {\r\n return this.$element()\r\n }\r\n var $target = $(e && e.target);\r\n var itemsSelector = this._getItemsSelector();\r\n if (\">\" === itemsSelector[0]) {\r\n var $items = this._$content().find(itemsSelector);\r\n if (!$items.is($target)) {\r\n $target = $target.closest($items)\r\n }\r\n }\r\n return $target\r\n },\r\n _getSourceElement() {\r\n var draggable = this._getSourceDraggable();\r\n return draggable._$sourceElement\r\n },\r\n _pointerDownHandler(e) {\r\n if (needSkipEvent(e)) {\r\n return\r\n }\r\n var position = {};\r\n var $element = this.$element();\r\n var dragDirection = this.option(\"dragDirection\");\r\n if (\"horizontal\" === dragDirection || \"both\" === dragDirection) {\r\n position.left = e.pageX - $element.offset().left + locate($element).left - getWidth($element) / 2\r\n }\r\n if (\"vertical\" === dragDirection || \"both\" === dragDirection) {\r\n position.top = e.pageY - $element.offset().top + locate($element).top - getHeight($element) / 2\r\n }\r\n this._move(position, $element);\r\n this._getAction(\"onDragMove\")(this._getEventArgs(e))\r\n },\r\n _isValidElement(event, $element) {\r\n var handle = this.option(\"handle\");\r\n var $target = $(event.originalEvent && event.originalEvent.target);\r\n if (handle && !$target.closest(handle).length) {\r\n return false\r\n }\r\n if (!$element.length) {\r\n return false\r\n }\r\n return !$element.is(\".dx-state-disabled, .dx-state-disabled *\")\r\n },\r\n _dragStartHandler(e) {\r\n var $element = this._getDraggableElement(e);\r\n this.dragInProgress = true;\r\n if (!this._isValidElement(e, $element)) {\r\n e.cancel = true;\r\n return\r\n }\r\n if (this._$sourceElement) {\r\n return\r\n }\r\n var dragStartArgs = this._getDragStartArgs(e, $element);\r\n this._getAction(\"onDragStart\")(dragStartArgs);\r\n if (dragStartArgs.cancel) {\r\n e.cancel = true;\r\n return\r\n }\r\n this.option(\"itemData\", dragStartArgs.itemData);\r\n this._setSourceDraggable();\r\n this._$sourceElement = $element;\r\n var initialOffset = $element.offset();\r\n if (!this._hasClonedDraggable() && this.option(\"autoScroll\")) {\r\n this._initScrollTop = this._getScrollableScrollTop();\r\n this._initScrollLeft = this._getScrollableScrollLeft();\r\n initialOffset = this._getDraggableElementOffset(initialOffset.left, initialOffset.top)\r\n }\r\n var $dragElement = this._$dragElement = this._createDragElement($element);\r\n this._toggleDraggingClass(true);\r\n this._toggleDragSourceClass(true);\r\n this._setGestureCoverCursor($dragElement.children());\r\n var isFixedPosition = \"fixed\" === $dragElement.css(\"position\");\r\n this._initPosition(extend({}, dragStartArgs, {\r\n dragElement: $dragElement.get(0),\r\n initialOffset: isFixedPosition && initialOffset\r\n }));\r\n this._getAction(\"onDraggableElementShown\")(_extends(_extends({}, dragStartArgs), {\r\n dragElement: $dragElement\r\n }));\r\n var $area = this._getArea();\r\n var areaOffset = this._getAreaOffset($area);\r\n var boundOffset = this._getBoundOffset();\r\n var areaWidth = getOuterWidth($area);\r\n var areaHeight = getOuterHeight($area);\r\n var elementWidth = getWidth($dragElement);\r\n var elementHeight = getHeight($dragElement);\r\n var startOffset_left = $dragElement.offset().left - areaOffset.left,\r\n startOffset_top = $dragElement.offset().top - areaOffset.top;\r\n if ($area.length) {\r\n e.maxLeftOffset = startOffset_left - boundOffset.left;\r\n e.maxRightOffset = areaWidth - startOffset_left - elementWidth - boundOffset.right;\r\n e.maxTopOffset = startOffset_top - boundOffset.top;\r\n e.maxBottomOffset = areaHeight - startOffset_top - elementHeight - boundOffset.bottom\r\n }\r\n if (this.option(\"autoScroll\")) {\r\n this._startAnimator()\r\n }\r\n },\r\n _getAreaOffset($area) {\r\n var offset = $area && positionUtils.offset($area);\r\n return offset || {\r\n left: 0,\r\n top: 0\r\n }\r\n },\r\n _toggleDraggingClass(value) {\r\n this._$dragElement && this._$dragElement.toggleClass(this._addWidgetPrefix(\"dragging\"), value)\r\n },\r\n _toggleDragSourceClass(value, $element) {\r\n var $sourceElement = $element || this._$sourceElement;\r\n $sourceElement && $sourceElement.toggleClass(this._addWidgetPrefix(\"source\"), value)\r\n },\r\n _setGestureCoverCursor($element) {\r\n $(\".\".concat(GESTURE_COVER_CLASS)).css(\"cursor\", $element.css(\"cursor\"))\r\n },\r\n _getBoundOffset() {\r\n var boundOffset = this.option(\"boundOffset\");\r\n if (isFunction(boundOffset)) {\r\n boundOffset = boundOffset.call(this)\r\n }\r\n return quadToObject(boundOffset)\r\n },\r\n _getArea() {\r\n var area = this.option(\"boundary\");\r\n if (isFunction(area)) {\r\n area = area.call(this)\r\n }\r\n return $(area)\r\n },\r\n _getContainer() {\r\n var container = this.option(\"container\");\r\n if (void 0 === container) {\r\n container = viewPort()\r\n }\r\n return $(container)\r\n },\r\n _getDraggableElementOffset(initialOffsetX, initialOffsetY) {\r\n var _a, _b, _c, _d;\r\n var initScrollTop = this._initScrollTop;\r\n var initScrollLeft = this._initScrollLeft;\r\n var scrollTop = this._getScrollableScrollTop();\r\n var scrollLeft = this._getScrollableScrollLeft();\r\n var elementPosition = $(this.element()).css(\"position\");\r\n var isFixedPosition = \"fixed\" === elementPosition;\r\n var result = {\r\n left: (null !== (_b = null === (_a = this._startPosition) || void 0 === _a ? void 0 : _a.left) && void 0 !== _b ? _b : 0) + initialOffsetX,\r\n top: (null !== (_d = null === (_c = this._startPosition) || void 0 === _c ? void 0 : _c.top) && void 0 !== _d ? _d : 0) + initialOffsetY\r\n };\r\n if (isFixedPosition || this._hasClonedDraggable()) {\r\n return result\r\n }\r\n return {\r\n left: isNumeric(scrollLeft) ? result.left + scrollLeft - initScrollLeft : result.left,\r\n top: isNumeric(scrollTop) ? result.top + scrollTop - initScrollTop : result.top\r\n }\r\n },\r\n _hasClonedDraggable() {\r\n return this.option(\"clone\") || this.option(\"dragTemplate\")\r\n },\r\n _dragMoveHandler(e) {\r\n this._dragMoveArgs = e;\r\n if (!this._$dragElement) {\r\n e.cancel = true;\r\n return\r\n }\r\n var offset = this._getDraggableElementOffset(e.offset.x, e.offset.y);\r\n this._move(offset);\r\n this._updateScrollable(e);\r\n var eventArgs = this._getEventArgs(e);\r\n this._getAction(\"onDragMove\")(eventArgs);\r\n if (true === eventArgs.cancel) {\r\n return\r\n }\r\n var targetDraggable = this._getTargetDraggable();\r\n targetDraggable.dragMove(e, scrollBy)\r\n },\r\n _updateScrollable(e) {\r\n if (this.option(\"autoScroll\")) {\r\n var mousePosition = getMousePosition(e);\r\n var allObjects = domAdapter.elementsFromPoint(mousePosition.x, mousePosition.y, this.$element().get(0));\r\n this._verticalScrollHelper.updateScrollable(allObjects, mousePosition);\r\n this._horizontalScrollHelper.updateScrollable(allObjects, mousePosition)\r\n }\r\n },\r\n _getScrollable($element) {\r\n var $scrollable;\r\n $element.parents().toArray().some(parent => {\r\n var $parent = $(parent);\r\n if (this._horizontalScrollHelper.isScrollable($parent) || this._verticalScrollHelper.isScrollable($parent)) {\r\n $scrollable = $parent;\r\n return true\r\n }\r\n return false\r\n });\r\n return $scrollable\r\n },\r\n _getScrollableScrollTop() {\r\n var _a, _b;\r\n return null !== (_b = null === (_a = this._getScrollable($(this.element()))) || void 0 === _a ? void 0 : _a.scrollTop()) && void 0 !== _b ? _b : 0\r\n },\r\n _getScrollableScrollLeft() {\r\n var _a, _b;\r\n return null !== (_b = null === (_a = this._getScrollable($(this.element()))) || void 0 === _a ? void 0 : _a.scrollLeft()) && void 0 !== _b ? _b : 0\r\n },\r\n _defaultActionArgs() {\r\n var args = this.callBase.apply(this, arguments);\r\n var component = this.option(\"component\");\r\n if (component) {\r\n args.component = component;\r\n args.element = component.element()\r\n }\r\n return args\r\n },\r\n _getEventArgs(e) {\r\n var sourceDraggable = this._getSourceDraggable();\r\n var targetDraggable = this._getTargetDraggable();\r\n return {\r\n event: e,\r\n itemData: sourceDraggable.option(\"itemData\"),\r\n itemElement: getPublicElement(sourceDraggable._$sourceElement),\r\n fromComponent: sourceDraggable.option(\"component\") || sourceDraggable,\r\n toComponent: targetDraggable.option(\"component\") || targetDraggable,\r\n fromData: sourceDraggable.option(\"data\"),\r\n toData: targetDraggable.option(\"data\")\r\n }\r\n },\r\n _getDragStartArgs(e, $itemElement) {\r\n var args = this._getEventArgs(e);\r\n return {\r\n event: args.event,\r\n itemData: args.itemData,\r\n itemElement: $itemElement,\r\n fromData: args.fromData\r\n }\r\n },\r\n _revertItemToInitialPosition() {\r\n !this._dragElementIsCloned() && this._move(this._initialLocate, this._$sourceElement)\r\n },\r\n _dragEndHandler(e) {\r\n var d = Deferred();\r\n var dragEndEventArgs = this._getEventArgs(e);\r\n var dropEventArgs = this._getEventArgs(e);\r\n var targetDraggable = this._getTargetDraggable();\r\n var needRevertPosition = true;\r\n this.dragInProgress = false;\r\n try {\r\n this._getAction(\"onDragEnd\")(dragEndEventArgs)\r\n } finally {\r\n when(fromPromise(dragEndEventArgs.cancel)).done(cancel => {\r\n if (!cancel) {\r\n if (targetDraggable !== this) {\r\n targetDraggable._getAction(\"onDrop\")(dropEventArgs)\r\n }\r\n if (!dropEventArgs.cancel) {\r\n needRevertPosition = false;\r\n when(fromPromise(targetDraggable.dragEnd(dragEndEventArgs))).always(d.resolve);\r\n return\r\n }\r\n }\r\n d.resolve()\r\n }).fail(d.resolve);\r\n d.done(() => {\r\n if (needRevertPosition) {\r\n this._revertItemToInitialPosition()\r\n }\r\n this._resetDragOptions(targetDraggable)\r\n })\r\n }\r\n },\r\n _isTargetOverAnotherDraggable(e) {\r\n var sourceDraggable = this._getSourceDraggable();\r\n if (this === sourceDraggable) {\r\n return false\r\n }\r\n var $dragElement = sourceDraggable._$dragElement;\r\n var $sourceDraggableElement = sourceDraggable.$element();\r\n var $targetDraggableElement = this.$element();\r\n var mousePosition = getMousePosition(e);\r\n var elements = domAdapter.elementsFromPoint(mousePosition.x, mousePosition.y, this.element());\r\n var firstWidgetElement = elements.filter(element => {\r\n var $element = $(element);\r\n if ($element.hasClass(this._addWidgetPrefix())) {\r\n return !$element.closest($dragElement).length\r\n }\r\n return false\r\n })[0];\r\n var $sourceElement = this._getSourceElement();\r\n var isTargetOverItself = firstWidgetElement === $sourceDraggableElement.get(0);\r\n var isTargetOverNestedDraggable = $(firstWidgetElement).closest($sourceElement).length;\r\n return !firstWidgetElement || firstWidgetElement === $targetDraggableElement.get(0) && !isTargetOverItself && !isTargetOverNestedDraggable\r\n },\r\n _dragEnterHandler(e) {\r\n this._fireDragEnterEvent(e);\r\n if (this._isTargetOverAnotherDraggable(e)) {\r\n this._setTargetDraggable()\r\n }\r\n var sourceDraggable = this._getSourceDraggable();\r\n sourceDraggable.dragEnter(e)\r\n },\r\n _dragLeaveHandler(e) {\r\n this._fireDragLeaveEvent(e);\r\n this._resetTargetDraggable();\r\n if (this !== this._getSourceDraggable()) {\r\n this.reset()\r\n }\r\n var sourceDraggable = this._getSourceDraggable();\r\n sourceDraggable.dragLeave(e)\r\n },\r\n _keydownHandler(e) {\r\n if (this.dragInProgress && \"Escape\" === e.key) {\r\n this._keydownEscapeHandler(e)\r\n }\r\n },\r\n _keydownEscapeHandler(e) {\r\n var $sourceElement = this._getSourceElement();\r\n if (!$sourceElement) {\r\n return\r\n }\r\n var dragCancelEventArgs = this._getEventArgs(e);\r\n this._getAction(\"onDragCancel\")(dragCancelEventArgs);\r\n if (dragCancelEventArgs.cancel) {\r\n return\r\n }\r\n this.dragInProgress = false;\r\n null === sourceDraggable || void 0 === sourceDraggable ? void 0 : sourceDraggable._toggleDraggingClass(false);\r\n this._detachEventHandlers();\r\n this._revertItemToInitialPosition();\r\n var targetDraggable = this._getTargetDraggable();\r\n this._resetDragOptions(targetDraggable);\r\n this._attachEventHandlers()\r\n },\r\n _getAction(name) {\r\n return this[\"_\".concat(name, \"Action\")] || this._createActionByOption(name)\r\n },\r\n _getAnonymousTemplateName: () => ANONYMOUS_TEMPLATE_NAME,\r\n _initTemplates() {\r\n if (!this.option(\"contentTemplate\")) {\r\n return\r\n }\r\n this._templateManager.addDefaultTemplates({\r\n content: new EmptyTemplate\r\n });\r\n this.callBase.apply(this, arguments)\r\n },\r\n _render() {\r\n this.callBase();\r\n this.$element().addClass(this._addWidgetPrefix());\r\n var transclude = this._templateManager.anonymousTemplateName === this.option(\"contentTemplate\");\r\n var template = this._getTemplateByOption(\"contentTemplate\");\r\n if (template) {\r\n $(template.render({\r\n container: this.element(),\r\n transclude: transclude\r\n }))\r\n }\r\n },\r\n _optionChanged(args) {\r\n var {\r\n name: name\r\n } = args;\r\n switch (name) {\r\n case \"onDragStart\":\r\n case \"onDragMove\":\r\n case \"onDragEnd\":\r\n case \"onDrop\":\r\n case \"onDragEnter\":\r\n case \"onDragLeave\":\r\n case \"onDragCancel\":\r\n case \"onDraggableElementShown\":\r\n this[\"_\".concat(name, \"Action\")] = this._createActionByOption(name);\r\n break;\r\n case \"dragTemplate\":\r\n case \"contentTemplate\":\r\n case \"container\":\r\n case \"clone\":\r\n break;\r\n case \"allowMoveByClick\":\r\n case \"dragDirection\":\r\n case \"disabled\":\r\n case \"boundary\":\r\n case \"filter\":\r\n case \"immediate\":\r\n this._resetDragElement();\r\n this._detachEventHandlers();\r\n this._attachEventHandlers();\r\n break;\r\n case \"onCancelByEsc\":\r\n this._keydownHandler();\r\n break;\r\n case \"autoScroll\":\r\n this._verticalScrollHelper.reset();\r\n this._horizontalScrollHelper.reset();\r\n break;\r\n case \"scrollSensitivity\":\r\n case \"scrollSpeed\":\r\n case \"boundOffset\":\r\n case \"handle\":\r\n case \"group\":\r\n case \"data\":\r\n case \"itemData\":\r\n break;\r\n default:\r\n this.callBase(args)\r\n }\r\n },\r\n _getTargetDraggable() {\r\n return targetDraggable || this\r\n },\r\n _getSourceDraggable() {\r\n return sourceDraggable || this\r\n },\r\n _setTargetDraggable() {\r\n var currentGroup = this.option(\"group\");\r\n var sourceDraggable = this._getSourceDraggable();\r\n if (currentGroup && currentGroup === sourceDraggable.option(\"group\")) {\r\n targetDraggable = this\r\n }\r\n },\r\n _setSourceDraggable() {\r\n sourceDraggable = this\r\n },\r\n _resetSourceDraggable() {\r\n sourceDraggable = null\r\n },\r\n _resetTargetDraggable() {\r\n targetDraggable = null\r\n },\r\n _resetDragOptions(targetDraggable) {\r\n this.reset();\r\n targetDraggable.reset();\r\n this._stopAnimator();\r\n this._horizontalScrollHelper.reset();\r\n this._verticalScrollHelper.reset();\r\n this._resetDragElement();\r\n this._resetSourceElement();\r\n this._resetTargetDraggable();\r\n this._resetSourceDraggable()\r\n },\r\n _dispose() {\r\n this.callBase();\r\n this._detachEventHandlers();\r\n this._resetDragElement();\r\n this._resetTargetDraggable();\r\n this._resetSourceDraggable();\r\n this._$sourceElement = null;\r\n this._stopAnimator()\r\n },\r\n _fireDragEnterEvent(sourceEvent) {\r\n var args = this._getEventArgs(sourceEvent);\r\n this._getAction(\"onDragEnter\")(args)\r\n },\r\n _fireDragLeaveEvent(sourceEvent) {\r\n var args = this._getEventArgs(sourceEvent);\r\n this._getAction(\"onDragLeave\")(args)\r\n }\r\n});\r\nregisterComponent(DRAGGABLE, Draggable);\r\nexport default Draggable;\r\n","/**\r\n * DevExtreme (esm/animation/frame.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n hasWindow,\r\n getWindow\r\n} from \"../core/utils/window\";\r\nvar window = hasWindow() ? getWindow() : {};\r\nimport callOnce from \"../core/utils/call_once\";\r\nvar FRAME_ANIMATION_STEP_TIME = 1e3 / 60;\r\nvar request = function(callback) {\r\n return setTimeout(callback, FRAME_ANIMATION_STEP_TIME)\r\n};\r\nvar cancel = function(requestID) {\r\n clearTimeout(requestID)\r\n};\r\nvar setAnimationFrameMethods = callOnce((function() {\r\n var nativeRequest = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame;\r\n var nativeCancel = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame;\r\n if (nativeRequest && nativeCancel) {\r\n request = nativeRequest;\r\n cancel = nativeCancel\r\n }\r\n}));\r\nexport function requestAnimationFrame() {\r\n setAnimationFrameMethods();\r\n return request.apply(window, arguments)\r\n}\r\nexport function cancelAnimationFrame() {\r\n setAnimationFrameMethods();\r\n cancel.apply(window, arguments)\r\n}\r\n","/**\r\n * DevExtreme (esm/animation/easing.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isFunction\r\n} from \"../core/utils/type\";\r\nvar CSS_TRANSITION_EASING_REGEX = /cubic-bezier\\((\\d+(?:\\.\\d+)?)\\s*,\\s*(\\d+(?:\\.\\d+)?)\\s*,\\s*(\\d+(?:\\.\\d+)?)\\s*,\\s*(\\d+(?:\\.\\d+)?)\\)/;\r\nvar TransitionTimingFuncMap = {\r\n linear: \"cubic-bezier(0, 0, 1, 1)\",\r\n swing: \"cubic-bezier(0.445, 0.05, 0.55, 0.95)\",\r\n ease: \"cubic-bezier(0.25, 0.1, 0.25, 1)\",\r\n \"ease-in\": \"cubic-bezier(0.42, 0, 1, 1)\",\r\n \"ease-out\": \"cubic-bezier(0, 0, 0.58, 1)\",\r\n \"ease-in-out\": \"cubic-bezier(0.42, 0, 0.58, 1)\"\r\n};\r\nvar polynomBezier = function(x1, y1, x2, y2) {\r\n var Cx = 3 * x1;\r\n var Bx = 3 * (x2 - x1) - Cx;\r\n var Ax = 1 - Cx - Bx;\r\n var Cy = 3 * y1;\r\n var By = 3 * (y2 - y1) - Cy;\r\n var Ay = 1 - Cy - By;\r\n var bezierX = function(t) {\r\n return t * (Cx + t * (Bx + t * Ax))\r\n };\r\n var derivativeX = function(t) {\r\n return Cx + t * (2 * Bx + 3 * t * Ax)\r\n };\r\n return function(t) {\r\n return function(t) {\r\n return t * (Cy + t * (By + t * Ay))\r\n }(function(t) {\r\n var x = t;\r\n var i = 0;\r\n var z;\r\n while (i < 14) {\r\n z = bezierX(x) - t;\r\n if (Math.abs(z) < .001) {\r\n break\r\n }\r\n x -= z / derivativeX(x);\r\n i++\r\n }\r\n return x\r\n }(t))\r\n }\r\n};\r\nvar easing = {};\r\nexport var convertTransitionTimingFuncToEasing = function(cssTransitionEasing) {\r\n cssTransitionEasing = TransitionTimingFuncMap[cssTransitionEasing] || cssTransitionEasing;\r\n var coeffs = cssTransitionEasing.match(CSS_TRANSITION_EASING_REGEX);\r\n var forceName;\r\n if (!coeffs) {\r\n forceName = \"linear\";\r\n coeffs = TransitionTimingFuncMap[forceName].match(CSS_TRANSITION_EASING_REGEX)\r\n }\r\n coeffs = coeffs.slice(1, 5);\r\n for (var i = 0; i < coeffs.length; i++) {\r\n coeffs[i] = parseFloat(coeffs[i])\r\n }\r\n var easingName = forceName || \"cubicbezier_\" + coeffs.join(\"_\").replace(/\\./g, \"p\");\r\n if (!isFunction(easing[easingName])) {\r\n easing[easingName] = function(x, t, b, c, d) {\r\n return c * polynomBezier(coeffs[0], coeffs[1], coeffs[2], coeffs[3])(t / d) + b\r\n }\r\n }\r\n return easingName\r\n};\r\nexport function setEasing(value) {\r\n easing = value\r\n}\r\nexport function getEasing(name) {\r\n return easing[name]\r\n}\r\n","/**\r\n * DevExtreme (esm/animation/fx.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport $ from \"../core/renderer\";\r\nimport {\r\n getWindow\r\n} from \"../core/utils/window\";\r\nvar window = getWindow();\r\nimport eventsEngine from \"../events/core/events_engine\";\r\nimport errors from \"../core/errors\";\r\nimport {\r\n getPublicElement\r\n} from \"../core/element\";\r\nimport {\r\n extend\r\n} from \"../core/utils/extend\";\r\nimport {\r\n isFunction,\r\n isPlainObject\r\n} from \"../core/utils/type\";\r\nimport {\r\n each,\r\n map\r\n} from \"../core/utils/iterator\";\r\nimport {\r\n getTranslateCss,\r\n parseTranslate,\r\n clearCache,\r\n locate,\r\n getTranslate\r\n} from \"./translator\";\r\nimport {\r\n convertTransitionTimingFuncToEasing,\r\n getEasing\r\n} from \"./easing\";\r\nimport {\r\n requestAnimationFrame,\r\n cancelAnimationFrame\r\n} from \"./frame\";\r\nimport {\r\n transitionEndEventName,\r\n transition\r\n} from \"../core/utils/support\";\r\nimport positionUtils from \"./position\";\r\nimport {\r\n removeEvent\r\n} from \"../events/remove\";\r\nimport {\r\n addNamespace\r\n} from \"../events/utils/index\";\r\nimport {\r\n when,\r\n Deferred\r\n} from \"../core/utils/deferred\";\r\nvar removeEventName = addNamespace(removeEvent, \"dxFX\");\r\nimport {\r\n noop\r\n} from \"../core/utils/common\";\r\nvar RELATIVE_VALUE_REGEX = /^([+-])=(.*)/i;\r\nvar ANIM_DATA_KEY = \"dxAnimData\";\r\nvar ANIM_QUEUE_KEY = \"dxAnimQueue\";\r\nvar TRANSFORM_PROP = \"transform\";\r\nvar TransitionAnimationStrategy = {\r\n initAnimation: function($element, config) {\r\n $element.css({\r\n transitionProperty: \"none\"\r\n });\r\n if (\"string\" === typeof config.from) {\r\n $element.addClass(config.from)\r\n } else {\r\n setProps($element, config.from)\r\n }\r\n var that = this;\r\n var deferred = new Deferred;\r\n var cleanupWhen = config.cleanupWhen;\r\n config.transitionAnimation = {\r\n deferred: deferred,\r\n finish: function() {\r\n that._finishTransition($element);\r\n if (cleanupWhen) {\r\n when(deferred, cleanupWhen).always((function() {\r\n that._cleanup($element, config)\r\n }))\r\n } else {\r\n that._cleanup($element, config)\r\n }\r\n deferred.resolveWith($element, [config, $element])\r\n }\r\n };\r\n this._completeAnimationCallback($element, config).done((function() {\r\n config.transitionAnimation.finish()\r\n })).fail((function() {\r\n deferred.rejectWith($element, [config, $element])\r\n }));\r\n if (!config.duration) {\r\n config.transitionAnimation.finish()\r\n }\r\n $element.css(\"transform\")\r\n },\r\n animate: function($element, config) {\r\n this._startAnimation($element, config);\r\n return config.transitionAnimation.deferred.promise()\r\n },\r\n _completeAnimationCallback: function($element, config) {\r\n var that = this;\r\n var startTime = Date.now() + config.delay;\r\n var deferred = new Deferred;\r\n var transitionEndFired = new Deferred;\r\n var simulatedTransitionEndFired = new Deferred;\r\n var simulatedEndEventTimer;\r\n var transitionEndEventFullName = transitionEndEventName() + \".dxFX\";\r\n config.transitionAnimation.cleanup = function() {\r\n clearTimeout(simulatedEndEventTimer);\r\n clearTimeout(waitForJSCompleteTimer);\r\n eventsEngine.off($element, transitionEndEventFullName);\r\n eventsEngine.off($element, removeEventName)\r\n };\r\n eventsEngine.one($element, transitionEndEventFullName, (function() {\r\n if (Date.now() - startTime >= config.duration) {\r\n transitionEndFired.reject()\r\n }\r\n }));\r\n eventsEngine.off($element, removeEventName);\r\n eventsEngine.on($element, removeEventName, (function() {\r\n that.stop($element, config);\r\n deferred.reject()\r\n }));\r\n var waitForJSCompleteTimer = setTimeout((function() {\r\n simulatedEndEventTimer = setTimeout((function() {\r\n simulatedTransitionEndFired.reject()\r\n }), config.duration + config.delay + fx._simulatedTransitionEndDelay);\r\n when(transitionEndFired, simulatedTransitionEndFired).fail(function() {\r\n deferred.resolve()\r\n }.bind(this))\r\n }));\r\n return deferred.promise()\r\n },\r\n _startAnimation: function($element, config) {\r\n $element.css({\r\n transitionProperty: \"all\",\r\n transitionDelay: config.delay + \"ms\",\r\n transitionDuration: config.duration + \"ms\",\r\n transitionTimingFunction: config.easing\r\n });\r\n if (\"string\" === typeof config.to) {\r\n $element[0].className += \" \" + config.to\r\n } else if (config.to) {\r\n setProps($element, config.to)\r\n }\r\n },\r\n _finishTransition: function($element) {\r\n $element.css(\"transition\", \"none\")\r\n },\r\n _cleanup: function($element, config) {\r\n config.transitionAnimation.cleanup();\r\n if (\"string\" === typeof config.from) {\r\n $element.removeClass(config.from);\r\n $element.removeClass(config.to)\r\n }\r\n },\r\n stop: function($element, config, jumpToEnd) {\r\n if (!config) {\r\n return\r\n }\r\n if (jumpToEnd) {\r\n config.transitionAnimation.finish()\r\n } else {\r\n if (isPlainObject(config.to)) {\r\n each(config.to, (function(key) {\r\n $element.css(key, $element.css(key))\r\n }))\r\n }\r\n this._finishTransition($element);\r\n this._cleanup($element, config)\r\n }\r\n }\r\n};\r\nvar FrameAnimationStrategy = {\r\n initAnimation: function($element, config) {\r\n setProps($element, config.from)\r\n },\r\n animate: function($element, config) {\r\n var deferred = new Deferred;\r\n var that = this;\r\n if (!config) {\r\n return deferred.reject().promise()\r\n }\r\n each(config.to, (function(prop) {\r\n if (void 0 === config.from[prop]) {\r\n config.from[prop] = that._normalizeValue($element.css(prop))\r\n }\r\n }));\r\n if (config.to[TRANSFORM_PROP]) {\r\n config.from[TRANSFORM_PROP] = that._parseTransform(config.from[TRANSFORM_PROP]);\r\n config.to[TRANSFORM_PROP] = that._parseTransform(config.to[TRANSFORM_PROP])\r\n }\r\n config.frameAnimation = {\r\n to: config.to,\r\n from: config.from,\r\n currentValue: config.from,\r\n easing: convertTransitionTimingFuncToEasing(config.easing),\r\n duration: config.duration,\r\n startTime: (new Date).valueOf(),\r\n finish: function() {\r\n this.currentValue = this.to;\r\n this.draw();\r\n cancelAnimationFrame(config.frameAnimation.animationFrameId);\r\n deferred.resolve()\r\n },\r\n draw: function() {\r\n if (config.draw) {\r\n config.draw(this.currentValue);\r\n return\r\n }\r\n var currentValue = extend({}, this.currentValue);\r\n if (currentValue[TRANSFORM_PROP]) {\r\n currentValue[TRANSFORM_PROP] = map(currentValue[TRANSFORM_PROP], (function(value, prop) {\r\n if (\"translate\" === prop) {\r\n return getTranslateCss(value)\r\n } else if (\"scale\" === prop) {\r\n return \"scale(\" + value + \")\"\r\n } else if (\"rotate\" === prop.substr(0, prop.length - 1)) {\r\n return prop + \"(\" + value + \"deg)\"\r\n }\r\n })).join(\" \")\r\n }\r\n $element.css(currentValue)\r\n }\r\n };\r\n if (config.delay) {\r\n config.frameAnimation.startTime += config.delay;\r\n config.frameAnimation.delayTimeout = setTimeout((function() {\r\n that._startAnimation($element, config)\r\n }), config.delay)\r\n } else {\r\n that._startAnimation($element, config)\r\n }\r\n return deferred.promise()\r\n },\r\n _startAnimation: function($element, config) {\r\n eventsEngine.off($element, removeEventName);\r\n eventsEngine.on($element, removeEventName, (function() {\r\n if (config.frameAnimation) {\r\n cancelAnimationFrame(config.frameAnimation.animationFrameId)\r\n }\r\n }));\r\n this._animationStep($element, config)\r\n },\r\n _parseTransform: function(transformString) {\r\n var result = {};\r\n each(transformString.match(/\\w+\\d*\\w*\\([^)]*\\)\\s*/g), (function(i, part) {\r\n var translateData = parseTranslate(part);\r\n var scaleData = part.match(/scale\\((.+?)\\)/);\r\n var rotateData = part.match(/(rotate.)\\((.+)deg\\)/);\r\n if (translateData) {\r\n result.translate = translateData\r\n }\r\n if (scaleData && scaleData[1]) {\r\n result.scale = parseFloat(scaleData[1])\r\n }\r\n if (rotateData && rotateData[1]) {\r\n result[rotateData[1]] = parseFloat(rotateData[2])\r\n }\r\n }));\r\n return result\r\n },\r\n stop: function($element, config, jumpToEnd) {\r\n var frameAnimation = config && config.frameAnimation;\r\n if (!frameAnimation) {\r\n return\r\n }\r\n cancelAnimationFrame(frameAnimation.animationFrameId);\r\n clearTimeout(frameAnimation.delayTimeout);\r\n if (jumpToEnd) {\r\n frameAnimation.finish()\r\n }\r\n delete config.frameAnimation\r\n },\r\n _animationStep: function($element, config) {\r\n var frameAnimation = config && config.frameAnimation;\r\n if (!frameAnimation) {\r\n return\r\n }\r\n var now = (new Date).valueOf();\r\n if (now >= frameAnimation.startTime + frameAnimation.duration) {\r\n frameAnimation.finish();\r\n return\r\n }\r\n frameAnimation.currentValue = this._calcStepValue(frameAnimation, now - frameAnimation.startTime);\r\n frameAnimation.draw();\r\n var that = this;\r\n frameAnimation.animationFrameId = requestAnimationFrame((function() {\r\n that._animationStep($element, config)\r\n }))\r\n },\r\n _calcStepValue: function(frameAnimation, currentDuration) {\r\n return function calcValueRecursively(from, to) {\r\n var result = Array.isArray(to) ? [] : {};\r\n each(to, (function(propName, endPropValue) {\r\n if (\"string\" === typeof endPropValue && false === parseFloat(endPropValue)) {\r\n return true\r\n }\r\n result[propName] = \"object\" === typeof endPropValue ? calcValueRecursively(from[propName], endPropValue) : function(propName) {\r\n var x = currentDuration / frameAnimation.duration;\r\n var t = currentDuration;\r\n var b = 1 * from[propName];\r\n var c = to[propName] - from[propName];\r\n var d = frameAnimation.duration;\r\n return getEasing(frameAnimation.easing)(x, t, b, c, d)\r\n }(propName)\r\n }));\r\n return result\r\n }(frameAnimation.from, frameAnimation.to)\r\n },\r\n _normalizeValue: function(value) {\r\n var numericValue = parseFloat(value);\r\n if (false === numericValue) {\r\n return value\r\n }\r\n return numericValue\r\n }\r\n};\r\nvar FallbackToNoAnimationStrategy = {\r\n initAnimation: function() {},\r\n animate: function() {\r\n return (new Deferred).resolve().promise()\r\n },\r\n stop: noop,\r\n isSynchronous: true\r\n};\r\nvar getAnimationStrategy = function(config) {\r\n config = config || {};\r\n var animationStrategies = {\r\n transition: transition() ? TransitionAnimationStrategy : FrameAnimationStrategy,\r\n frame: FrameAnimationStrategy,\r\n noAnimation: FallbackToNoAnimationStrategy\r\n };\r\n var strategy = config.strategy || \"transition\";\r\n if (\"css\" === config.type && !transition()) {\r\n strategy = \"noAnimation\"\r\n }\r\n return animationStrategies[strategy]\r\n};\r\nvar baseConfigValidator = function(config, animationType, validate, typeMessage) {\r\n each([\"from\", \"to\"], (function() {\r\n if (!validate(config[this])) {\r\n throw errors.Error(\"E0010\", animationType, this, typeMessage)\r\n }\r\n }))\r\n};\r\nvar isObjectConfigValidator = function(config, animationType) {\r\n return baseConfigValidator(config, animationType, (function(target) {\r\n return isPlainObject(target)\r\n }), \"a plain object\")\r\n};\r\nvar isStringConfigValidator = function(config, animationType) {\r\n return baseConfigValidator(config, animationType, (function(target) {\r\n return \"string\" === typeof target\r\n }), \"a string\")\r\n};\r\nvar CustomAnimationConfigurator = {\r\n setup: function() {}\r\n};\r\nvar CssAnimationConfigurator = {\r\n validateConfig: function(config) {\r\n isStringConfigValidator(config, \"css\")\r\n },\r\n setup: function() {}\r\n};\r\nvar positionAliases = {\r\n top: {\r\n my: \"bottom center\",\r\n at: \"top center\"\r\n },\r\n bottom: {\r\n my: \"top center\",\r\n at: \"bottom center\"\r\n },\r\n right: {\r\n my: \"left center\",\r\n at: \"right center\"\r\n },\r\n left: {\r\n my: \"right center\",\r\n at: \"left center\"\r\n }\r\n};\r\nvar SlideAnimationConfigurator = {\r\n validateConfig: function(config) {\r\n isObjectConfigValidator(config, \"slide\")\r\n },\r\n setup: function($element, config) {\r\n var location = locate($element);\r\n if (\"slide\" !== config.type) {\r\n var positioningConfig = \"slideIn\" === config.type ? config.from : config.to;\r\n positioningConfig.position = extend({\r\n of: window\r\n }, positionAliases[config.direction]);\r\n setupPosition($element, positioningConfig)\r\n }\r\n this._setUpConfig(location, config.from);\r\n this._setUpConfig(location, config.to);\r\n clearCache($element)\r\n },\r\n _setUpConfig: function(location, config) {\r\n config.left = \"left\" in config ? config.left : \"+=0\";\r\n config.top = \"top\" in config ? config.top : \"+=0\";\r\n this._initNewPosition(location, config)\r\n },\r\n _initNewPosition: function(location, config) {\r\n var position = {\r\n left: config.left,\r\n top: config.top\r\n };\r\n delete config.left;\r\n delete config.top;\r\n var relativeValue = this._getRelativeValue(position.left);\r\n if (void 0 !== relativeValue) {\r\n position.left = relativeValue + location.left\r\n } else {\r\n config.left = 0\r\n }\r\n relativeValue = this._getRelativeValue(position.top);\r\n if (void 0 !== relativeValue) {\r\n position.top = relativeValue + location.top\r\n } else {\r\n config.top = 0\r\n }\r\n config[TRANSFORM_PROP] = getTranslateCss({\r\n x: position.left,\r\n y: position.top\r\n })\r\n },\r\n _getRelativeValue: function(value) {\r\n var relativeValue;\r\n if (\"string\" === typeof value && (relativeValue = RELATIVE_VALUE_REGEX.exec(value))) {\r\n return parseInt(relativeValue[1] + \"1\") * relativeValue[2]\r\n }\r\n }\r\n};\r\nvar FadeAnimationConfigurator = {\r\n setup: function($element, config) {\r\n var _from$opacity, _to$opacity;\r\n var from = config.from;\r\n var to = config.to;\r\n var defaultFromOpacity = \"fadeOut\" === config.type ? 1 : 0;\r\n var defaultToOpacity = \"fadeOut\" === config.type ? 0 : 1;\r\n var fromOpacity = isPlainObject(from) ? String(null !== (_from$opacity = from.opacity) && void 0 !== _from$opacity ? _from$opacity : defaultFromOpacity) : String(from);\r\n var toOpacity = isPlainObject(to) ? String(null !== (_to$opacity = to.opacity) && void 0 !== _to$opacity ? _to$opacity : defaultToOpacity) : String(to);\r\n if (!config.skipElementInitialStyles) {\r\n fromOpacity = $element.css(\"opacity\")\r\n }\r\n switch (config.type) {\r\n case \"fadeIn\":\r\n toOpacity = 1;\r\n break;\r\n case \"fadeOut\":\r\n toOpacity = 0\r\n }\r\n config.from = {\r\n visibility: \"visible\",\r\n opacity: fromOpacity\r\n };\r\n config.to = {\r\n opacity: toOpacity\r\n }\r\n }\r\n};\r\nvar PopAnimationConfigurator = {\r\n validateConfig: function(config) {\r\n isObjectConfigValidator(config, \"pop\")\r\n },\r\n setup: function($element, config) {\r\n var from = config.from;\r\n var to = config.to;\r\n var fromOpacity = \"opacity\" in from ? from.opacity : $element.css(\"opacity\");\r\n var toOpacity = \"opacity\" in to ? to.opacity : 1;\r\n var fromScale = \"scale\" in from ? from.scale : 0;\r\n var toScale = \"scale\" in to ? to.scale : 1;\r\n config.from = {\r\n opacity: fromOpacity\r\n };\r\n var translate = getTranslate($element);\r\n config.from[TRANSFORM_PROP] = this._getCssTransform(translate, fromScale);\r\n config.to = {\r\n opacity: toOpacity\r\n };\r\n config.to[TRANSFORM_PROP] = this._getCssTransform(translate, toScale)\r\n },\r\n _getCssTransform: function(translate, scale) {\r\n return getTranslateCss(translate) + \"scale(\" + scale + \")\"\r\n }\r\n};\r\nvar animationConfigurators = {\r\n custom: CustomAnimationConfigurator,\r\n slide: SlideAnimationConfigurator,\r\n slideIn: SlideAnimationConfigurator,\r\n slideOut: SlideAnimationConfigurator,\r\n fade: FadeAnimationConfigurator,\r\n fadeIn: FadeAnimationConfigurator,\r\n fadeOut: FadeAnimationConfigurator,\r\n pop: PopAnimationConfigurator,\r\n css: CssAnimationConfigurator\r\n};\r\nvar getAnimationConfigurator = function(config) {\r\n var result = animationConfigurators[config.type];\r\n if (!result) {\r\n throw errors.Error(\"E0011\", config.type)\r\n }\r\n return result\r\n};\r\nvar defaultJSConfig = {\r\n type: \"custom\",\r\n from: {},\r\n to: {},\r\n duration: 400,\r\n start: noop,\r\n complete: noop,\r\n easing: \"ease\",\r\n delay: 0\r\n};\r\nvar defaultCssConfig = {\r\n duration: 400,\r\n easing: \"ease\",\r\n delay: 0\r\n};\r\n\r\nfunction setupAnimationOnElement() {\r\n var $element = this.element;\r\n var config = this.config;\r\n setupPosition($element, config.from);\r\n setupPosition($element, config.to);\r\n this.configurator.setup($element, config);\r\n $element.data(ANIM_DATA_KEY, this);\r\n if (fx.off) {\r\n config.duration = 0;\r\n config.delay = 0\r\n }\r\n this.strategy.initAnimation($element, config);\r\n if (config.start) {\r\n var element = getPublicElement($element);\r\n config.start.apply(this, [element, config])\r\n }\r\n}\r\nvar onElementAnimationComplete = function(animation) {\r\n var $element = animation.element;\r\n var config = animation.config;\r\n $element.removeData(ANIM_DATA_KEY);\r\n if (config.complete) {\r\n var element = getPublicElement($element);\r\n config.complete.apply(this, [element, config])\r\n }\r\n animation.deferred.resolveWith(this, [$element, config])\r\n};\r\nvar startAnimationOnElement = function() {\r\n var animation = this;\r\n var $element = animation.element;\r\n var config = animation.config;\r\n animation.isStarted = true;\r\n return animation.strategy.animate($element, config).done((function() {\r\n onElementAnimationComplete(animation)\r\n })).fail((function() {\r\n animation.deferred.rejectWith(this, [$element, config])\r\n }))\r\n};\r\nvar stopAnimationOnElement = function(jumpToEnd) {\r\n var $element = this.element;\r\n var config = this.config;\r\n clearTimeout(this.startTimeout);\r\n if (!this.isStarted) {\r\n this.start()\r\n }\r\n this.strategy.stop($element, config, jumpToEnd)\r\n};\r\nvar scopedRemoveEvent = addNamespace(removeEvent, \"dxFXStartAnimation\");\r\nvar subscribeToRemoveEvent = function(animation) {\r\n eventsEngine.off(animation.element, scopedRemoveEvent);\r\n eventsEngine.on(animation.element, scopedRemoveEvent, (function() {\r\n fx.stop(animation.element)\r\n }));\r\n animation.deferred.always((function() {\r\n eventsEngine.off(animation.element, scopedRemoveEvent)\r\n }))\r\n};\r\nvar createAnimation = function(element, initialConfig) {\r\n var defaultConfig = \"css\" === initialConfig.type ? defaultCssConfig : defaultJSConfig;\r\n var config = extend(true, {}, defaultConfig, initialConfig);\r\n var configurator = getAnimationConfigurator(config);\r\n var strategy = getAnimationStrategy(config);\r\n var animation = {\r\n element: $(element),\r\n config: config,\r\n configurator: configurator,\r\n strategy: strategy,\r\n isSynchronous: strategy.isSynchronous,\r\n setup: setupAnimationOnElement,\r\n start: startAnimationOnElement,\r\n stop: stopAnimationOnElement,\r\n deferred: new Deferred\r\n };\r\n if (isFunction(configurator.validateConfig)) {\r\n configurator.validateConfig(config)\r\n }\r\n subscribeToRemoveEvent(animation);\r\n return animation\r\n};\r\nvar animate = function(element, config) {\r\n var $element = $(element);\r\n if (!$element.length) {\r\n return (new Deferred).resolve().promise()\r\n }\r\n var animation = createAnimation($element, config);\r\n pushInAnimationQueue($element, animation);\r\n return animation.deferred.promise()\r\n};\r\n\r\nfunction pushInAnimationQueue($element, animation) {\r\n var queueData = getAnimQueueData($element);\r\n writeAnimQueueData($element, queueData);\r\n queueData.push(animation);\r\n if (!isAnimating($element)) {\r\n shiftFromAnimationQueue($element, queueData)\r\n }\r\n}\r\n\r\nfunction getAnimQueueData($element) {\r\n return $element.data(ANIM_QUEUE_KEY) || []\r\n}\r\n\r\nfunction writeAnimQueueData($element, queueData) {\r\n $element.data(ANIM_QUEUE_KEY, queueData)\r\n}\r\nvar destroyAnimQueueData = function($element) {\r\n $element.removeData(ANIM_QUEUE_KEY)\r\n};\r\n\r\nfunction isAnimating($element) {\r\n return !!$element.data(ANIM_DATA_KEY)\r\n}\r\n\r\nfunction shiftFromAnimationQueue($element, queueData) {\r\n queueData = getAnimQueueData($element);\r\n if (!queueData.length) {\r\n return\r\n }\r\n var animation = queueData.shift();\r\n if (0 === queueData.length) {\r\n destroyAnimQueueData($element)\r\n }\r\n executeAnimation(animation).done((function() {\r\n if (!isAnimating($element)) {\r\n shiftFromAnimationQueue($element)\r\n }\r\n }))\r\n}\r\n\r\nfunction executeAnimation(animation) {\r\n animation.setup();\r\n if (fx.off || animation.isSynchronous) {\r\n animation.start()\r\n } else {\r\n animation.startTimeout = setTimeout((function() {\r\n animation.start()\r\n }))\r\n }\r\n return animation.deferred.promise()\r\n}\r\n\r\nfunction setupPosition($element, config) {\r\n if (!config || !config.position) {\r\n return\r\n }\r\n var win = $(window);\r\n var left = 0;\r\n var top = 0;\r\n var position = positionUtils.calculate($element, config.position);\r\n var offset = $element.offset();\r\n var currentPosition = $element.position();\r\n if (currentPosition.top > offset.top) {\r\n top = win.scrollTop()\r\n }\r\n if (currentPosition.left > offset.left) {\r\n left = win.scrollLeft()\r\n }\r\n extend(config, {\r\n left: position.h.location - offset.left + currentPosition.left - left,\r\n top: position.v.location - offset.top + currentPosition.top - top\r\n });\r\n delete config.position\r\n}\r\n\r\nfunction setProps($element, props) {\r\n each(props, (function(key, value) {\r\n try {\r\n $element.css(key, isFunction(value) ? value() : value)\r\n } catch (e) {}\r\n }))\r\n}\r\nvar stop = function(element, jumpToEnd) {\r\n var $element = $(element);\r\n var queueData = getAnimQueueData($element);\r\n each(queueData, (function(_, animation) {\r\n animation.config.delay = 0;\r\n animation.config.duration = 0;\r\n animation.isSynchronous = true\r\n }));\r\n if (!isAnimating($element)) {\r\n shiftFromAnimationQueue($element, queueData)\r\n }\r\n var animation = $element.data(ANIM_DATA_KEY);\r\n if (animation) {\r\n animation.stop(jumpToEnd)\r\n }\r\n $element.removeData(ANIM_DATA_KEY);\r\n destroyAnimQueueData($element)\r\n};\r\nvar fx = {\r\n off: false,\r\n animationTypes: animationConfigurators,\r\n animate: animate,\r\n createAnimation: createAnimation,\r\n isAnimating: isAnimating,\r\n stop: stop,\r\n _simulatedTransitionEndDelay: 100\r\n};\r\nexport default fx;\r\n","/**\r\n * DevExtreme (esm/animation/position.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n getOuterWidth,\r\n getOuterHeight,\r\n getWidth,\r\n getHeight\r\n} from \"../core/utils/size\";\r\nimport $ from \"../core/renderer\";\r\nimport {\r\n splitPair,\r\n pairToObject\r\n} from \"../core/utils/common\";\r\nimport {\r\n each\r\n} from \"../core/utils/iterator\";\r\nimport {\r\n getWindow\r\n} from \"../core/utils/window\";\r\nvar window = getWindow();\r\nimport domAdapter from \"../core/dom_adapter\";\r\nimport {\r\n isWindow,\r\n isDefined\r\n} from \"../core/utils/type\";\r\nimport {\r\n extend\r\n} from \"../core/utils/extend\";\r\nimport {\r\n getBoundingRect\r\n} from \"../core/utils/position\";\r\nimport browser from \"../core/utils/browser\";\r\nimport {\r\n resetPosition,\r\n move\r\n} from \"./translator\";\r\nimport {\r\n touch\r\n} from \"../core/utils/support\";\r\nimport devices from \"../core/devices\";\r\nimport {\r\n setStyle\r\n} from \"../core/utils/style\";\r\nvar horzRe = /left|right/;\r\nvar vertRe = /top|bottom/;\r\nvar collisionRe = /fit|flip|none/;\r\nvar scaleRe = /scale\\(.+?\\)/;\r\nvar IS_SAFARI = browser.safari;\r\nvar normalizeAlign = function(raw) {\r\n var result = {\r\n h: \"center\",\r\n v: \"center\"\r\n };\r\n var pair = splitPair(raw);\r\n if (pair) {\r\n each(pair, (function() {\r\n var w = String(this).toLowerCase();\r\n if (horzRe.test(w)) {\r\n result.h = w\r\n } else if (vertRe.test(w)) {\r\n result.v = w\r\n }\r\n }))\r\n }\r\n return result\r\n};\r\nvar normalizeOffset = function(raw) {\r\n return pairToObject(raw)\r\n};\r\nvar normalizeCollision = function(raw) {\r\n var pair = splitPair(raw);\r\n var h = String(pair && pair[0]).toLowerCase();\r\n var v = String(pair && pair[1]).toLowerCase();\r\n if (!collisionRe.test(h)) {\r\n h = \"none\"\r\n }\r\n if (!collisionRe.test(v)) {\r\n v = h\r\n }\r\n return {\r\n h: h,\r\n v: v\r\n }\r\n};\r\nvar getAlignFactor = function(align) {\r\n switch (align) {\r\n case \"center\":\r\n return .5;\r\n case \"right\":\r\n case \"bottom\":\r\n return 1;\r\n default:\r\n return 0\r\n }\r\n};\r\nvar inverseAlign = function(align) {\r\n switch (align) {\r\n case \"left\":\r\n return \"right\";\r\n case \"right\":\r\n return \"left\";\r\n case \"top\":\r\n return \"bottom\";\r\n case \"bottom\":\r\n return \"top\";\r\n default:\r\n return align\r\n }\r\n};\r\nvar calculateOversize = function(data, bounds) {\r\n var oversize = 0;\r\n if (data.myLocation < bounds.min) {\r\n oversize += bounds.min - data.myLocation\r\n }\r\n if (data.myLocation > bounds.max) {\r\n oversize += data.myLocation - bounds.max\r\n }\r\n return oversize\r\n};\r\nvar collisionSide = function(direction, data, bounds) {\r\n if (data.myLocation < bounds.min) {\r\n return \"h\" === direction ? \"left\" : \"top\"\r\n }\r\n if (data.myLocation > bounds.max) {\r\n return \"h\" === direction ? \"right\" : \"bottom\"\r\n }\r\n return \"none\"\r\n};\r\nvar initMyLocation = function(data) {\r\n data.myLocation = data.atLocation + getAlignFactor(data.atAlign) * data.atSize - getAlignFactor(data.myAlign) * data.mySize + data.offset\r\n};\r\nvar collisionResolvers = {\r\n fit: function(data, bounds) {\r\n var result = false;\r\n if (data.myLocation > bounds.max) {\r\n data.myLocation = bounds.max;\r\n result = true\r\n }\r\n if (data.myLocation < bounds.min) {\r\n data.myLocation = bounds.min;\r\n result = true\r\n }\r\n data.fit = result\r\n },\r\n flip: function(data, bounds) {\r\n data.flip = false;\r\n if (\"center\" === data.myAlign && \"center\" === data.atAlign) {\r\n return\r\n }\r\n if (data.myLocation < bounds.min || data.myLocation > bounds.max) {\r\n var inverseData = extend({}, data, {\r\n myAlign: inverseAlign(data.myAlign),\r\n atAlign: inverseAlign(data.atAlign),\r\n offset: -data.offset\r\n });\r\n initMyLocation(inverseData);\r\n inverseData.oversize = calculateOversize(inverseData, bounds);\r\n if (inverseData.myLocation >= bounds.min && inverseData.myLocation <= bounds.max || data.oversize > inverseData.oversize) {\r\n data.myLocation = inverseData.myLocation;\r\n data.oversize = inverseData.oversize;\r\n data.flip = true\r\n }\r\n }\r\n },\r\n flipfit: function(data, bounds) {\r\n this.flip(data, bounds);\r\n this.fit(data, bounds)\r\n },\r\n none: function(data) {\r\n data.oversize = 0\r\n }\r\n};\r\nvar scrollbarWidth;\r\nvar calculateScrollbarWidth = function() {\r\n var $scrollDiv = $(\"
\").css({\r\n width: 100,\r\n height: 100,\r\n overflow: \"scroll\",\r\n position: \"absolute\",\r\n top: -9999\r\n }).appendTo($(\"body\"));\r\n var result = $scrollDiv.get(0).offsetWidth - $scrollDiv.get(0).clientWidth;\r\n $scrollDiv.remove();\r\n scrollbarWidth = result\r\n};\r\nvar defaultPositionResult = {\r\n h: {\r\n location: 0,\r\n flip: false,\r\n fit: false,\r\n oversize: 0\r\n },\r\n v: {\r\n location: 0,\r\n flip: false,\r\n fit: false,\r\n oversize: 0\r\n }\r\n};\r\nvar calculatePosition = function(what, options) {\r\n var $what = $(what);\r\n var currentOffset = $what.offset();\r\n var result = extend(true, {}, defaultPositionResult, {\r\n h: {\r\n location: currentOffset.left\r\n },\r\n v: {\r\n location: currentOffset.top\r\n }\r\n });\r\n if (!options) {\r\n return result\r\n }\r\n var my = normalizeAlign(options.my);\r\n var at = normalizeAlign(options.at);\r\n var of = $(options.of).length && options.of || window;\r\n var offset = normalizeOffset(options.offset);\r\n var collision = normalizeCollision(options.collision);\r\n var boundary = options.boundary;\r\n var boundaryOffset = normalizeOffset(options.boundaryOffset);\r\n var h = {\r\n mySize: getOuterWidth($what),\r\n myAlign: my.h,\r\n atAlign: at.h,\r\n offset: offset.h,\r\n collision: collision.h,\r\n boundaryOffset: boundaryOffset.h\r\n };\r\n var v = {\r\n mySize: getOuterHeight($what),\r\n myAlign: my.v,\r\n atAlign: at.v,\r\n offset: offset.v,\r\n collision: collision.v,\r\n boundaryOffset: boundaryOffset.v\r\n };\r\n if (of.preventDefault) {\r\n h.atLocation = of.pageX;\r\n v.atLocation = of.pageY;\r\n h.atSize = 0;\r\n v.atSize = 0\r\n } else {\r\n of = $(of);\r\n if (isWindow(of [0])) {\r\n h.atLocation = of.scrollLeft();\r\n v.atLocation = of.scrollTop();\r\n if (\"phone\" === devices.real().deviceType && of [0].visualViewport) {\r\n h.atLocation = Math.max(h.atLocation, of [0].visualViewport.offsetLeft);\r\n v.atLocation = Math.max(v.atLocation, of [0].visualViewport.offsetTop);\r\n h.atSize = of [0].visualViewport.width;\r\n v.atSize = of [0].visualViewport.height\r\n } else {\r\n h.atSize = of [0].innerWidth > of [0].outerWidth ? of [0].innerWidth : getWidth(of);\r\n v.atSize = of [0].innerHeight > of [0].outerHeight || IS_SAFARI ? of [0].innerHeight : getHeight(of)\r\n }\r\n } else if (9 === of [0].nodeType) {\r\n h.atLocation = 0;\r\n v.atLocation = 0;\r\n h.atSize = getWidth(of);\r\n v.atSize = getHeight(of)\r\n } else {\r\n var ofRect = getBoundingRect(of.get(0));\r\n var o = getOffsetWithoutScale(of);\r\n h.atLocation = o.left;\r\n v.atLocation = o.top;\r\n h.atSize = Math.max(ofRect.width, getOuterWidth(of));\r\n v.atSize = Math.max(ofRect.height, getOuterHeight(of))\r\n }\r\n }\r\n initMyLocation(h);\r\n initMyLocation(v);\r\n var bounds = function() {\r\n var win = $(window);\r\n var windowWidth = getWidth(win);\r\n var windowHeight = getHeight(win);\r\n var left = win.scrollLeft();\r\n var top = win.scrollTop();\r\n var documentElement = domAdapter.getDocumentElement();\r\n var hZoomLevel = touch ? documentElement.clientWidth / windowWidth : 1;\r\n var vZoomLevel = touch ? documentElement.clientHeight / windowHeight : 1;\r\n if (void 0 === scrollbarWidth) {\r\n calculateScrollbarWidth()\r\n }\r\n var boundaryWidth = windowWidth;\r\n var boundaryHeight = windowHeight;\r\n if (boundary && !isWindow(boundary)) {\r\n var $boundary = $(boundary);\r\n var boundaryPosition = $boundary.offset();\r\n left = boundaryPosition.left;\r\n top = boundaryPosition.top;\r\n boundaryWidth = getWidth($boundary);\r\n boundaryHeight = getHeight($boundary)\r\n }\r\n return {\r\n h: {\r\n min: left + h.boundaryOffset,\r\n max: left + boundaryWidth / hZoomLevel - h.mySize - h.boundaryOffset\r\n },\r\n v: {\r\n min: top + v.boundaryOffset,\r\n max: top + boundaryHeight / vZoomLevel - v.mySize - v.boundaryOffset\r\n }\r\n }\r\n }();\r\n h.oversize = calculateOversize(h, bounds.h);\r\n v.oversize = calculateOversize(v, bounds.v);\r\n h.collisionSide = collisionSide(\"h\", h, bounds.h);\r\n v.collisionSide = collisionSide(\"v\", v, bounds.v);\r\n if (collisionResolvers[h.collision]) {\r\n collisionResolvers[h.collision](h, bounds.h)\r\n }\r\n if (collisionResolvers[v.collision]) {\r\n collisionResolvers[v.collision](v, bounds.v)\r\n }\r\n var preciser = function(number) {\r\n return options.precise ? number : Math.round(number)\r\n };\r\n extend(true, result, {\r\n h: {\r\n location: preciser(h.myLocation),\r\n oversize: preciser(h.oversize),\r\n fit: h.fit,\r\n flip: h.flip,\r\n collisionSide: h.collisionSide\r\n },\r\n v: {\r\n location: preciser(v.myLocation),\r\n oversize: preciser(v.oversize),\r\n fit: v.fit,\r\n flip: v.flip,\r\n collisionSide: v.collisionSide\r\n },\r\n precise: options.precise\r\n });\r\n return result\r\n};\r\nvar setScaleProperty = function(element, scale, styleAttr, isEmpty) {\r\n var stylePropIsValid = isDefined(element.style) && !domAdapter.isNode(element.style);\r\n var newStyleValue = isEmpty ? styleAttr.replace(scale, \"\") : styleAttr;\r\n if (stylePropIsValid) {\r\n setStyle(element, newStyleValue, false)\r\n } else {\r\n var styleAttributeNode = domAdapter.createAttribute(\"style\");\r\n styleAttributeNode.value = newStyleValue;\r\n element.setAttributeNode(styleAttributeNode)\r\n }\r\n};\r\nvar getOffsetWithoutScale = function getOffsetWithoutScale($startElement) {\r\n var _currentElement$getAt, _style$match;\r\n var $currentElement = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : $startElement;\r\n var currentElement = $currentElement.get(0);\r\n if (!currentElement) {\r\n return $startElement.offset()\r\n }\r\n var style = (null === (_currentElement$getAt = currentElement.getAttribute) || void 0 === _currentElement$getAt ? void 0 : _currentElement$getAt.call(currentElement, \"style\")) || \"\";\r\n var scale = null === (_style$match = style.match(scaleRe)) || void 0 === _style$match ? void 0 : _style$match[0];\r\n var offset;\r\n if (scale) {\r\n setScaleProperty(currentElement, scale, style, true);\r\n offset = getOffsetWithoutScale($startElement, $currentElement.parent());\r\n setScaleProperty(currentElement, scale, style, false)\r\n } else {\r\n offset = getOffsetWithoutScale($startElement, $currentElement.parent())\r\n }\r\n return offset\r\n};\r\nvar position = function(what, options) {\r\n var $what = $(what);\r\n if (!options) {\r\n return $what.offset()\r\n }\r\n resetPosition($what, true);\r\n var offset = getOffsetWithoutScale($what);\r\n var targetPosition = options.h && options.v ? options : calculatePosition($what, options);\r\n var preciser = function(number) {\r\n return options.precise ? number : Math.round(number)\r\n };\r\n move($what, {\r\n left: targetPosition.h.location - preciser(offset.left),\r\n top: targetPosition.v.location - preciser(offset.top)\r\n });\r\n return targetPosition\r\n};\r\nvar offset = function(element) {\r\n element = $(element).get(0);\r\n if (isWindow(element)) {\r\n return null\r\n } else if (element && \"pageY\" in element && \"pageX\" in element) {\r\n return {\r\n top: element.pageY,\r\n left: element.pageX\r\n }\r\n }\r\n return $(element).offset()\r\n};\r\nif (!position.inverseAlign) {\r\n position.inverseAlign = inverseAlign\r\n}\r\nif (!position.normalizeAlign) {\r\n position.normalizeAlign = normalizeAlign\r\n}\r\nexport default {\r\n calculateScrollbarWidth: calculateScrollbarWidth,\r\n calculate: calculatePosition,\r\n setup: position,\r\n offset: offset\r\n};\r\n","/**\r\n * DevExtreme (esm/animation/translator.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport $ from \"../core/renderer\";\r\nimport {\r\n data as elementData,\r\n removeData\r\n} from \"../core/element_data\";\r\nimport {\r\n type\r\n} from \"../core/utils/type\";\r\nvar TRANSLATOR_DATA_KEY = \"dxTranslator\";\r\nvar TRANSFORM_MATRIX_REGEX = /matrix(3d)?\\((.+?)\\)/;\r\nvar TRANSLATE_REGEX = /translate(?:3d)?\\((.+?)\\)/;\r\nexport var locate = function($element) {\r\n $element = $($element);\r\n var translate = getTranslate($element);\r\n return {\r\n left: translate.x,\r\n top: translate.y\r\n }\r\n};\r\n\r\nfunction isPercentValue(value) {\r\n return \"string\" === type(value) && \"%\" === value[value.length - 1]\r\n}\r\n\r\nfunction cacheTranslate($element, translate) {\r\n if ($element.length) {\r\n elementData($element.get(0), TRANSLATOR_DATA_KEY, translate)\r\n }\r\n}\r\nexport var clearCache = function($element) {\r\n if ($element.length) {\r\n removeData($element.get(0), TRANSLATOR_DATA_KEY)\r\n }\r\n};\r\nexport var getTranslateCss = function(translate) {\r\n translate.x = translate.x || 0;\r\n translate.y = translate.y || 0;\r\n var xValueString = isPercentValue(translate.x) ? translate.x : translate.x + \"px\";\r\n var yValueString = isPercentValue(translate.y) ? translate.y : translate.y + \"px\";\r\n return \"translate(\" + xValueString + \", \" + yValueString + \")\"\r\n};\r\nexport var getTranslate = function($element) {\r\n var result = $element.length ? elementData($element.get(0), TRANSLATOR_DATA_KEY) : null;\r\n if (!result) {\r\n var transformValue = $element.css(\"transform\") || getTranslateCss({\r\n x: 0,\r\n y: 0\r\n });\r\n var matrix = transformValue.match(TRANSFORM_MATRIX_REGEX);\r\n var is3D = matrix && matrix[1];\r\n if (matrix) {\r\n matrix = matrix[2].split(\",\");\r\n if (\"3d\" === is3D) {\r\n matrix = matrix.slice(12, 15)\r\n } else {\r\n matrix.push(0);\r\n matrix = matrix.slice(4, 7)\r\n }\r\n } else {\r\n matrix = [0, 0, 0]\r\n }\r\n result = {\r\n x: parseFloat(matrix[0]),\r\n y: parseFloat(matrix[1]),\r\n z: parseFloat(matrix[2])\r\n };\r\n cacheTranslate($element, result)\r\n }\r\n return result\r\n};\r\nexport var move = function($element, position) {\r\n $element = $($element);\r\n var left = position.left;\r\n var top = position.top;\r\n var translate;\r\n if (void 0 === left) {\r\n translate = getTranslate($element);\r\n translate.y = top || 0\r\n } else if (void 0 === top) {\r\n translate = getTranslate($element);\r\n translate.x = left || 0\r\n } else {\r\n translate = {\r\n x: left || 0,\r\n y: top || 0,\r\n z: 0\r\n };\r\n cacheTranslate($element, translate)\r\n }\r\n $element.css({\r\n transform: getTranslateCss(translate)\r\n });\r\n if (isPercentValue(left) || isPercentValue(top)) {\r\n clearCache($element)\r\n }\r\n};\r\nexport var resetPosition = function($element, finishTransition) {\r\n $element = $($element);\r\n var originalTransition;\r\n var stylesConfig = {\r\n left: 0,\r\n top: 0,\r\n transform: \"none\"\r\n };\r\n if (finishTransition) {\r\n originalTransition = $element.css(\"transition\");\r\n stylesConfig.transition = \"none\"\r\n }\r\n $element.css(stylesConfig);\r\n clearCache($element);\r\n if (finishTransition) {\r\n $element.get(0).offsetHeight;\r\n $element.css(\"transition\", originalTransition)\r\n }\r\n};\r\nexport var parseTranslate = function(translateString) {\r\n var result = translateString.match(TRANSLATE_REGEX);\r\n if (!result || !result[1]) {\r\n return\r\n }\r\n result = result[1].split(\",\");\r\n result = {\r\n x: parseFloat(result[0]),\r\n y: parseFloat(result[1]),\r\n z: parseFloat(result[2])\r\n };\r\n return result\r\n};\r\n","/**\r\n * DevExtreme (esm/color.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nvar standardColorNames = {\r\n aliceblue: \"f0f8ff\",\r\n antiquewhite: \"faebd7\",\r\n aqua: \"00ffff\",\r\n aquamarine: \"7fffd4\",\r\n azure: \"f0ffff\",\r\n beige: \"f5f5dc\",\r\n bisque: \"ffe4c4\",\r\n black: \"000000\",\r\n blanchedalmond: \"ffebcd\",\r\n blue: \"0000ff\",\r\n blueviolet: \"8a2be2\",\r\n brown: \"a52a2a\",\r\n burlywood: \"deb887\",\r\n cadetblue: \"5f9ea0\",\r\n chartreuse: \"7fff00\",\r\n chocolate: \"d2691e\",\r\n coral: \"ff7f50\",\r\n cornflowerblue: \"6495ed\",\r\n cornsilk: \"fff8dc\",\r\n crimson: \"dc143c\",\r\n cyan: \"00ffff\",\r\n darkblue: \"00008b\",\r\n darkcyan: \"008b8b\",\r\n darkgoldenrod: \"b8860b\",\r\n darkgray: \"a9a9a9\",\r\n darkgreen: \"006400\",\r\n darkgrey: \"a9a9a9\",\r\n darkkhaki: \"bdb76b\",\r\n darkmagenta: \"8b008b\",\r\n darkolivegreen: \"556b2f\",\r\n darkorange: \"ff8c00\",\r\n darkorchid: \"9932cc\",\r\n darkred: \"8b0000\",\r\n darksalmon: \"e9967a\",\r\n darkseagreen: \"8fbc8f\",\r\n darkslateblue: \"483d8b\",\r\n darkslategray: \"2f4f4f\",\r\n darkslategrey: \"2f4f4f\",\r\n darkturquoise: \"00ced1\",\r\n darkviolet: \"9400d3\",\r\n deeppink: \"ff1493\",\r\n deepskyblue: \"00bfff\",\r\n dimgray: \"696969\",\r\n dimgrey: \"696969\",\r\n dodgerblue: \"1e90ff\",\r\n feldspar: \"d19275\",\r\n firebrick: \"b22222\",\r\n floralwhite: \"fffaf0\",\r\n forestgreen: \"228b22\",\r\n fuchsia: \"ff00ff\",\r\n gainsboro: \"dcdcdc\",\r\n ghostwhite: \"f8f8ff\",\r\n gold: \"ffd700\",\r\n goldenrod: \"daa520\",\r\n gray: \"808080\",\r\n green: \"008000\",\r\n greenyellow: \"adff2f\",\r\n grey: \"808080\",\r\n honeydew: \"f0fff0\",\r\n hotpink: \"ff69b4\",\r\n indianred: \"cd5c5c\",\r\n indigo: \"4b0082\",\r\n ivory: \"fffff0\",\r\n khaki: \"f0e68c\",\r\n lavender: \"e6e6fa\",\r\n lavenderblush: \"fff0f5\",\r\n lawngreen: \"7cfc00\",\r\n lemonchiffon: \"fffacd\",\r\n lightblue: \"add8e6\",\r\n lightcoral: \"f08080\",\r\n lightcyan: \"e0ffff\",\r\n lightgoldenrodyellow: \"fafad2\",\r\n lightgray: \"d3d3d3\",\r\n lightgreen: \"90ee90\",\r\n lightgrey: \"d3d3d3\",\r\n lightpink: \"ffb6c1\",\r\n lightsalmon: \"ffa07a\",\r\n lightseagreen: \"20b2aa\",\r\n lightskyblue: \"87cefa\",\r\n lightslateblue: \"8470ff\",\r\n lightslategray: \"778899\",\r\n lightslategrey: \"778899\",\r\n lightsteelblue: \"b0c4de\",\r\n lightyellow: \"ffffe0\",\r\n lime: \"00ff00\",\r\n limegreen: \"32cd32\",\r\n linen: \"faf0e6\",\r\n magenta: \"ff00ff\",\r\n maroon: \"800000\",\r\n mediumaquamarine: \"66cdaa\",\r\n mediumblue: \"0000cd\",\r\n mediumorchid: \"ba55d3\",\r\n mediumpurple: \"9370d8\",\r\n mediumseagreen: \"3cb371\",\r\n mediumslateblue: \"7b68ee\",\r\n mediumspringgreen: \"00fa9a\",\r\n mediumturquoise: \"48d1cc\",\r\n mediumvioletred: \"c71585\",\r\n midnightblue: \"191970\",\r\n mintcream: \"f5fffa\",\r\n mistyrose: \"ffe4e1\",\r\n moccasin: \"ffe4b5\",\r\n navajowhite: \"ffdead\",\r\n navy: \"000080\",\r\n oldlace: \"fdf5e6\",\r\n olive: \"808000\",\r\n olivedrab: \"6b8e23\",\r\n orange: \"ffa500\",\r\n orangered: \"ff4500\",\r\n orchid: \"da70d6\",\r\n palegoldenrod: \"eee8aa\",\r\n palegreen: \"98fb98\",\r\n paleturquoise: \"afeeee\",\r\n palevioletred: \"d87093\",\r\n papayawhip: \"ffefd5\",\r\n peachpuff: \"ffdab9\",\r\n peru: \"cd853f\",\r\n pink: \"ffc0cb\",\r\n plum: \"dda0dd\",\r\n powderblue: \"b0e0e6\",\r\n purple: \"800080\",\r\n rebeccapurple: \"663399\",\r\n red: \"ff0000\",\r\n rosybrown: \"bc8f8f\",\r\n royalblue: \"4169e1\",\r\n saddlebrown: \"8b4513\",\r\n salmon: \"fa8072\",\r\n sandybrown: \"f4a460\",\r\n seagreen: \"2e8b57\",\r\n seashell: \"fff5ee\",\r\n sienna: \"a0522d\",\r\n silver: \"c0c0c0\",\r\n skyblue: \"87ceeb\",\r\n slateblue: \"6a5acd\",\r\n slategray: \"708090\",\r\n slategrey: \"708090\",\r\n snow: \"fffafa\",\r\n springgreen: \"00ff7f\",\r\n steelblue: \"4682b4\",\r\n tan: \"d2b48c\",\r\n teal: \"008080\",\r\n thistle: \"d8bfd8\",\r\n tomato: \"ff6347\",\r\n turquoise: \"40e0d0\",\r\n violet: \"ee82ee\",\r\n violetred: \"d02090\",\r\n wheat: \"f5deb3\",\r\n white: \"ffffff\",\r\n whitesmoke: \"f5f5f5\",\r\n yellow: \"ffff00\",\r\n yellowgreen: \"9acd32\"\r\n};\r\nvar standardColorTypes = [{\r\n re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\r\n process: function(colorString) {\r\n return [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10)]\r\n }\r\n}, {\r\n re: /^rgba\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d*\\.*\\d+)\\)$/,\r\n process: function(colorString) {\r\n return [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10), parseFloat(colorString[4])]\r\n }\r\n}, {\r\n re: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/,\r\n process: function(colorString) {\r\n return [parseInt(colorString[1], 16), parseInt(colorString[2], 16), parseInt(colorString[3], 16)]\r\n }\r\n}, {\r\n re: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/,\r\n process: function(colorString) {\r\n return [parseInt(colorString[1], 16), parseInt(colorString[2], 16), parseInt(colorString[3], 16), Number((parseInt(colorString[4], 16) / 255).toFixed(2))]\r\n }\r\n}, {\r\n re: /^#([a-f0-9]{1})([a-f0-9]{1})([a-f0-9]{1})([a-f0-9]{1})$/,\r\n process: function(colorString) {\r\n return [parseInt(colorString[1] + colorString[1], 16), parseInt(colorString[2] + colorString[2], 16), parseInt(colorString[3] + colorString[3], 16), Number((parseInt(colorString[4] + colorString[4], 16) / 255).toFixed(2))]\r\n }\r\n}, {\r\n re: /^#([a-f0-9]{1})([a-f0-9]{1})([a-f0-9]{1})$/,\r\n process: function(colorString) {\r\n return [parseInt(colorString[1] + colorString[1], 16), parseInt(colorString[2] + colorString[2], 16), parseInt(colorString[3] + colorString[3], 16)]\r\n }\r\n}, {\r\n re: /^hsv\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\r\n process: function(colorString) {\r\n var h = parseInt(colorString[1], 10);\r\n var s = parseInt(colorString[2], 10);\r\n var v = parseInt(colorString[3], 10);\r\n var rgb = hsvToRgb(h, s, v);\r\n return [rgb[0], rgb[1], rgb[2], 1, [h, s, v]]\r\n }\r\n}, {\r\n re: /^hsl\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\r\n process: function(colorString) {\r\n var h = parseInt(colorString[1], 10);\r\n var s = parseInt(colorString[2], 10);\r\n var l = parseInt(colorString[3], 10);\r\n var rgb = hslToRgb(h, s, l);\r\n return [rgb[0], rgb[1], rgb[2], 1, null, [h, s, l]]\r\n }\r\n}];\r\nvar _round = Math.round;\r\n\r\nfunction Color(value) {\r\n this.baseColor = value;\r\n var color;\r\n if (value) {\r\n color = String(value).toLowerCase().replace(/ /g, \"\");\r\n color = standardColorNames[color] ? \"#\" + standardColorNames[color] : color;\r\n color = parseColor(color)\r\n }\r\n if (!color) {\r\n this.colorIsInvalid = true\r\n }\r\n color = color || {};\r\n this.r = normalize(color[0]);\r\n this.g = normalize(color[1]);\r\n this.b = normalize(color[2]);\r\n this.a = normalize(color[3], 1, 1);\r\n if (color[4]) {\r\n this.hsv = {\r\n h: color[4][0],\r\n s: color[4][1],\r\n v: color[4][2]\r\n }\r\n } else {\r\n this.hsv = toHsvFromRgb(this.r, this.g, this.b)\r\n }\r\n if (color[5]) {\r\n this.hsl = {\r\n h: color[5][0],\r\n s: color[5][1],\r\n l: color[5][2]\r\n }\r\n } else {\r\n this.hsl = toHslFromRgb(this.r, this.g, this.b)\r\n }\r\n}\r\n\r\nfunction parseColor(color) {\r\n if (\"transparent\" === color) {\r\n return [0, 0, 0, 0]\r\n }\r\n var i = 0;\r\n var ii = standardColorTypes.length;\r\n var str;\r\n for (; i < ii; ++i) {\r\n str = standardColorTypes[i].re.exec(color);\r\n if (str) {\r\n return standardColorTypes[i].process(str)\r\n }\r\n }\r\n return null\r\n}\r\n\r\nfunction normalize(colorComponent, def, max) {\r\n def = def || 0;\r\n max = max || 255;\r\n return colorComponent < 0 || isNaN(colorComponent) ? def : colorComponent > max ? max : colorComponent\r\n}\r\n\r\nfunction toHexFromRgb(r, g, b) {\r\n return \"#\" + (16777216 | r << 16 | g << 8 | b).toString(16).slice(1)\r\n}\r\n\r\nfunction toHsvFromRgb(r, g, b) {\r\n var max = Math.max(r, g, b);\r\n var min = Math.min(r, g, b);\r\n var delta = max - min;\r\n var H;\r\n var S;\r\n var V = max;\r\n S = 0 === max ? 0 : 1 - min / max;\r\n if (max === min) {\r\n H = 0\r\n } else {\r\n switch (max) {\r\n case r:\r\n H = (g - b) / delta * 60;\r\n if (g < b) {\r\n H += 360\r\n }\r\n break;\r\n case g:\r\n H = (b - r) / delta * 60 + 120;\r\n break;\r\n case b:\r\n H = (r - g) / delta * 60 + 240\r\n }\r\n }\r\n S *= 100;\r\n V *= 100 / 255;\r\n return {\r\n h: Math.round(H),\r\n s: Math.round(S),\r\n v: Math.round(V)\r\n }\r\n}\r\n\r\nfunction hsvToRgb(h, s, v) {\r\n var index = Math.floor(h % 360 / 60);\r\n var vMin = (100 - s) * v / 100;\r\n var a = h % 60 / 60 * (v - vMin);\r\n var vInc = vMin + a;\r\n var vDec = v - a;\r\n var r;\r\n var g;\r\n var b;\r\n switch (index) {\r\n case 0:\r\n r = v;\r\n g = vInc;\r\n b = vMin;\r\n break;\r\n case 1:\r\n r = vDec;\r\n g = v;\r\n b = vMin;\r\n break;\r\n case 2:\r\n r = vMin;\r\n g = v;\r\n b = vInc;\r\n break;\r\n case 3:\r\n r = vMin;\r\n g = vDec;\r\n b = v;\r\n break;\r\n case 4:\r\n r = vInc;\r\n g = vMin;\r\n b = v;\r\n break;\r\n case 5:\r\n r = v;\r\n g = vMin;\r\n b = vDec\r\n }\r\n return [Math.round(2.55 * r), Math.round(2.55 * g), Math.round(2.55 * b)]\r\n}\r\n\r\nfunction calculateHue(r, g, b, delta) {\r\n var max = Math.max(r, g, b);\r\n switch (max) {\r\n case r:\r\n return (g - b) / delta + (g < b ? 6 : 0);\r\n case g:\r\n return (b - r) / delta + 2;\r\n case b:\r\n return (r - g) / delta + 4\r\n }\r\n}\r\n\r\nfunction toHslFromRgb(r, g, b) {\r\n r = convertTo01Bounds(r, 255);\r\n g = convertTo01Bounds(g, 255);\r\n b = convertTo01Bounds(b, 255);\r\n var max = Math.max(r, g, b);\r\n var min = Math.min(r, g, b);\r\n var maxMinSum = max + min;\r\n var h;\r\n var s;\r\n var l = maxMinSum / 2;\r\n if (max === min) {\r\n h = s = 0\r\n } else {\r\n var delta = max - min;\r\n if (l > .5) {\r\n s = delta / (2 - maxMinSum)\r\n } else {\r\n s = delta / maxMinSum\r\n }\r\n h = calculateHue(r, g, b, delta);\r\n h /= 6\r\n }\r\n return {\r\n h: _round(360 * h),\r\n s: _round(100 * s),\r\n l: _round(100 * l)\r\n }\r\n}\r\n\r\nfunction makeColorTint(colorPart, h) {\r\n var colorTint = h;\r\n if (\"r\" === colorPart) {\r\n colorTint = h + 1 / 3\r\n }\r\n if (\"b\" === colorPart) {\r\n colorTint = h - 1 / 3\r\n }\r\n return colorTint\r\n}\r\n\r\nfunction modifyColorTint(colorTint) {\r\n if (colorTint < 0) {\r\n colorTint += 1\r\n }\r\n if (colorTint > 1) {\r\n colorTint -= 1\r\n }\r\n return colorTint\r\n}\r\n\r\nfunction hueToRgb(p, q, colorTint) {\r\n colorTint = modifyColorTint(colorTint);\r\n if (colorTint < 1 / 6) {\r\n return p + 6 * (q - p) * colorTint\r\n }\r\n if (colorTint < .5) {\r\n return q\r\n }\r\n if (colorTint < 2 / 3) {\r\n return p + (q - p) * (2 / 3 - colorTint) * 6\r\n }\r\n return p\r\n}\r\n\r\nfunction hslToRgb(h, s, l) {\r\n var r;\r\n var g;\r\n var b;\r\n h = convertTo01Bounds(h, 360);\r\n s = convertTo01Bounds(s, 100);\r\n l = convertTo01Bounds(l, 100);\r\n if (0 === s) {\r\n r = g = b = l\r\n } else {\r\n var q = l < .5 ? l * (1 + s) : l + s - l * s;\r\n var p = 2 * l - q;\r\n r = hueToRgb(p, q, makeColorTint(\"r\", h));\r\n g = hueToRgb(p, q, makeColorTint(\"g\", h));\r\n b = hueToRgb(p, q, makeColorTint(\"b\", h))\r\n }\r\n return [_round(255 * r), _round(255 * g), _round(255 * b)]\r\n}\r\n\r\nfunction convertTo01Bounds(n, max) {\r\n n = Math.min(max, Math.max(0, parseFloat(n)));\r\n if (Math.abs(n - max) < 1e-6) {\r\n return 1\r\n }\r\n return n % max / parseFloat(max)\r\n}\r\n\r\nfunction isIntegerBetweenMinAndMax(number, min, max) {\r\n min = min || 0;\r\n max = max || 255;\r\n if (number % 1 !== 0 || number < min || number > max || \"number\" !== typeof number || isNaN(number)) {\r\n return false\r\n }\r\n return true\r\n}\r\nColor.prototype = {\r\n constructor: Color,\r\n highlight: function(step) {\r\n step = step || 10;\r\n return this.alter(step).toHex()\r\n },\r\n darken: function(step) {\r\n step = step || 10;\r\n return this.alter(-step).toHex()\r\n },\r\n alter: function(step) {\r\n var result = new Color;\r\n result.r = normalize(this.r + step);\r\n result.g = normalize(this.g + step);\r\n result.b = normalize(this.b + step);\r\n return result\r\n },\r\n blend: function(blendColor, opacity) {\r\n var other = blendColor instanceof Color ? blendColor : new Color(blendColor);\r\n var result = new Color;\r\n result.r = normalize(_round(this.r * (1 - opacity) + other.r * opacity));\r\n result.g = normalize(_round(this.g * (1 - opacity) + other.g * opacity));\r\n result.b = normalize(_round(this.b * (1 - opacity) + other.b * opacity));\r\n return result\r\n },\r\n toHex: function() {\r\n return toHexFromRgb(this.r, this.g, this.b)\r\n },\r\n getPureColor: function() {\r\n var rgb = hsvToRgb(this.hsv.h, 100, 100);\r\n return new Color(\"rgb(\" + rgb.join(\",\") + \")\")\r\n },\r\n isValidHex: function(hex) {\r\n return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex)\r\n },\r\n isValidRGB: function(r, g, b) {\r\n if (!isIntegerBetweenMinAndMax(r) || !isIntegerBetweenMinAndMax(g) || !isIntegerBetweenMinAndMax(b)) {\r\n return false\r\n }\r\n return true\r\n },\r\n isValidAlpha: function(a) {\r\n if (isNaN(a) || a < 0 || a > 1 || \"number\" !== typeof a) {\r\n return false\r\n }\r\n return true\r\n },\r\n colorIsInvalid: false,\r\n fromHSL: function(hsl) {\r\n var color = new Color;\r\n var rgb = hslToRgb(hsl.h, hsl.s, hsl.l);\r\n color.r = rgb[0];\r\n color.g = rgb[1];\r\n color.b = rgb[2];\r\n return color\r\n }\r\n};\r\nexport default Color;\r\n","/**\r\n * DevExtreme (esm/core/action.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport $ from \"./renderer\";\r\nimport {\r\n getWindow\r\n} from \"./utils/window\";\r\nimport {\r\n isPlainObject,\r\n isFunction\r\n} from \"./utils/type\";\r\nimport {\r\n each\r\n} from \"./utils/iterator\";\r\nexport default class Action {\r\n constructor(action, config) {\r\n config = config || {};\r\n this._action = action;\r\n this._context = config.context || getWindow();\r\n this._beforeExecute = config.beforeExecute;\r\n this._afterExecute = config.afterExecute;\r\n this._component = config.component;\r\n this._validatingTargetName = config.validatingTargetName;\r\n var excludeValidators = this._excludeValidators = {};\r\n if (config.excludeValidators) {\r\n for (var i = 0; i < config.excludeValidators.length; i++) {\r\n excludeValidators[config.excludeValidators[i]] = true\r\n }\r\n }\r\n }\r\n execute() {\r\n var e = {\r\n action: this._action,\r\n args: Array.prototype.slice.call(arguments),\r\n context: this._context,\r\n component: this._component,\r\n validatingTargetName: this._validatingTargetName,\r\n cancel: false,\r\n handled: false\r\n };\r\n var beforeExecute = this._beforeExecute;\r\n var afterExecute = this._afterExecute;\r\n var argsBag = e.args[0] || {};\r\n if (!this._validateAction(e)) {\r\n return\r\n }\r\n null === beforeExecute || void 0 === beforeExecute ? void 0 : beforeExecute.call(this._context, e);\r\n if (e.cancel) {\r\n return\r\n }\r\n var result = this._executeAction(e);\r\n if (argsBag.cancel) {\r\n return\r\n }\r\n null === afterExecute || void 0 === afterExecute ? void 0 : afterExecute.call(this._context, e);\r\n return result\r\n }\r\n _validateAction(e) {\r\n var excludeValidators = this._excludeValidators;\r\n var {\r\n executors: executors\r\n } = Action;\r\n for (var name in executors) {\r\n if (!excludeValidators[name]) {\r\n var _executor$validate;\r\n var executor = executors[name];\r\n null === (_executor$validate = executor.validate) || void 0 === _executor$validate ? void 0 : _executor$validate.call(executor, e);\r\n if (e.cancel) {\r\n return false\r\n }\r\n }\r\n }\r\n return true\r\n }\r\n _executeAction(e) {\r\n var result;\r\n var {\r\n executors: executors\r\n } = Action;\r\n for (var name in executors) {\r\n var _executor$execute;\r\n var executor = executors[name];\r\n null === (_executor$execute = executor.execute) || void 0 === _executor$execute ? void 0 : _executor$execute.call(executor, e);\r\n if (e.handled) {\r\n result = e.result;\r\n break\r\n }\r\n }\r\n return result\r\n }\r\n static registerExecutor(name, executor) {\r\n if (isPlainObject(name)) {\r\n each(name, Action.registerExecutor);\r\n return\r\n }\r\n Action.executors[name] = executor\r\n }\r\n static unregisterExecutor() {\r\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\r\n args[_key] = arguments[_key]\r\n }\r\n each(args, (function() {\r\n delete Action.executors[this]\r\n }))\r\n }\r\n}\r\nAction.executors = {};\r\nvar createValidatorByTargetElement = condition => e => {\r\n if (!e.args.length) {\r\n return\r\n }\r\n var args = e.args[0];\r\n var element = args[e.validatingTargetName] || args.element;\r\n if (element && condition($(element))) {\r\n e.cancel = true\r\n }\r\n};\r\nAction.registerExecutor({\r\n disabled: {\r\n validate: createValidatorByTargetElement($target => $target.is(\".dx-state-disabled, .dx-state-disabled *\"))\r\n },\r\n readOnly: {\r\n validate: createValidatorByTargetElement($target => $target.is(\".dx-state-readonly, .dx-state-readonly *:not(.dx-state-independent)\"))\r\n },\r\n undefined: {\r\n execute: e => {\r\n if (!e.action) {\r\n e.result = void 0;\r\n e.handled = true\r\n }\r\n }\r\n },\r\n func: {\r\n execute: e => {\r\n if (isFunction(e.action)) {\r\n e.result = e.action.call(e.context, e.args[0]);\r\n e.handled = true\r\n }\r\n }\r\n }\r\n});\r\n","/**\r\n * DevExtreme (esm/core/class.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport errors from \"./errors\";\r\nimport {\r\n isWindow\r\n} from \"./utils/type\";\r\nvar wrapOverridden = function(baseProto, methodName, method) {\r\n return function() {\r\n var prevCallBase = this.callBase;\r\n this.callBase = baseProto[methodName];\r\n try {\r\n return method.apply(this, arguments)\r\n } finally {\r\n this.callBase = prevCallBase\r\n }\r\n }\r\n};\r\nvar clonePrototype = function(obj) {\r\n var func = function() {};\r\n func.prototype = obj.prototype;\r\n return new func\r\n};\r\nvar redefine = function(members) {\r\n var overridden;\r\n var memberName;\r\n var member;\r\n if (!members) {\r\n return this\r\n }\r\n for (memberName in members) {\r\n member = members[memberName];\r\n overridden = \"function\" === typeof this.prototype[memberName] && \"function\" === typeof member;\r\n this.prototype[memberName] = overridden ? wrapOverridden(this.parent.prototype, memberName, member) : member\r\n }\r\n return this\r\n};\r\nvar include = function() {\r\n var classObj = this;\r\n var argument;\r\n var name;\r\n var i;\r\n var hasClassObjOwnProperty = Object.prototype.hasOwnProperty.bind(classObj);\r\n var isES6Class = !hasClassObjOwnProperty(\"_includedCtors\") && !hasClassObjOwnProperty(\"_includedPostCtors\");\r\n if (isES6Class) {\r\n classObj._includedCtors = classObj._includedCtors.slice(0);\r\n classObj._includedPostCtors = classObj._includedPostCtors.slice(0)\r\n }\r\n for (i = 0; i < arguments.length; i++) {\r\n argument = arguments[i];\r\n if (argument.ctor) {\r\n classObj._includedCtors.push(argument.ctor)\r\n }\r\n if (argument.postCtor) {\r\n classObj._includedPostCtors.push(argument.postCtor)\r\n }\r\n for (name in argument) {\r\n if (\"ctor\" === name || \"postCtor\" === name || \"default\" === name) {\r\n continue\r\n }\r\n classObj.prototype[name] = argument[name]\r\n }\r\n }\r\n return classObj\r\n};\r\nvar subclassOf = function(parentClass) {\r\n var hasParentProperty = Object.prototype.hasOwnProperty.bind(this)(\"parent\");\r\n var isES6Class = !hasParentProperty && this.parent;\r\n if (isES6Class) {\r\n var baseClass = Object.getPrototypeOf(this);\r\n return baseClass === parentClass || baseClass.subclassOf(parentClass)\r\n } else {\r\n if (this.parent === parentClass) {\r\n return true\r\n }\r\n if (!this.parent || !this.parent.subclassOf) {\r\n return false\r\n }\r\n return this.parent.subclassOf(parentClass)\r\n }\r\n};\r\nvar abstract = function() {\r\n throw errors.Error(\"E0001\")\r\n};\r\nvar copyStatic = function() {\r\n var hasOwn = Object.prototype.hasOwnProperty;\r\n return function(source, destination) {\r\n for (var key in source) {\r\n if (!hasOwn.call(source, key)) {\r\n return\r\n }\r\n destination[key] = source[key]\r\n }\r\n }\r\n}();\r\nvar classImpl = function() {};\r\nclassImpl.inherit = function(members) {\r\n var inheritor = function() {\r\n if (!this || isWindow(this) || \"function\" !== typeof this.constructor) {\r\n throw errors.Error(\"E0003\")\r\n }\r\n var instance = this;\r\n var ctor = instance.ctor;\r\n var includedCtors = instance.constructor._includedCtors;\r\n var includedPostCtors = instance.constructor._includedPostCtors;\r\n var i;\r\n for (i = 0; i < includedCtors.length; i++) {\r\n includedCtors[i].call(instance)\r\n }\r\n if (ctor) {\r\n ctor.apply(instance, arguments)\r\n }\r\n for (i = 0; i < includedPostCtors.length; i++) {\r\n includedPostCtors[i].call(instance)\r\n }\r\n };\r\n inheritor.prototype = clonePrototype(this);\r\n copyStatic(this, inheritor);\r\n inheritor.inherit = this.inherit;\r\n inheritor.abstract = abstract;\r\n inheritor.redefine = redefine;\r\n inheritor.include = include;\r\n inheritor.subclassOf = subclassOf;\r\n inheritor.parent = this;\r\n inheritor._includedCtors = this._includedCtors ? this._includedCtors.slice(0) : [];\r\n inheritor._includedPostCtors = this._includedPostCtors ? this._includedPostCtors.slice(0) : [];\r\n inheritor.prototype.constructor = inheritor;\r\n inheritor.redefine(members);\r\n return inheritor\r\n};\r\nclassImpl.abstract = abstract;\r\nexport default classImpl;\r\n","/**\r\n * DevExtreme (esm/core/component_registrator.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport $ from \"./renderer\";\r\nimport callbacks from \"./component_registrator_callbacks\";\r\nimport errors from \"./errors\";\r\nimport {\r\n name as publicComponentName\r\n} from \"./utils/public_component\";\r\nvar registerComponent = function(name, namespace, componentClass) {\r\n if (!componentClass) {\r\n componentClass = namespace\r\n } else {\r\n namespace[name] = componentClass\r\n }\r\n publicComponentName(componentClass, name);\r\n callbacks.fire(name, componentClass)\r\n};\r\nvar registerRendererComponent = function(name, componentClass) {\r\n $.fn[name] = function(options) {\r\n var isMemberInvoke = \"string\" === typeof options;\r\n var result;\r\n if (isMemberInvoke) {\r\n var memberName = options;\r\n var memberArgs = [].slice.call(arguments).slice(1);\r\n this.each((function() {\r\n var instance = componentClass.getInstance(this);\r\n if (!instance) {\r\n throw errors.Error(\"E0009\", name)\r\n }\r\n var member = instance[memberName];\r\n var memberValue = member.apply(instance, memberArgs);\r\n if (void 0 === result) {\r\n result = memberValue\r\n }\r\n }))\r\n } else {\r\n this.each((function() {\r\n var instance = componentClass.getInstance(this);\r\n if (instance) {\r\n instance.option(options)\r\n } else {\r\n new componentClass(this, options)\r\n }\r\n }));\r\n result = this\r\n }\r\n return result\r\n }\r\n};\r\ncallbacks.add(registerRendererComponent);\r\nexport default registerComponent;\r\n","/**\r\n * DevExtreme (esm/core/component_registrator_callbacks.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport MemorizedCallbacks from \"./memorized_callbacks\";\r\nexport default new MemorizedCallbacks;\r\n","/**\r\n * DevExtreme (esm/core/config.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n extend\r\n} from \"./utils/extend\";\r\nimport errors from \"./errors\";\r\nvar config = {\r\n rtlEnabled: false,\r\n defaultCurrency: \"USD\",\r\n defaultUseCurrencyAccountingStyle: true,\r\n oDataFilterToLower: true,\r\n serverDecimalSeparator: \".\",\r\n decimalSeparator: \".\",\r\n thousandsSeparator: \",\",\r\n forceIsoDateParsing: true,\r\n wrapActionsBeforeExecute: true,\r\n useLegacyStoreResult: false,\r\n useJQuery: void 0,\r\n editorStylingMode: void 0,\r\n useLegacyVisibleIndex: false,\r\n floatingActionButtonConfig: {\r\n icon: \"add\",\r\n closeIcon: \"close\",\r\n label: \"\",\r\n position: {\r\n at: \"right bottom\",\r\n my: \"right bottom\",\r\n offset: {\r\n x: -16,\r\n y: -16\r\n }\r\n },\r\n maxSpeedDialActionCount: 5,\r\n shading: false,\r\n direction: \"auto\"\r\n },\r\n optionsParser: optionsString => {\r\n if (\"{\" !== optionsString.trim().charAt(0)) {\r\n optionsString = \"{\" + optionsString + \"}\"\r\n }\r\n try {\r\n return JSON.parse(optionsString)\r\n } catch (ex) {\r\n try {\r\n return JSON.parse(normalizeToJSONString(optionsString))\r\n } catch (exNormalize) {\r\n throw errors.Error(\"E3018\", ex, optionsString)\r\n }\r\n }\r\n }\r\n};\r\nvar normalizeToJSONString = optionsString => optionsString.replace(/'/g, '\"').replace(/,\\s*([\\]}])/g, \"$1\").replace(/([{,])\\s*([^\":\\s]+)\\s*:/g, '$1\"$2\":');\r\nvar deprecatedFields = [\"decimalSeparator\", \"thousandsSeparator\"];\r\nvar configMethod = function() {\r\n if (!arguments.length) {\r\n return config\r\n }\r\n var newConfig = arguments.length <= 0 ? void 0 : arguments[0];\r\n deprecatedFields.forEach(deprecatedField => {\r\n if (newConfig[deprecatedField]) {\r\n var message = \"Now, the \".concat(deprecatedField, \" is selected based on the specified locale.\");\r\n errors.log(\"W0003\", \"config\", deprecatedField, \"19.2\", message)\r\n }\r\n });\r\n extend(config, newConfig)\r\n};\r\nif (\"undefined\" !== typeof DevExpress && DevExpress.config) {\r\n configMethod(DevExpress.config)\r\n}\r\nexport default configMethod;\r\n","/**\r\n * DevExtreme (esm/core/devices.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n getHeight,\r\n getWidth\r\n} from \"./utils/size\";\r\nimport $ from \"../core/renderer\";\r\nimport {\r\n getWindow,\r\n getNavigator,\r\n hasWindow\r\n} from \"./utils/window\";\r\nimport {\r\n extend\r\n} from \"./utils/extend\";\r\nimport {\r\n isPlainObject\r\n} from \"./utils/type\";\r\nimport {\r\n each\r\n} from \"./utils/iterator\";\r\nimport errors from \"./errors\";\r\nimport Callbacks from \"./utils/callbacks\";\r\nimport readyCallbacks from \"./utils/ready_callbacks\";\r\nimport resizeCallbacks from \"./utils/resize_callbacks\";\r\nimport {\r\n EventsStrategy\r\n} from \"./events_strategy\";\r\nimport {\r\n sessionStorage as SessionStorage\r\n} from \"./utils/storage\";\r\nimport {\r\n changeCallback,\r\n value as viewPort\r\n} from \"./utils/view_port\";\r\nimport Config from \"./config\";\r\nvar navigator = getNavigator();\r\nvar window = getWindow();\r\nvar KNOWN_UA_TABLE = {\r\n iPhone: \"iPhone\",\r\n iPhone5: \"iPhone\",\r\n iPhone6: \"iPhone\",\r\n iPhone6plus: \"iPhone\",\r\n iPad: \"iPad\",\r\n iPadMini: \"iPad Mini\",\r\n androidPhone: \"Android Mobile\",\r\n androidTablet: \"Android\",\r\n msSurface: \"Windows ARM Tablet PC\",\r\n desktop: \"desktop\"\r\n};\r\nvar DEFAULT_DEVICE = {\r\n deviceType: \"desktop\",\r\n platform: \"generic\",\r\n version: [],\r\n phone: false,\r\n tablet: false,\r\n android: false,\r\n ios: false,\r\n generic: true,\r\n grade: \"A\",\r\n mac: false\r\n};\r\nvar uaParsers = {\r\n generic(userAgent) {\r\n var isPhone = /windows phone/i.test(userAgent) || userAgent.match(/WPDesktop/);\r\n var isTablet = !isPhone && /Windows(.*)arm(.*)Tablet PC/i.test(userAgent);\r\n var isDesktop = !isPhone && !isTablet && /msapphost/i.test(userAgent);\r\n var isMac = /((intel|ppc) mac os x)/.test(userAgent.toLowerCase());\r\n if (!(isPhone || isTablet || isDesktop || isMac)) {\r\n return\r\n }\r\n return {\r\n deviceType: isPhone ? \"phone\" : isTablet ? \"tablet\" : \"desktop\",\r\n platform: \"generic\",\r\n version: [],\r\n grade: \"A\",\r\n mac: isMac\r\n }\r\n },\r\n ios(userAgent) {\r\n if (!/ip(hone|od|ad)/i.test(userAgent)) {\r\n return\r\n }\r\n var isPhone = /ip(hone|od)/i.test(userAgent);\r\n var matches = userAgent.match(/os (\\d+)_(\\d+)_?(\\d+)?/i);\r\n var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3] || 0, 10)] : [];\r\n var isIPhone4 = 480 === window.screen.height;\r\n var grade = isIPhone4 ? \"B\" : \"A\";\r\n return {\r\n deviceType: isPhone ? \"phone\" : \"tablet\",\r\n platform: \"ios\",\r\n version: version,\r\n grade: grade\r\n }\r\n },\r\n android(userAgent) {\r\n if (!/android|htc_|silk/i.test(userAgent)) {\r\n return\r\n }\r\n var isPhone = /mobile/i.test(userAgent);\r\n var matches = userAgent.match(/android (\\d+)\\.?(\\d+)?\\.?(\\d+)?/i);\r\n var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2] || 0, 10), parseInt(matches[3] || 0, 10)] : [];\r\n var worseThan4_4 = version.length > 1 && (version[0] < 4 || 4 === version[0] && version[1] < 4);\r\n var grade = worseThan4_4 ? \"B\" : \"A\";\r\n return {\r\n deviceType: isPhone ? \"phone\" : \"tablet\",\r\n platform: \"android\",\r\n version: version,\r\n grade: grade\r\n }\r\n }\r\n};\r\nclass Devices {\r\n constructor(options) {\r\n this._window = (null === options || void 0 === options ? void 0 : options.window) || window;\r\n this._realDevice = this._getDevice();\r\n this._currentDevice = void 0;\r\n this._currentOrientation = void 0;\r\n this._eventsStrategy = new EventsStrategy(this);\r\n this.changed = Callbacks();\r\n if (hasWindow()) {\r\n readyCallbacks.add(this._recalculateOrientation.bind(this));\r\n resizeCallbacks.add(this._recalculateOrientation.bind(this))\r\n }\r\n }\r\n current(deviceOrName) {\r\n if (deviceOrName) {\r\n this._currentDevice = this._getDevice(deviceOrName);\r\n this._forced = true;\r\n this.changed.fire();\r\n return\r\n }\r\n if (!this._currentDevice) {\r\n deviceOrName = void 0;\r\n try {\r\n deviceOrName = this._getDeviceOrNameFromWindowScope()\r\n } catch (e) {\r\n deviceOrName = this._getDeviceNameFromSessionStorage()\r\n } finally {\r\n if (!deviceOrName) {\r\n deviceOrName = this._getDeviceNameFromSessionStorage()\r\n }\r\n if (deviceOrName) {\r\n this._forced = true\r\n }\r\n }\r\n this._currentDevice = this._getDevice(deviceOrName)\r\n }\r\n return this._currentDevice\r\n }\r\n real(forceDevice) {\r\n return extend({}, this._realDevice)\r\n }\r\n orientation() {\r\n return this._currentOrientation\r\n }\r\n isForced() {\r\n return this._forced\r\n }\r\n isRippleEmulator() {\r\n return !!this._window.tinyHippos\r\n }\r\n _getCssClasses(device) {\r\n var result = [];\r\n var realDevice = this._realDevice;\r\n device = device || this.current();\r\n if (device.deviceType) {\r\n result.push(\"dx-device-\".concat(device.deviceType));\r\n if (\"desktop\" !== device.deviceType) {\r\n result.push(\"dx-device-mobile\")\r\n }\r\n }\r\n result.push(\"dx-device-\".concat(realDevice.platform));\r\n if (realDevice.version && realDevice.version.length) {\r\n result.push(\"dx-device-\".concat(realDevice.platform, \"-\").concat(realDevice.version[0]))\r\n }\r\n if (this.isSimulator()) {\r\n result.push(\"dx-simulator\")\r\n }\r\n if (Config().rtlEnabled) {\r\n result.push(\"dx-rtl\")\r\n }\r\n return result\r\n }\r\n attachCssClasses(element, device) {\r\n this._deviceClasses = this._getCssClasses(device).join(\" \");\r\n $(element).addClass(this._deviceClasses)\r\n }\r\n detachCssClasses(element) {\r\n $(element).removeClass(this._deviceClasses)\r\n }\r\n isSimulator() {\r\n try {\r\n return this._isSimulator || hasWindow() && this._window.top !== this._window.self && this._window.top[\"dx-force-device\"] || this.isRippleEmulator()\r\n } catch (e) {\r\n return false\r\n }\r\n }\r\n forceSimulator() {\r\n this._isSimulator = true\r\n }\r\n _getDevice(deviceName) {\r\n if (\"genericPhone\" === deviceName) {\r\n deviceName = {\r\n deviceType: \"phone\",\r\n platform: \"generic\",\r\n generic: true\r\n }\r\n }\r\n if (isPlainObject(deviceName)) {\r\n return this._fromConfig(deviceName)\r\n } else {\r\n var ua;\r\n if (deviceName) {\r\n ua = KNOWN_UA_TABLE[deviceName];\r\n if (!ua) {\r\n throw errors.Error(\"E0005\")\r\n }\r\n } else {\r\n ua = navigator.userAgent\r\n }\r\n return this._fromUA(ua)\r\n }\r\n }\r\n _getDeviceOrNameFromWindowScope() {\r\n var result;\r\n if (hasWindow() && (this._window.top[\"dx-force-device-object\"] || this._window.top[\"dx-force-device\"])) {\r\n result = this._window.top[\"dx-force-device-object\"] || this._window.top[\"dx-force-device\"]\r\n }\r\n return result\r\n }\r\n _getDeviceNameFromSessionStorage() {\r\n var sessionStorage = SessionStorage();\r\n if (!sessionStorage) {\r\n return\r\n }\r\n var deviceOrName = sessionStorage.getItem(\"dx-force-device\");\r\n try {\r\n return JSON.parse(deviceOrName)\r\n } catch (ex) {\r\n return deviceOrName\r\n }\r\n }\r\n _fromConfig(config) {\r\n var result = extend({}, DEFAULT_DEVICE, this._currentDevice, config);\r\n var shortcuts = {\r\n phone: \"phone\" === result.deviceType,\r\n tablet: \"tablet\" === result.deviceType,\r\n android: \"android\" === result.platform,\r\n ios: \"ios\" === result.platform,\r\n generic: \"generic\" === result.platform\r\n };\r\n return extend(result, shortcuts)\r\n }\r\n _fromUA(ua) {\r\n var config;\r\n each(uaParsers, (platform, parser) => {\r\n config = parser(ua);\r\n return !config\r\n });\r\n if (config) {\r\n return this._fromConfig(config)\r\n }\r\n return DEFAULT_DEVICE\r\n }\r\n _changeOrientation() {\r\n var $window = $(this._window);\r\n var orientation = getHeight($window) > getWidth($window) ? \"portrait\" : \"landscape\";\r\n if (this._currentOrientation === orientation) {\r\n return\r\n }\r\n this._currentOrientation = orientation;\r\n this._eventsStrategy.fireEvent(\"orientationChanged\", [{\r\n orientation: orientation\r\n }])\r\n }\r\n _recalculateOrientation() {\r\n var windowWidth = getWidth(this._window);\r\n if (this._currentWidth === windowWidth) {\r\n return\r\n }\r\n this._currentWidth = windowWidth;\r\n this._changeOrientation()\r\n }\r\n on(eventName, eventHandler) {\r\n this._eventsStrategy.on(eventName, eventHandler);\r\n return this\r\n }\r\n off(eventName, eventHandler) {\r\n this._eventsStrategy.off(eventName, eventHandler);\r\n return this\r\n }\r\n}\r\nvar devices = new Devices;\r\nvar viewPortElement = viewPort();\r\nif (viewPortElement) {\r\n devices.attachCssClasses(viewPortElement)\r\n}\r\nchangeCallback.add((viewPort, prevViewport) => {\r\n devices.detachCssClasses(prevViewport);\r\n devices.attachCssClasses(viewPort)\r\n});\r\nexport default devices;\r\n","/**\r\n * DevExtreme (esm/core/dom_adapter.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport injector from \"./utils/dependency_injector\";\r\nimport {\r\n noop\r\n} from \"./utils/common\";\r\nimport {\r\n getShadowElementsFromPoint\r\n} from \"./utils/shadow_dom\";\r\nvar ELEMENT_NODE = 1;\r\nvar TEXT_NODE = 3;\r\nvar DOCUMENT_NODE = 9;\r\nvar DOCUMENT_FRAGMENT_NODE = 11;\r\nvar nativeDOMAdapterStrategy = {\r\n querySelectorAll: (element, selector) => element.querySelectorAll(selector),\r\n elementMatches(element, selector) {\r\n var matches = element.matches || element.matchesSelector || element.mozMatchesSelector || element.msMatchesSelector || element.oMatchesSelector || element.webkitMatchesSelector || (selector => {\r\n var doc = element.document || element.ownerDocument;\r\n if (!doc) {\r\n return false\r\n }\r\n var items = this.querySelectorAll(doc, selector);\r\n for (var i = 0; i < items.length; i++) {\r\n if (items[i] === element) {\r\n return true\r\n }\r\n }\r\n });\r\n return matches.call(element, selector)\r\n },\r\n createElement(tagName, context) {\r\n context = context || this._document;\r\n return context.createElement(tagName)\r\n },\r\n createElementNS(ns, tagName, context) {\r\n context = context || this._document;\r\n return context.createElementNS(ns, tagName)\r\n },\r\n createTextNode(text, context) {\r\n context = context || this._document;\r\n return context.createTextNode(text)\r\n },\r\n createAttribute(text, context) {\r\n context = context || this._document;\r\n return context.createAttribute(text)\r\n },\r\n isNode: element => element && \"object\" === typeof element && \"nodeType\" in element && \"nodeName\" in element,\r\n isElementNode: element => element && element.nodeType === ELEMENT_NODE,\r\n isTextNode: element => element && element.nodeType === TEXT_NODE,\r\n isDocument: element => element && element.nodeType === DOCUMENT_NODE,\r\n isDocumentFragment: element => element && element.nodeType === DOCUMENT_FRAGMENT_NODE,\r\n removeElement(element) {\r\n var parentNode = element && element.parentNode;\r\n if (parentNode) {\r\n parentNode.removeChild(element)\r\n }\r\n },\r\n insertElement(parentElement, newElement, nextSiblingElement) {\r\n if (parentElement && newElement && parentElement !== newElement) {\r\n if (nextSiblingElement) {\r\n parentElement.insertBefore(newElement, nextSiblingElement)\r\n } else {\r\n parentElement.appendChild(newElement)\r\n }\r\n }\r\n },\r\n getAttribute: (element, name) => element.getAttribute(name),\r\n setAttribute(element, name, value) {\r\n if (\"style\" === name) {\r\n element.style.cssText = value\r\n } else {\r\n element.setAttribute(name, value)\r\n }\r\n },\r\n removeAttribute(element, name) {\r\n element.removeAttribute(name)\r\n },\r\n setProperty(element, name, value) {\r\n element[name] = value\r\n },\r\n setText(element, text) {\r\n if (element) {\r\n element.textContent = text\r\n }\r\n },\r\n setClass(element, className, isAdd) {\r\n if (1 === element.nodeType && className) {\r\n isAdd ? element.classList.add(className) : element.classList.remove(className)\r\n }\r\n },\r\n setStyle(element, name, value) {\r\n element.style[name] = value || \"\"\r\n },\r\n _document: \"undefined\" === typeof document ? void 0 : document,\r\n getDocument() {\r\n return this._document\r\n },\r\n getActiveElement(element) {\r\n var activeElementHolder = this.getRootNode(element);\r\n return activeElementHolder.activeElement\r\n },\r\n getRootNode(element) {\r\n var _element$getRootNode, _element$getRootNode2;\r\n return null !== (_element$getRootNode = null === element || void 0 === element ? void 0 : null === (_element$getRootNode2 = element.getRootNode) || void 0 === _element$getRootNode2 ? void 0 : _element$getRootNode2.call(element)) && void 0 !== _element$getRootNode ? _element$getRootNode : this._document\r\n },\r\n getBody() {\r\n return this._document.body\r\n },\r\n createDocumentFragment() {\r\n return this._document.createDocumentFragment()\r\n },\r\n getDocumentElement() {\r\n return this._document.documentElement\r\n },\r\n getLocation() {\r\n return this._document.location\r\n },\r\n getSelection() {\r\n return this._document.selection\r\n },\r\n getReadyState() {\r\n return this._document.readyState\r\n },\r\n getHead() {\r\n return this._document.head\r\n },\r\n hasDocumentProperty(property) {\r\n return property in this._document\r\n },\r\n listen(element, event, callback, options) {\r\n if (!element || !(\"addEventListener\" in element)) {\r\n return noop\r\n }\r\n element.addEventListener(event, callback, options);\r\n return () => {\r\n element.removeEventListener(event, callback)\r\n }\r\n },\r\n elementsFromPoint(x, y, element) {\r\n var activeElementHolder = this.getRootNode(element);\r\n if (activeElementHolder.host) {\r\n return getShadowElementsFromPoint(x, y, activeElementHolder)\r\n }\r\n return activeElementHolder.elementsFromPoint(x, y)\r\n }\r\n};\r\nexport default injector(nativeDOMAdapterStrategy);\r\n","/**\r\n * DevExtreme (esm/core/postponed_operations.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n Deferred,\r\n when\r\n} from \"./utils/deferred\";\r\nimport {\r\n isDefined\r\n} from \"./utils/type\";\r\nexport class PostponedOperations {\r\n constructor() {\r\n this._postponedOperations = {}\r\n }\r\n add(key, fn, postponedPromise) {\r\n if (key in this._postponedOperations) {\r\n postponedPromise && this._postponedOperations[key].promises.push(postponedPromise)\r\n } else {\r\n var completePromise = new Deferred;\r\n this._postponedOperations[key] = {\r\n fn: fn,\r\n completePromise: completePromise,\r\n promises: postponedPromise ? [postponedPromise] : []\r\n }\r\n }\r\n return this._postponedOperations[key].completePromise.promise()\r\n }\r\n callPostponedOperations() {\r\n for (var key in this._postponedOperations) {\r\n var operation = this._postponedOperations[key];\r\n if (isDefined(operation)) {\r\n if (operation.promises && operation.promises.length) {\r\n when(...operation.promises).done(operation.fn).then(operation.completePromise.resolve)\r\n } else {\r\n operation.fn().done(operation.completePromise.resolve)\r\n }\r\n }\r\n }\r\n this._postponedOperations = {}\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/component.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport Config from \"./config\";\r\nimport {\r\n extend\r\n} from \"./utils/extend\";\r\nimport {\r\n Options\r\n} from \"./options/index\";\r\nimport {\r\n convertRulesToOptions\r\n} from \"./options/utils\";\r\nimport Class from \"./class\";\r\nimport Action from \"./action\";\r\nimport errors from \"./errors\";\r\nimport Callbacks from \"./utils/callbacks\";\r\nimport {\r\n EventsStrategy\r\n} from \"./events_strategy\";\r\nimport {\r\n name as publicComponentName\r\n} from \"./utils/public_component\";\r\nimport {\r\n PostponedOperations\r\n} from \"./postponed_operations\";\r\nimport {\r\n isFunction,\r\n isPlainObject,\r\n isDefined\r\n} from \"./utils/type\";\r\nimport {\r\n noop\r\n} from \"./utils/common\";\r\nimport {\r\n getPathParts\r\n} from \"./utils/data\";\r\nvar getEventName = actionName => actionName.charAt(2).toLowerCase() + actionName.substr(3);\r\nvar isInnerOption = optionName => 0 === optionName.indexOf(\"_\", 0);\r\nexport var Component = Class.inherit({\r\n _setDeprecatedOptions() {\r\n this._deprecatedOptions = {}\r\n },\r\n _getDeprecatedOptions() {\r\n return this._deprecatedOptions\r\n },\r\n _getDefaultOptions: () => ({\r\n onInitialized: null,\r\n onOptionChanged: null,\r\n onDisposing: null,\r\n defaultOptionsRules: null\r\n }),\r\n _defaultOptionsRules: () => [],\r\n _setOptionsByDevice(rules) {\r\n this._options.applyRules(rules)\r\n },\r\n _convertRulesToOptions: rules => convertRulesToOptions(rules),\r\n _isInitialOptionValue(name) {\r\n return this._options.isInitial(name)\r\n },\r\n _setOptionsByReference() {\r\n this._optionsByReference = {}\r\n },\r\n _getOptionsByReference() {\r\n return this._optionsByReference\r\n },\r\n ctor() {\r\n var options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};\r\n var {\r\n _optionChangedCallbacks: _optionChangedCallbacks,\r\n _disposingCallbacks: _disposingCallbacks\r\n } = options;\r\n this.NAME = publicComponentName(this.constructor);\r\n this._eventsStrategy = EventsStrategy.create(this, options.eventsStrategy);\r\n this._updateLockCount = 0;\r\n this._optionChangedCallbacks = _optionChangedCallbacks || Callbacks();\r\n this._disposingCallbacks = _disposingCallbacks || Callbacks();\r\n this.postponedOperations = new PostponedOperations;\r\n this._createOptions(options)\r\n },\r\n _createOptions(options) {\r\n this.beginUpdate();\r\n try {\r\n this._setOptionsByReference();\r\n this._setDeprecatedOptions();\r\n this._options = new Options(this._getDefaultOptions(), this._getDefaultOptions(), this._getOptionsByReference(), this._getDeprecatedOptions());\r\n this._options.onChanging((name, previousValue, value) => this._initialized && this._optionChanging(name, previousValue, value));\r\n this._options.onDeprecated((option, info) => this._logDeprecatedOptionWarning(option, info));\r\n this._options.onChanged((name, value, previousValue) => this._notifyOptionChanged(name, value, previousValue));\r\n this._options.onStartChange(() => this.beginUpdate());\r\n this._options.onEndChange(() => this.endUpdate());\r\n this._options.addRules(this._defaultOptionsRules());\r\n if (options && options.onInitializing) {\r\n options.onInitializing.apply(this, [options])\r\n }\r\n this._setOptionsByDevice(options.defaultOptionsRules);\r\n this._initOptions(options)\r\n } finally {\r\n this.endUpdate()\r\n }\r\n },\r\n _initOptions(options) {\r\n this.option(options)\r\n },\r\n _init() {\r\n this._createOptionChangedAction();\r\n this.on(\"disposing\", args => {\r\n this._disposingCallbacks.fireWith(this, [args])\r\n })\r\n },\r\n _logDeprecatedOptionWarning(option, info) {\r\n var message = info.message || \"Use the '\".concat(info.alias, \"' option instead\");\r\n errors.log(\"W0001\", this.NAME, option, info.since, message)\r\n },\r\n _logDeprecatedComponentWarning(since, alias) {\r\n errors.log(\"W0000\", this.NAME, since, \"Use the '\".concat(alias, \"' widget instead\"))\r\n },\r\n _createOptionChangedAction() {\r\n this._optionChangedAction = this._createActionByOption(\"onOptionChanged\", {\r\n excludeValidators: [\"disabled\", \"readOnly\"]\r\n })\r\n },\r\n _createDisposingAction() {\r\n this._disposingAction = this._createActionByOption(\"onDisposing\", {\r\n excludeValidators: [\"disabled\", \"readOnly\"]\r\n })\r\n },\r\n _optionChanged(args) {\r\n switch (args.name) {\r\n case \"onDisposing\":\r\n case \"onInitialized\":\r\n break;\r\n case \"onOptionChanged\":\r\n this._createOptionChangedAction()\r\n }\r\n },\r\n _dispose() {\r\n this._optionChangedCallbacks.empty();\r\n this._createDisposingAction();\r\n this._disposingAction();\r\n this._eventsStrategy.dispose();\r\n this._options.dispose();\r\n this._disposed = true\r\n },\r\n _lockUpdate() {\r\n this._updateLockCount++\r\n },\r\n _unlockUpdate() {\r\n this._updateLockCount = Math.max(this._updateLockCount - 1, 0)\r\n },\r\n _isUpdateAllowed() {\r\n return 0 === this._updateLockCount\r\n },\r\n _isInitializingRequired() {\r\n return !this._initializing && !this._initialized\r\n },\r\n isInitialized() {\r\n return this._initialized\r\n },\r\n _commitUpdate() {\r\n this.postponedOperations.callPostponedOperations();\r\n this._isInitializingRequired() && this._initializeComponent()\r\n },\r\n _initializeComponent() {\r\n this._initializing = true;\r\n try {\r\n this._init()\r\n } finally {\r\n this._initializing = false;\r\n this._lockUpdate();\r\n this._createActionByOption(\"onInitialized\", {\r\n excludeValidators: [\"disabled\", \"readOnly\"]\r\n })();\r\n this._unlockUpdate();\r\n this._initialized = true\r\n }\r\n },\r\n instance() {\r\n return this\r\n },\r\n beginUpdate: function() {\r\n this._lockUpdate()\r\n },\r\n endUpdate: function() {\r\n this._unlockUpdate();\r\n this._isUpdateAllowed() && this._commitUpdate()\r\n },\r\n _optionChanging: noop,\r\n _notifyOptionChanged(option, value, previousValue) {\r\n if (this._initialized) {\r\n var optionNames = [option].concat(this._options.getAliasesByName(option));\r\n for (var i = 0; i < optionNames.length; i++) {\r\n var name = optionNames[i];\r\n var args = {\r\n name: getPathParts(name)[0],\r\n fullName: name,\r\n value: value,\r\n previousValue: previousValue\r\n };\r\n if (!isInnerOption(name)) {\r\n this._optionChangedCallbacks.fireWith(this, [extend(this._defaultActionArgs(), args)]);\r\n this._optionChangedAction(extend({}, args))\r\n }\r\n if (!this._disposed && this._cancelOptionChange !== name) {\r\n this._optionChanged(args)\r\n }\r\n }\r\n }\r\n },\r\n initialOption(name) {\r\n return this._options.initial(name)\r\n },\r\n _defaultActionConfig() {\r\n return {\r\n context: this,\r\n component: this\r\n }\r\n },\r\n _defaultActionArgs() {\r\n return {\r\n component: this\r\n }\r\n },\r\n _createAction(actionSource, config) {\r\n var action;\r\n return e => {\r\n if (!isDefined(e)) {\r\n e = {}\r\n }\r\n if (!isPlainObject(e)) {\r\n e = {\r\n actionValue: e\r\n }\r\n }\r\n action = action || new Action(actionSource, extend(config, this._defaultActionConfig()));\r\n return action.execute.call(action, extend(e, this._defaultActionArgs()))\r\n }\r\n },\r\n _createActionByOption(optionName, config) {\r\n var _this = this;\r\n var action;\r\n var eventName;\r\n var actionFunc;\r\n var result = function() {\r\n if (!eventName) {\r\n config = config || {};\r\n if (\"string\" !== typeof optionName) {\r\n throw errors.Error(\"E0008\")\r\n }\r\n if (0 === optionName.indexOf(\"on\")) {\r\n eventName = getEventName(optionName)\r\n }\r\n actionFunc = _this.option(optionName)\r\n }\r\n if (!action && !actionFunc && !config.beforeExecute && !config.afterExecute && !_this._eventsStrategy.hasEvent(eventName)) {\r\n return\r\n }\r\n if (!action) {\r\n var beforeExecute = config.beforeExecute;\r\n config.beforeExecute = function() {\r\n for (var _len2 = arguments.length, props = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\r\n props[_key2] = arguments[_key2]\r\n }\r\n beforeExecute && beforeExecute.apply(_this, props);\r\n _this._eventsStrategy.fireEvent(eventName, props[0].args)\r\n };\r\n action = _this._createAction(actionFunc, config)\r\n }\r\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\r\n args[_key] = arguments[_key]\r\n }\r\n if (Config().wrapActionsBeforeExecute) {\r\n var beforeActionExecute = _this.option(\"beforeActionExecute\") || noop;\r\n var wrappedAction = beforeActionExecute(_this, action, config) || action;\r\n return wrappedAction.apply(_this, args)\r\n }\r\n return action.apply(_this, args)\r\n };\r\n if (Config().wrapActionsBeforeExecute) {\r\n return result\r\n }\r\n var onActionCreated = this.option(\"onActionCreated\") || noop;\r\n return onActionCreated(this, result, config) || result\r\n },\r\n on(eventName, eventHandler) {\r\n this._eventsStrategy.on(eventName, eventHandler);\r\n return this\r\n },\r\n off(eventName, eventHandler) {\r\n this._eventsStrategy.off(eventName, eventHandler);\r\n return this\r\n },\r\n hasActionSubscription: function(actionName) {\r\n return !!this._options.silent(actionName) || this._eventsStrategy.hasEvent(getEventName(actionName))\r\n },\r\n isOptionDeprecated(name) {\r\n return this._options.isDeprecated(name)\r\n },\r\n _setOptionWithoutOptionChange(name, value) {\r\n this._cancelOptionChange = name;\r\n this.option(name, value);\r\n this._cancelOptionChange = false\r\n },\r\n _getOptionValue(name, context) {\r\n var value = this.option(name);\r\n if (isFunction(value)) {\r\n return value.bind(context)()\r\n }\r\n return value\r\n },\r\n option() {\r\n return this._options.option(...arguments)\r\n },\r\n resetOption(name) {\r\n this.beginUpdate();\r\n this._options.reset(name);\r\n this.endUpdate()\r\n }\r\n});\r\n","/**\r\n * DevExtreme (esm/core/template_manager.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport $ from \"./renderer\";\r\nimport {\r\n isDefined,\r\n isFunction,\r\n isRenderer\r\n} from \"./utils/type\";\r\nimport {\r\n noop\r\n} from \"./utils/common\";\r\nimport {\r\n extend\r\n} from \"./utils/extend\";\r\nimport {\r\n FunctionTemplate\r\n} from \"./templates/function_template\";\r\nimport {\r\n EmptyTemplate\r\n} from \"./templates/empty_template\";\r\nimport {\r\n findTemplates,\r\n suitableTemplatesByName,\r\n templateKey,\r\n getNormalizedTemplateArgs,\r\n validateTemplateSource,\r\n defaultCreateElement,\r\n acquireTemplate\r\n} from \"./utils/template_manager\";\r\nvar TEXT_NODE = 3;\r\nvar ANONYMOUS_TEMPLATE_NAME = \"template\";\r\nvar TEMPLATE_OPTIONS_NAME = \"dxTemplate\";\r\nvar TEMPLATE_WRAPPER_CLASS = \"dx-template-wrapper\";\r\nvar DX_POLYMORPH_WIDGET_TEMPLATE = new FunctionTemplate(_ref => {\r\n var {\r\n model: model,\r\n parent: parent\r\n } = _ref;\r\n var widgetName = model.widget;\r\n if (!widgetName) {\r\n return $()\r\n }\r\n var widgetElement = $(\"
\");\r\n var widgetOptions = model.options || {};\r\n if (parent) {\r\n parent._createComponent(widgetElement, widgetName, widgetOptions)\r\n } else {\r\n widgetElement[widgetName](widgetOptions)\r\n }\r\n return widgetElement\r\n});\r\nexport class TemplateManager {\r\n constructor(createElement, anonymousTemplateName) {\r\n this._tempTemplates = [];\r\n this._defaultTemplates = {};\r\n this._anonymousTemplateName = anonymousTemplateName || ANONYMOUS_TEMPLATE_NAME;\r\n this._createElement = createElement || defaultCreateElement;\r\n this._createTemplateIfNeeded = this._createTemplateIfNeeded.bind(this)\r\n }\r\n static createDefaultOptions() {\r\n return {\r\n integrationOptions: {\r\n watchMethod: function(fn, callback) {\r\n var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};\r\n if (!options.skipImmediate) {\r\n callback(fn())\r\n }\r\n return noop\r\n },\r\n templates: {\r\n \"dx-polymorph-widget\": DX_POLYMORPH_WIDGET_TEMPLATE\r\n },\r\n useDeferUpdateForTemplates: true\r\n }\r\n }\r\n }\r\n get anonymousTemplateName() {\r\n return this._anonymousTemplateName\r\n }\r\n addDefaultTemplates(templates) {\r\n this._defaultTemplates = extend({}, this._defaultTemplates, templates)\r\n }\r\n dispose() {\r\n this._tempTemplates.forEach(tempTemplate => {\r\n tempTemplate.template.dispose && tempTemplate.template.dispose()\r\n });\r\n this._tempTemplates = []\r\n }\r\n extractTemplates($el) {\r\n var templates = this._extractTemplates($el);\r\n var anonymousTemplateMeta = this._extractAnonymousTemplate($el);\r\n return {\r\n templates: templates,\r\n anonymousTemplateMeta: anonymousTemplateMeta\r\n }\r\n }\r\n _extractTemplates($el) {\r\n var templates = findTemplates($el, TEMPLATE_OPTIONS_NAME);\r\n var suitableTemplates = suitableTemplatesByName(templates);\r\n templates.forEach(_ref2 => {\r\n var {\r\n element: element,\r\n options: {\r\n name: name\r\n }\r\n } = _ref2;\r\n if (element === suitableTemplates[name]) {\r\n $(element).addClass(TEMPLATE_WRAPPER_CLASS).detach()\r\n } else {\r\n $(element).remove()\r\n }\r\n });\r\n return Object.keys(suitableTemplates).map(name => ({\r\n name: name,\r\n template: this._createTemplate(suitableTemplates[name])\r\n }))\r\n }\r\n _extractAnonymousTemplate($el) {\r\n var $anonymousTemplate = $el.contents().detach();\r\n var $notJunkTemplateContent = $anonymousTemplate.filter((_, element) => {\r\n var isTextNode = element.nodeType === TEXT_NODE;\r\n var isEmptyText = $(element).text().trim().length < 1;\r\n return !(isTextNode && isEmptyText)\r\n });\r\n return $notJunkTemplateContent.length > 0 ? {\r\n template: this._createTemplate($anonymousTemplate),\r\n name: this._anonymousTemplateName\r\n } : {}\r\n }\r\n _createTemplateIfNeeded(templateSource) {\r\n var cachedTemplate = this._tempTemplates.filter(tempTemplate => tempTemplate.source === templateKey(templateSource))[0];\r\n if (cachedTemplate) {\r\n return cachedTemplate.template\r\n }\r\n var template = this._createTemplate(templateSource);\r\n this._tempTemplates.push({\r\n template: template,\r\n source: templateKey(templateSource)\r\n });\r\n return template\r\n }\r\n _createTemplate(templateSource) {\r\n return this._createElement(validateTemplateSource(templateSource))\r\n }\r\n getTemplate(templateSource, templates, _ref3, context) {\r\n var {\r\n isAsyncTemplate: isAsyncTemplate,\r\n skipTemplates: skipTemplates\r\n } = _ref3;\r\n if (!isFunction(templateSource)) {\r\n return acquireTemplate(templateSource, this._createTemplateIfNeeded, templates, isAsyncTemplate, skipTemplates, this._defaultTemplates)\r\n }\r\n return new FunctionTemplate(options => {\r\n var templateSourceResult = templateSource.apply(context, getNormalizedTemplateArgs(options));\r\n if (!isDefined(templateSourceResult)) {\r\n return new EmptyTemplate\r\n }\r\n var dispose = false;\r\n var template = acquireTemplate(templateSourceResult, templateSource => {\r\n if (templateSource.nodeType || isRenderer(templateSource) && !$(templateSource).is(\"script\")) {\r\n return new FunctionTemplate(() => templateSource)\r\n }\r\n dispose = true;\r\n return this._createTemplate(templateSource)\r\n }, templates, isAsyncTemplate, skipTemplates, this._defaultTemplates);\r\n var result = template.render(options);\r\n dispose && template.dispose && template.dispose();\r\n return result\r\n })\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/dom_component.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport $ from \"../core/renderer\";\r\nimport config from \"./config\";\r\nimport errors from \"./errors\";\r\nimport windowResizeCallbacks from \"../core/utils/resize_callbacks\";\r\nimport {\r\n Component\r\n} from \"./component\";\r\nimport {\r\n TemplateManager\r\n} from \"./template_manager\";\r\nimport {\r\n attachInstanceToElement,\r\n getInstanceByElement\r\n} from \"./utils/public_component\";\r\nimport {\r\n addShadowDomStyles\r\n} from \"./utils/shadow_dom\";\r\nimport {\r\n cleanDataRecursive\r\n} from \"./element_data\";\r\nimport {\r\n each\r\n} from \"./utils/iterator\";\r\nimport {\r\n extend\r\n} from \"./utils/extend\";\r\nimport {\r\n getPublicElement\r\n} from \"../core/element\";\r\nimport {\r\n grep,\r\n noop\r\n} from \"./utils/common\";\r\nimport {\r\n isString,\r\n isDefined,\r\n isFunction\r\n} from \"./utils/type\";\r\nimport {\r\n hasWindow\r\n} from \"../core/utils/window\";\r\nimport {\r\n resize as resizeEvent,\r\n visibility as visibilityEvents\r\n} from \"../events/short\";\r\nvar {\r\n abstract: abstract\r\n} = Component;\r\nvar DOMComponent = Component.inherit({\r\n _getDefaultOptions() {\r\n return extend(this.callBase(), {\r\n width: void 0,\r\n height: void 0,\r\n rtlEnabled: config().rtlEnabled,\r\n elementAttr: {},\r\n disabled: false,\r\n integrationOptions: {}\r\n }, this._useTemplates() ? TemplateManager.createDefaultOptions() : {})\r\n },\r\n ctor(element, options) {\r\n this._customClass = null;\r\n this._createElement(element);\r\n attachInstanceToElement(this._$element, this, this._dispose);\r\n this.callBase(options)\r\n },\r\n _createElement(element) {\r\n this._$element = $(element)\r\n },\r\n _getSynchronizableOptionsForCreateComponent: () => [\"rtlEnabled\", \"disabled\", \"templatesRenderAsynchronously\"],\r\n _checkFunctionValueDeprecation: function(optionNames) {\r\n if (!this.option(\"_ignoreFunctionValueDeprecation\")) {\r\n optionNames.forEach(optionName => {\r\n if (isFunction(this.option(optionName))) {\r\n errors.log(\"W0017\", optionName)\r\n }\r\n })\r\n }\r\n },\r\n _visibilityChanged: abstract,\r\n _dimensionChanged: abstract,\r\n _init() {\r\n this.callBase();\r\n this._checkFunctionValueDeprecation([\"width\", \"height\", \"maxHeight\", \"maxWidth\", \"minHeight\", \"minWidth\", \"popupHeight\", \"popupWidth\"]);\r\n this._attachWindowResizeCallback();\r\n this._initTemplateManager()\r\n },\r\n _setOptionsByDevice(instanceCustomRules) {\r\n this.callBase([].concat(this.constructor._classCustomRules || [], instanceCustomRules || []))\r\n },\r\n _isInitialOptionValue(name) {\r\n var isCustomOption = this.constructor._classCustomRules && Object.prototype.hasOwnProperty.call(this._convertRulesToOptions(this.constructor._classCustomRules), name);\r\n return !isCustomOption && this.callBase(name)\r\n },\r\n _attachWindowResizeCallback() {\r\n if (this._isDimensionChangeSupported()) {\r\n var windowResizeCallBack = this._windowResizeCallBack = this._dimensionChanged.bind(this);\r\n windowResizeCallbacks.add(windowResizeCallBack)\r\n }\r\n },\r\n _isDimensionChangeSupported() {\r\n return this._dimensionChanged !== abstract\r\n },\r\n _renderComponent() {\r\n this._initMarkup();\r\n hasWindow() && this._render()\r\n },\r\n _initMarkup() {\r\n var {\r\n rtlEnabled: rtlEnabled\r\n } = this.option() || {};\r\n this._renderElementAttributes();\r\n this._toggleRTLDirection(rtlEnabled);\r\n this._renderVisibilityChange();\r\n this._renderDimensions()\r\n },\r\n _render() {\r\n this._attachVisibilityChangeHandlers();\r\n addShadowDomStyles(this.$element())\r\n },\r\n _renderElementAttributes() {\r\n var {\r\n elementAttr: elementAttr\r\n } = this.option() || {};\r\n var attributes = extend({}, elementAttr);\r\n var classNames = attributes.class;\r\n delete attributes.class;\r\n this.$element().attr(attributes).removeClass(this._customClass).addClass(classNames);\r\n this._customClass = classNames\r\n },\r\n _renderVisibilityChange() {\r\n if (this._isDimensionChangeSupported()) {\r\n this._attachDimensionChangeHandlers()\r\n }\r\n if (this._isVisibilityChangeSupported()) {\r\n var $element = this.$element();\r\n $element.addClass(\"dx-visibility-change-handler\")\r\n }\r\n },\r\n _renderDimensions() {\r\n var $element = this.$element();\r\n var element = $element.get(0);\r\n var width = this._getOptionValue(\"width\", element);\r\n var height = this._getOptionValue(\"height\", element);\r\n if (this._isCssUpdateRequired(element, height, width)) {\r\n $element.css({\r\n width: null === width ? \"\" : width,\r\n height: null === height ? \"\" : height\r\n })\r\n }\r\n },\r\n _isCssUpdateRequired: (element, height, width) => !!(isDefined(width) || isDefined(height) || element.style.width || element.style.height),\r\n _attachDimensionChangeHandlers() {\r\n var $el = this.$element();\r\n var namespace = \"\".concat(this.NAME, \"VisibilityChange\");\r\n resizeEvent.off($el, {\r\n namespace: namespace\r\n });\r\n resizeEvent.on($el, () => this._dimensionChanged(), {\r\n namespace: namespace\r\n })\r\n },\r\n _attachVisibilityChangeHandlers() {\r\n if (this._isVisibilityChangeSupported()) {\r\n var $el = this.$element();\r\n var namespace = \"\".concat(this.NAME, \"VisibilityChange\");\r\n this._isHidden = !this._isVisible();\r\n visibilityEvents.off($el, {\r\n namespace: namespace\r\n });\r\n visibilityEvents.on($el, () => this._checkVisibilityChanged(\"shown\"), () => this._checkVisibilityChanged(\"hiding\"), {\r\n namespace: namespace\r\n })\r\n }\r\n },\r\n _isVisible() {\r\n var $element = this.$element();\r\n return $element.is(\":visible\")\r\n },\r\n _checkVisibilityChanged(action) {\r\n var isVisible = this._isVisible();\r\n if (isVisible) {\r\n if (\"hiding\" === action && !this._isHidden) {\r\n this._visibilityChanged(false);\r\n this._isHidden = true\r\n } else if (\"shown\" === action && this._isHidden) {\r\n this._isHidden = false;\r\n this._visibilityChanged(true)\r\n }\r\n }\r\n },\r\n _isVisibilityChangeSupported() {\r\n return this._visibilityChanged !== abstract && hasWindow()\r\n },\r\n _clean: noop,\r\n _modelByElement() {\r\n var {\r\n modelByElement: modelByElement\r\n } = this.option();\r\n var $element = this.$element();\r\n return modelByElement ? modelByElement($element) : void 0\r\n },\r\n _invalidate() {\r\n if (this._isUpdateAllowed()) {\r\n throw errors.Error(\"E0007\")\r\n }\r\n this._requireRefresh = true\r\n },\r\n _refresh() {\r\n this._clean();\r\n this._renderComponent()\r\n },\r\n _dispose() {\r\n this._templateManager && this._templateManager.dispose();\r\n this.callBase();\r\n this._clean();\r\n this._detachWindowResizeCallback()\r\n },\r\n _detachWindowResizeCallback() {\r\n if (this._isDimensionChangeSupported()) {\r\n windowResizeCallbacks.remove(this._windowResizeCallBack)\r\n }\r\n },\r\n _toggleRTLDirection(rtl) {\r\n var $element = this.$element();\r\n $element.toggleClass(\"dx-rtl\", rtl)\r\n },\r\n _createComponent(element, component) {\r\n var config = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};\r\n var synchronizableOptions = grep(this._getSynchronizableOptionsForCreateComponent(), value => !(value in config));\r\n var {\r\n integrationOptions: integrationOptions\r\n } = this.option();\r\n var {\r\n nestedComponentOptions: nestedComponentOptions\r\n } = this.option();\r\n nestedComponentOptions = nestedComponentOptions || noop;\r\n var nestedComponentConfig = extend({\r\n integrationOptions: integrationOptions\r\n }, nestedComponentOptions(this));\r\n synchronizableOptions.forEach(optionName => nestedComponentConfig[optionName] = this.option(optionName));\r\n this._extendConfig(config, nestedComponentConfig);\r\n var instance = void 0;\r\n if (isString(component)) {\r\n var $element = $(element)[component](config);\r\n instance = $element[component](\"instance\")\r\n } else if (element) {\r\n instance = component.getInstance(element);\r\n if (instance) {\r\n instance.option(config)\r\n } else {\r\n instance = new component(element, config)\r\n }\r\n }\r\n if (instance) {\r\n var optionChangedHandler = _ref => {\r\n var {\r\n name: name,\r\n value: value\r\n } = _ref;\r\n if (synchronizableOptions.includes(name)) {\r\n instance.option(name, value)\r\n }\r\n };\r\n this.on(\"optionChanged\", optionChangedHandler);\r\n instance.on(\"disposing\", () => this.off(\"optionChanged\", optionChangedHandler))\r\n }\r\n return instance\r\n },\r\n _extendConfig(config, extendConfig) {\r\n each(extendConfig, (key, value) => {\r\n !Object.prototype.hasOwnProperty.call(config, key) && (config[key] = value)\r\n })\r\n },\r\n _defaultActionConfig() {\r\n var $element = this.$element();\r\n var context = this._modelByElement($element);\r\n return extend(this.callBase(), {\r\n context: context\r\n })\r\n },\r\n _defaultActionArgs() {\r\n var $element = this.$element();\r\n var model = this._modelByElement($element);\r\n var element = this.element();\r\n return extend(this.callBase(), {\r\n element: element,\r\n model: model\r\n })\r\n },\r\n _optionChanged(args) {\r\n switch (args.name) {\r\n case \"width\":\r\n case \"height\":\r\n this._renderDimensions();\r\n break;\r\n case \"rtlEnabled\":\r\n this._invalidate();\r\n break;\r\n case \"elementAttr\":\r\n this._renderElementAttributes();\r\n break;\r\n case \"disabled\":\r\n case \"integrationOptions\":\r\n break;\r\n default:\r\n this.callBase(args)\r\n }\r\n },\r\n _removeAttributes(element) {\r\n var attrs = element.attributes;\r\n for (var i = attrs.length - 1; i >= 0; i--) {\r\n var attr = attrs[i];\r\n if (attr) {\r\n var {\r\n name: name\r\n } = attr;\r\n if (!name.indexOf(\"aria-\") || -1 !== name.indexOf(\"dx-\") || \"role\" === name || \"style\" === name || \"tabindex\" === name) {\r\n element.removeAttribute(name)\r\n }\r\n }\r\n }\r\n },\r\n _removeClasses(element) {\r\n element.className = element.className.split(\" \").filter(cssClass => 0 !== cssClass.lastIndexOf(\"dx-\", 0)).join(\" \")\r\n },\r\n _updateDOMComponent(renderRequired) {\r\n if (renderRequired) {\r\n this._renderComponent()\r\n } else if (this._requireRefresh) {\r\n this._requireRefresh = false;\r\n this._refresh()\r\n }\r\n },\r\n endUpdate() {\r\n var renderRequired = this._isInitializingRequired();\r\n this.callBase();\r\n this._isUpdateAllowed() && this._updateDOMComponent(renderRequired)\r\n },\r\n $element() {\r\n return this._$element\r\n },\r\n element() {\r\n var $element = this.$element();\r\n return getPublicElement($element)\r\n },\r\n dispose() {\r\n var element = this.$element().get(0);\r\n cleanDataRecursive(element, true);\r\n element.textContent = \"\";\r\n this._removeAttributes(element);\r\n this._removeClasses(element)\r\n },\r\n resetOption(optionName) {\r\n this.callBase(optionName);\r\n if (\"width\" === optionName || \"height\" === optionName) {\r\n var initialOption = this.initialOption(optionName);\r\n !isDefined(initialOption) && this.$element().css(optionName, \"\")\r\n }\r\n },\r\n _getAnonymousTemplateName() {\r\n return\r\n },\r\n _initTemplateManager() {\r\n if (this._templateManager || !this._useTemplates()) {\r\n return\r\n }\r\n var {\r\n integrationOptions: integrationOptions = {}\r\n } = this.option();\r\n var {\r\n createTemplate: createTemplate\r\n } = integrationOptions;\r\n this._templateManager = new TemplateManager(createTemplate, this._getAnonymousTemplateName());\r\n this._initTemplates()\r\n },\r\n _initTemplates() {\r\n var {\r\n templates: templates,\r\n anonymousTemplateMeta: anonymousTemplateMeta\r\n } = this._templateManager.extractTemplates(this.$element());\r\n var anonymousTemplate = this.option(\"integrationOptions.templates.\".concat(anonymousTemplateMeta.name));\r\n templates.forEach(_ref2 => {\r\n var {\r\n name: name,\r\n template: template\r\n } = _ref2;\r\n this._options.silent(\"integrationOptions.templates.\".concat(name), template)\r\n });\r\n if (anonymousTemplateMeta.name && !anonymousTemplate) {\r\n this._options.silent(\"integrationOptions.templates.\".concat(anonymousTemplateMeta.name), anonymousTemplateMeta.template);\r\n this._options.silent(\"_hasAnonymousTemplateContent\", true)\r\n }\r\n },\r\n _getTemplateByOption(optionName) {\r\n return this._getTemplate(this.option(optionName))\r\n },\r\n _getTemplate(templateSource) {\r\n var templates = this.option(\"integrationOptions.templates\");\r\n var isAsyncTemplate = this.option(\"templatesRenderAsynchronously\");\r\n var skipTemplates = this.option(\"integrationOptions.skipTemplates\");\r\n return this._templateManager.getTemplate(templateSource, templates, {\r\n isAsyncTemplate: isAsyncTemplate,\r\n skipTemplates: skipTemplates\r\n }, this)\r\n },\r\n _saveTemplate(name, template) {\r\n this._setOptionWithoutOptionChange(\"integrationOptions.templates.\" + name, this._templateManager._createTemplate(template))\r\n },\r\n _useTemplates: () => true\r\n});\r\nDOMComponent.getInstance = function(element) {\r\n return getInstanceByElement($(element), this)\r\n};\r\nDOMComponent.defaultOptions = function(rule) {\r\n this._classCustomRules = this._classCustomRules || [];\r\n this._classCustomRules.push(rule)\r\n};\r\nexport default DOMComponent;\r\n","/**\r\n * DevExtreme (esm/core/element.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nvar strategy = function(element) {\r\n return element && element.get(0)\r\n};\r\nexport function getPublicElement(element) {\r\n return strategy(element)\r\n}\r\nexport function setPublicElementWrapper(newStrategy) {\r\n strategy = newStrategy\r\n}\r\n","/**\r\n * DevExtreme (esm/core/element_data.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport domAdapter from \"./dom_adapter\";\r\nimport eventsEngine from \"../events/core/events_engine\";\r\nimport MemorizedCallbacks from \"./memorized_callbacks\";\r\nvar dataMap = new WeakMap;\r\nvar strategy;\r\nexport var strategyChanging = new MemorizedCallbacks;\r\nvar beforeCleanDataFunc = function() {};\r\nvar afterCleanDataFunc = function() {};\r\nexport var setDataStrategy = function(value) {\r\n strategyChanging.fire(value);\r\n strategy = value;\r\n var cleanData = strategy.cleanData;\r\n strategy.cleanData = function(nodes) {\r\n beforeCleanDataFunc(nodes);\r\n var result = cleanData.call(this, nodes);\r\n afterCleanDataFunc(nodes);\r\n return result\r\n }\r\n};\r\nsetDataStrategy({\r\n data: function() {\r\n var element = arguments[0];\r\n var key = arguments[1];\r\n var value = arguments[2];\r\n if (!element) {\r\n return\r\n }\r\n var elementData = dataMap.get(element);\r\n if (!elementData) {\r\n elementData = {};\r\n dataMap.set(element, elementData)\r\n }\r\n if (void 0 === key) {\r\n return elementData\r\n }\r\n if (2 === arguments.length) {\r\n return elementData[key]\r\n }\r\n elementData[key] = value;\r\n return value\r\n },\r\n removeData: function(element, key) {\r\n if (!element) {\r\n return\r\n }\r\n if (void 0 === key) {\r\n dataMap.delete(element)\r\n } else {\r\n var elementData = dataMap.get(element);\r\n if (elementData) {\r\n delete elementData[key]\r\n }\r\n }\r\n },\r\n cleanData: function(elements) {\r\n for (var i = 0; i < elements.length; i++) {\r\n eventsEngine.off(elements[i]);\r\n dataMap.delete(elements[i])\r\n }\r\n }\r\n});\r\nexport function getDataStrategy() {\r\n return strategy\r\n}\r\nexport function data() {\r\n return strategy.data.apply(this, arguments)\r\n}\r\nexport function beforeCleanData(callback) {\r\n beforeCleanDataFunc = callback\r\n}\r\nexport function afterCleanData(callback) {\r\n afterCleanDataFunc = callback\r\n}\r\nexport function cleanData(nodes) {\r\n return strategy.cleanData.call(this, nodes)\r\n}\r\nexport function removeData(element, key) {\r\n return strategy.removeData.call(this, element, key)\r\n}\r\nexport function cleanDataRecursive(element, cleanSelf) {\r\n if (!domAdapter.isElementNode(element)) {\r\n return\r\n }\r\n var childElements = element.getElementsByTagName(\"*\");\r\n strategy.cleanData(childElements);\r\n if (cleanSelf) {\r\n strategy.cleanData([element])\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/errors.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport errorUtils from \"./utils/error\";\r\nexport default errorUtils({\r\n E0001: \"Method is not implemented\",\r\n E0002: \"Member name collision: {0}\",\r\n E0003: \"A class must be instantiated using the 'new' keyword\",\r\n E0004: \"The NAME property of the component is not specified\",\r\n E0005: \"Unknown device\",\r\n E0006: \"Unknown endpoint key is requested\",\r\n E0007: \"'Invalidate' method is called outside the update transaction\",\r\n E0008: \"Type of the option name is not appropriate to create an action\",\r\n E0009: \"Component '{0}' has not been initialized for an element\",\r\n E0010: \"Animation configuration with the '{0}' type requires '{1}' configuration as {2}\",\r\n E0011: \"Unknown animation type '{0}'\",\r\n E0012: \"jQuery version is too old. Please upgrade jQuery to 1.10.0 or later\",\r\n E0013: \"KnockoutJS version is too old. Please upgrade KnockoutJS to 2.3.0 or later\",\r\n E0014: \"The 'release' method shouldn't be called for an unlocked Lock object\",\r\n E0015: \"Queued task returned an unexpected result\",\r\n E0017: \"Event namespace is not defined\",\r\n E0018: \"DevExpress.ui.DevExpressPopup widget is required\",\r\n E0020: \"Template engine '{0}' is not supported\",\r\n E0021: \"Unknown theme is set: {0}\",\r\n E0022: \"LINK[rel=DevExpress-theme] tags must go before DevExpress included scripts\",\r\n E0023: \"Template name is not specified\",\r\n E0024: \"DevExtreme bundle already included\",\r\n E0025: \"Unexpected argument type\",\r\n E0100: \"Unknown validation type is detected\",\r\n E0101: \"Misconfigured range validation rule is detected\",\r\n E0102: \"Misconfigured comparison validation rule is detected\",\r\n E0103: \"validationCallback of an asynchronous rule should return a jQuery or a native promise\",\r\n E0110: \"Unknown validation group is detected\",\r\n E0120: \"Adapter for a DevExpressValidator component cannot be configured\",\r\n E0121: \"The 'customItem' parameter of the 'onCustomItemCreating' function is empty or contains invalid data. Assign a custom object or a Promise that is resolved after the item is created.\",\r\n W0000: \"'{0}' is deprecated in {1}. {2}\",\r\n W0001: \"{0} - '{1}' option is deprecated in {2}. {3}\",\r\n W0002: \"{0} - '{1}' method is deprecated in {2}. {3}\",\r\n W0003: \"{0} - '{1}' property is deprecated in {2}. {3}\",\r\n W0004: \"Timeout for theme loading is over: {0}\",\r\n W0005: \"'{0}' event is deprecated in {1}. {2}\",\r\n W0006: \"Invalid recurrence rule: '{0}'\",\r\n W0007: \"'{0}' Globalize culture is not defined\",\r\n W0008: \"Invalid view name: '{0}'\",\r\n W0009: \"Invalid time zone name: '{0}'\",\r\n W0010: \"{0} is deprecated in {1}. {2}\",\r\n W0011: \"Number parsing is invoked while the parser is not defined\",\r\n W0012: \"Date parsing is invoked while the parser is not defined\",\r\n W0013: \"'{0}' file is deprecated in {1}. {2}\",\r\n W0014: \"{0} - '{1}' type is deprecated in {2}. {3}\",\r\n W0015: \"Instead of returning a value from the '{0}' function, write it into the '{1}' field of the function's parameter.\",\r\n W0016: 'The \"{0}\" option does not accept the \"{1}\" value since v{2}. {3}.',\r\n W0017: 'Setting the \"{0}\" property with a function is deprecated since v21.2',\r\n W0018: 'Setting the \"position\" property with a function is deprecated since v21.2'\r\n});\r\n","/**\r\n * DevExtreme (esm/core/events_strategy.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport Callbacks from \"./utils/callbacks\";\r\nimport {\r\n each\r\n} from \"./utils/iterator\";\r\nimport {\r\n isFunction,\r\n isPlainObject\r\n} from \"./utils/type\";\r\nexport class EventsStrategy {\r\n constructor(owner) {\r\n var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};\r\n this._events = {};\r\n this._owner = owner;\r\n this._options = options\r\n }\r\n static create(owner, strategy) {\r\n if (strategy) {\r\n return isFunction(strategy) ? strategy(owner) : strategy\r\n } else {\r\n return new EventsStrategy(owner)\r\n }\r\n }\r\n hasEvent(eventName) {\r\n var callbacks = this._events[eventName];\r\n return callbacks ? callbacks.has() : false\r\n }\r\n fireEvent(eventName, eventArgs) {\r\n var callbacks = this._events[eventName];\r\n if (callbacks) {\r\n callbacks.fireWith(this._owner, eventArgs)\r\n }\r\n return this._owner\r\n }\r\n on(eventName, eventHandler) {\r\n if (isPlainObject(eventName)) {\r\n each(eventName, (e, h) => {\r\n this.on(e, h)\r\n })\r\n } else {\r\n var callbacks = this._events[eventName];\r\n if (!callbacks) {\r\n callbacks = Callbacks({\r\n syncStrategy: this._options.syncStrategy\r\n });\r\n this._events[eventName] = callbacks\r\n }\r\n var addFn = callbacks.originalAdd || callbacks.add;\r\n addFn.call(callbacks, eventHandler)\r\n }\r\n }\r\n off(eventName, eventHandler) {\r\n var callbacks = this._events[eventName];\r\n if (callbacks) {\r\n if (isFunction(eventHandler)) {\r\n callbacks.remove(eventHandler)\r\n } else {\r\n callbacks.empty()\r\n }\r\n }\r\n }\r\n dispose() {\r\n each(this._events, (eventName, event) => {\r\n event.empty()\r\n })\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/guid.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport Class from \"./class\";\r\nvar Guid = Class.inherit({\r\n ctor: function(value) {\r\n if (value) {\r\n value = String(value)\r\n }\r\n this._value = this._normalize(value || this._generate())\r\n },\r\n _normalize: function(value) {\r\n value = value.replace(/[^a-f0-9]/gi, \"\").toLowerCase();\r\n while (value.length < 32) {\r\n value += \"0\"\r\n }\r\n return [value.substr(0, 8), value.substr(8, 4), value.substr(12, 4), value.substr(16, 4), value.substr(20, 12)].join(\"-\")\r\n },\r\n _generate: function() {\r\n var value = \"\";\r\n for (var i = 0; i < 32; i++) {\r\n value += Math.round(15 * Math.random()).toString(16)\r\n }\r\n return value\r\n },\r\n toString: function() {\r\n return this._value\r\n },\r\n valueOf: function() {\r\n return this._value\r\n },\r\n toJSON: function() {\r\n return this._value\r\n }\r\n});\r\nexport default Guid;\r\n","/**\r\n * DevExtreme (esm/core/memorized_callbacks.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n each\r\n} from \"../core/utils/iterator\";\r\nimport Callbacks from \"./utils/callbacks\";\r\nexport default class MemorizedCallbacks {\r\n constructor() {\r\n this.memory = [];\r\n this.callbacks = Callbacks()\r\n }\r\n add(fn) {\r\n each(this.memory, (_, item) => fn.apply(fn, item));\r\n this.callbacks.add(fn)\r\n }\r\n remove(fn) {\r\n this.callbacks.remove(fn)\r\n }\r\n fire() {\r\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\r\n args[_key] = arguments[_key]\r\n }\r\n this.memory.push(args);\r\n this.callbacks.fire.apply(this.callbacks, args)\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/options/option_manager.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n compileGetter,\r\n compileSetter,\r\n getPathParts\r\n} from \"../utils/data\";\r\nimport {\r\n noop\r\n} from \"../utils/common\";\r\nimport {\r\n equals\r\n} from \"../utils/comparator\";\r\nimport {\r\n extend\r\n} from \"../utils/extend\";\r\nimport {\r\n isDefined,\r\n isPlainObject\r\n} from \"../utils/type\";\r\nimport {\r\n normalizeOptions\r\n} from \"./utils\";\r\nvar cachedGetters = {};\r\nvar cachedSetters = {};\r\nexport class OptionManager {\r\n constructor(options, optionsByReference) {\r\n this._options = options;\r\n this._optionsByReference = optionsByReference;\r\n this._changingCallback;\r\n this._changedCallback;\r\n this._namePreparedCallbacks\r\n }\r\n _setByReference(options, rulesOptions) {\r\n extend(true, options, rulesOptions);\r\n for (var fieldName in this._optionsByReference) {\r\n if (Object.prototype.hasOwnProperty.call(rulesOptions, fieldName)) {\r\n options[fieldName] = rulesOptions[fieldName]\r\n }\r\n }\r\n }\r\n _setPreparedValue(name, value, merge, silent) {\r\n var previousValue = this.get(this._options, name, false);\r\n if (!equals(previousValue, value)) {\r\n var path = getPathParts(name);\r\n !silent && this._changingCallback(name, previousValue, value);\r\n cachedSetters[name] = cachedSetters[name] || compileSetter(name);\r\n cachedSetters[name](this._options, value, {\r\n functionsAsIs: true,\r\n merge: isDefined(merge) ? merge : !this._optionsByReference[name],\r\n unwrapObservables: path.length > 1 && !!this._optionsByReference[path[0]]\r\n });\r\n !silent && this._changedCallback(name, value, previousValue)\r\n }\r\n }\r\n _prepareRelevantNames(options, name, value, silent) {\r\n if (isPlainObject(value)) {\r\n for (var valueName in value) {\r\n this._prepareRelevantNames(options, \"\".concat(name, \".\").concat(valueName), value[valueName])\r\n }\r\n }\r\n this._namePreparedCallbacks(options, name, value, silent)\r\n }\r\n get() {\r\n var options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this._options;\r\n var name = arguments.length > 1 ? arguments[1] : void 0;\r\n var unwrapObservables = arguments.length > 2 ? arguments[2] : void 0;\r\n cachedGetters[name] = cachedGetters[name] || compileGetter(name);\r\n return cachedGetters[name](options, {\r\n functionsAsIs: true,\r\n unwrapObservables: unwrapObservables\r\n })\r\n }\r\n set(options, value, merge, silent) {\r\n options = normalizeOptions(options, value);\r\n for (var name in options) {\r\n this._prepareRelevantNames(options, name, options[name], silent)\r\n }\r\n for (var _name in options) {\r\n this._setPreparedValue(_name, options[_name], merge, silent)\r\n }\r\n }\r\n onRelevantNamesPrepared(callBack) {\r\n this._namePreparedCallbacks = callBack\r\n }\r\n onChanging(callBack) {\r\n this._changingCallback = callBack\r\n }\r\n onChanged(callBack) {\r\n this._changedCallback = callBack\r\n }\r\n dispose() {\r\n this._changingCallback = noop;\r\n this._changedCallback = noop\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/utils/comparator.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport domAdapter from \"../dom_adapter\";\r\nimport {\r\n toComparable\r\n} from \"./data\";\r\nimport {\r\n isRenderer\r\n} from \"./type\";\r\nvar hasNegation = function(oldValue, newValue) {\r\n return 1 / oldValue === 1 / newValue\r\n};\r\nexport var equals = function(oldValue, newValue) {\r\n oldValue = toComparable(oldValue, true);\r\n newValue = toComparable(newValue, true);\r\n if (oldValue && newValue && isRenderer(oldValue) && isRenderer(newValue)) {\r\n return newValue.is(oldValue)\r\n }\r\n var oldValueIsNaN = oldValue !== oldValue;\r\n var newValueIsNaN = newValue !== newValue;\r\n if (oldValueIsNaN && newValueIsNaN) {\r\n return true\r\n }\r\n if (0 === oldValue && 0 === newValue) {\r\n return hasNegation(oldValue, newValue)\r\n }\r\n if (null === oldValue || \"object\" !== typeof oldValue || domAdapter.isElementNode(oldValue)) {\r\n return oldValue === newValue\r\n }\r\n return false\r\n};\r\n","/**\r\n * DevExtreme (esm/core/options/index.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\r\nimport {\r\n isFunction,\r\n isObject,\r\n type\r\n} from \"../utils/type\";\r\nimport {\r\n equalByValue,\r\n noop\r\n} from \"../utils/common\";\r\nimport {\r\n OptionManager\r\n} from \"./option_manager\";\r\nimport {\r\n getPathParts\r\n} from \"../utils/data\";\r\nimport {\r\n getFieldName,\r\n getParentName,\r\n convertRulesToOptions,\r\n getNestedOptionValue\r\n} from \"./utils\";\r\nimport {\r\n extend\r\n} from \"../utils/extend\";\r\nexport class Options {\r\n constructor(options, defaultOptions, optionsByReference, deprecatedOptions) {\r\n this._deprecatedCallback;\r\n this._startChangeCallback;\r\n this._endChangeCallback;\r\n this._default = defaultOptions;\r\n this._deprecated = deprecatedOptions;\r\n this._deprecatedNames = [];\r\n this._initDeprecatedNames();\r\n this._optionManager = new OptionManager(options, optionsByReference);\r\n this._optionManager.onRelevantNamesPrepared((options, name, value, silent) => this._setRelevantNames(options, name, value, silent));\r\n this._cachedOptions = {};\r\n this._rules = []\r\n }\r\n set _initial(value) {\r\n this._initialOptions = value\r\n }\r\n get _initial() {\r\n if (!this._initialOptions) {\r\n var rulesOptions = this._getByRules(this.silent(\"defaultOptionsRules\"));\r\n this._initialOptions = this._default;\r\n this._optionManager._setByReference(this._initialOptions, rulesOptions)\r\n }\r\n return this._initialOptions\r\n }\r\n _initDeprecatedNames() {\r\n for (var optionName in this._deprecated) {\r\n this._deprecatedNames.push(optionName)\r\n }\r\n }\r\n _getByRules(rules) {\r\n rules = Array.isArray(rules) ? this._rules.concat(rules) : this._rules;\r\n return convertRulesToOptions(rules)\r\n }\r\n _notifyDeprecated(option) {\r\n var info = this._deprecated[option];\r\n if (info) {\r\n this._deprecatedCallback(option, info)\r\n }\r\n }\r\n _setRelevantNames(options, name, value, silent) {\r\n if (name) {\r\n var normalizedName = this._normalizeName(name, silent);\r\n if (normalizedName && normalizedName !== name) {\r\n this._setField(options, normalizedName, value);\r\n this._clearField(options, name)\r\n }\r\n }\r\n }\r\n _setField(options, fullName, value) {\r\n var fieldName = \"\";\r\n var fieldObject = null;\r\n do {\r\n fieldName = fieldName ? \".\".concat(fieldName) : \"\";\r\n fieldName = getFieldName(fullName) + fieldName;\r\n fullName = getParentName(fullName);\r\n fieldObject = fullName ? this._optionManager.get(options, fullName, false) : options\r\n } while (!fieldObject);\r\n fieldObject[fieldName] = value\r\n }\r\n _clearField(options, name) {\r\n delete options[name];\r\n var previousFieldName = getParentName(name);\r\n var fieldObject = previousFieldName ? this._optionManager.get(options, previousFieldName, false) : options;\r\n if (fieldObject) {\r\n delete fieldObject[getFieldName(name)]\r\n }\r\n }\r\n _normalizeName(name, silent) {\r\n if (this._deprecatedNames.length && name) {\r\n for (var i = 0; i < this._deprecatedNames.length; i++) {\r\n if (this._deprecatedNames[i] === name) {\r\n var deprecate = this._deprecated[name];\r\n if (deprecate) {\r\n !silent && this._notifyDeprecated(name);\r\n return deprecate.alias || name\r\n }\r\n }\r\n }\r\n }\r\n return name\r\n }\r\n addRules(rules) {\r\n this._rules = rules.concat(this._rules)\r\n }\r\n applyRules(rules) {\r\n var options = this._getByRules(rules);\r\n this.silent(options)\r\n }\r\n dispose() {\r\n this._deprecatedCallback = noop;\r\n this._startChangeCallback = noop;\r\n this._endChangeCallback = noop;\r\n this._optionManager.dispose()\r\n }\r\n onChanging(callBack) {\r\n this._optionManager.onChanging(callBack)\r\n }\r\n onChanged(callBack) {\r\n this._optionManager.onChanged(callBack)\r\n }\r\n onDeprecated(callBack) {\r\n this._deprecatedCallback = callBack\r\n }\r\n onStartChange(callBack) {\r\n this._startChangeCallback = callBack\r\n }\r\n onEndChange(callBack) {\r\n this._endChangeCallback = callBack\r\n }\r\n isInitial(name) {\r\n var value = this.silent(name);\r\n var initialValue = this.initial(name);\r\n var areFunctions = isFunction(value) && isFunction(initialValue);\r\n return areFunctions ? value.toString() === initialValue.toString() : equalByValue(value, initialValue)\r\n }\r\n initial(name) {\r\n return getNestedOptionValue(this._initial, name)\r\n }\r\n option(options, value) {\r\n var isGetter = arguments.length < 2 && \"object\" !== type(options);\r\n if (isGetter) {\r\n return this._optionManager.get(void 0, this._normalizeName(options))\r\n } else {\r\n this._startChangeCallback();\r\n try {\r\n this._optionManager.set(options, value)\r\n } finally {\r\n this._endChangeCallback()\r\n }\r\n }\r\n }\r\n silent(options, value) {\r\n var isGetter = arguments.length < 2 && \"object\" !== type(options);\r\n if (isGetter) {\r\n return this._optionManager.get(void 0, options, void 0, true)\r\n } else {\r\n this._optionManager.set(options, value, void 0, true)\r\n }\r\n }\r\n reset(name) {\r\n if (name) {\r\n var fullPath = getPathParts(name);\r\n var value = fullPath.reduce((value, field) => value ? value[field] : this.initial(field), null);\r\n var defaultValue = isObject(value) ? _extends({}, value) : value;\r\n this._optionManager.set(name, defaultValue, false)\r\n }\r\n }\r\n getAliasesByName(name) {\r\n return Object.keys(this._deprecated).filter(aliasName => name === this._deprecated[aliasName].alias)\r\n }\r\n isDeprecated(name) {\r\n return Object.prototype.hasOwnProperty.call(this._deprecated, name)\r\n }\r\n cache(name, options) {\r\n var isGetter = arguments.length < 2;\r\n if (isGetter) {\r\n return this._cachedOptions[name]\r\n } else {\r\n this._cachedOptions[name] = extend(this._cachedOptions[name], options)\r\n }\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/options/utils.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport devices from \"../devices\";\r\nimport {\r\n isEmptyObject,\r\n isFunction\r\n} from \"../utils/type\";\r\nimport {\r\n findBestMatches\r\n} from \"../utils/common\";\r\nimport {\r\n extend\r\n} from \"../utils/extend\";\r\nimport {\r\n compileGetter\r\n} from \"../utils/data\";\r\nvar cachedGetters = {};\r\nexport var convertRulesToOptions = rules => {\r\n var currentDevice = devices.current();\r\n return rules.reduce((options, _ref) => {\r\n var {\r\n device: device,\r\n options: ruleOptions\r\n } = _ref;\r\n var deviceFilter = device || {};\r\n var match = isFunction(deviceFilter) ? deviceFilter(currentDevice) : deviceMatch(currentDevice, deviceFilter);\r\n if (match) {\r\n extend(true, options, ruleOptions)\r\n }\r\n return options\r\n }, {})\r\n};\r\nexport var normalizeOptions = (options, value) => \"string\" !== typeof options ? options : {\r\n [options]: value\r\n};\r\nexport var deviceMatch = (device, filter) => isEmptyObject(filter) || findBestMatches(device, [filter]).length > 0;\r\nexport var getFieldName = fullName => fullName.substr(fullName.lastIndexOf(\".\") + 1);\r\nexport var getParentName = fullName => fullName.substr(0, fullName.lastIndexOf(\".\"));\r\nexport var getNestedOptionValue = function(optionsObject, name) {\r\n cachedGetters[name] = cachedGetters[name] || compileGetter(name);\r\n return cachedGetters[name](optionsObject, {\r\n functionsAsIs: true\r\n })\r\n};\r\nexport var createDefaultOptionRules = function() {\r\n var options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];\r\n return options\r\n};\r\n","/**\r\n * DevExtreme (esm/core/renderer_base.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n cleanDataRecursive,\r\n removeData,\r\n data as elementData\r\n} from \"./element_data\";\r\nimport domAdapter from \"./dom_adapter\";\r\nimport {\r\n getWindow\r\n} from \"./utils/window\";\r\nimport {\r\n isObject,\r\n isWindow,\r\n isPlainObject,\r\n isString,\r\n isNumeric,\r\n isDefined,\r\n isFunction,\r\n type\r\n} from \"./utils/type\";\r\nimport {\r\n styleProp,\r\n normalizeStyleProp\r\n} from \"./utils/style\";\r\nimport {\r\n getOffset,\r\n getWindowByElement\r\n} from \"./utils/size\";\r\nimport {\r\n parseHTML,\r\n isTablePart\r\n} from \"./utils/html_parser\";\r\nvar window = getWindow();\r\nvar renderer;\r\nvar initRender = function(selector, context) {\r\n if (!selector) {\r\n this.length = 0;\r\n return this\r\n }\r\n if (\"string\" === typeof selector) {\r\n if (\"body\" === selector) {\r\n this[0] = context ? context.body : domAdapter.getBody();\r\n this.length = 1;\r\n return this\r\n }\r\n context = context || domAdapter.getDocument();\r\n if (\"<\" === selector[0]) {\r\n this[0] = domAdapter.createElement(selector.slice(1, -1), context);\r\n this.length = 1;\r\n return this\r\n } [].push.apply(this, domAdapter.querySelectorAll(context, selector));\r\n return this\r\n } else if (domAdapter.isNode(selector) || isWindow(selector)) {\r\n this[0] = selector;\r\n this.length = 1;\r\n return this\r\n } else if (Array.isArray(selector)) {\r\n [].push.apply(this, selector);\r\n return this\r\n }\r\n return renderer(selector.toArray ? selector.toArray() : [selector])\r\n};\r\nrenderer = function(selector, context) {\r\n return new initRender(selector, context)\r\n};\r\nrenderer.fn = {\r\n dxRenderer: true\r\n};\r\ninitRender.prototype = renderer.fn;\r\nvar repeatMethod = function(methodName, args) {\r\n for (var i = 0; i < this.length; i++) {\r\n var item = renderer(this[i]);\r\n item[methodName].apply(item, args)\r\n }\r\n return this\r\n};\r\nvar setAttributeValue = function(element, attrName, value) {\r\n if (void 0 !== value && null !== value && false !== value) {\r\n domAdapter.setAttribute(element, attrName, value)\r\n } else {\r\n domAdapter.removeAttribute(element, attrName)\r\n }\r\n};\r\ninitRender.prototype.show = function() {\r\n return this.toggle(true)\r\n};\r\ninitRender.prototype.hide = function() {\r\n return this.toggle(false)\r\n};\r\ninitRender.prototype.toggle = function(value) {\r\n if (this[0]) {\r\n this.toggleClass(\"dx-state-invisible\", !value)\r\n }\r\n return this\r\n};\r\ninitRender.prototype.attr = function(attrName, value) {\r\n if (this.length > 1 && arguments.length > 1) {\r\n return repeatMethod.call(this, \"attr\", arguments)\r\n }\r\n if (!this[0]) {\r\n if (isObject(attrName) || void 0 !== value) {\r\n return this\r\n } else {\r\n return\r\n }\r\n }\r\n if (!this[0].getAttribute) {\r\n return this.prop(attrName, value)\r\n }\r\n if (\"string\" === typeof attrName && 1 === arguments.length) {\r\n var result = this[0].getAttribute(attrName);\r\n return null == result ? void 0 : result\r\n } else if (isPlainObject(attrName)) {\r\n for (var key in attrName) {\r\n this.attr(key, attrName[key])\r\n }\r\n } else {\r\n setAttributeValue(this[0], attrName, value)\r\n }\r\n return this\r\n};\r\ninitRender.prototype.removeAttr = function(attrName) {\r\n this[0] && domAdapter.removeAttribute(this[0], attrName);\r\n return this\r\n};\r\ninitRender.prototype.prop = function(propName, value) {\r\n if (!this[0]) {\r\n return this\r\n }\r\n if (\"string\" === typeof propName && 1 === arguments.length) {\r\n return this[0][propName]\r\n } else if (isPlainObject(propName)) {\r\n for (var key in propName) {\r\n this.prop(key, propName[key])\r\n }\r\n } else {\r\n domAdapter.setProperty(this[0], propName, value)\r\n }\r\n return this\r\n};\r\ninitRender.prototype.addClass = function(className) {\r\n return this.toggleClass(className, true)\r\n};\r\ninitRender.prototype.removeClass = function(className) {\r\n return this.toggleClass(className, false)\r\n};\r\ninitRender.prototype.hasClass = function(className) {\r\n if (!this[0] || void 0 === this[0].className) {\r\n return false\r\n }\r\n var classNames = className.split(\" \");\r\n for (var i = 0; i < classNames.length; i++) {\r\n if (this[0].classList) {\r\n if (this[0].classList.contains(classNames[i])) {\r\n return true\r\n }\r\n } else {\r\n var _className = isString(this[0].className) ? this[0].className : domAdapter.getAttribute(this[0], \"class\");\r\n if ((_className || \"\").split(\" \").indexOf(classNames[i]) >= 0) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n};\r\ninitRender.prototype.toggleClass = function(className, value) {\r\n if (this.length > 1) {\r\n return repeatMethod.call(this, \"toggleClass\", arguments)\r\n }\r\n if (!this[0] || !className) {\r\n return this\r\n }\r\n value = void 0 === value ? !this.hasClass(className) : value;\r\n var classNames = className.split(\" \");\r\n for (var i = 0; i < classNames.length; i++) {\r\n domAdapter.setClass(this[0], classNames[i], value)\r\n }\r\n return this\r\n};\r\ninitRender.prototype.html = function(value) {\r\n if (!arguments.length) {\r\n return this[0].innerHTML\r\n }\r\n this.empty();\r\n if (\"string\" === typeof value && !isTablePart(value) || \"number\" === typeof value) {\r\n this[0].innerHTML = value;\r\n return this\r\n }\r\n return this.append(parseHTML(value))\r\n};\r\nvar appendElements = function(element, nextSibling) {\r\n if (!this[0] || !element) {\r\n return\r\n }\r\n if (\"string\" === typeof element) {\r\n element = parseHTML(element)\r\n } else if (element.nodeType) {\r\n element = [element]\r\n } else if (isNumeric(element)) {\r\n element = [domAdapter.createTextNode(element)]\r\n }\r\n for (var i = 0; i < element.length; i++) {\r\n var item = element[i];\r\n var container = this[0];\r\n var wrapTR = \"TABLE\" === container.tagName && \"TR\" === item.tagName;\r\n if (wrapTR && container.tBodies && container.tBodies.length) {\r\n container = container.tBodies[0]\r\n }\r\n domAdapter.insertElement(container, item.nodeType ? item : item[0], nextSibling)\r\n }\r\n};\r\nvar setCss = function(name, value) {\r\n if (!this[0] || !this[0].style) {\r\n return\r\n }\r\n if (null === value || \"number\" === typeof value && isNaN(value)) {\r\n return\r\n }\r\n name = styleProp(name);\r\n for (var i = 0; i < this.length; i++) {\r\n this[i].style[name] = normalizeStyleProp(name, value)\r\n }\r\n};\r\ninitRender.prototype.css = function(name, value) {\r\n if (isString(name)) {\r\n if (2 === arguments.length) {\r\n setCss.call(this, name, value)\r\n } else {\r\n if (!this[0]) {\r\n return\r\n }\r\n name = styleProp(name);\r\n var result = window.getComputedStyle(this[0])[name] || this[0].style[name];\r\n return isNumeric(result) ? result.toString() : result\r\n }\r\n } else if (isPlainObject(name)) {\r\n for (var key in name) {\r\n setCss.call(this, key, name[key])\r\n }\r\n }\r\n return this\r\n};\r\ninitRender.prototype.prepend = function(element) {\r\n if (arguments.length > 1) {\r\n for (var i = 0; i < arguments.length; i++) {\r\n this.prepend(arguments[i])\r\n }\r\n return this\r\n }\r\n appendElements.apply(this, [element, this[0].firstChild]);\r\n return this\r\n};\r\ninitRender.prototype.append = function(element) {\r\n if (arguments.length > 1) {\r\n for (var i = 0; i < arguments.length; i++) {\r\n this.append(arguments[i])\r\n }\r\n return this\r\n }\r\n appendElements.apply(this, [element]);\r\n return this\r\n};\r\ninitRender.prototype.prependTo = function(element) {\r\n if (this.length > 1) {\r\n for (var i = this.length - 1; i >= 0; i--) {\r\n renderer(this[i]).prependTo(element)\r\n }\r\n return this\r\n }\r\n element = renderer(element);\r\n if (element[0]) {\r\n domAdapter.insertElement(element[0], this[0], element[0].firstChild)\r\n }\r\n return this\r\n};\r\ninitRender.prototype.appendTo = function(element) {\r\n if (this.length > 1) {\r\n return repeatMethod.call(this, \"appendTo\", arguments)\r\n }\r\n domAdapter.insertElement(renderer(element)[0], this[0]);\r\n return this\r\n};\r\ninitRender.prototype.insertBefore = function(element) {\r\n if (element && element[0]) {\r\n domAdapter.insertElement(element[0].parentNode, this[0], element[0])\r\n }\r\n return this\r\n};\r\ninitRender.prototype.insertAfter = function(element) {\r\n if (element && element[0]) {\r\n domAdapter.insertElement(element[0].parentNode, this[0], element[0].nextSibling)\r\n }\r\n return this\r\n};\r\ninitRender.prototype.before = function(element) {\r\n if (this[0]) {\r\n domAdapter.insertElement(this[0].parentNode, element[0], this[0])\r\n }\r\n return this\r\n};\r\ninitRender.prototype.after = function(element) {\r\n if (this[0]) {\r\n domAdapter.insertElement(this[0].parentNode, element[0], this[0].nextSibling)\r\n }\r\n return this\r\n};\r\ninitRender.prototype.wrap = function(wrapper) {\r\n if (this[0]) {\r\n var wrap = renderer(wrapper);\r\n wrap.insertBefore(this);\r\n wrap.append(this)\r\n }\r\n return this\r\n};\r\ninitRender.prototype.wrapInner = function(wrapper) {\r\n var contents = this.contents();\r\n if (contents.length) {\r\n contents.wrap(wrapper)\r\n } else {\r\n this.append(wrapper)\r\n }\r\n return this\r\n};\r\ninitRender.prototype.replaceWith = function(element) {\r\n if (!(element && element[0])) {\r\n return\r\n }\r\n if (element.is(this)) {\r\n return this\r\n }\r\n element.insertBefore(this);\r\n this.remove();\r\n return element\r\n};\r\ninitRender.prototype.remove = function() {\r\n if (this.length > 1) {\r\n return repeatMethod.call(this, \"remove\", arguments)\r\n }\r\n cleanDataRecursive(this[0], true);\r\n domAdapter.removeElement(this[0]);\r\n return this\r\n};\r\ninitRender.prototype.detach = function() {\r\n if (this.length > 1) {\r\n return repeatMethod.call(this, \"detach\", arguments)\r\n }\r\n domAdapter.removeElement(this[0]);\r\n return this\r\n};\r\ninitRender.prototype.empty = function() {\r\n if (this.length > 1) {\r\n return repeatMethod.call(this, \"empty\", arguments)\r\n }\r\n cleanDataRecursive(this[0]);\r\n domAdapter.setText(this[0], \"\");\r\n return this\r\n};\r\ninitRender.prototype.clone = function() {\r\n var result = [];\r\n for (var i = 0; i < this.length; i++) {\r\n result.push(this[i].cloneNode(true))\r\n }\r\n return renderer(result)\r\n};\r\ninitRender.prototype.text = function(value) {\r\n if (!arguments.length) {\r\n var result = \"\";\r\n for (var i = 0; i < this.length; i++) {\r\n result += this[i] && this[i].textContent || \"\"\r\n }\r\n return result\r\n }\r\n var text = isFunction(value) ? value() : value;\r\n cleanDataRecursive(this[0], false);\r\n domAdapter.setText(this[0], isDefined(text) ? text : \"\");\r\n return this\r\n};\r\ninitRender.prototype.val = function(value) {\r\n if (1 === arguments.length) {\r\n return this.prop(\"value\", isDefined(value) ? value : \"\")\r\n }\r\n return this.prop(\"value\")\r\n};\r\ninitRender.prototype.contents = function() {\r\n if (!this[0]) {\r\n return renderer()\r\n }\r\n var result = [];\r\n result.push.apply(result, this[0].childNodes);\r\n return renderer(result)\r\n};\r\ninitRender.prototype.find = function(selector) {\r\n var result = renderer();\r\n if (!selector) {\r\n return result\r\n }\r\n var nodes = [];\r\n var i;\r\n if (\"string\" === typeof selector) {\r\n selector = selector.trim();\r\n for (i = 0; i < this.length; i++) {\r\n var element = this[i];\r\n if (domAdapter.isElementNode(element)) {\r\n var elementId = element.getAttribute(\"id\");\r\n var queryId = elementId || \"dx-query-children\";\r\n if (!elementId) {\r\n setAttributeValue(element, \"id\", queryId)\r\n }\r\n queryId = \"[id='\" + queryId + \"'] \";\r\n var querySelector = queryId + selector.replace(/([^\\\\])(,)/g, \"$1, \" + queryId);\r\n nodes.push.apply(nodes, domAdapter.querySelectorAll(element, querySelector));\r\n setAttributeValue(element, \"id\", elementId)\r\n } else if (domAdapter.isDocument(element) || domAdapter.isDocumentFragment(element)) {\r\n nodes.push.apply(nodes, domAdapter.querySelectorAll(element, selector))\r\n }\r\n }\r\n } else {\r\n for (i = 0; i < this.length; i++) {\r\n selector = domAdapter.isNode(selector) ? selector : selector[0];\r\n if (this[i] !== selector && this[i].contains(selector)) {\r\n nodes.push(selector)\r\n }\r\n }\r\n }\r\n return result.add(nodes)\r\n};\r\nvar isVisible = function(_, element) {\r\n var _element$host;\r\n element = null !== (_element$host = element.host) && void 0 !== _element$host ? _element$host : element;\r\n if (!element.nodeType) {\r\n return true\r\n }\r\n return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length)\r\n};\r\ninitRender.prototype.filter = function(selector) {\r\n if (!selector) {\r\n return renderer()\r\n }\r\n if (\":visible\" === selector) {\r\n return this.filter(isVisible)\r\n } else if (\":hidden\" === selector) {\r\n return this.filter((function(_, element) {\r\n return !isVisible(_, element)\r\n }))\r\n }\r\n var result = [];\r\n for (var i = 0; i < this.length; i++) {\r\n var item = this[i];\r\n if (domAdapter.isElementNode(item) && \"string\" === type(selector)) {\r\n domAdapter.elementMatches(item, selector) && result.push(item)\r\n } else if (domAdapter.isNode(selector) || isWindow(selector)) {\r\n selector === item && result.push(item)\r\n } else if (isFunction(selector)) {\r\n selector.call(item, i, item) && result.push(item)\r\n } else {\r\n for (var j = 0; j < selector.length; j++) {\r\n selector[j] === item && result.push(item)\r\n }\r\n }\r\n }\r\n return renderer(result)\r\n};\r\ninitRender.prototype.not = function(selector) {\r\n var result = [];\r\n var nodes = this.filter(selector).toArray();\r\n for (var i = 0; i < this.length; i++) {\r\n if (-1 === nodes.indexOf(this[i])) {\r\n result.push(this[i])\r\n }\r\n }\r\n return renderer(result)\r\n};\r\ninitRender.prototype.is = function(selector) {\r\n return !!this.filter(selector).length\r\n};\r\ninitRender.prototype.children = function(selector) {\r\n var result = [];\r\n for (var i = 0; i < this.length; i++) {\r\n var nodes = this[i] ? this[i].childNodes : [];\r\n for (var j = 0; j < nodes.length; j++) {\r\n if (domAdapter.isElementNode(nodes[j])) {\r\n result.push(nodes[j])\r\n }\r\n }\r\n }\r\n result = renderer(result);\r\n return selector ? result.filter(selector) : result\r\n};\r\ninitRender.prototype.siblings = function() {\r\n var element = this[0];\r\n if (!element || !element.parentNode) {\r\n return renderer()\r\n }\r\n var result = [];\r\n var parentChildNodes = element.parentNode.childNodes || [];\r\n for (var i = 0; i < parentChildNodes.length; i++) {\r\n var node = parentChildNodes[i];\r\n if (domAdapter.isElementNode(node) && node !== element) {\r\n result.push(node)\r\n }\r\n }\r\n return renderer(result)\r\n};\r\ninitRender.prototype.each = function(callback) {\r\n for (var i = 0; i < this.length; i++) {\r\n if (false === callback.call(this[i], i, this[i])) {\r\n break\r\n }\r\n }\r\n};\r\ninitRender.prototype.index = function(element) {\r\n if (!element) {\r\n return this.parent().children().index(this)\r\n }\r\n element = renderer(element);\r\n return this.toArray().indexOf(element[0])\r\n};\r\ninitRender.prototype.get = function(index) {\r\n return this[index < 0 ? this.length + index : index]\r\n};\r\ninitRender.prototype.eq = function(index) {\r\n index = index < 0 ? this.length + index : index;\r\n return renderer(this[index])\r\n};\r\ninitRender.prototype.first = function() {\r\n return this.eq(0)\r\n};\r\ninitRender.prototype.last = function() {\r\n return this.eq(-1)\r\n};\r\ninitRender.prototype.select = function() {\r\n for (var i = 0; i < this.length; i += 1) {\r\n this[i].select && this[i].select()\r\n }\r\n return this\r\n};\r\ninitRender.prototype.parent = function(selector) {\r\n if (!this[0]) {\r\n return renderer()\r\n }\r\n var result = renderer(this[0].parentNode);\r\n return !selector || result.is(selector) ? result : renderer()\r\n};\r\ninitRender.prototype.parents = function(selector) {\r\n var result = [];\r\n var parent = this.parent();\r\n while (parent && parent[0] && !domAdapter.isDocument(parent[0])) {\r\n if (domAdapter.isElementNode(parent[0])) {\r\n if (!selector || parent.is(selector)) {\r\n result.push(parent.get(0))\r\n }\r\n }\r\n parent = parent.parent()\r\n }\r\n return renderer(result)\r\n};\r\ninitRender.prototype.closest = function(selector) {\r\n if (this.is(selector)) {\r\n return this\r\n }\r\n var parent = this.parent();\r\n while (parent && parent.length) {\r\n if (parent.is(selector)) {\r\n return parent\r\n }\r\n parent = parent.parent()\r\n }\r\n return renderer()\r\n};\r\ninitRender.prototype.next = function(selector) {\r\n if (!this[0]) {\r\n return renderer()\r\n }\r\n var next = renderer(this[0].nextSibling);\r\n if (!arguments.length) {\r\n return next\r\n }\r\n while (next && next.length) {\r\n if (next.is(selector)) {\r\n return next\r\n }\r\n next = next.next()\r\n }\r\n return renderer()\r\n};\r\ninitRender.prototype.prev = function() {\r\n if (!this[0]) {\r\n return renderer()\r\n }\r\n return renderer(this[0].previousSibling)\r\n};\r\ninitRender.prototype.add = function(selector) {\r\n var targets = renderer(selector);\r\n var result = this.toArray();\r\n for (var i = 0; i < targets.length; i++) {\r\n var target = targets[i];\r\n if (-1 === result.indexOf(target)) {\r\n result.push(target)\r\n }\r\n }\r\n return renderer(result)\r\n};\r\nvar emptyArray = [];\r\ninitRender.prototype.splice = function() {\r\n return renderer(emptyArray.splice.apply(this, arguments))\r\n};\r\ninitRender.prototype.slice = function() {\r\n return renderer(emptyArray.slice.apply(this, arguments))\r\n};\r\ninitRender.prototype.toArray = function() {\r\n return emptyArray.slice.call(this)\r\n};\r\ninitRender.prototype.offset = function() {\r\n if (!this[0]) {\r\n return\r\n }\r\n return getOffset(this[0])\r\n};\r\ninitRender.prototype.offsetParent = function() {\r\n if (!this[0]) {\r\n return renderer()\r\n }\r\n var offsetParent = renderer(this[0].offsetParent);\r\n while (offsetParent[0] && \"static\" === offsetParent.css(\"position\")) {\r\n offsetParent = renderer(offsetParent[0].offsetParent)\r\n }\r\n offsetParent = offsetParent[0] ? offsetParent : renderer(domAdapter.getDocumentElement());\r\n return offsetParent\r\n};\r\ninitRender.prototype.position = function() {\r\n if (!this[0]) {\r\n return\r\n }\r\n var offset;\r\n var marginTop = parseFloat(this.css(\"marginTop\"));\r\n var marginLeft = parseFloat(this.css(\"marginLeft\"));\r\n if (\"fixed\" === this.css(\"position\")) {\r\n offset = this[0].getBoundingClientRect();\r\n return {\r\n top: offset.top - marginTop,\r\n left: offset.left - marginLeft\r\n }\r\n }\r\n offset = this.offset();\r\n var offsetParent = this.offsetParent();\r\n var parentOffset = {\r\n top: 0,\r\n left: 0\r\n };\r\n if (\"HTML\" !== offsetParent[0].nodeName) {\r\n parentOffset = offsetParent.offset()\r\n }\r\n parentOffset = {\r\n top: parentOffset.top + parseFloat(offsetParent.css(\"borderTopWidth\")),\r\n left: parentOffset.left + parseFloat(offsetParent.css(\"borderLeftWidth\"))\r\n };\r\n return {\r\n top: offset.top - parentOffset.top - marginTop,\r\n left: offset.left - parentOffset.left - marginLeft\r\n }\r\n};\r\n[{\r\n name: \"scrollLeft\",\r\n offsetProp: \"pageXOffset\",\r\n scrollWindow: function(win, value) {\r\n win.scrollTo(value, win.pageYOffset)\r\n }\r\n}, {\r\n name: \"scrollTop\",\r\n offsetProp: \"pageYOffset\",\r\n scrollWindow: function(win, value) {\r\n win.scrollTo(win.pageXOffset, value)\r\n }\r\n}].forEach((function(directionStrategy) {\r\n var propName = directionStrategy.name;\r\n initRender.prototype[propName] = function(value) {\r\n if (!this[0]) {\r\n return\r\n }\r\n var window = getWindowByElement(this[0]);\r\n if (void 0 === value) {\r\n return window ? window[directionStrategy.offsetProp] : this[0][propName]\r\n }\r\n if (window) {\r\n directionStrategy.scrollWindow(window, value)\r\n } else {\r\n this[0][propName] = value\r\n }\r\n return this\r\n }\r\n}));\r\ninitRender.prototype.data = function(key, value) {\r\n if (!this[0]) {\r\n return\r\n }\r\n if (arguments.length < 2) {\r\n return elementData.call(renderer, this[0], key)\r\n }\r\n elementData.call(renderer, this[0], key, value);\r\n return this\r\n};\r\ninitRender.prototype.removeData = function(key) {\r\n this[0] && removeData(this[0], key);\r\n return this\r\n};\r\nvar rendererWrapper = function() {\r\n return renderer.apply(this, arguments)\r\n};\r\nObject.defineProperty(rendererWrapper, \"fn\", {\r\n enumerable: true,\r\n configurable: true,\r\n get: function() {\r\n return renderer.fn\r\n },\r\n set: function(value) {\r\n renderer.fn = value\r\n }\r\n});\r\nexport default {\r\n set: function(strategy) {\r\n renderer = strategy\r\n },\r\n get: function() {\r\n return rendererWrapper\r\n }\r\n};\r\n","/**\r\n * DevExtreme (esm/core/renderer.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport rendererBase from \"./renderer_base\";\r\nexport default rendererBase.get();\r\n","/**\r\n * DevExtreme (esm/core/resize_observer.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n noop\r\n} from \"./utils/common\";\r\nimport {\r\n getWindow,\r\n hasWindow\r\n} from \"./utils/window\";\r\nvar window = getWindow();\r\nvar ResizeObserverMock = {\r\n observe: noop,\r\n unobserve: noop,\r\n disconnect: noop\r\n};\r\nclass ResizeObserverSingleton {\r\n constructor() {\r\n if (!hasWindow() || !window.ResizeObserver) {\r\n return ResizeObserverMock\r\n }\r\n this._callbacksMap = new Map;\r\n this._observer = new window.ResizeObserver(entries => {\r\n entries.forEach(entry => {\r\n var _this$_callbacksMap$g;\r\n null === (_this$_callbacksMap$g = this._callbacksMap.get(entry.target)) || void 0 === _this$_callbacksMap$g ? void 0 : _this$_callbacksMap$g(entry)\r\n })\r\n })\r\n }\r\n observe(element, callback) {\r\n this._callbacksMap.set(element, callback);\r\n this._observer.observe(element)\r\n }\r\n unobserve(element) {\r\n this._callbacksMap.delete(element);\r\n this._observer.unobserve(element)\r\n }\r\n disconnect() {\r\n this._callbacksMap.clear();\r\n this._observer.disconnect()\r\n }\r\n}\r\nvar resizeObserverSingleton = new ResizeObserverSingleton;\r\nexport default resizeObserverSingleton;\r\n","/**\r\n * DevExtreme (esm/core/templates/bindable_template.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport $ from \"../renderer\";\r\nimport {\r\n TemplateBase\r\n} from \"./template_base\";\r\nimport eventsEngine from \"../../events/core/events_engine\";\r\nimport {\r\n removeEvent\r\n} from \"../../events/remove\";\r\nimport {\r\n isPrimitive\r\n} from \"../utils/type\";\r\nvar watchChanges = function(rawData, watchMethod, fields, fieldsMap, callback) {\r\n var fieldsDispose;\r\n var globalDispose = ((data, watchMethod, callback) => watchMethod(() => data, callback))(rawData, watchMethod, (function(dataWithRawFields) {\r\n fieldsDispose && fieldsDispose();\r\n if (isPrimitive(dataWithRawFields)) {\r\n callback(dataWithRawFields);\r\n return\r\n }\r\n fieldsDispose = function(data, watchMethod, fields, fieldsMap, callback) {\r\n var resolvedData = {};\r\n var missedFields = fields.slice();\r\n var watchHandlers = fields.map((function(name) {\r\n var fieldGetter = fieldsMap[name];\r\n return watchMethod(fieldGetter ? () => fieldGetter(data) : () => data[name], (function(value) {\r\n resolvedData[name] = value;\r\n if (missedFields.length) {\r\n var index = missedFields.indexOf(name);\r\n if (index >= 0) {\r\n missedFields.splice(index, 1)\r\n }\r\n }\r\n if (!missedFields.length) {\r\n callback(resolvedData)\r\n }\r\n }))\r\n }));\r\n return function() {\r\n watchHandlers.forEach(dispose => dispose())\r\n }\r\n }(dataWithRawFields, watchMethod, fields, fieldsMap, callback)\r\n }));\r\n return function() {\r\n fieldsDispose && fieldsDispose();\r\n globalDispose && globalDispose()\r\n }\r\n};\r\nexport class BindableTemplate extends TemplateBase {\r\n constructor(render, fields, watchMethod, fieldsMap) {\r\n super();\r\n this._render = render;\r\n this._fields = fields;\r\n this._fieldsMap = fieldsMap || {};\r\n this._watchMethod = watchMethod\r\n }\r\n _renderCore(options) {\r\n var $container = $(options.container);\r\n var dispose = watchChanges(options.model, this._watchMethod, this._fields, this._fieldsMap, data => {\r\n $container.empty();\r\n this._render($container, data, options.model)\r\n });\r\n eventsEngine.on($container, removeEvent, dispose);\r\n return $container.contents()\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/templates/child_default_template.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n TemplateBase\r\n} from \"./template_base\";\r\nexport class ChildDefaultTemplate extends TemplateBase {\r\n constructor(name) {\r\n super();\r\n this.name = name\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/templates/empty_template.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport $ from \"../renderer\";\r\nimport {\r\n TemplateBase\r\n} from \"./template_base\";\r\nexport class EmptyTemplate extends TemplateBase {\r\n _renderCore() {\r\n return $()\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/templates/function_template.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n TemplateBase\r\n} from \"./template_base\";\r\nimport {\r\n normalizeTemplateElement\r\n} from \"../utils/dom\";\r\nexport class FunctionTemplate extends TemplateBase {\r\n constructor(render) {\r\n super();\r\n this._render = render\r\n }\r\n _renderCore(options) {\r\n return normalizeTemplateElement(this._render(options))\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/templates/template_base.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport $ from \"../renderer\";\r\nimport domAdapter from \"../dom_adapter\";\r\nimport Callbacks from \"../utils/callbacks\";\r\nimport {\r\n contains\r\n} from \"../utils/dom\";\r\nimport {\r\n triggerShownEvent\r\n} from \"../../events/visibility_change\";\r\nimport errors from \"../errors\";\r\nexport var renderedCallbacks = Callbacks({\r\n syncStrategy: true\r\n});\r\nexport class TemplateBase {\r\n render(options) {\r\n options = options || {};\r\n var onRendered = options.onRendered;\r\n delete options.onRendered;\r\n var $result;\r\n if (options.renovated && options.transclude && this._element) {\r\n $result = $(\"
\").append(this._element).contents()\r\n } else {\r\n $result = this._renderCore(options)\r\n }\r\n this._ensureResultInContainer($result, options.container);\r\n renderedCallbacks.fire($result, options.container);\r\n onRendered && onRendered();\r\n return $result\r\n }\r\n _ensureResultInContainer($result, container) {\r\n if (!container) {\r\n return\r\n }\r\n var $container = $(container);\r\n var resultInContainer = contains($container.get(0), $result.get(0));\r\n $container.append($result);\r\n if (resultInContainer) {\r\n return\r\n }\r\n var resultInBody = domAdapter.getBody().contains($container.get(0));\r\n if (!resultInBody) {\r\n return\r\n }\r\n triggerShownEvent($result)\r\n }\r\n _renderCore() {\r\n throw errors.Error(\"E0001\")\r\n }\r\n}\r\n","/**\r\n * DevExtreme (esm/core/http_request.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n getWindow\r\n} from \"./utils/window\";\r\nvar window = getWindow();\r\nimport injector from \"./utils/dependency_injector\";\r\nvar nativeXMLHttpRequest = {\r\n getXhr: function() {\r\n return new window.XMLHttpRequest\r\n }\r\n};\r\nexport default injector(nativeXMLHttpRequest);\r\n","/**\r\n * DevExtreme (esm/core/utils/ajax.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n Deferred\r\n} from \"./deferred\";\r\nimport domAdapter from \"../../core/dom_adapter\";\r\nimport httpRequest from \"../../core/http_request\";\r\nimport {\r\n getWindow,\r\n hasWindow\r\n} from \"../../core/utils/window\";\r\nvar window = getWindow();\r\nimport {\r\n extendFromObject\r\n} from \"./extend\";\r\nimport {\r\n isDefined\r\n} from \"./type\";\r\nimport injector from \"./dependency_injector\";\r\nvar SUCCESS = \"success\";\r\nvar ERROR = \"error\";\r\nvar TIMEOUT = \"timeout\";\r\nvar NO_CONTENT = \"nocontent\";\r\nvar PARSER_ERROR = \"parsererror\";\r\nvar isStatusSuccess = function(status) {\r\n return 200 <= status && status < 300\r\n};\r\nvar hasContent = function(status) {\r\n return 204 !== status\r\n};\r\nvar paramsConvert = function(params) {\r\n var result = [];\r\n for (var name in params) {\r\n var value = params[name];\r\n if (void 0 === value) {\r\n continue\r\n }\r\n if (null === value) {\r\n value = \"\"\r\n }\r\n if (\"function\" === typeof value) {\r\n value = value()\r\n }\r\n result.push(encodeURIComponent(name) + \"=\" + encodeURIComponent(value))\r\n }\r\n return result.join(\"&\")\r\n};\r\nvar createScript = function(options) {\r\n var script = domAdapter.createElement(\"script\");\r\n for (var name in options) {\r\n script[name] = options[name]\r\n }\r\n return script\r\n};\r\nvar removeScript = function(scriptNode) {\r\n scriptNode.parentNode.removeChild(scriptNode)\r\n};\r\nvar appendToHead = function(element) {\r\n return domAdapter.getHead().appendChild(element)\r\n};\r\nvar evalScript = function(code) {\r\n var script = createScript({\r\n text: code\r\n });\r\n appendToHead(script);\r\n removeScript(script)\r\n};\r\nvar evalCrossDomainScript = function(url) {\r\n var script = createScript({\r\n src: url\r\n });\r\n return new Promise((function(resolve, reject) {\r\n var events = {\r\n load: resolve,\r\n error: reject\r\n };\r\n var loadHandler = function(e) {\r\n events[e.type]();\r\n removeScript(script)\r\n };\r\n for (var event in events) {\r\n domAdapter.listen(script, event, loadHandler)\r\n }\r\n appendToHead(script)\r\n }))\r\n};\r\nvar getAcceptHeader = function(options) {\r\n var dataType = options.dataType || \"*\";\r\n var scriptAccept = \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\";\r\n var accepts = {\r\n \"*\": \"*/*\",\r\n text: \"text/plain\",\r\n html: \"text/html\",\r\n xml: \"application/xml, text/xml\",\r\n json: \"application/json, text/javascript\",\r\n jsonp: scriptAccept,\r\n script: scriptAccept\r\n };\r\n extendFromObject(accepts, options.accepts, true);\r\n return accepts[dataType] ? accepts[dataType] + (\"*\" !== dataType ? \", */*; q=0.01\" : \"\") : accepts[\"*\"]\r\n};\r\nvar getContentTypeHeader = function(options) {\r\n var defaultContentType;\r\n if (options.data && !options.upload && \"GET\" !== getMethod(options)) {\r\n defaultContentType = \"application/x-www-form-urlencoded;charset=utf-8\"\r\n }\r\n return options.contentType || defaultContentType\r\n};\r\nvar getDataFromResponse = function(xhr) {\r\n return xhr.responseType && \"text\" !== xhr.responseType || \"string\" !== typeof xhr.responseText ? xhr.response : xhr.responseText\r\n};\r\nvar postProcess = function(deferred, xhr, dataType) {\r\n var data = getDataFromResponse(xhr);\r\n switch (dataType) {\r\n case \"jsonp\":\r\n evalScript(data);\r\n break;\r\n case \"script\":\r\n evalScript(data);\r\n deferred.resolve(data, SUCCESS, xhr);\r\n break;\r\n case \"json\":\r\n try {\r\n deferred.resolve(JSON.parse(data), SUCCESS, xhr)\r\n } catch (e) {\r\n deferred.reject(xhr, PARSER_ERROR, e)\r\n }\r\n break;\r\n default:\r\n deferred.resolve(data, SUCCESS, xhr)\r\n }\r\n};\r\nvar isCrossDomain = function(url) {\r\n if (!hasWindow()) {\r\n return true\r\n }\r\n var crossDomain = false;\r\n var originAnchor = domAdapter.createElement(\"a\");\r\n var urlAnchor = domAdapter.createElement(\"a\");\r\n originAnchor.href = window.location.href;\r\n try {\r\n urlAnchor.href = url;\r\n urlAnchor.href = urlAnchor.href;\r\n crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !== urlAnchor.protocol + \"//\" + urlAnchor.host\r\n } catch (e) {\r\n crossDomain = true\r\n }\r\n return crossDomain\r\n};\r\nvar setHttpTimeout = function(timeout, xhr) {\r\n return timeout && setTimeout((function() {\r\n xhr.customStatus = TIMEOUT;\r\n xhr.abort()\r\n }), timeout)\r\n};\r\nvar getJsonpOptions = function(options) {\r\n if (\"jsonp\" === options.dataType) {\r\n var random = Math.random().toString().replace(/\\D/g, \"\");\r\n var callbackName = options.jsonpCallback || \"dxCallback\" + Date.now() + \"_\" + random;\r\n var callbackParameter = options.jsonp || \"callback\";\r\n options.data = options.data || {};\r\n options.data[callbackParameter] = callbackName;\r\n return callbackName\r\n }\r\n};\r\nvar getRequestOptions = function(options, headers) {\r\n var params = options.data;\r\n var paramsAlreadyString = \"string\" === typeof params;\r\n var url = options.url || window.location.href;\r\n if (!paramsAlreadyString && !options.cache) {\r\n params = params || {};\r\n params._ = Date.now()\r\n }\r\n if (params && !options.upload) {\r\n if (!paramsAlreadyString) {\r\n params = paramsConvert(params)\r\n }\r\n if (\"GET\" === getMethod(options)) {\r\n if (\"\" !== params) {\r\n url += (url.indexOf(\"?\") > -1 ? \"&\" : \"?\") + params\r\n }\r\n params = null\r\n } else if (headers[\"Content-Type\"] && headers[\"Content-Type\"].indexOf(\"application/x-www-form-urlencoded\") > -1) {\r\n params = params.replace(/%20/g, \"+\")\r\n }\r\n }\r\n return {\r\n url: url,\r\n parameters: params\r\n }\r\n};\r\n\r\nfunction getMethod(options) {\r\n return (options.method || \"GET\").toUpperCase()\r\n}\r\nvar getRequestHeaders = function(options) {\r\n var headers = options.headers || {};\r\n headers[\"Content-Type\"] = headers[\"Content-Type\"] || getContentTypeHeader(options);\r\n headers.Accept = headers.Accept || getAcceptHeader(options);\r\n if (!options.crossDomain && !headers[\"X-Requested-With\"]) {\r\n headers[\"X-Requested-With\"] = \"XMLHttpRequest\"\r\n }\r\n return headers\r\n};\r\nvar sendRequest = function(options) {\r\n var xhr = httpRequest.getXhr();\r\n var d = new Deferred;\r\n var result = d.promise();\r\n var async = isDefined(options.async) ? options.async : true;\r\n var dataType = options.dataType;\r\n var timeout = options.timeout || 0;\r\n var timeoutId;\r\n options.crossDomain = isCrossDomain(options.url);\r\n var needScriptEvaluation = \"jsonp\" === dataType || \"script\" === dataType;\r\n if (void 0 === options.cache) {\r\n options.cache = !needScriptEvaluation\r\n }\r\n var callbackName = getJsonpOptions(options);\r\n var headers = getRequestHeaders(options);\r\n var requestOptions = getRequestOptions(options, headers);\r\n var url = requestOptions.url;\r\n var parameters = requestOptions.parameters;\r\n if (callbackName) {\r\n window[callbackName] = function(data) {\r\n d.resolve(data, SUCCESS, xhr)\r\n }\r\n }\r\n if (options.crossDomain && needScriptEvaluation) {\r\n evalCrossDomainScript(url).then((function() {\r\n if (\"jsonp\" === dataType) {\r\n return\r\n }\r\n d.resolve(null, SUCCESS, xhr)\r\n }), (function() {\r\n d.reject(xhr, ERROR)\r\n }));\r\n return result\r\n }\r\n if (options.crossDomain && !(\"withCredentials\" in xhr)) {\r\n d.reject(xhr, ERROR);\r\n return result\r\n }\r\n xhr.open(getMethod(options), url, async, options.username, options.password);\r\n if (async) {\r\n xhr.timeout = timeout;\r\n timeoutId = setHttpTimeout(timeout, xhr)\r\n }\r\n xhr.onreadystatechange = function(e) {\r\n if (4 === xhr.readyState) {\r\n clearTimeout(timeoutId);\r\n if (isStatusSuccess(xhr.status)) {\r\n if (hasContent(xhr.status)) {\r\n postProcess(d, xhr, dataType)\r\n } else {\r\n d.resolve(null, NO_CONTENT, xhr)\r\n }\r\n } else {\r\n d.reject(xhr, xhr.customStatus || ERROR)\r\n }\r\n }\r\n };\r\n if (options.upload) {\r\n xhr.upload.onprogress = options.upload.onprogress;\r\n xhr.upload.onloadstart = options.upload.onloadstart;\r\n xhr.upload.onabort = options.upload.onabort\r\n }\r\n if (options.xhrFields) {\r\n for (var field in options.xhrFields) {\r\n xhr[field] = options.xhrFields[field]\r\n }\r\n }\r\n if (\"arraybuffer\" === options.responseType) {\r\n xhr.responseType = options.responseType\r\n }\r\n for (var name in headers) {\r\n if (Object.prototype.hasOwnProperty.call(headers, name) && isDefined(headers[name])) {\r\n xhr.setRequestHeader(name, headers[name])\r\n }\r\n }\r\n if (options.beforeSend) {\r\n options.beforeSend(xhr)\r\n }\r\n xhr.send(parameters);\r\n result.abort = function() {\r\n xhr.abort()\r\n };\r\n return result\r\n};\r\nexport default injector({\r\n sendRequest: sendRequest\r\n});\r\n","/**\r\n * DevExtreme (esm/core/utils/array.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isDefined\r\n} from \"./type\";\r\nimport {\r\n orderEach\r\n} from \"./object\";\r\nimport config from \"../config\";\r\n\r\nfunction createOccurrenceMap(array) {\r\n return array.reduce((map, value) => {\r\n var _map$get;\r\n var count = (null !== (_map$get = map.get(value)) && void 0 !== _map$get ? _map$get : 0) + 1;\r\n map.set(value, count);\r\n return map\r\n }, new Map)\r\n}\r\nexport var wrapToArray = function(item) {\r\n return Array.isArray(item) ? item : [item]\r\n};\r\nexport var getUniqueValues = function(values) {\r\n return [...new Set(values)]\r\n};\r\nexport var getIntersection = function(firstArray, secondArray) {\r\n var toRemoveMap = createOccurrenceMap(secondArray);\r\n return firstArray.filter(value => {\r\n var occurrencesCount = toRemoveMap.get(value);\r\n occurrencesCount && toRemoveMap.set(value, occurrencesCount - 1);\r\n return occurrencesCount\r\n })\r\n};\r\nexport var removeDuplicates = function() {\r\n var from = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];\r\n var toRemove = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];\r\n var toRemoveMap = createOccurrenceMap(toRemove);\r\n return from.filter(value => {\r\n var occurrencesCount = toRemoveMap.get(value);\r\n occurrencesCount && toRemoveMap.set(value, occurrencesCount - 1);\r\n return !occurrencesCount\r\n })\r\n};\r\nexport var normalizeIndexes = function(items, indexPropName, currentItem, needIndexCallback) {\r\n var indexedItems = {};\r\n var {\r\n useLegacyVisibleIndex: useLegacyVisibleIndex\r\n } = config();\r\n var currentIndex = 0;\r\n var shouldUpdateIndex = item => !isDefined(item[indexPropName]) && (!needIndexCallback || needIndexCallback(item));\r\n items.forEach(item => {\r\n var index = item[indexPropName];\r\n if (index >= 0) {\r\n indexedItems[index] = indexedItems[index] || [];\r\n if (item === currentItem) {\r\n indexedItems[index].unshift(item)\r\n } else {\r\n indexedItems[index].push(item)\r\n }\r\n } else {\r\n item[indexPropName] = void 0\r\n }\r\n });\r\n if (!useLegacyVisibleIndex) {\r\n items.forEach(item => {\r\n if (shouldUpdateIndex(item)) {\r\n while (indexedItems[currentIndex]) {\r\n currentIndex++\r\n }\r\n indexedItems[currentIndex] = [item];\r\n currentIndex++\r\n }\r\n })\r\n }\r\n currentIndex = 0;\r\n orderEach(indexedItems, (function(index, items) {\r\n items.forEach(item => {\r\n if (index >= 0) {\r\n item[indexPropName] = currentIndex++\r\n }\r\n })\r\n }));\r\n if (useLegacyVisibleIndex) {\r\n items.forEach(item => {\r\n if (shouldUpdateIndex(item)) {\r\n item[indexPropName] = currentIndex++\r\n }\r\n })\r\n }\r\n};\r\nexport var groupBy = (array, getGroupName) => array.reduce((groupedResult, item) => {\r\n var _groupedResult$groupN;\r\n var groupName = getGroupName(item);\r\n groupedResult[groupName] = null !== (_groupedResult$groupN = groupedResult[groupName]) && void 0 !== _groupedResult$groupN ? _groupedResult$groupN : [];\r\n groupedResult[groupName].push(item);\r\n return groupedResult\r\n}, {});\r\n","/**\r\n * DevExtreme (esm/core/utils/array_compare.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isObject\r\n} from \"./type\";\r\nvar getKeyWrapper = function(item, getKey) {\r\n var key = getKey(item);\r\n if (isObject(key)) {\r\n try {\r\n return JSON.stringify(key)\r\n } catch (e) {\r\n return key\r\n }\r\n }\r\n return key\r\n};\r\nvar getSameNewByOld = function(oldItem, newItems, newIndexByKey, getKey) {\r\n var key = getKeyWrapper(oldItem, getKey);\r\n return newItems[newIndexByKey[key]]\r\n};\r\nexport var isKeysEqual = function(oldKeys, newKeys) {\r\n if (oldKeys.length !== newKeys.length) {\r\n return false\r\n }\r\n for (var i = 0; i < newKeys.length; i++) {\r\n if (oldKeys[i] !== newKeys[i]) {\r\n return false\r\n }\r\n }\r\n return true\r\n};\r\nexport var findChanges = function(oldItems, newItems, getKey, isItemEquals) {\r\n var oldIndexByKey = {};\r\n var newIndexByKey = {};\r\n var addedCount = 0;\r\n var removeCount = 0;\r\n var result = [];\r\n oldItems.forEach((function(item, index) {\r\n var key = getKeyWrapper(item, getKey);\r\n oldIndexByKey[key] = index\r\n }));\r\n newItems.forEach((function(item, index) {\r\n var key = getKeyWrapper(item, getKey);\r\n newIndexByKey[key] = index\r\n }));\r\n var itemCount = Math.max(oldItems.length, newItems.length);\r\n for (var index = 0; index < itemCount + addedCount; index++) {\r\n var newItem = newItems[index];\r\n var oldNextIndex = index - addedCount + removeCount;\r\n var nextOldItem = oldItems[oldNextIndex];\r\n var isRemoved = !newItem || nextOldItem && !getSameNewByOld(nextOldItem, newItems, newIndexByKey, getKey);\r\n if (isRemoved) {\r\n if (nextOldItem) {\r\n result.push({\r\n type: \"remove\",\r\n key: getKey(nextOldItem),\r\n index: index,\r\n oldItem: nextOldItem\r\n });\r\n removeCount++;\r\n index--\r\n }\r\n } else {\r\n var key = getKeyWrapper(newItem, getKey);\r\n var oldIndex = oldIndexByKey[key];\r\n var oldItem = oldItems[oldIndex];\r\n if (!oldItem) {\r\n addedCount++;\r\n result.push({\r\n type: \"insert\",\r\n data: newItem,\r\n index: index\r\n })\r\n } else if (oldIndex === oldNextIndex) {\r\n if (!isItemEquals(oldItem, newItem)) {\r\n result.push({\r\n type: \"update\",\r\n data: newItem,\r\n key: getKey(newItem),\r\n index: index,\r\n oldItem: oldItem\r\n })\r\n }\r\n } else {\r\n return\r\n }\r\n }\r\n }\r\n return result\r\n};\r\n","/**\r\n * DevExtreme (esm/core/utils/browser.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n extend\r\n} from \"./extend\";\r\nimport {\r\n getNavigator\r\n} from \"./window\";\r\nvar navigator = getNavigator();\r\nvar webkitRegExp = /(webkit)[ /]([\\w.]+)/;\r\nvar mozillaRegExp = /(mozilla)(?:.*? rv:([\\w.]+))/;\r\nvar browserFromUA = ua => {\r\n ua = ua.toLowerCase();\r\n var result = {};\r\n var matches = webkitRegExp.exec(ua) || ua.indexOf(\"compatible\") < 0 && mozillaRegExp.exec(ua) || [];\r\n var browserName = matches[1];\r\n var browserVersion = matches[2];\r\n if (\"webkit\" === browserName) {\r\n result.webkit = true;\r\n if (ua.indexOf(\"chrome\") >= 0 || ua.indexOf(\"crios\") >= 0) {\r\n browserName = \"chrome\";\r\n browserVersion = /(?:chrome|crios)\\/(\\d+\\.\\d+)/.exec(ua);\r\n browserVersion = browserVersion && browserVersion[1]\r\n } else if (ua.indexOf(\"fxios\") >= 0) {\r\n browserName = \"mozilla\";\r\n browserVersion = /fxios\\/(\\d+\\.\\d+)/.exec(ua);\r\n browserVersion = browserVersion && browserVersion[1]\r\n } else if (ua.indexOf(\"safari\") >= 0 && /version|phantomjs/.test(ua)) {\r\n browserName = \"safari\";\r\n browserVersion = /(?:version|phantomjs)\\/([0-9.]+)/.exec(ua);\r\n browserVersion = browserVersion && browserVersion[1]\r\n } else {\r\n browserName = \"unknown\";\r\n browserVersion = /applewebkit\\/([0-9.]+)/.exec(ua);\r\n browserVersion = browserVersion && browserVersion[1]\r\n }\r\n }\r\n if (browserName) {\r\n result[browserName] = true;\r\n result.version = browserVersion\r\n }\r\n return result\r\n};\r\nexport default extend({\r\n _fromUA: browserFromUA\r\n}, browserFromUA(navigator.userAgent));\r\n","/**\r\n * DevExtreme (esm/core/utils/call_once.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nvar callOnce = function(handler) {\r\n var result;\r\n var _wrappedHandler = function() {\r\n result = handler.apply(this, arguments);\r\n _wrappedHandler = function() {\r\n return result\r\n };\r\n return result\r\n };\r\n return function() {\r\n return _wrappedHandler.apply(this, arguments)\r\n }\r\n};\r\nexport default callOnce;\r\n","/**\r\n * DevExtreme (esm/core/utils/callbacks.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nvar Callback = function(options) {\r\n this._options = options || {};\r\n this._list = [];\r\n this._queue = [];\r\n this._firing = false;\r\n this._fired = false;\r\n this._firingIndexes = []\r\n};\r\nCallback.prototype._fireCore = function(context, args) {\r\n var firingIndexes = this._firingIndexes;\r\n var list = this._list;\r\n var stopOnFalse = this._options.stopOnFalse;\r\n var step = firingIndexes.length;\r\n for (firingIndexes[step] = 0; firingIndexes[step] < list.length; firingIndexes[step]++) {\r\n var result = list[firingIndexes[step]].apply(context, args);\r\n if (false === result && stopOnFalse) {\r\n break\r\n }\r\n }\r\n firingIndexes.pop()\r\n};\r\nCallback.prototype.add = function(fn) {\r\n if (\"function\" === typeof fn && (!this._options.unique || !this.has(fn))) {\r\n this._list.push(fn)\r\n }\r\n return this\r\n};\r\nCallback.prototype.remove = function(fn) {\r\n var list = this._list;\r\n var firingIndexes = this._firingIndexes;\r\n var index = list.indexOf(fn);\r\n if (index > -1) {\r\n list.splice(index, 1);\r\n if (this._firing && firingIndexes.length) {\r\n for (var step = 0; step < firingIndexes.length; step++) {\r\n if (index <= firingIndexes[step]) {\r\n firingIndexes[step]--\r\n }\r\n }\r\n }\r\n }\r\n return this\r\n};\r\nCallback.prototype.has = function(fn) {\r\n var list = this._list;\r\n return fn ? list.indexOf(fn) > -1 : !!list.length\r\n};\r\nCallback.prototype.empty = function(fn) {\r\n this._list = [];\r\n return this\r\n};\r\nCallback.prototype.fireWith = function(context, args) {\r\n var queue = this._queue;\r\n args = args || [];\r\n args = args.slice ? args.slice() : args;\r\n if (this._options.syncStrategy) {\r\n this._firing = true;\r\n this._fireCore(context, args)\r\n } else {\r\n queue.push([context, args]);\r\n if (this._firing) {\r\n return\r\n }\r\n this._firing = true;\r\n while (queue.length) {\r\n var memory = queue.shift();\r\n this._fireCore(memory[0], memory[1])\r\n }\r\n }\r\n this._firing = false;\r\n this._fired = true;\r\n return this\r\n};\r\nCallback.prototype.fire = function() {\r\n this.fireWith(this, arguments)\r\n};\r\nCallback.prototype.fired = function() {\r\n return this._fired\r\n};\r\nvar Callbacks = function(options) {\r\n return new Callback(options)\r\n};\r\nexport default Callbacks;\r\n","/**\r\n * DevExtreme (esm/core/utils/common.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\r\nimport config from \"../config\";\r\nimport Guid from \"../guid\";\r\nimport {\r\n when,\r\n Deferred\r\n} from \"../utils/deferred\";\r\nimport {\r\n toComparable\r\n} from \"./data\";\r\nimport {\r\n each\r\n} from \"./iterator\";\r\nimport {\r\n isDefined,\r\n isFunction,\r\n isString,\r\n isObject,\r\n type\r\n} from \"./type\";\r\nexport var ensureDefined = function(value, defaultValue) {\r\n return isDefined(value) ? value : defaultValue\r\n};\r\nexport var executeAsync = function(action, context) {\r\n var deferred = new Deferred;\r\n var normalizedContext = context || this;\r\n var task = {\r\n promise: deferred.promise(),\r\n abort: function() {\r\n clearTimeout(timerId);\r\n deferred.rejectWith(normalizedContext)\r\n }\r\n };\r\n var callback = function() {\r\n var result = action.call(normalizedContext);\r\n if (result && result.done && isFunction(result.done)) {\r\n result.done((function() {\r\n deferred.resolveWith(normalizedContext)\r\n }))\r\n } else {\r\n deferred.resolveWith(normalizedContext)\r\n }\r\n };\r\n var timerId = (arguments[2] || setTimeout)(callback, \"number\" === typeof context ? context : 0);\r\n return task\r\n};\r\nvar delayedFuncs = [];\r\nvar delayedNames = [];\r\nvar delayedDeferreds = [];\r\nvar executingName;\r\nvar deferExecute = function(name, func, deferred) {\r\n if (executingName && executingName !== name) {\r\n delayedFuncs.push(func);\r\n delayedNames.push(name);\r\n deferred = deferred || new Deferred;\r\n delayedDeferreds.push(deferred);\r\n return deferred\r\n } else {\r\n var oldExecutingName = executingName;\r\n var currentDelayedCount = delayedDeferreds.length;\r\n executingName = name;\r\n var result = func();\r\n if (!result) {\r\n if (delayedDeferreds.length > currentDelayedCount) {\r\n result = when.apply(this, delayedDeferreds.slice(currentDelayedCount))\r\n } else if (deferred) {\r\n deferred.resolve()\r\n }\r\n }\r\n executingName = oldExecutingName;\r\n if (deferred && result && result.done) {\r\n result.done(deferred.resolve).fail(deferred.reject)\r\n }\r\n if (!executingName && delayedFuncs.length) {\r\n (\"render\" === delayedNames.shift() ? deferRender : deferUpdate)(delayedFuncs.shift(), delayedDeferreds.shift())\r\n }\r\n return result || when()\r\n }\r\n};\r\nexport var deferRender = function(func, deferred) {\r\n return deferExecute(\"render\", func, deferred)\r\n};\r\nexport var deferUpdate = function(func, deferred) {\r\n return deferExecute(\"update\", func, deferred)\r\n};\r\nexport var deferRenderer = function(func) {\r\n return function() {\r\n var that = this;\r\n return deferExecute(\"render\", (function() {\r\n return func.call(that)\r\n }))\r\n }\r\n};\r\nexport var deferUpdater = function(func) {\r\n return function() {\r\n var that = this;\r\n return deferExecute(\"update\", (function() {\r\n return func.call(that)\r\n }))\r\n }\r\n};\r\nexport var findBestMatches = function(targetFilter, items, mapFn) {\r\n var bestMatches = [];\r\n var maxMatchCount = 0;\r\n each(items, (index, itemSrc) => {\r\n var matchCount = 0;\r\n var item = mapFn ? mapFn(itemSrc) : itemSrc;\r\n each(targetFilter, (paramName, targetValue) => {\r\n var value = item[paramName];\r\n if (void 0 === value) {\r\n return\r\n }\r\n if (match(value, targetValue)) {\r\n matchCount++;\r\n return\r\n }\r\n matchCount = -1;\r\n return false\r\n });\r\n if (matchCount < maxMatchCount) {\r\n return\r\n }\r\n if (matchCount > maxMatchCount) {\r\n bestMatches.length = 0;\r\n maxMatchCount = matchCount\r\n }\r\n bestMatches.push(itemSrc)\r\n });\r\n return bestMatches\r\n};\r\nvar match = function(value, targetValue) {\r\n if (Array.isArray(value) && Array.isArray(targetValue)) {\r\n var mismatch = false;\r\n each(value, (index, valueItem) => {\r\n if (valueItem !== targetValue[index]) {\r\n mismatch = true;\r\n return false\r\n }\r\n });\r\n if (mismatch) {\r\n return false\r\n }\r\n return true\r\n }\r\n if (value === targetValue) {\r\n return true\r\n }\r\n return false\r\n};\r\nexport var splitPair = function(raw) {\r\n var _raw$x, _raw$y;\r\n switch (type(raw)) {\r\n case \"string\":\r\n return raw.split(/\\s+/, 2);\r\n case \"object\":\r\n return [null !== (_raw$x = raw.x) && void 0 !== _raw$x ? _raw$x : raw.h, null !== (_raw$y = raw.y) && void 0 !== _raw$y ? _raw$y : raw.v];\r\n case \"number\":\r\n return [raw];\r\n case \"array\":\r\n return raw;\r\n default:\r\n return null\r\n }\r\n};\r\nexport var normalizeKey = function(id) {\r\n var key = isString(id) ? id : id.toString();\r\n var arr = key.match(/[^a-zA-Z0-9_]/g);\r\n arr && each(arr, (_, sign) => {\r\n key = key.replace(sign, \"__\" + sign.charCodeAt() + \"__\")\r\n });\r\n return key\r\n};\r\nexport var denormalizeKey = function(key) {\r\n var arr = key.match(/__\\d+__/g);\r\n arr && arr.forEach(char => {\r\n var charCode = parseInt(char.replace(\"__\", \"\"));\r\n key = key.replace(char, String.fromCharCode(charCode))\r\n });\r\n return key\r\n};\r\nexport var pairToObject = function(raw, preventRound) {\r\n var pair = splitPair(raw);\r\n var h = preventRound ? parseFloat(pair && pair[0]) : parseInt(pair && pair[0], 10);\r\n var v = preventRound ? parseFloat(pair && pair[1]) : parseInt(pair && pair[1], 10);\r\n if (!isFinite(h)) {\r\n h = 0\r\n }\r\n if (!isFinite(v)) {\r\n v = h\r\n }\r\n return {\r\n h: h,\r\n v: v\r\n }\r\n};\r\nexport var getKeyHash = function(key) {\r\n if (key instanceof Guid) {\r\n return key.toString()\r\n } else if (isObject(key) || Array.isArray(key)) {\r\n try {\r\n var keyHash = JSON.stringify(key);\r\n return \"{}\" === keyHash ? key : keyHash\r\n } catch (e) {\r\n return key\r\n }\r\n }\r\n return key\r\n};\r\nexport var escapeRegExp = function(string) {\r\n return string.replace(/[[\\]{}\\-()*+?.\\\\^$|\\s]/g, \"\\\\$&\")\r\n};\r\nexport var applyServerDecimalSeparator = function(value) {\r\n var separator = config().serverDecimalSeparator;\r\n if (isDefined(value)) {\r\n value = value.toString().replace(\".\", separator)\r\n }\r\n return value\r\n};\r\nexport var noop = function() {};\r\nexport var asyncNoop = function() {\r\n return (new Deferred).resolve().promise()\r\n};\r\nexport var grep = function(elements, checkFunction, invert) {\r\n var result = [];\r\n var check;\r\n var expectedCheck = !invert;\r\n for (var i = 0; i < elements.length; i++) {\r\n check = !!checkFunction(elements[i], i);\r\n if (check === expectedCheck) {\r\n result.push(elements[i])\r\n }\r\n }\r\n return result\r\n};\r\nvar compareArrays = (array1, array2, depth, options) => {\r\n if (array1.length !== array2.length) {\r\n return false\r\n }\r\n return !array1.some((item, idx) => !compareByValue(item, array2[idx], depth + 1, _extends({}, options, {\r\n strict: true\r\n })))\r\n};\r\nvar compareObjects = (object1, object2, depth, options) => {\r\n var keys1 = Object.keys(object1);\r\n var keys2 = Object.keys(object2);\r\n if (keys1.length !== keys2.length) {\r\n return false\r\n }\r\n var keys2Set = new Set(keys2);\r\n return !keys1.some(key => !keys2Set.has(key) || !compareByValue(object1[key], object2[key], depth + 1, options))\r\n};\r\nvar DEFAULT_EQUAL_BY_VALUE_OPTS = {\r\n maxDepth: 3,\r\n strict: true\r\n};\r\nvar compareByValue = (value1, value2, depth, options) => {\r\n var {\r\n strict: strict,\r\n maxDepth: maxDepth\r\n } = options;\r\n var comparable1 = toComparable(value1, true);\r\n var comparable2 = toComparable(value2, true);\r\n var comparisonResult = strict ? comparable1 === comparable2 : comparable1 == comparable2;\r\n switch (true) {\r\n case comparisonResult:\r\n case depth >= maxDepth:\r\n return true;\r\n case isObject(comparable1) && isObject(comparable2):\r\n return compareObjects(comparable1, comparable2, depth, options);\r\n case Array.isArray(comparable1) && Array.isArray(comparable2):\r\n return compareArrays(comparable1, comparable2, depth, options);\r\n default:\r\n return false\r\n }\r\n};\r\nexport var equalByValue = function(value1, value2) {\r\n var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : DEFAULT_EQUAL_BY_VALUE_OPTS;\r\n var compareOptions = _extends({}, DEFAULT_EQUAL_BY_VALUE_OPTS, options);\r\n return compareByValue(value1, value2, 0, compareOptions)\r\n};\r\n","/**\r\n * DevExtreme (esm/core/utils/console.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isFunction\r\n} from \"./type\";\r\nvar noop = function() {};\r\nvar getConsoleMethod = function(method) {\r\n if (\"undefined\" === typeof console || !isFunction(console[method])) {\r\n return noop\r\n }\r\n return console[method].bind(console)\r\n};\r\nexport var logger = {\r\n log: getConsoleMethod(\"log\"),\r\n info: getConsoleMethod(\"info\"),\r\n warn: getConsoleMethod(\"warn\"),\r\n error: getConsoleMethod(\"error\")\r\n};\r\nexport var debug = function() {\r\n function assert(condition, message) {\r\n if (!condition) {\r\n throw new Error(message)\r\n }\r\n }\r\n return {\r\n assert: assert,\r\n assertParam: function(parameter, message) {\r\n assert(null !== parameter && void 0 !== parameter, message)\r\n }\r\n }\r\n}();\r\n","/**\r\n * DevExtreme (esm/core/utils/data.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport errors from \"../errors\";\r\nimport Class from \"../class\";\r\nimport {\r\n deepExtendArraySafe\r\n} from \"./object\";\r\nimport {\r\n isObject,\r\n isPlainObject,\r\n isFunction,\r\n isDefined\r\n} from \"./type\";\r\nimport {\r\n each\r\n} from \"./iterator\";\r\nimport variableWrapper from \"./variable_wrapper\";\r\nvar unwrapVariable = variableWrapper.unwrap;\r\nvar isWrapped = variableWrapper.isWrapped;\r\nvar assign = variableWrapper.assign;\r\nvar bracketsToDots = function(expr) {\r\n return expr.replace(/\\[/g, \".\").replace(/\\]/g, \"\")\r\n};\r\nexport var getPathParts = function(name) {\r\n return bracketsToDots(name).split(\".\")\r\n};\r\nvar readPropValue = function(obj, propName, options) {\r\n options = options || {};\r\n if (\"this\" === propName) {\r\n return unwrap(obj, options)\r\n }\r\n return unwrap(obj[propName], options)\r\n};\r\nvar assignPropValue = function(obj, propName, value, options) {\r\n if (\"this\" === propName) {\r\n throw new errors.Error(\"E4016\")\r\n }\r\n var propValue = obj[propName];\r\n if (options.unwrapObservables && isWrapped(propValue)) {\r\n assign(propValue, value)\r\n } else {\r\n obj[propName] = value\r\n }\r\n};\r\nvar prepareOptions = function(options) {\r\n options = options || {};\r\n options.unwrapObservables = void 0 !== options.unwrapObservables ? options.unwrapObservables : true;\r\n return options\r\n};\r\n\r\nfunction unwrap(value, options) {\r\n return options.unwrapObservables ? unwrapVariable(value) : value\r\n}\r\nexport var compileGetter = function(expr) {\r\n if (arguments.length > 1) {\r\n expr = [].slice.call(arguments)\r\n }\r\n if (!expr || \"this\" === expr) {\r\n return function(obj) {\r\n return obj\r\n }\r\n }\r\n if (\"string\" === typeof expr) {\r\n var path = getPathParts(expr);\r\n return function(obj, options) {\r\n options = prepareOptions(options);\r\n var functionAsIs = options.functionsAsIs;\r\n var hasDefaultValue = \"defaultValue\" in options;\r\n var current = unwrap(obj, options);\r\n for (var i = 0; i < path.length; i++) {\r\n if (!current) {\r\n if (null == current && hasDefaultValue) {\r\n return options.defaultValue\r\n }\r\n break\r\n }\r\n var pathPart = path[i];\r\n if (hasDefaultValue && isObject(current) && !(pathPart in current)) {\r\n return options.defaultValue\r\n }\r\n var next = unwrap(current[pathPart], options);\r\n if (!functionAsIs && isFunction(next)) {\r\n next = next.call(current)\r\n }\r\n current = next\r\n }\r\n return current\r\n }\r\n }\r\n if (Array.isArray(expr)) {\r\n return combineGetters(expr)\r\n }\r\n if (isFunction(expr)) {\r\n return expr\r\n }\r\n};\r\n\r\nfunction combineGetters(getters) {\r\n var compiledGetters = {};\r\n for (var i = 0, l = getters.length; i < l; i++) {\r\n var getter = getters[i];\r\n compiledGetters[getter] = compileGetter(getter)\r\n }\r\n return function(obj, options) {\r\n var result;\r\n each(compiledGetters, (function(name) {\r\n var value = this(obj, options);\r\n if (void 0 === value) {\r\n return\r\n }\r\n var current = result || (result = {});\r\n var path = name.split(\".\");\r\n var last = path.length - 1;\r\n for (var _i = 0; _i < last; _i++) {\r\n var pathItem = path[_i];\r\n if (!(pathItem in current)) {\r\n current[pathItem] = {}\r\n }\r\n current = current[pathItem]\r\n }\r\n current[path[last]] = value\r\n }));\r\n return result\r\n }\r\n}\r\nvar ensurePropValueDefined = function(obj, propName, value, options) {\r\n if (isDefined(value)) {\r\n return value\r\n }\r\n var newValue = {};\r\n assignPropValue(obj, propName, newValue, options);\r\n return newValue\r\n};\r\nexport var compileSetter = function(expr) {\r\n expr = getPathParts(expr || \"this\");\r\n var lastLevelIndex = expr.length - 1;\r\n return function(obj, value, options) {\r\n options = prepareOptions(options);\r\n var currentValue = unwrap(obj, options);\r\n expr.forEach((function(propertyName, levelIndex) {\r\n var propertyValue = readPropValue(currentValue, propertyName, options);\r\n var isPropertyFunc = !options.functionsAsIs && isFunction(propertyValue) && !isWrapped(propertyValue);\r\n if (levelIndex === lastLevelIndex) {\r\n if (options.merge && isPlainObject(value) && (!isDefined(propertyValue) || isPlainObject(propertyValue))) {\r\n propertyValue = ensurePropValueDefined(currentValue, propertyName, propertyValue, options);\r\n deepExtendArraySafe(propertyValue, value, false, true)\r\n } else if (isPropertyFunc) {\r\n currentValue[propertyName](value)\r\n } else {\r\n assignPropValue(currentValue, propertyName, value, options)\r\n }\r\n } else {\r\n propertyValue = ensurePropValueDefined(currentValue, propertyName, propertyValue, options);\r\n if (isPropertyFunc) {\r\n propertyValue = propertyValue.call(currentValue)\r\n }\r\n currentValue = propertyValue\r\n }\r\n }))\r\n }\r\n};\r\nexport var toComparable = function(value, caseSensitive) {\r\n var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};\r\n if (value instanceof Date) {\r\n return value.getTime()\r\n }\r\n if (value && value instanceof Class && value.valueOf) {\r\n return value.valueOf()\r\n }\r\n if (!caseSensitive && \"string\" === typeof value) {\r\n var _options$collatorOpti;\r\n if (\"base\" === (null === options || void 0 === options ? void 0 : null === (_options$collatorOpti = options.collatorOptions) || void 0 === _options$collatorOpti ? void 0 : _options$collatorOpti.sensitivity)) {\r\n var REMOVE_DIACRITICAL_MARKS_REGEXP = /[\\u0300-\\u036f]/g;\r\n value = value.normalize(\"NFD\").replace(REMOVE_DIACRITICAL_MARKS_REGEXP, \"\")\r\n }\r\n return null !== options && void 0 !== options && options.locale ? value.toLocaleLowerCase(options.locale) : value.toLowerCase()\r\n }\r\n return value\r\n};\r\n","/**\r\n * DevExtreme (esm/renovation/ui/common/utils/date/toMilliseconds.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nvar timeIntervals = {\r\n millisecond: 1,\r\n second: 1e3,\r\n minute: 6e4,\r\n hour: 36e5,\r\n day: 864e5,\r\n week: 6048e5,\r\n month: 2592e6,\r\n quarter: 7776e6,\r\n year: 31536e6\r\n};\r\nexport function toMilliseconds(value) {\r\n return timeIntervals[value]\r\n}\r\n","/**\r\n * DevExtreme (esm/core/utils/date.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isObject,\r\n isString,\r\n isDate,\r\n isDefined,\r\n isNumeric\r\n} from \"./type\";\r\nimport {\r\n adjust\r\n} from \"./math\";\r\nimport {\r\n each\r\n} from \"./iterator\";\r\nimport {\r\n camelize\r\n} from \"./inflector\";\r\nimport {\r\n toMilliseconds\r\n} from \"../../renovation/ui/common/utils/date/index\";\r\nvar DAYS_IN_WEEK = 7;\r\nvar THURSDAY_WEEK_NUMBER = 4;\r\nvar SUNDAY_WEEK_NUMBER = 7;\r\nvar USUAL_WEEK_COUNT_IN_YEAR = 52;\r\nvar dateUnitIntervals = [\"millisecond\", \"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"quarter\", \"year\"];\r\nvar getDatesInterval = function(startDate, endDate, intervalUnit) {\r\n var delta = endDate.getTime() - startDate.getTime();\r\n var millisecondCount = toMilliseconds(intervalUnit) || 1;\r\n return Math.floor(delta / millisecondCount)\r\n};\r\nvar getNextDateUnit = function(unit, withWeeks) {\r\n var interval = getDateUnitInterval(unit);\r\n switch (interval) {\r\n case \"millisecond\":\r\n return \"second\";\r\n case \"second\":\r\n return \"minute\";\r\n case \"minute\":\r\n return \"hour\";\r\n case \"hour\":\r\n return \"day\";\r\n case \"day\":\r\n return withWeeks ? \"week\" : \"month\";\r\n case \"week\":\r\n return \"month\";\r\n case \"month\":\r\n return \"quarter\";\r\n case \"quarter\":\r\n case \"year\":\r\n return \"year\";\r\n default:\r\n return 0\r\n }\r\n};\r\nvar convertMillisecondsToDateUnits = function(value) {\r\n var i;\r\n var dateUnitCount;\r\n var dateUnitInterval;\r\n var dateUnitIntervals = [\"millisecond\", \"second\", \"minute\", \"hour\", \"day\", \"month\", \"year\"];\r\n var result = {};\r\n for (i = dateUnitIntervals.length - 1; i >= 0; i--) {\r\n dateUnitInterval = dateUnitIntervals[i];\r\n dateUnitCount = Math.floor(value / toMilliseconds(dateUnitInterval));\r\n if (dateUnitCount > 0) {\r\n result[dateUnitInterval + \"s\"] = dateUnitCount;\r\n value -= convertDateUnitToMilliseconds(dateUnitInterval, dateUnitCount)\r\n }\r\n }\r\n return result\r\n};\r\nvar dateToMilliseconds = function(tickInterval) {\r\n var milliseconds = 0;\r\n if (isObject(tickInterval)) {\r\n each(tickInterval, (function(key, value) {\r\n milliseconds += convertDateUnitToMilliseconds(key.substr(0, key.length - 1), value)\r\n }))\r\n }\r\n if (isString(tickInterval)) {\r\n milliseconds = convertDateUnitToMilliseconds(tickInterval, 1)\r\n }\r\n return milliseconds\r\n};\r\n\r\nfunction convertDateUnitToMilliseconds(dateUnit, count) {\r\n return toMilliseconds(dateUnit) * count\r\n}\r\n\r\nfunction getDateUnitInterval(tickInterval) {\r\n var maxInterval = -1;\r\n var i;\r\n if (isString(tickInterval)) {\r\n return tickInterval\r\n }\r\n if (isObject(tickInterval)) {\r\n each(tickInterval, (function(key, value) {\r\n for (i = 0; i < dateUnitIntervals.length; i++) {\r\n if (value && (key === dateUnitIntervals[i] + \"s\" || key === dateUnitIntervals[i]) && maxInterval < i) {\r\n maxInterval = i\r\n }\r\n }\r\n }));\r\n return dateUnitIntervals[maxInterval]\r\n }\r\n return \"\"\r\n}\r\nvar tickIntervalToFormatMap = {\r\n millisecond: \"millisecond\",\r\n second: \"longtime\",\r\n minute: \"shorttime\",\r\n hour: \"shorttime\",\r\n day: \"day\",\r\n week: \"day\",\r\n month: \"month\",\r\n quarter: \"quarter\",\r\n year: \"year\"\r\n};\r\n\r\nfunction getDateFormatByTickInterval(tickInterval) {\r\n return tickIntervalToFormatMap[getDateUnitInterval(tickInterval)] || \"\"\r\n}\r\nvar getQuarter = function(month) {\r\n return Math.floor(month / 3)\r\n};\r\nvar getFirstQuarterMonth = function(month) {\r\n return 3 * getQuarter(month)\r\n};\r\n\r\nfunction correctDateWithUnitBeginning(date, dateInterval, withCorrection, firstDayOfWeek) {\r\n date = new Date(date.getTime());\r\n var oldDate = new Date(date.getTime());\r\n var firstQuarterMonth;\r\n var month;\r\n var dateUnitInterval = getDateUnitInterval(dateInterval);\r\n switch (dateUnitInterval) {\r\n case \"second\":\r\n date = new Date(1e3 * Math.floor(oldDate.getTime() / 1e3));\r\n break;\r\n case \"minute\":\r\n date = new Date(6e4 * Math.floor(oldDate.getTime() / 6e4));\r\n break;\r\n case \"hour\":\r\n date = new Date(36e5 * Math.floor(oldDate.getTime() / 36e5));\r\n break;\r\n case \"year\":\r\n date.setMonth(0);\r\n case \"month\":\r\n date.setDate(1);\r\n case \"day\":\r\n date.setHours(0, 0, 0, 0);\r\n break;\r\n case \"week\":\r\n date = getFirstWeekDate(date, firstDayOfWeek || 0);\r\n date.setHours(0, 0, 0, 0);\r\n break;\r\n case \"quarter\":\r\n firstQuarterMonth = getFirstQuarterMonth(date.getMonth());\r\n month = date.getMonth();\r\n date.setDate(1);\r\n date.setHours(0, 0, 0, 0);\r\n if (month !== firstQuarterMonth) {\r\n date.setMonth(firstQuarterMonth)\r\n }\r\n }\r\n if (withCorrection && \"hour\" !== dateUnitInterval && \"minute\" !== dateUnitInterval && \"second\" !== dateUnitInterval) {\r\n fixTimezoneGap(oldDate, date)\r\n }\r\n return date\r\n}\r\n\r\nfunction trimTime(date) {\r\n return correctDateWithUnitBeginning(date, \"day\")\r\n}\r\nvar setToDayEnd = function(date) {\r\n var result = trimTime(date);\r\n result.setDate(result.getDate() + 1);\r\n return new Date(result.getTime() - 1)\r\n};\r\nvar getDatesDifferences = function(date1, date2) {\r\n var counter = 0;\r\n var differences = {\r\n year: date1.getFullYear() !== date2.getFullYear(),\r\n month: date1.getMonth() !== date2.getMonth(),\r\n day: date1.getDate() !== date2.getDate(),\r\n hour: date1.getHours() !== date2.getHours(),\r\n minute: date1.getMinutes() !== date2.getMinutes(),\r\n second: date1.getSeconds() !== date2.getSeconds(),\r\n millisecond: date1.getMilliseconds() !== date2.getMilliseconds()\r\n };\r\n each(differences, (function(key, value) {\r\n if (value) {\r\n counter++\r\n }\r\n }));\r\n if (0 === counter && 0 !== getTimezonesDifference(date1, date2)) {\r\n differences.hour = true;\r\n counter++\r\n }\r\n differences.count = counter;\r\n return differences\r\n};\r\n\r\nfunction addDateInterval(value, interval, dir) {\r\n var result = new Date(value.getTime());\r\n var intervalObject = isString(interval) ? getDateIntervalByString(interval.toLowerCase()) : isNumeric(interval) ? convertMillisecondsToDateUnits(interval) : interval;\r\n if (intervalObject.years) {\r\n result.setFullYear(result.getFullYear() + intervalObject.years * dir)\r\n }\r\n if (intervalObject.quarters) {\r\n result.setMonth(result.getMonth() + 3 * intervalObject.quarters * dir)\r\n }\r\n if (intervalObject.months) {\r\n result.setMonth(result.getMonth() + intervalObject.months * dir)\r\n }\r\n if (intervalObject.weeks) {\r\n result.setDate(result.getDate() + 7 * intervalObject.weeks * dir)\r\n }\r\n if (intervalObject.days) {\r\n result.setDate(result.getDate() + intervalObject.days * dir)\r\n }\r\n if (intervalObject.hours) {\r\n result.setTime(result.getTime() + 36e5 * intervalObject.hours * dir)\r\n }\r\n if (intervalObject.minutes) {\r\n result.setTime(result.getTime() + 6e4 * intervalObject.minutes * dir)\r\n }\r\n if (intervalObject.seconds) {\r\n result.setTime(result.getTime() + 1e3 * intervalObject.seconds * dir)\r\n }\r\n if (intervalObject.milliseconds) {\r\n result.setTime(result.getTime() + intervalObject.milliseconds * dir)\r\n }\r\n return result\r\n}\r\nvar addInterval = function(value, interval, isNegative) {\r\n var dir = isNegative ? -1 : 1;\r\n return isDate(value) ? addDateInterval(value, interval, dir) : adjust(value + interval * dir, interval)\r\n};\r\nvar getSequenceByInterval = function(min, max, interval) {\r\n var intervals = [];\r\n var cur;\r\n intervals.push(isDate(min) ? new Date(min.getTime()) : min);\r\n cur = min;\r\n while (cur < max) {\r\n cur = addInterval(cur, interval);\r\n intervals.push(cur)\r\n }\r\n return intervals\r\n};\r\nvar getViewFirstCellDate = function(viewType, date) {\r\n if (\"month\" === viewType) {\r\n return createDateWithFullYear(date.getFullYear(), date.getMonth(), 1)\r\n }\r\n if (\"year\" === viewType) {\r\n return createDateWithFullYear(date.getFullYear(), 0, date.getDate())\r\n }\r\n if (\"decade\" === viewType) {\r\n return createDateWithFullYear(getFirstYearInDecade(date), date.getMonth(), date.getDate())\r\n }\r\n if (\"century\" === viewType) {\r\n return createDateWithFullYear(getFirstDecadeInCentury(date), date.getMonth(), date.getDate())\r\n }\r\n};\r\nvar getViewLastCellDate = function(viewType, date) {\r\n if (\"month\" === viewType) {\r\n return createDateWithFullYear(date.getFullYear(), date.getMonth(), getLastMonthDay(date))\r\n }\r\n if (\"year\" === viewType) {\r\n return createDateWithFullYear(date.getFullYear(), 11, date.getDate())\r\n }\r\n if (\"decade\" === viewType) {\r\n return createDateWithFullYear(getFirstYearInDecade(date) + 9, date.getMonth(), date.getDate())\r\n }\r\n if (\"century\" === viewType) {\r\n return createDateWithFullYear(getFirstDecadeInCentury(date) + 90, date.getMonth(), date.getDate())\r\n }\r\n};\r\nvar getViewMinBoundaryDate = function(viewType, date) {\r\n var resultDate = createDateWithFullYear(date.getFullYear(), date.getMonth(), 1);\r\n if (\"month\" === viewType) {\r\n return resultDate\r\n }\r\n resultDate.setMonth(0);\r\n if (\"year\" === viewType) {\r\n return resultDate\r\n }\r\n if (\"decade\" === viewType) {\r\n resultDate.setFullYear(getFirstYearInDecade(date))\r\n }\r\n if (\"century\" === viewType) {\r\n resultDate.setFullYear(getFirstDecadeInCentury(date))\r\n }\r\n return resultDate\r\n};\r\nvar getViewMaxBoundaryDate = function(viewType, date) {\r\n var resultDate = new Date(date);\r\n resultDate.setDate(getLastMonthDay(date));\r\n if (\"month\" === viewType) {\r\n return resultDate\r\n }\r\n resultDate.setMonth(11);\r\n resultDate.setDate(getLastMonthDay(resultDate));\r\n if (\"year\" === viewType) {\r\n return resultDate\r\n }\r\n if (\"decade\" === viewType) {\r\n resultDate.setFullYear(getFirstYearInDecade(date) + 9)\r\n }\r\n if (\"century\" === viewType) {\r\n resultDate.setFullYear(getFirstDecadeInCentury(date) + 99)\r\n }\r\n return resultDate\r\n};\r\n\r\nfunction getLastMonthDay(date) {\r\n var resultDate = createDateWithFullYear(date.getFullYear(), date.getMonth() + 1, 0);\r\n return resultDate.getDate()\r\n}\r\nvar getViewUp = function(typeView) {\r\n switch (typeView) {\r\n case \"month\":\r\n return \"year\";\r\n case \"year\":\r\n return \"decade\";\r\n case \"decade\":\r\n return \"century\"\r\n }\r\n};\r\nvar getViewDown = function(typeView) {\r\n switch (typeView) {\r\n case \"century\":\r\n return \"decade\";\r\n case \"decade\":\r\n return \"year\";\r\n case \"year\":\r\n return \"month\"\r\n }\r\n};\r\nvar getDifferenceInMonth = function(typeView) {\r\n var difference = 1;\r\n if (\"year\" === typeView) {\r\n difference = 12\r\n }\r\n if (\"decade\" === typeView) {\r\n difference = 120\r\n }\r\n if (\"century\" === typeView) {\r\n difference = 1200\r\n }\r\n return difference\r\n};\r\nvar getDifferenceInMonthForCells = function(typeView) {\r\n var difference = 1;\r\n if (\"decade\" === typeView) {\r\n difference = 12\r\n }\r\n if (\"century\" === typeView) {\r\n difference = 120\r\n }\r\n return difference\r\n};\r\n\r\nfunction getDateIntervalByString(intervalString) {\r\n var result = {};\r\n switch (intervalString) {\r\n case \"year\":\r\n result.years = 1;\r\n break;\r\n case \"month\":\r\n result.months = 1;\r\n break;\r\n case \"quarter\":\r\n result.months = 3;\r\n break;\r\n case \"week\":\r\n result.weeks = 1;\r\n break;\r\n case \"day\":\r\n result.days = 1;\r\n break;\r\n case \"hour\":\r\n result.hours = 1;\r\n break;\r\n case \"minute\":\r\n result.minutes = 1;\r\n break;\r\n case \"second\":\r\n result.seconds = 1;\r\n break;\r\n case \"millisecond\":\r\n result.milliseconds = 1\r\n }\r\n return result\r\n}\r\n\r\nfunction sameDate(date1, date2) {\r\n return sameMonthAndYear(date1, date2) && date1.getDate() === date2.getDate()\r\n}\r\n\r\nfunction sameMonthAndYear(date1, date2) {\r\n return sameYear(date1, date2) && date1.getMonth() === date2.getMonth()\r\n}\r\n\r\nfunction sameYear(date1, date2) {\r\n return date1 && date2 && date1.getFullYear() === date2.getFullYear()\r\n}\r\n\r\nfunction sameHoursAndMinutes(date1, date2) {\r\n return date1 && date2 && date1.getHours() === date2.getHours() && date1.getMinutes() === date2.getMinutes()\r\n}\r\nvar sameDecade = function(date1, date2) {\r\n if (!isDefined(date1) || !isDefined(date2)) {\r\n return\r\n }\r\n var startDecadeDate1 = date1.getFullYear() - date1.getFullYear() % 10;\r\n var startDecadeDate2 = date2.getFullYear() - date2.getFullYear() % 10;\r\n return date1 && date2 && startDecadeDate1 === startDecadeDate2\r\n};\r\nvar sameCentury = function(date1, date2) {\r\n if (!isDefined(date1) || !isDefined(date2)) {\r\n return\r\n }\r\n var startCenturyDate1 = date1.getFullYear() - date1.getFullYear() % 100;\r\n var startCenturyDate2 = date2.getFullYear() - date2.getFullYear() % 100;\r\n return date1 && date2 && startCenturyDate1 === startCenturyDate2\r\n};\r\n\r\nfunction getFirstDecadeInCentury(date) {\r\n return date && date.getFullYear() - date.getFullYear() % 100\r\n}\r\n\r\nfunction getFirstYearInDecade(date) {\r\n return date && date.getFullYear() - date.getFullYear() % 10\r\n}\r\nvar getShortDateFormat = function() {\r\n return \"yyyy/MM/dd\"\r\n};\r\nvar getFirstMonthDate = function(date) {\r\n if (!isDefined(date)) {\r\n return\r\n }\r\n return createDateWithFullYear(date.getFullYear(), date.getMonth(), 1)\r\n};\r\nvar getLastMonthDate = function(date) {\r\n if (!isDefined(date)) {\r\n return\r\n }\r\n return createDateWithFullYear(date.getFullYear(), date.getMonth() + 1, 0)\r\n};\r\n\r\nfunction getFirstWeekDate(date, firstDayOfWeek) {\r\n var delta = (date.getDay() - firstDayOfWeek + DAYS_IN_WEEK) % DAYS_IN_WEEK;\r\n var result = new Date(date);\r\n result.setDate(date.getDate() - delta);\r\n return result\r\n}\r\n\r\nfunction getUTCTime(date) {\r\n return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())\r\n}\r\n\r\nfunction getDayNumber(date) {\r\n var ms = getUTCTime(date) - getUTCTime(getFirstDateInYear(date.getFullYear()));\r\n return 1 + Math.floor(ms / toMilliseconds(\"day\"))\r\n}\r\n\r\nfunction getFirstDateInYear(year) {\r\n return new Date(year, 0, 1)\r\n}\r\n\r\nfunction getLastDateInYear(year) {\r\n return new Date(year, 11, 31)\r\n}\r\n\r\nfunction getDayWeekNumber(date, firstDayOfWeek) {\r\n var day = date.getDay() - firstDayOfWeek + 1;\r\n if (day <= 0) {\r\n day += DAYS_IN_WEEK\r\n }\r\n return day\r\n}\r\n\r\nfunction getWeekNumber(date, firstDayOfWeek, rule) {\r\n var firstWeekDayInYear = getDayWeekNumber(getFirstDateInYear(date.getFullYear()), firstDayOfWeek);\r\n var lastWeekDayInYear = getDayWeekNumber(getLastDateInYear(date.getFullYear()), firstDayOfWeek);\r\n var daysInFirstWeek = DAYS_IN_WEEK - firstWeekDayInYear + 1;\r\n var weekNumber = Math.ceil((getDayNumber(date) - daysInFirstWeek) / 7);\r\n switch (rule) {\r\n case \"fullWeek\":\r\n if (daysInFirstWeek === DAYS_IN_WEEK) {\r\n weekNumber++\r\n }\r\n if (0 === weekNumber) {\r\n var lastDateInPreviousYear = getLastDateInYear(date.getFullYear() - 1);\r\n return getWeekNumber(lastDateInPreviousYear, firstDayOfWeek, rule)\r\n }\r\n return weekNumber;\r\n case \"firstDay\":\r\n if (daysInFirstWeek > 0) {\r\n weekNumber++\r\n }\r\n var isSunday = firstWeekDayInYear === SUNDAY_WEEK_NUMBER || lastWeekDayInYear === SUNDAY_WEEK_NUMBER;\r\n if (weekNumber > USUAL_WEEK_COUNT_IN_YEAR && !isSunday || 54 === weekNumber) {\r\n weekNumber = 1\r\n }\r\n return weekNumber;\r\n case \"firstFourDays\":\r\n if (daysInFirstWeek > 3) {\r\n weekNumber++\r\n }\r\n var isThursday = firstWeekDayInYear === THURSDAY_WEEK_NUMBER || lastWeekDayInYear === THURSDAY_WEEK_NUMBER;\r\n if (weekNumber > USUAL_WEEK_COUNT_IN_YEAR && !isThursday) {\r\n weekNumber = 1\r\n }\r\n if (0 === weekNumber) {\r\n var _lastDateInPreviousYear = getLastDateInYear(date.getFullYear() - 1);\r\n return getWeekNumber(_lastDateInPreviousYear, firstDayOfWeek, rule)\r\n }\r\n return weekNumber\r\n }\r\n}\r\nvar normalizeDateByWeek = function(date, currentDate) {\r\n var differenceInDays = dateUtils.getDatesInterval(date, currentDate, \"day\");\r\n var resultDate = new Date(date);\r\n if (differenceInDays >= 6) {\r\n resultDate = new Date(resultDate.setDate(resultDate.getDate() + 7))\r\n }\r\n return resultDate\r\n};\r\nvar dateInRange = function(date, min, max, format) {\r\n if (\"date\" === format) {\r\n min = min && dateUtils.correctDateWithUnitBeginning(min, \"day\");\r\n max = max && dateUtils.correctDateWithUnitBeginning(max, \"day\");\r\n date = date && dateUtils.correctDateWithUnitBeginning(date, \"day\")\r\n }\r\n return normalizeDate(date, min, max) === date\r\n};\r\nvar intervalsOverlap = function(options) {\r\n var {\r\n firstMin: firstMin,\r\n firstMax: firstMax,\r\n secondMin: secondMin,\r\n secondMax: secondMax\r\n } = options;\r\n return firstMin <= secondMin && secondMin <= firstMax || firstMin > secondMin && firstMin < secondMax || firstMin < secondMax && firstMax > secondMax\r\n};\r\nvar dateTimeFromDecimal = function(number) {\r\n var hours = Math.floor(number);\r\n var minutes = number % 1 * 60;\r\n return {\r\n hours: hours,\r\n minutes: minutes\r\n }\r\n};\r\nvar roundDateByStartDayHour = function(date, startDayHour) {\r\n var startTime = this.dateTimeFromDecimal(startDayHour);\r\n var result = new Date(date);\r\n if (date.getHours() === startTime.hours && date.getMinutes() < startTime.minutes || date.getHours() < startTime.hours) {\r\n result.setHours(startTime.hours, startTime.minutes, 0, 0)\r\n }\r\n return result\r\n};\r\n\r\nfunction normalizeDate(date, min, max) {\r\n var normalizedDate = date;\r\n if (!isDefined(date)) {\r\n return date\r\n }\r\n if (isDefined(min) && date < min) {\r\n normalizedDate = min\r\n }\r\n if (isDefined(max) && date > max) {\r\n normalizedDate = max\r\n }\r\n return normalizedDate\r\n}\r\n\r\nfunction fixTimezoneGap(oldDate, newDate) {\r\n if (!isDefined(oldDate)) {\r\n return\r\n }\r\n var diff = newDate.getHours() - oldDate.getHours();\r\n if (0 === diff) {\r\n return\r\n }\r\n var sign = 1 === diff || -23 === diff ? -1 : 1;\r\n var trial = new Date(newDate.getTime() + 36e5 * sign);\r\n if (sign > 0 || trial.getDate() === newDate.getDate()) {\r\n newDate.setTime(trial.getTime())\r\n }\r\n}\r\nvar roundToHour = function(date) {\r\n var result = new Date(date.getTime());\r\n result.setHours(result.getHours() + 1);\r\n result.setMinutes(0);\r\n return result\r\n};\r\n\r\nfunction getTimezonesDifference(min, max) {\r\n return 60 * (max.getTimezoneOffset() - min.getTimezoneOffset()) * 1e3\r\n}\r\nvar makeDate = function(date) {\r\n return new Date(date)\r\n};\r\nvar getDatesOfInterval = function(startDate, endDate, step) {\r\n var result = [];\r\n var currentDate = new Date(startDate.getTime());\r\n while (currentDate < endDate) {\r\n result.push(new Date(currentDate.getTime()));\r\n currentDate = this.addInterval(currentDate, step)\r\n }\r\n return result\r\n};\r\nvar createDateWithFullYear = function(year) {\r\n var result = new Date(...arguments);\r\n result.setFullYear(year);\r\n return result\r\n};\r\nvar dateUtils = {\r\n dateUnitIntervals: dateUnitIntervals,\r\n convertMillisecondsToDateUnits: convertMillisecondsToDateUnits,\r\n dateToMilliseconds: dateToMilliseconds,\r\n getNextDateUnit: getNextDateUnit,\r\n convertDateUnitToMilliseconds: convertDateUnitToMilliseconds,\r\n getDateUnitInterval: getDateUnitInterval,\r\n getDateFormatByTickInterval: getDateFormatByTickInterval,\r\n getDatesDifferences: getDatesDifferences,\r\n correctDateWithUnitBeginning: correctDateWithUnitBeginning,\r\n trimTime: trimTime,\r\n setToDayEnd: setToDayEnd,\r\n roundDateByStartDayHour: roundDateByStartDayHour,\r\n dateTimeFromDecimal: dateTimeFromDecimal,\r\n addDateInterval: addDateInterval,\r\n addInterval: addInterval,\r\n getSequenceByInterval: getSequenceByInterval,\r\n getDateIntervalByString: getDateIntervalByString,\r\n sameHoursAndMinutes: sameHoursAndMinutes,\r\n sameDate: sameDate,\r\n sameMonthAndYear: sameMonthAndYear,\r\n sameMonth: sameMonthAndYear,\r\n sameYear: sameYear,\r\n sameDecade: sameDecade,\r\n sameCentury: sameCentury,\r\n getDifferenceInMonth: getDifferenceInMonth,\r\n getDifferenceInMonthForCells: getDifferenceInMonthForCells,\r\n getFirstYearInDecade: getFirstYearInDecade,\r\n getFirstDecadeInCentury: getFirstDecadeInCentury,\r\n getShortDateFormat: getShortDateFormat,\r\n getViewFirstCellDate: getViewFirstCellDate,\r\n getViewLastCellDate: getViewLastCellDate,\r\n getViewDown: getViewDown,\r\n getViewUp: getViewUp,\r\n getLastMonthDay: getLastMonthDay,\r\n getLastMonthDate: getLastMonthDate,\r\n getFirstMonthDate: getFirstMonthDate,\r\n getFirstWeekDate: getFirstWeekDate,\r\n getWeekNumber: getWeekNumber,\r\n normalizeDateByWeek: normalizeDateByWeek,\r\n getQuarter: getQuarter,\r\n getFirstQuarterMonth: getFirstQuarterMonth,\r\n dateInRange: dateInRange,\r\n intervalsOverlap: intervalsOverlap,\r\n roundToHour: roundToHour,\r\n normalizeDate: normalizeDate,\r\n getViewMinBoundaryDate: getViewMinBoundaryDate,\r\n getViewMaxBoundaryDate: getViewMaxBoundaryDate,\r\n fixTimezoneGap: fixTimezoneGap,\r\n getTimezonesDifference: getTimezonesDifference,\r\n makeDate: makeDate,\r\n getDatesInterval: getDatesInterval,\r\n getDatesOfInterval: getDatesOfInterval,\r\n createDateWithFullYear: createDateWithFullYear\r\n};\r\ndateUtils.sameView = function(view, date1, date2) {\r\n return dateUtils[camelize(\"same \" + view)](date1, date2)\r\n};\r\nexport default dateUtils;\r\n","/**\r\n * DevExtreme (esm/core/utils/date_serialization.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport config from \"../config\";\r\nimport {\r\n getFormatter as getLDMLFormatter\r\n} from \"../../localization/ldml/date.formatter\";\r\nimport defaultDateNames from \"../../localization/default_date_names\";\r\nimport {\r\n isString,\r\n isDate,\r\n isNumeric as isNumber\r\n} from \"./type\";\r\nvar NUMBER_SERIALIZATION_FORMAT = \"number\";\r\nvar DATE_SERIALIZATION_FORMAT = \"yyyy/MM/dd\";\r\nvar DATETIME_SERIALIZATION_FORMAT = \"yyyy/MM/dd HH:mm:ss\";\r\nvar ISO8601_PATTERN = /^(\\d{4,})(-)?(\\d{2})(-)?(\\d{2})(?:T(\\d{2})(:)?(\\d{2})?(:)?(\\d{2}(?:\\.(\\d{1,3})\\d*)?)?)?(Z|([+-])(\\d{2})(:)?(\\d{2})?)?$/;\r\nvar ISO8601_TIME_PATTERN = /^(\\d{2}):(\\d{2})(:(\\d{2}))?$/;\r\nvar ISO8601_PATTERN_PARTS = [\"\", \"yyyy\", \"\", \"MM\", \"\", \"dd\", \"THH\", \"\", \"mm\", \"\", \"ss\", \".SSS\"];\r\nvar DATE_SERIALIZATION_PATTERN = /^(\\d{4})\\/(\\d{2})\\/(\\d{2})$/;\r\nvar MILLISECOND_LENGHT = 3;\r\nvar dateParser = function(text, skipISO8601Parsing) {\r\n var result;\r\n if (isString(text) && !skipISO8601Parsing) {\r\n result = parseISO8601String(text)\r\n }\r\n return result || parseDate(text)\r\n};\r\n\r\nfunction getTimePart(part) {\r\n return +part || 0\r\n}\r\n\r\nfunction parseDate(text) {\r\n var isDefaultSerializationFormat = getDateSerializationFormat(text) === DATE_SERIALIZATION_FORMAT;\r\n var parsedValue = !isDate(text) && Date.parse(text);\r\n if (!parsedValue && isDefaultSerializationFormat) {\r\n var parts = text.match(DATE_SERIALIZATION_PATTERN);\r\n if (parts) {\r\n var newDate = new Date(getTimePart(parts[1]), getTimePart(parts[2]), getTimePart(parts[3]));\r\n newDate.setFullYear(getTimePart(parts[1]));\r\n newDate.setMonth(getTimePart(parts[2]) - 1);\r\n newDate.setDate(getTimePart(parts[3]));\r\n return newDate\r\n }\r\n }\r\n return isNumber(parsedValue) ? new Date(parsedValue) : text\r\n}\r\n\r\nfunction parseISO8601String(text) {\r\n var parts = text.match(ISO8601_PATTERN);\r\n if (!parts) {\r\n parts = text.match(ISO8601_TIME_PATTERN);\r\n if (parts) {\r\n return new Date(0, 0, 0, getTimePart(parts[1]), getTimePart(parts[2]), getTimePart(parts[4]))\r\n }\r\n return\r\n }\r\n var year = getTimePart(parts[1]);\r\n var month = --parts[3];\r\n var day = parts[5];\r\n var timeZoneHour = 0;\r\n var timeZoneMinute = 0;\r\n var correctYear = d => {\r\n year < 100 && d.setFullYear(year);\r\n return d\r\n };\r\n timeZoneHour = getTimePart(parts[14]);\r\n timeZoneMinute = getTimePart(parts[16]);\r\n if (\"-\" === parts[13]) {\r\n timeZoneHour = -timeZoneHour;\r\n timeZoneMinute = -timeZoneMinute\r\n }\r\n var hour = getTimePart(parts[6]) - timeZoneHour;\r\n var minute = getTimePart(parts[8]) - timeZoneMinute;\r\n var second = getTimePart(parts[10]);\r\n var millisecond = function(part) {\r\n part = part || \"\";\r\n return getTimePart(part) * Math.pow(10, MILLISECOND_LENGHT - part.length)\r\n }(parts[11]);\r\n if (parts[12]) {\r\n return correctYear(new Date(Date.UTC(year, month, day, hour, minute, second, millisecond)))\r\n }\r\n return correctYear(new Date(year, month, day, hour, minute, second, millisecond))\r\n}\r\nvar getIso8601Format = function(text, useUtc) {\r\n var parts = text.match(ISO8601_PATTERN);\r\n var result = \"\";\r\n if (!parts) {\r\n parts = text.match(ISO8601_TIME_PATTERN);\r\n if (parts) {\r\n return parts[3] ? \"HH:mm:ss\" : \"HH:mm\"\r\n }\r\n return\r\n }\r\n for (var i = 1; i < ISO8601_PATTERN_PARTS.length; i++) {\r\n if (parts[i]) {\r\n result += ISO8601_PATTERN_PARTS[i] || parts[i]\r\n }\r\n }\r\n if (\"Z\" === parts[12]) {\r\n result += \"'Z'\"\r\n }\r\n if (parts[14]) {\r\n if (parts[15]) {\r\n result += \"xxx\"\r\n } else if (parts[16]) {\r\n result += \"xx\"\r\n } else {\r\n result += \"x\"\r\n }\r\n }\r\n return result\r\n};\r\nvar deserializeDate = function(value) {\r\n if (\"number\" === typeof value) {\r\n return new Date(value)\r\n }\r\n return dateParser(value, !config().forceIsoDateParsing)\r\n};\r\nvar serializeDate = function(value, serializationFormat) {\r\n if (!serializationFormat) {\r\n return value\r\n }\r\n if (!isDate(value)) {\r\n return null\r\n }\r\n if (serializationFormat === NUMBER_SERIALIZATION_FORMAT) {\r\n return value && value.valueOf ? value.valueOf() : null\r\n }\r\n return getLDMLFormatter(serializationFormat, defaultDateNames)(value)\r\n};\r\nvar getDateSerializationFormat = function(value) {\r\n if (\"number\" === typeof value) {\r\n return NUMBER_SERIALIZATION_FORMAT\r\n } else if (isString(value)) {\r\n var format;\r\n if (config().forceIsoDateParsing) {\r\n format = getIso8601Format(value)\r\n }\r\n if (format) {\r\n return format\r\n } else if (value.indexOf(\":\") >= 0) {\r\n return DATETIME_SERIALIZATION_FORMAT\r\n } else {\r\n return DATE_SERIALIZATION_FORMAT\r\n }\r\n } else if (value) {\r\n return null\r\n }\r\n};\r\nexport default {\r\n dateParser: dateParser,\r\n deserializeDate: deserializeDate,\r\n serializeDate: serializeDate,\r\n getDateSerializationFormat: getDateSerializationFormat\r\n};\r\n","/**\r\n * DevExtreme (esm/core/utils/deferred.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isDeferred,\r\n isDefined,\r\n isPromise\r\n} from \"../utils/type\";\r\nimport {\r\n extend\r\n} from \"../utils/extend\";\r\nimport Callbacks from \"../utils/callbacks\";\r\nvar deferredConfig = [{\r\n method: \"resolve\",\r\n handler: \"done\",\r\n state: \"resolved\"\r\n}, {\r\n method: \"reject\",\r\n handler: \"fail\",\r\n state: \"rejected\"\r\n}, {\r\n method: \"notify\",\r\n handler: \"progress\"\r\n}];\r\nvar _DeferredObj = function() {\r\n var that = this;\r\n this._state = \"pending\";\r\n this._promise = {};\r\n deferredConfig.forEach(function(config) {\r\n var methodName = config.method;\r\n this[methodName + \"Callbacks\"] = Callbacks();\r\n this[methodName] = function() {\r\n return this[methodName + \"With\"](this._promise, arguments)\r\n }.bind(this);\r\n this._promise[config.handler] = function(handler) {\r\n if (!handler) {\r\n return this\r\n }\r\n var callbacks = that[methodName + \"Callbacks\"];\r\n if (callbacks.fired()) {\r\n handler.apply(that[methodName + \"Context\"], that[methodName + \"Args\"])\r\n } else {\r\n callbacks.add(function(context, args) {\r\n handler.apply(context, args)\r\n }.bind(this))\r\n }\r\n return this\r\n }\r\n }.bind(this));\r\n this._promise.always = function(handler) {\r\n return this.done(handler).fail(handler)\r\n };\r\n this._promise.catch = function(handler) {\r\n return this.then(null, handler)\r\n };\r\n this._promise.then = function(resolve, reject) {\r\n var result = new _DeferredObj;\r\n [\"done\", \"fail\"].forEach(function(method) {\r\n var callback = \"done\" === method ? resolve : reject;\r\n this[method]((function() {\r\n if (!callback) {\r\n result[\"done\" === method ? \"resolve\" : \"reject\"].apply(this, arguments);\r\n return\r\n }\r\n var callbackResult = callback && callback.apply(this, arguments);\r\n if (isDeferred(callbackResult)) {\r\n callbackResult.done(result.resolve).fail(result.reject)\r\n } else if (isPromise(callbackResult)) {\r\n callbackResult.then(result.resolve, result.reject)\r\n } else {\r\n result.resolve.apply(this, isDefined(callbackResult) ? [callbackResult] : arguments)\r\n }\r\n }))\r\n }.bind(this));\r\n return result.promise()\r\n };\r\n this._promise.state = function() {\r\n return that._state\r\n };\r\n this._promise.promise = function(args) {\r\n return args ? extend(args, that._promise) : that._promise\r\n };\r\n this._promise.promise(this)\r\n};\r\ndeferredConfig.forEach((function(config) {\r\n var methodName = config.method;\r\n var state = config.state;\r\n _DeferredObj.prototype[methodName + \"With\"] = function(context, args) {\r\n var callbacks = this[methodName + \"Callbacks\"];\r\n if (\"pending\" === this.state()) {\r\n this[methodName + \"Args\"] = args;\r\n this[methodName + \"Context\"] = context;\r\n if (state) {\r\n this._state = state\r\n }\r\n callbacks.fire(context, args)\r\n }\r\n return this\r\n }\r\n}));\r\nexport function fromPromise(promise, context) {\r\n if (isDeferred(promise)) {\r\n return promise\r\n } else if (isPromise(promise)) {\r\n var d = new _DeferredObj;\r\n promise.then((function() {\r\n d.resolveWith.apply(d, [context].concat([\r\n [].slice.call(arguments)\r\n ]))\r\n }), (function() {\r\n d.rejectWith.apply(d, [context].concat([\r\n [].slice.call(arguments)\r\n ]))\r\n }));\r\n return d\r\n }\r\n return (new _DeferredObj).resolveWith(context, [promise])\r\n}\r\nvar whenFunc = function() {\r\n if (1 === arguments.length) {\r\n return fromPromise(arguments[0])\r\n }\r\n var values = [].slice.call(arguments);\r\n var contexts = [];\r\n var resolvedCount = 0;\r\n var deferred = new _DeferredObj;\r\n var updateState = function(i) {\r\n return function(value) {\r\n contexts[i] = this;\r\n values[i] = arguments.length > 1 ? [].slice.call(arguments) : value;\r\n resolvedCount++;\r\n if (resolvedCount === values.length) {\r\n deferred.resolveWith(contexts, values)\r\n }\r\n }\r\n };\r\n for (var i = 0; i < values.length; i++) {\r\n if (isDeferred(values[i])) {\r\n values[i].promise().done(updateState(i)).fail(deferred.reject)\r\n } else {\r\n resolvedCount++\r\n }\r\n }\r\n if (resolvedCount === values.length) {\r\n deferred.resolveWith(contexts, values)\r\n }\r\n return deferred.promise()\r\n};\r\nexport function setStrategy(value) {\r\n _DeferredObj = value.Deferred;\r\n whenFunc = value.when\r\n}\r\nexport function Deferred() {\r\n return new _DeferredObj\r\n}\r\nexport function when() {\r\n return whenFunc.apply(this, arguments)\r\n}\r\n","/**\r\n * DevExtreme (esm/core/utils/dependency_injector.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n extend\r\n} from \"./extend\";\r\nimport {\r\n isFunction\r\n} from \"./type\";\r\nimport {\r\n each\r\n} from \"./iterator\";\r\nimport Class from \"../class\";\r\nexport default function(object) {\r\n var BaseClass = Class.inherit(object);\r\n var InjectedClass = BaseClass;\r\n var instance = new InjectedClass(object);\r\n var initialFields = {};\r\n var injectFields = function(injectionObject, initial) {\r\n each(injectionObject, (function(key) {\r\n if (isFunction(instance[key])) {\r\n if (initial || !object[key]) {\r\n object[key] = function() {\r\n return instance[key].apply(object, arguments)\r\n }\r\n }\r\n } else {\r\n if (initial) {\r\n initialFields[key] = object[key]\r\n }\r\n object[key] = instance[key]\r\n }\r\n }))\r\n };\r\n injectFields(object, true);\r\n object.inject = function(injectionObject) {\r\n InjectedClass = InjectedClass.inherit(injectionObject);\r\n instance = new InjectedClass;\r\n injectFields(injectionObject)\r\n };\r\n object.resetInjection = function() {\r\n extend(object, initialFields);\r\n InjectedClass = BaseClass;\r\n instance = new BaseClass\r\n };\r\n return object\r\n}\r\n","/**\r\n * DevExtreme (esm/core/utils/dom.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport domAdapter from \"../../core/dom_adapter\";\r\nimport $ from \"../../core/renderer\";\r\nimport {\r\n each\r\n} from \"./iterator\";\r\nimport {\r\n isDefined,\r\n isRenderer,\r\n isWindow,\r\n isString\r\n} from \"./type\";\r\nimport {\r\n getWindow\r\n} from \"./window\";\r\nvar window = getWindow();\r\nvar getRootNodeHost = element => {\r\n if (!element.getRootNode) {\r\n return\r\n }\r\n var host = element.getRootNode().host;\r\n if (isString(host)) {\r\n return\r\n }\r\n return host\r\n};\r\nexport var resetActiveElement = () => {\r\n var activeElement = domAdapter.getActiveElement();\r\n if (activeElement && activeElement !== domAdapter.getBody()) {\r\n var _activeElement$blur;\r\n null === (_activeElement$blur = activeElement.blur) || void 0 === _activeElement$blur ? void 0 : _activeElement$blur.call(activeElement)\r\n }\r\n};\r\nexport var clearSelection = () => {\r\n var selection = window.getSelection();\r\n if (!selection) {\r\n return\r\n }\r\n if (\"Caret\" === selection.type) {\r\n return\r\n }\r\n if (selection.empty) {\r\n selection.empty()\r\n } else if (selection.removeAllRanges) {\r\n try {\r\n selection.removeAllRanges()\r\n } catch (e) {}\r\n }\r\n};\r\nexport var closestCommonParent = (startTarget, endTarget) => {\r\n var $startTarget = $(startTarget);\r\n var $endTarget = $(endTarget);\r\n if ($startTarget[0] === $endTarget[0]) {\r\n return $startTarget[0]\r\n }\r\n var $startParents = $startTarget.parents();\r\n var $endParents = $endTarget.parents();\r\n var startingParent = Math.min($startParents.length, $endParents.length);\r\n for (var i = -startingParent; i < 0; i++) {\r\n if ($startParents.get(i) === $endParents.get(i)) {\r\n return $startParents.get(i)\r\n }\r\n }\r\n};\r\nexport var extractTemplateMarkup = element => {\r\n element = $(element);\r\n var templateTag = element.length && element.filter((function() {\r\n var $node = $(this);\r\n return $node.is(\"script[type]\") && $node.attr(\"type\").indexOf(\"script\") < 0\r\n }));\r\n if (templateTag.length) {\r\n return templateTag.eq(0).html()\r\n } else {\r\n element = $(\"
\").append(element);\r\n return element.html()\r\n }\r\n};\r\nexport var normalizeTemplateElement = element => {\r\n var $element = isDefined(element) && (element.nodeType || isRenderer(element)) ? $(element) : $(\"
\").html(element).contents();\r\n if (1 === $element.length) {\r\n if ($element.is(\"script\")) {\r\n $element = normalizeTemplateElement($element.html().trim())\r\n } else if ($element.is(\"table\")) {\r\n $element = $element.children(\"tbody\").contents()\r\n }\r\n }\r\n return $element\r\n};\r\nexport var clipboardText = (event, text) => {\r\n var clipboard = event.originalEvent && event.originalEvent.clipboardData || window.clipboardData;\r\n if (!text) {\r\n return clipboard && clipboard.getData(\"Text\")\r\n }\r\n clipboard && clipboard.setData(\"Text\", text)\r\n};\r\nexport var contains = (container, element) => {\r\n if (!element) {\r\n return false\r\n }\r\n if (isWindow(container)) {\r\n return contains(container.document, element)\r\n }\r\n return container.contains(element) || contains(container, getRootNodeHost(element))\r\n};\r\nexport var createTextElementHiddenCopy = (element, text, options) => {\r\n var elementStyles = window.getComputedStyle($(element).get(0));\r\n var includePaddings = options && options.includePaddings;\r\n return $(\"
\").text(text).css({\r\n fontStyle: elementStyles.fontStyle,\r\n fontVariant: elementStyles.fontVariant,\r\n fontWeight: elementStyles.fontWeight,\r\n fontSize: elementStyles.fontSize,\r\n fontFamily: elementStyles.fontFamily,\r\n letterSpacing: elementStyles.letterSpacing,\r\n border: elementStyles.border,\r\n paddingTop: includePaddings ? elementStyles.paddingTop : \"\",\r\n paddingRight: includePaddings ? elementStyles.paddingRight : \"\",\r\n paddingBottom: includePaddings ? elementStyles.paddingBottom : \"\",\r\n paddingLeft: includePaddings ? elementStyles.paddingLeft : \"\",\r\n visibility: \"hidden\",\r\n whiteSpace: \"pre\",\r\n position: \"absolute\",\r\n float: \"left\"\r\n })\r\n};\r\nexport var insertBefore = (element, newElement) => {\r\n if (newElement) {\r\n domAdapter.insertElement(element.parentNode, newElement, element)\r\n }\r\n return element\r\n};\r\nexport var replaceWith = (element, newElement) => {\r\n if (!(newElement && newElement[0])) {\r\n return\r\n }\r\n if (newElement.is(element)) {\r\n return element\r\n }\r\n each(newElement, (_, currentElement) => {\r\n insertBefore(element[0], currentElement)\r\n });\r\n element.remove();\r\n return newElement\r\n};\r\nexport var isElementInDom = $element => {\r\n var element = null === $element || void 0 === $element ? void 0 : $element.get(0);\r\n var shadowHost = null === element || void 0 === element ? void 0 : element.getRootNode().host;\r\n return !!$(shadowHost || element).closest(getWindow().document).length\r\n};\r\n","/**\r\n * DevExtreme (esm/core/utils/error.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n extend\r\n} from \"./extend\";\r\nimport {\r\n logger\r\n} from \"./console\";\r\nimport {\r\n format\r\n} from \"./string\";\r\nimport {\r\n version\r\n} from \"../version\";\r\nvar ERROR_URL = \"http://js.devexpress.com/error/\" + version.split(\".\").slice(0, 2).join(\"_\") + \"/\";\r\nexport default function(baseErrors, errors) {\r\n var exports = {\r\n ERROR_MESSAGES: extend(errors, baseErrors),\r\n Error: function() {\r\n return makeError([].slice.call(arguments))\r\n },\r\n log: function(id) {\r\n var method = \"log\";\r\n if (/^E\\d+$/.test(id)) {\r\n method = \"error\"\r\n } else if (/^W\\d+$/.test(id)) {\r\n method = \"warn\"\r\n }\r\n logger[method](\"log\" === method ? id : combineMessage([].slice.call(arguments)))\r\n }\r\n };\r\n\r\n function combineMessage(args) {\r\n var id = args[0];\r\n args = args.slice(1);\r\n return formatMessage(id, formatDetails(id, args))\r\n }\r\n\r\n function formatDetails(id, args) {\r\n args = [exports.ERROR_MESSAGES[id]].concat(args);\r\n return format.apply(this, args).replace(/\\.*\\s*?$/, \"\")\r\n }\r\n\r\n function formatMessage(id, details) {\r\n return format.apply(this, [\"{0} - {1}. See:\\n{2}\", id, details, getErrorUrl(id)])\r\n }\r\n\r\n function makeError(args) {\r\n var id = args[0];\r\n args = args.slice(1);\r\n var details = formatDetails(id, args);\r\n var url = getErrorUrl(id);\r\n var message = formatMessage(id, details);\r\n return extend(new Error(message), {\r\n __id: id,\r\n __details: details,\r\n url: url\r\n })\r\n }\r\n\r\n function getErrorUrl(id) {\r\n return ERROR_URL + id\r\n }\r\n return exports\r\n}\r\n","/**\r\n * DevExtreme (esm/core/utils/extend.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isPlainObject\r\n} from \"./type\";\r\nexport var extendFromObject = function(target, source, overrideExistingValues) {\r\n target = target || {};\r\n for (var prop in source) {\r\n if (Object.prototype.hasOwnProperty.call(source, prop)) {\r\n var value = source[prop];\r\n if (!(prop in target) || overrideExistingValues) {\r\n target[prop] = value\r\n }\r\n }\r\n }\r\n return target\r\n};\r\nexport var extend = function extend(target) {\r\n target = target || {};\r\n var i = 1;\r\n var deep = false;\r\n if (\"boolean\" === typeof target) {\r\n deep = target;\r\n target = arguments[1] || {};\r\n i++\r\n }\r\n for (; i < arguments.length; i++) {\r\n var source = arguments[i];\r\n if (null == source) {\r\n continue\r\n }\r\n for (var key in source) {\r\n var targetValue = target[key];\r\n var sourceValue = source[key];\r\n var sourceValueIsArray = false;\r\n var clone = void 0;\r\n if (\"__proto__\" === key || \"constructor\" === key || target === sourceValue) {\r\n continue\r\n }\r\n if (deep && sourceValue && (isPlainObject(sourceValue) || (sourceValueIsArray = Array.isArray(sourceValue)))) {\r\n if (sourceValueIsArray) {\r\n clone = targetValue && Array.isArray(targetValue) ? targetValue : []\r\n } else {\r\n clone = targetValue && isPlainObject(targetValue) ? targetValue : {}\r\n }\r\n target[key] = extend(deep, clone, sourceValue)\r\n } else if (void 0 !== sourceValue) {\r\n target[key] = sourceValue\r\n }\r\n }\r\n }\r\n return target\r\n};\r\n","/**\r\n * DevExtreme (esm/core/utils/html_parser.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport domAdapter from \"../dom_adapter\";\r\nvar isTagName = /<([a-z][^/\\0>\\x20\\t\\r\\n\\f]+)/i;\r\nvar tagWrappers = {\r\n default: {\r\n tagsCount: 0,\r\n startTags: \"\",\r\n endTags: \"\"\r\n },\r\n thead: {\r\n tagsCount: 1,\r\n startTags: \"
\"\r\n },\r\n td: {\r\n tagsCount: 3,\r\n startTags: \"
\"\r\n },\r\n col: {\r\n tagsCount: 2,\r\n startTags: \"
\"\r\n },\r\n tr: {\r\n tagsCount: 2,\r\n startTags: \"
\"\r\n }\r\n};\r\ntagWrappers.tbody = tagWrappers.colgroup = tagWrappers.caption = tagWrappers.tfoot = tagWrappers.thead;\r\ntagWrappers.th = tagWrappers.td;\r\nexport var parseHTML = function(html) {\r\n if (\"string\" !== typeof html) {\r\n return null\r\n }\r\n var fragment = domAdapter.createDocumentFragment();\r\n var container = fragment.appendChild(domAdapter.createElement(\"div\"));\r\n var tags = isTagName.exec(html);\r\n var firstRootTag = tags && tags[1].toLowerCase();\r\n var tagWrapper = tagWrappers[firstRootTag] || tagWrappers.default;\r\n container.innerHTML = tagWrapper.startTags + html + tagWrapper.endTags;\r\n for (var i = 0; i < tagWrapper.tagsCount; i++) {\r\n container = container.lastChild\r\n }\r\n return [...container.childNodes]\r\n};\r\nexport var isTablePart = function(html) {\r\n var tags = isTagName.exec(html);\r\n return tags && tags[1] in tagWrappers\r\n};\r\n","/**\r\n * DevExtreme (esm/core/utils/icon.js)\r\n * Version: 23.1.4\r\n * Build date: Fri Jul 14 2023\r\n *\r\n * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport $ from \"../../core/renderer\";\r\nvar ICON_CLASS = \"dx-icon\";\r\nvar SVG_ICON_CLASS = \"dx-svg-icon\";\r\nexport var getImageSourceType = source => {\r\n if (!source || \"string\" !== typeof source) {\r\n return false\r\n }\r\n if (/^\\s*